
How to build an engaging virtual product tour
6/2/2023
This post details the technical implementation of Vercel's virtual product tour. Key contributions include the design of a `DemoContext` for managing tour state (current slide, sub-index, tooltip references, slide data), URL parameter synchronization (`i` query parameter) for deep linking using `useRouter`, dynamic tooltip positioning and resizing logic with `ResizeObserver` and throttling, and precise animation timing using CSS transitions and `transitionEnd` event listeners to synchronize tooltip appearance with dot movement. Accessibility considerations like `aria-live` and keyboard navigation are also discussed.