Skip to content

perf: mobile performance optimization#2

Merged
daolanx merged 9 commits into
mainfrom
perf/mobile-optimization
May 30, 2026
Merged

perf: mobile performance optimization#2
daolanx merged 9 commits into
mainfrom
perf/mobile-optimization

Conversation

@daolanx
Copy link
Copy Markdown
Owner

@daolanx daolanx commented May 30, 2026

Mobile Performance & UI Optimization

LCP Optimization

  • Remove FadeIn from hero section — LCP element was hidden with opacity: 0, delaying Lighthouse LCP timer
  • Add priority to above-the-fold portfolio image for preload
  • Replace Material Symbols icon font with inline SVG / lucide-react — zero external font network requests
  • Switch font-display from swap to optional — eliminates FOIT/FOUT and layout shift
  • Use CSS variables from next/font for all font families in Tailwind theme

Bundle Size Reduction

  • Replace <img> with next/image using fill + sizes for responsive loading
  • Fix optimizePackageImports to match actual import path (framer-motion)
  • Remove unused Geist font (~20-40KB savings)
  • Reduce Space Mono weight from 400+700 to 400 only
  • Disable webpack/turbopack polyfills for modern browsers (~14KB savings)

Mobile UX Improvements

  • Hero: reduce min-h from 90vh to 70vh on mobile, smaller padding
  • Social links: icon-only on mobile, full labels on desktop (hidden md:inline)
  • CaseLink buttons: vertical stack on mobile, horizontal on desktop
  • "View All" links: moved to section bottom, centered, consistent style
  • Consistent button style: square corners, border-on-surface, hover fill effect

Render-Blocking & JS Deferral

  • Defer ParticleCanvas with next/dynamic (ssr: false) + requestIdleCallback
  • Move ParticleCanvas to bottom of page to unblock first paint
  • Cache canvas innerWidth/Height to avoid forced reflow in animation loop

Configuration

  • Add poweredByHeader: false
  • Optimize deviceSizes and imageSizes for image delivery

🤖 Generated with Claude Code

daolanx added 4 commits May 30, 2026 20:04
- Add remotePatterns for demo.daolanx.com in next.config.ts
- Replace raw <img> with next/image in ProjectRow and ProjectCard
- Use fill + sizes for responsive image loading
- Expected savings: ~360KB on mobile (from 447KB to ~87KB)
- Add isDesktop() utility for viewport check
- Bail early in useEffect when viewport < 768px
- Prevents unused requestAnimationFrame loop on mobile
- Add custom image loader with deviceSizes/imageSizes
- Add optimizePackageImports for motion/react and lucide-react
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 30, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
dax-studio d2cd49d Commit Preview URL

Branch Preview URL
May 30 2026, 03:27 PM

@daolanx daolanx force-pushed the perf/mobile-optimization branch from 4bbb13a to 192cb3c Compare May 30, 2026 13:57
daolanx added 5 commits May 30, 2026 22:05
Read window.innerWidth/Height in resize handler instead of
every animation frame to prevent layout thrashing.
- Move ParticleCanvas after Footer to unblock first paint
- Use requestIdleCallback to delay initialization until browser idle
- SSR disabled, only loads on client side
- Remove FadeIn wrapper from first portfolio image (was hiding it with opacity:0)
- Add priority to first portfolio image for preload
- Reduce Space Mono to weight 400 only (700 unused)
- Replace material-symbols-outlined font with lucide-react icons
- Use inline SVG for GitHub/Twitter brand icons
- Remove external Google Fonts CSS link (zero network requests)
- Use CSS variables from next/font for all font families
- Switch font-display to optional for better LCP
- Move View All links to bottom center for better UX
- Responsive hero: smaller min-height and padding on mobile
- Hero social links: icon-only on mobile, full labels on desktop
- CaseLink: vertical stack on mobile, horizontal on desktop
- Consistent button styles: square corners, border-on-surface
- Remove FadeIn from hero section to improve LCP
- Replace Material Symbols with lucide-react/inline SVG
- Use CSS variables from next/font for all font families
- Switch font-display to optional
@daolanx
Copy link
Copy Markdown
Owner Author

daolanx commented May 30, 2026

Before

image image

After

image image

@daolanx daolanx merged commit 28ada61 into main May 30, 2026
1 check passed
@daolanx daolanx deleted the perf/mobile-optimization branch May 30, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant