You are browsing as a guest. Sign up (or log in) to start making projects!

1h 22m 53s logged

Site Slap Devlog #4 (pasted it twice, rendered it never)

TL;DR

  • fire skin got its upgrade wave: cinematic slow timing, snap scrolling between full-height panels, three tabs replaced by one
    pulsing button, and a draggable popup window
  • the popup drags at 60fps because React never hears about it. position lives in a ref and writes straight to the dom
  • my paste of the popup duplicated 12 lines of jsx, and the line that actually renders it never existed. the button flipped state
    into the void
  • next: the popup stops showing a fix list and starts showing your actual upgraded site

the upgrade wave

four changes in one session.

the window expands first, then the text rises in. everything slowed to about half its old speed, long delays between each element,
so switching to fire feels like a scene opening instead of ui popping in.

the page now snap-scrolls between full-height panels: hero, score, screenshot, roast, fixes. one flick per section.

the og / quick fix / full fix tabs are gone from fire. in their place, one button at the end of the fixes that pulses a sonar ring
and says view upgraded.


the floating window

clicking it opens what looks like another mac window. traffic lights, a title bar, and the red dot actually closes it. you can grab
the title bar and drag it anywhere on screen.

inside: your current score for contrast, the upgraded score in the big serif, and a minor / full toggle that swaps both the number
and the fix list.

it works.


what i learned

dragging with react state is a trap. pointermove fires around 60 times a second, and putting the position in state would re-render
the whole component on every single event.

instead the position lives in a ref. pointerdown records where you grabbed and where the window already was. pointermove computes
the offset and writes style.transform directly onto the dom node. React never re-renders during the drag, so it stays smooth.

the other half is setPointerCapture. without it, dragging fast outruns the title bar, the cursor leaves the element, and the
window gets dropped mid-drag. capture pins every pointer event to the bar until you let go.

also learned the dumb way that pasting a component in is not the same as shipping it. my paste duplicated a 12 line block of jsx,
and i never added the line that renders the window when the state flips. state going true means nothing if nothing reads it.


what’s next

  • the popup body swaps the fix list for the upgraded site itself. Groq’s vision model looks at the screenshot plus the fixes and
    writes a new version of the page as one self-contained html file, rendered inside a sandboxed iframe
  • both upgrade tiers start generating in the background the moment the slap result lands, so the popup opens already loaded
  • push it, then check the Vercel deploy

Tip of the Day

if a button does nothing, check whether the thing it opens is ever rendered. flipping state to true is only half the job. something
has to read that state and put pixels on screen.

0
3

Comments 0

No comments yet. Be the first!