feat(website): serve a theme-aware landing showreel - #1438
Open
Wassim Chegham (manekinekko) wants to merge 2 commits into
Open
Wassim Chegham (manekinekko) wants to merge 2 commits into
Wassim Chegham (manekinekko) wants to merge 2 commits into
Conversation
Replace the single dark showreel with dark and light cuts restyled to the landing tokens, and pick the one matching Starlight's data-theme. - Home.astro: expose both video URLs as data-src-dark/-light and both posters as base-aware CSS custom properties instead of a poster attribute. - landing.css: paint the active theme's poster as the frame background and keep the video transparent until it has a frame, so neither first paint (including reduced motion and no-JS) nor a theme change shows the other cut. Theme the frame, overlay controls, status and narrow-screen divider with --scope-* tokens. - showreel.ts: observe data-theme and swap a loaded player to the matching cut at the same position, keeping it playing or paused. Paused players load only the frame at that position; off-screen or partly visible players hide the stale frame and defer the swap. Lazy src, preload="none", visibility gating, reduced motion, blocked autoplay and error reporting are unchanged. - README: document both cuts, theme selection and swapping. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Wassim Chegham (manekinekko)
September 28, 2026 20:38
View session
Copilot started reviewing on behalf of
Wassim Chegham (manekinekko)
September 29, 2026 07:29
View session
| if (sourceIsStale()) { | ||
| // Hide the other cut at once, even when a partly visible player defers the swap. | ||
| delete video.dataset.ready; | ||
| syncPlayback(); |
Contributor
There was a problem hiding this comment.
Updated the visibility check to require an intersection ratio of at least 0.25. Commit: 1854d40.
Copilot started work on behalf of
Wassim Chegham (manekinekko)
September 30, 2026 14:51
View session
Co-authored-by: manekinekko <1699357+manekinekko@users.noreply.github.com>
This branch has not been 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.

Summary
The landing-page showreel on https://microsoft.github.io/scope/ always played the dark cut, so light-mode visitors got a dark block in the middle of a light page. The page now serves a dark cut in dark mode and a light cut in light mode, both restyled with the landing design tokens (dark: bg
#0e111b, brand#b1b4ff; light: bg#fafbfd, brand#5048bd).scope-showreel-{dark,light}.mp4andscope-showreel-poster-{dark,light}.jpgtowebsite/public/and removes the old single video and poster, which were referenced only fromHome.astroand the README. Encoding is unchanged: H.264 High, 1920x1080, 30 fps, 29.97 s (half speed), no audio, faststart.data-themeon<html>, which Starlight sets with a blocking script, including its resolution of Auto. There is no separate preference logic.posterattribute,Home.astropasses both posters to CSS as base-aware custom properties. The frame paints the active theme's poster, and the video stays transparent until it has a frame. This also covers reduced-motion visitors, who only see the poster, and visitors without JavaScript.MutationObserverondata-themeswaps a loaded player to the matching cut at the same position, playing or paused, including after an explicit user pause. It is disconnected indisconnectedCallback.preload="none", lazysrcassignment, the 25% IntersectionObserver gating, reduced motion, the blocked-autoplay message and error reporting.--scope-*tokens instead of hard-coded dark colours, so they stay readable over either cut.Demos
Both screenshots show the same frame (3.3 s) in light mode.
Before
The live site in light mode plays the dark cut:
After
Light mode plays the light cut:
Dark mode plays the dark cut:
Testing
From
website/:pnpm test: 7/7 pass.pnpm build: 203 pages, with both the local/base andSITE=https://microsoft.github.io BASE_PATH=/scope. Media URLs include the base correctly in both.tsconsrc/scripts/showreel.tspasses, and the repo license-header check (scripts/license-headers.ts --check) passes.In headless Google Chrome (puppeteer), 72 automated checks pass against the dev server, and an earlier version of the suite passed against the
/scopeproduction preview:Documentation and compatibility
website/README.md: the "Showreel" section is updated to cover both cuts and posters, how the theme is chosen and swapped, and the new file links.Checklist
up()/down()and keep it CosmosDB-compatible. (N/A)NOTICE/NOTICE-REVIEW.txtwithpnpm noticeas needed. (N/A: no dependency changes)