Skip to content

chore: clean up assets, fix fragile code, and clear lint errors - #6

Merged
BK5102 merged 2 commits into
fix/dead-linksfrom
chore/site-cleanup
Oct 2, 2026
Merged

BK5102 merged 2 commits into
fix/dead-linksfrom
chore/site-cleanup

Conversation

@BK5102

@BK5102 BK5102 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Stacked on fix/dead-links. Merge that first; GitHub will retarget this PR to main.

What changed and why

Performance

  • Headshots compressed to 28–88 KB JPEGs (were up to 1.4 MB), max 640px wide.
  • Removed the 14 MB hero background video (the hero will be redesigned) and an unused 46 MB old video. Built site assets go from ~17 MB to ~0.9 MB.
  • Project images are stored locally in src/assets/projects/ instead of hotlinked from Unsplash.

Bugs / fragile code

  • Catch-all NotFound route: unknown URLs previously rendered an empty page.
  • Navbar "Contact" scrolls using router state instead of a 100 ms setTimeout, which could miss on slow devices.
  • pulse-grid used Math.random() during render, so the pattern changed on re-render. It is now a fixed pattern.
  • Discord, LinkedIn, and Sun Devil Central URLs are centralized in src/data/links.js (the Discord invite was hardcoded in 4 places).

Lint: 10 errors → 0

  • Removed unused imports; commented out hidden-guide imports next to their already-commented list entries.
  • Replaced setState-in-effect in Navbar and Resources with derived state.

Dead code removed

  • react.svg, duplicate src/assets/DQ.png, public/vite.svg, interactive-grid-pattern.jsx
  • tailwind.config.js (ignored by Tailwind v4), unused gridFade keyframes, no-op aspect-w-* classes
  • Navbar's unused scroll listener, unused bradley headshot

Data / content

  • About page: the Founders box is now derived from leaders.json, so the founders appear in order Cedric, Ryan, Vaibhav. Headshots are looked up by exact filename, and list keys are stable.
  • leaders.json: "Mathematices" typo, "Junior" capitalization, "" → null.
  • index.html: meta description and Open Graph tags, so shared links show a summary.

How it was tested

  • npm run lint passes with 0 errors; npm run build passes.
  • Rendered the built site in headless Edge: Home has no video, About shows the leaders with the compressed headshots and the Founders list, #/does-not-exist shows "Page not found", and Projects images load from local assets.

Visual changes

  • The home hero is now plain black (video removed).
  • About headshots and project images are visually the same, just smaller files.

Performance
- Compress headshots to 28-88 KB JPEGs (were up to 1.4 MB).
- Remove hero background video (14 MB) and unused old video (46 MB);
  the hero will be redesigned.
- Store project images locally instead of hotlinking Unsplash.

Bugs / fragile code
- Add catch-all NotFound route (unknown URLs rendered an empty page).
- Navbar Contact: scroll via router state instead of a 100 ms setTimeout.
- pulse-grid: deterministic pattern instead of Math.random() in render.
- Centralize Discord/LinkedIn/Sun Devil Central URLs in src/data/links.js.

Lint (10 errors -> 0)
- Remove unused imports; comment out hidden-guide imports.
- Replace setState-in-effect in Navbar and Resources with derived state.

Dead code
- Delete react.svg, duplicate src/assets/DQ.png, public/vite.svg,
  interactive-grid-pattern.jsx, tailwind.config.js (ignored by v4),
  unused gridFade keyframes, aspect-w-* classes, Navbar scroll listener,
  unused bradley headshot.

Data / content
- About: derive Founders from leaders.json; exact headshot filename
  lookup; stable list keys.
- leaders.json: fix typo/capitalization, "" -> null.
- index.html: add meta description and Open Graph tags.
Review on #6 measured the Contact link at ~2-2.5s under CPU/network
throttling. Profiling (4x CPU, ~1.6 Mbps) showed scrollIntoView is called
as soon as About renders (~0.7s); the delay was the *smooth* scroll being
starved by a ~1.5s main-thread task from About's DotPattern (~1,000
animated SVG nodes) and IconCloud mounting. (On main the 100 ms timeout
fires before About renders under throttling, so it never scrolls at all.)

- Jump to the section (behavior: 'auto') instead of animating, so the
  scroll lands when About renders: Contact from Home now settles in
  ~1.2-1.5s throttled vs ~2.6-3.2s, with scrolling starting at render.
- Memoize DotPattern and IconCloud so About re-renders (navigation state,
  year select) don't re-reconcile the dot field.
@BK5102

BK5102 commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Performance results

Lighthouse, mobile preset (simulated slow 4G, 4x CPU), median of 3 runs, local Edge build served with gzip. Compared with main built the same way.

Build Page Score FCP LCP TBT CLS Weight
main Home 94 2.50 s 2.50 s 0 ms 0.001 3,377 KB
main About 67 2.49 s 2.72 s 2,212 ms 0.014 2,202 KB
#6 Home 94 2.49 s 2.49 s 0 ms 0.001 176 KB
#6 About 73 2.48 s 2.73 s 823 ms 0 383 KB

Verdict: faster. Home is about 95% lighter (3,377 KB to 176 KB; video removed, headshots compressed). About's blocking time drops from 2.2 s to 0.8 s, from memoizing DotPattern/IconCloud.

Contact navigation (the review comment; 4x CPU, ~1.6 Mbps, 5 runs): with 066dc93, the scroll starts as soon as About renders instead of stalling behind the decorations' long task (settled ~1.2-1.5 s vs ~2.6-3.2 s before the fix). On main the 100 ms timeout fires before About renders, so it never scrolls. About's heavy decorations remain in this PR; #8 removes them.

@BK5102
BK5102 merged commit 5519b8a into fix/dead-links Oct 2, 2026
BK5102 added a commit that referenced this pull request Oct 3, 2026
chore: land #6–#8 on main (stacked PRs merged into intermediate branches)
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