Skip to content

Transform-based slide deck: hide scrollbar, true slide-by-slide nav#74

Open
hansjohn819-commits wants to merge 1 commit into
zarazhangrui:mainfrom
hansjohn819-commits:transform-based-deck
Open

Transform-based slide deck: hide scrollbar, true slide-by-slide nav#74
hansjohn819-commits wants to merge 1 commit into
zarazhangrui:mainfrom
hansjohn819-commits:transform-based-deck

Conversation

@hansjohn819-commits

Copy link
Copy Markdown

Why

Two UX issues with the scroll-based deck during real presentations:

  1. Scrollbar shows up in fullscreen. When presenting (F11), the
    browser's right-edge scrollbar is a constant visual distraction —
    it makes the page feel like "a webpage that scrolls" rather than
    "slides advancing". scroll-snap-type doesn't hide it.

  2. Trackpad fine-scrolls can land between slides. Even with
    scroll-snap-type: y mandatory, the visual feel is "scrolling that
    snapped" rather than "the next slide came in".

What changed

All slides now live inside a single <div class="deck"> container.
Navigation moves the deck via transform: translateY(-idx * 100vh)
instead of scrolling. body has overflow: hidden so no scrollbar
ever shows. Smooth between-slide motion comes from a CSS transition
on .deck, and is disabled under prefers-reduced-motion.

User-facing navigation is unchanged: arrow keys, space, mouse wheel,
click slide, click nav dots all advance the active slide.

Files

  • viewport-base.csshtml/body overflow: hidden; new
    .deck rule with transition; removed scroll-snap-* and .slide
    scroll-snap-align; prefers-reduced-motion now also disables
    the deck transition.
  • html-template.md — body skeleton wraps slides in
    <div class="deck" id="deck">; SlidePresentation controller
    rewritten to drive the transform via goTo(). The old
    Intersection Observer is replaced by a direct activate(idx) call
    that marks the active slide visible and updates dots / progress.
  • SKILL.md — Phase 5 navigation summary updated.

Testing

  • Verified in Chrome / Edge on Windows at 1080p and 4K
  • Fullscreen (F11) shows no scrollbar
  • All four nav methods (keyboard / wheel / click slide / click dot) advance correctly
  • Reveal animations still fire on slide entry via .slide.visible .reveal
  • prefers-reduced-motion: reduce disables the deck transition

…de nav)

All slides now live inside a single <div class="deck"> container.
Navigation moves the deck via transform: translateY(-idx * 100vh) instead
of scrolling. body is overflow: hidden so no scrollbar ever shows — the
right-edge scrollbar in fullscreen presentation mode is a constant visual
distraction.

The feel becomes true slide-by-slide advancement rather than
scrolling-that-snaps. A trackpad fine-scroll can no longer land between
two slides.

User-facing navigation is unchanged: arrow keys, space, mouse wheel, click
slide, click nav dots all advance the active slide. Smooth between-slide
motion is provided by a CSS transition on .deck, and is disabled under
prefers-reduced-motion.

Files changed:
- viewport-base.css: html/body overflow hidden; new .deck rule with
  transition; removed scroll-snap-* and .slide scroll-snap-align;
  prefers-reduced-motion now also disables .deck transition.
- html-template.md: body skeleton wraps slides in <div class="deck">;
  SlidePresentation controller rewritten to drive transform via goTo();
  Intersection Observer replaced by a direct activate(idx) call that
  marks the active slide visible, updates dots and progress.
- SKILL.md: Phase 5 navigation summary updated.
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