feat(motion): Conditional Motion Engine (vl-motion) with CSS if() progressive enhancement - #7
Merged
Conversation
… progressive enhancement Co-authored-by: Erik Assis Cardoso <erikconnect@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…e near page bottom Co-authored-by: Erik Assis Cardoso <erikconnect@users.noreply.github.com>
- Refined the public Showcase to include only six routes: Home, Timeline, Skins, Catalog, Hosts, and Archive. - Updated README to clarify Velora as a declarative CSS motion engine and the role of Skins as optional design-system models. - Enhanced documentation for scene management, timelines, and modular entry points. - Removed outdated pages and streamlined navigation in the showcase. - Adjusted the contract checklist to reflect the new structure and ensure compliance with motion standards.
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
Adds a first version of Velora's Conditional Motion Engine — a declarative
vl-motionattribute that selects a motion mode and centrally re-scales the shared motion tokens every preset already reads. Zero JavaScript animation runtime; CSSif()is used strictly as progressive enhancement over a baseline that works everywhere.vl-motion="standard | subtle | cinematic | still".Walkthrough
Live comparison of the three modes on the Zero-JS Motion showcase page — cinematic reveals with a larger/slower/blurred entrance, subtle with a shorter/quieter reveal, and still (reduced-motion-safe) appears with no movement. All content renders correctly (no stuck-hidden elements).
vl_motion_engine_demo_fixed.mp4
Conditional Motion Engine section
Three vl-motion modes rendered
What changed
packages/css/src/01-tokens.css): new central engine knobs —--vl-motion-mode,--vl-motion-preference,--vl-motion-speed-scale,--vl-motion-intensity,--vl-motion-depth,--vl-motion-blur,--vl-motion-mode-ease. Neutral defaults (scale1, offset0) keep existing motion identical when no mode is set.packages/css/src/03a-motion-conditions.css, new): baseline[vl-motion="…"]selectors assign the knobs; a@supports (width: if(...))block re-derives them with CSSif()usingmedia(),style()andsupports()(reduced-motion,pointer: coarse, scroll-timeline availability). Includes aprefers-reduced-motioncollapse and astillmode that renders the composed resting state with no movement.packages/css/src/03-motion.css): base[vl-effect]/channel duration routes through--vl-motion-speed-scale, easing through--vl-motion-mode-ease;vl-flow-in/vl-reveal-cinematicblur is additive via--vl-motion-blur. All changes preserve prior behavior at neutral defaults; explicitvl-speed/vl-depthstill win.velora.css(after03b) andmotion-core.cssin correct cascade order.vl-motionadded to the compiler allowlist + value rule (standard|subtle|cinematic|still) inpackages/compiler/src/grammar.mjs, to the showcase validator allowlist, and documented indocs/project/CONTRACT.md. Deprecated attributes remain forbidden.apps/showcase/pages/motion/zero-js-motion.html): a new "Conditional Motion Engine" section withcinematic,subtle, and reduced-motion-safe (still) demos driving the real framework grammar (not showcase-local CSS). Demo reveals usevl-range="entry"so scroll-driven entrances complete reliably near the page bottom.Conditional Motionpage (apps/docs/src/pages/motion-conditions.astro) + sidebar link, explaining the engine,if()as progressive enhancement, and the no-if()fallback.Validation
pnpm verify:contract— CSS sync OK, contract passed for 49 pages (2713vl-*attrs), motion compiler 0 issues.pnpm build— full Turborepo build passes (Vite + Astro process theif()CSS without error; docs now 10 pages).pnpm --filter @velora/compiler test(8/8) andpnpm --filter showcase test:library(10/10).Acceptance criteria
vl-motionworks declaratively. ✅if()used only as progressive enhancement, with a working fallback. ✅still). ✅To show artifacts inline, enable in settings.