Mobile LCP: inline splash logo as data URI; revert harmful image preload

- The high-priority <link rel=preload as=image> stole bandwidth from render-
  blocking CSS on 4G, pushing FCP 1.1s -> 2.2s and the score 82 -> 70. Removed.
- TBT is ~30ms (not main-thread bound), so the FCP->LCP gap was the logo's
  network fetch. Inline the mark as a data URI: zero request, paints with FCP.
  LCP should drop toward FCP and stop swinging run-to-run.
This commit is contained in:
jwinterm
2026-06-06 19:03:38 -04:00
parent 945529af33
commit 065cabc38c
3 changed files with 10 additions and 4 deletions
-3
View File
@@ -105,9 +105,6 @@ export default function Home() {
return (
<main className="relative flex flex-col items-center overflow-hidden">
{/* The splash logo is the homepage LCP element on mobile; fetch it immediately
so it isn't queued behind render-blocking CSS/JS. */}
<link rel="preload" as="image" href="/images/branding/splash-such.svg" fetchPriority="high" />
<DynamicBackground nebulaPosition={nebulaPosition} visible={entered} />
<Header floating visible={entered} />
@@ -4,6 +4,7 @@ import Link from "next/link";
import { motion, useReducedMotion } from "framer-motion";
import { ChevronDown, LayoutGrid, Smartphone, Wrench, Info } from "lucide-react";
import { useEffect, useRef, useState } from "react";
import { SPLASH_LOGO_SRC } from "./splash-logo-data";
const navButtons = [
{ label: "Portfolio", href: "/products", Icon: LayoutGrid, corner: "left-4 top-6 sm:left-6 sm:top-24 lg:left-8 lg:top-32" },
@@ -110,8 +111,10 @@ export function HeroSplash({ onEnter, sectionRef, leaving }: { onEnter: () => vo
className={entering ? "splash-zoom" : undefined}
style={{ filter: entering ? "url(#splash-water)" : undefined }}
>
{/* Data URI (no network request) so the logo paints with FCP; it is the
mobile LCP element. */}
<img
src="/images/branding/splash-such.svg"
src={SPLASH_LOGO_SRC}
alt="Such Software"
fetchPriority="high"
className="h-auto w-[min(72vw,42vh)]"
@@ -0,0 +1,6 @@
// AUTO-GENERATED from public/images/branding/splash-such.svg.
// Inlined as a data URI so the splash logo (the homepage LCP element) needs no
// network request and paints with first contentful paint. Regenerate if the
// mark changes.
export const SPLASH_LOGO_SRC =
"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20200%20200%22%20role%3D%22img%22%20aria-label%3D%22Such%20Software%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22splash-glow%22%20x%3D%22-30%25%22%20y%3D%22-30%25%22%20width%3D%22160%25%22%20height%3D%22160%25%22%3E%3CfeGaussianBlur%20stdDeviation%3D%221.6%22%20result%3D%22b%22%2F%3E%3CfeMerge%3E%3CfeMergeNode%20in%3D%22b%22%2F%3E%3CfeMergeNode%20in%3D%22SourceGraphic%22%2F%3E%3C%2FfeMerge%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%22172%22%20height%3D%22172%22%20rx%3D%2216%22%20fill%3D%22none%22%20stroke%3D%22%2322d3ee%22%20stroke-width%3D%223.5%22%20filter%3D%22url%28%23splash-glow%29%22%20opacity%3D%220.45%22%2F%3E%3Cg%20fill%3D%22none%22%20stroke-width%3D%2214%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M%2078%2C36%20H%2036%20V%2058%20H%2078%20V%2082%20H%2036%22%20stroke%3D%22%2335c98e%22%2F%3E%3Cpath%20d%3D%22m%20118%2C36%20v%2034%20c%200%2C12.15%209.85%2C14%2022%2C14%2012.15%2C0%2022%2C-1.85%2022%2C-14%20V%2036%22%20stroke%3D%22%23e8689e%22%2F%3E%3Cpath%20d%3D%22M%2078%2C118%20H%2036%20V%20164%20H%2078%22%20stroke%3D%22%234aade0%22%2F%3E%3Cpath%20d%3D%22M%20118%2C118%20V%20164%20M%20162%2C118%20V%20164%20M%20118%2C141%20H%20162%22%20stroke%3D%22%2345c99e%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E";