Repository navigation
feat: redesign home hero with spotlight map - #95
Merged
Merged
Conversation
Put the text block and the tool on the left and let the map fill the right, so the page reads as a landing hero while the form stays one glance away. The header now holds the brand, GitHub link and theme toggle at every breakpoint, replacing the card that only showed on desktop. The map panel bleeds to the viewport's right edge and sticks under the header, so the camera only frames what is on screen. Its canvas fades out through a CSS mask rather than background-colored overlays, which cut off the page glow behind it and left a visible seam. Corner marks in an accent color, mono section labels and a staggered entrance animation carry the new style; under reduced motion the entrance becomes a short fade.
Give the hero an animated subject: the map dims everything but its focus. With no city selected it tours the counties on its own, pausing while the pointer or keyboard focus is on the map and while the page is hidden. Selecting a city or district moves the spotlight there, flies the camera to it and labels it with a corner mark. Dimming runs on feature state in a single source, with every feature settling fully clear or fully opaque under one layer opacity, so overlapping county and town masks never stack and shared borders leave no seams. Islets under 1% of a region's largest landmass are left out of its framing, so Kinmen's far-off Wuqiu islets do not pull the camera out to sea. The canvas stays hidden until the spotlight is drawn, on first load and while a theme switch restyles the basemap, so neither the old basemap nor an unmasked map flashes. Under reduced motion the tour is off and the camera jumps instead of flying. The topology loaders now share a promise cache, reject non-OK responses and evict failed requests so a later call can retry.
Theme switches swap the basemap style behind a hidden canvas. The default 300ms paint transition was still running when the canvas faded back in, which showed as a gray haze over the new theme. The generated styles are updated to match the script.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The home page was a tool with a map beside it. On desktop the brand, GitHub link and theme toggle sat in a card above the form (mobile had a separate header), and the map stayed a static overview of Taiwan until a city was picked. It worked, but it did not read as a landing page, and the map had nothing to show before the first input.
This turns the page into a split hero in the style of ui.spectrumhq.in: headline and tool on the left, an animated map on the right, faded where the two meet. The form still comes right after the headline, so a result is as close as before.
Changes
All changes are in
apps/web;packages/coreand the vendoredcomponents/ui/*are untouched.Hero layout and header (
25f470f)enter-fx), reduced to a plain fade underprefers-reduced-motion.lgand up) is no longer a grid cell. It spans from 42% of the container to the viewport's right edge and sticks under the header, sized to the viewport so the camera only frames what is on screen.map-fade) rather than background-colored overlays, which hid the page glow behind the map and left a visible seam. Only the canvas is masked; the focus label and zoom controls stay crisp.BracketBadgeandSectionLabelcomponents, and a--markaccent color for the corner marks.Spotlight map (
5d08445)FeatureStateTweener) under one layer opacity, so overlapping county and district masks never stack and shared borders leave no seams.src/lib/map-spotlight.ts.Basemap paint transitions (
86d2241)scripts/process-map-styles.tssetstransition: { duration: 0, delay: 0 }on the neutralized styles, and both generated styles inpublic/data/styles/are updated to match. MapLibre's default 300ms paint transition was still running when the canvas faded back in after a theme switch, which showed as a gray haze over the new theme.Verification
pnpm check(core build, workspace typecheck, ESLint, Prettier) passes; 29 unit tests pass.next buildpasses, 379 static pages generated.apps/webhas no browser tests, so none of the map behavior above is covered in CI.Not done
body::afterradial gradient, which this PR does not change.