diff --git a/scripts/optimize-images.manifest.json b/scripts/optimize-images.manifest.json index e0fc830..efcac0b 100644 --- a/scripts/optimize-images.manifest.json +++ b/scripts/optimize-images.manifest.json @@ -72,4 +72,4 @@ "why-parents-3.png (webp newer)", "why-parents-4.png (webp newer)" ] -} \ No newline at end of file +} diff --git a/scripts/optimize-images.mjs b/scripts/optimize-images.mjs index 9513e90..7fec187 100644 --- a/scripts/optimize-images.mjs +++ b/scripts/optimize-images.mjs @@ -35,15 +35,23 @@ for (const [base, variants] of byBase) { if (!heavy) continue const srcPath = path.join(ROOT, heavy) const stat = await fs.stat(srcPath).catch(() => null) - if (!stat || stat.size < MIN_BYTES) { manifest.skipped.push(path.basename(srcPath)); continue } + if (!stat || stat.size < MIN_BYTES) { + manifest.skipped.push(path.basename(srcPath)) + continue + } const outPath = path.join(ROOT, `${base}.webp`) const outStat = await fs.stat(outPath).catch(() => null) - if (outStat && outStat.mtimeMs > stat.mtimeMs) { manifest.skipped.push(path.basename(srcPath) + ' (webp newer)'); continue } + if (outStat && outStat.mtimeMs > stat.mtimeMs) { + manifest.skipped.push(path.basename(srcPath) + ' (webp newer)') + continue + } await sharp(srcPath).webp({ quality: QUALITY }).toFile(outPath) manifest.encoded.push({ src: path.basename(srcPath), out: `${base}.webp`, before: stat.size }) } const manifestPath = path.join(process.cwd(), 'scripts/optimize-images.manifest.json') await fs.writeFile(manifestPath, JSON.stringify(manifest, null, 2)) -console.log(`Deleted ${manifest.deletedDuplicates.length} duplicates, encoded ${manifest.encoded.length} files, skipped ${manifest.skipped.length}.`) +console.log( + `Deleted ${manifest.deletedDuplicates.length} duplicates, encoded ${manifest.encoded.length} files, skipped ${manifest.skipped.length}.` +) console.log('Manifest:', manifestPath) diff --git a/src/app/api/admin/seed/route.ts b/src/app/api/admin/seed/route.ts index d3e6509..c4544ba 100644 --- a/src/app/api/admin/seed/route.ts +++ b/src/app/api/admin/seed/route.ts @@ -47,7 +47,7 @@ async function findOrUploadMedia( limit: 1, overrideAccess: true, }) - if (existing.docs.length > 0) return existing.docs[0].id as string + if (existing.docs.length > 0) return existing.docs[0]!.id as string const fullPath = path.resolve(process.cwd(), localPath) if (!fs.existsSync(fullPath)) return null const buffer = fs.readFileSync(fullPath) diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 3ccf41d..d951e51 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -20,11 +20,11 @@ const DEFAULT_NAV: NavLinkItem[] = [ label: 'Локації', href: '/lokatsii', children: [ - { label: 'ДиноПарк', href: '/lokatsii#dynopark' }, - { label: 'Диво Ліс', href: '/lokatsii#dyvolis' }, - { label: 'Дзеркальний Лабіринт', href: '/lokatsii#maze' }, - { label: 'Тир з призами', href: '/lokatsii#tir' }, - { label: 'Дитячий майданчик', href: '/lokatsii#playground' }, + { label: 'ДиноПарк', href: '/lokatsii#dynopark' }, + { label: 'Диво Ліс', href: '/lokatsii#dyvolis' }, + { label: 'Дзеркальний Лабіринт', href: '/lokatsii#maze' }, + { label: 'Тир з призами', href: '/lokatsii#tir' }, + { label: 'Дитячий майданчик', href: '/lokatsii#playground' }, ], }, { label: 'Блог', href: '/blog' }, diff --git a/src/components/layout/HeaderClient.tsx b/src/components/layout/HeaderClient.tsx index 11d003f..e6fec0b 100644 --- a/src/components/layout/HeaderClient.tsx +++ b/src/components/layout/HeaderClient.tsx @@ -47,8 +47,7 @@ export function HeaderClient({ navLinks, ctaLabel, ctaHref, logo }: HeaderClient backgroundColor: 'rgba(34, 62, 13, 0.42)', backdropFilter: 'blur(22px) saturate(160%)', WebkitBackdropFilter: 'blur(22px) saturate(160%)', - boxShadow: - 'inset 0 1px 0 0 rgba(255,255,255,0.18), 0 1px 0 0 rgba(34,62,13,0.18)', + boxShadow: 'inset 0 1px 0 0 rgba(255,255,255,0.18), 0 1px 0 0 rgba(34,62,13,0.18)', }} > {/* Highlight sheen (top edge) — gives the glass-y look from Figma */} @@ -56,12 +55,11 @@ export function HeaderClient({ navLinks, ctaLabel, ctaHref, logo }: HeaderClient aria-hidden="true" className="pointer-events-none absolute inset-x-0 top-0 h-[34px]" style={{ - background: - 'linear-gradient(to bottom, rgba(255,255,255,0.10), rgba(255,255,255,0))', + background: 'linear-gradient(to bottom, rgba(255,255,255,0.10), rgba(255,255,255,0))', }} /> -
+
{/* Logo */} {logo ? ( @@ -78,19 +76,19 @@ export function HeaderClient({ navLinks, ctaLabel, ctaHref, logo }: HeaderClient className="absolute" style={{ top: '91.32%', right: '21.81%', bottom: '0.97%', left: '22.26%' }} > - +
- +
- +
)} @@ -98,14 +96,14 @@ export function HeaderClient({ navLinks, ctaLabel, ctaHref, logo }: HeaderClient {/* Nav — desktop */}