Skip to content

finishing UX updates on timer#8

Merged
Hectormalvarez merged 6 commits into
mainfrom
dev
Jun 5, 2026
Merged

finishing UX updates on timer#8
Hectormalvarez merged 6 commits into
mainfrom
dev

Conversation

@Hectormalvarez

Copy link
Copy Markdown
Owner

updates to presentation of the timer, including smoothing out the animations.

Call tick() at the top of start() so the clock displays immediately
on initial load rather than after the first setTimeout fires at the
next second boundary.
The timer panel starts hidden via the HTML 'hidden' attribute, so
calling closePanel() at the end of init() was needlessly triggering
the closing CSS animation on every page load.
- Drop position: absolute / top / left / transform: translateX(-50%)
  / z-index from #timer-panel so it stacks naturally below the toggle
  button inside the centered #clock-container.
- Remove the matching translateX(-50%) terms from
  @Keyframes timer-panel-open and @Keyframes timer-panel-close.
- Switch body overflow from 'hidden' to 'overflow-y: auto;
  overflow-x: hidden' so short viewports can still scroll to see
  the full panel.
Add a flipAnimateClockContainer helper that wraps the FLIP technique
to smoothly slide #clock-container when the timer panel is added or
removed (which re-centers the container in the body):

- First: capture the container's current bounding rect.
- Run the panel open/close mutation.
- Last: capture the new rect, compute the delta, apply an inverted
  transform to keep the container visually pinned, then animate the
  transform back to identity in the next animation frame.
- Lock body overflow during the transition so the page cannot scroll
  while the height changes (prevents a flash of the vertical scrollbar).
- Clean up inline transition/transform/overflow on transitionend with
  a 400ms fallback.

openPanel() and closePanel() now both delegate to the helper, so the
clock slides down on open and up on close, making the toggle feel
symmetric. The separate CSS timer-panel-close animation on the panel
itself is no longer used (it was causing close to lag behind open).
@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clock-website Ready Ready Preview, Comment Jun 5, 2026 7:25pm

@Hectormalvarez Hectormalvarez merged commit 2b924d2 into main Jun 5, 2026
4 checks passed
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