Skip to content

feat(html): animated backgrounds, parameterized transitions and fonts in the dialect#32

Merged
LeadcodeDev merged 1 commit into
mainfrom
feat/html-dialect-extensions
Jul 18, 2026
Merged

feat(html): animated backgrounds, parameterized transitions and fonts in the dialect#32
LeadcodeDev merged 1 commit into
mainfrom
feat/html-dialect-extensions

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

Closes #18.

Goal: close the authoring gaps that force JSON round-trips — scene backgrounds (incl. animated presets), transition duration/easing, and custom fonts are now expressible in HTML.

  • background on <scene> and <rustmotion>: values starting with {/[ parse as structured JSON (animated presets, $ref templates, arrays); anything else stays a string. Invalid JSON → explicit InvalidBackgroundJson error.
  • transition + transition-duration + transition-easing on <scene> → full Transition object; parameters without a transition type are a hard transpile error.
  • <font family=".." path|src=".."> under <rustmotion> → scenario fonts array. Notable: <font> is an HTML5 formatting element, so html5ever nests following siblings inside it — the scene walker recurses through font subtrees to find them.

Tests: 12 new (TDD), covering string/JSON/invalid backgrounds on scene and root, full transition params, both orphan-param errors, font collection via path and src, both missing-attribute errors, and absent-fonts-key behavior. New examples/html/showcase.html exercises all three features and passes rustmotion validate end-to-end (schema + geometry).

Verify: cargo test --workspace → 151 passed ✓ · cargo fmt --check ✓ · clippy 0 warnings ✓ · rustmotion validate -f examples/html/showcase.html

… in the dialect

- <scene background='...'> and <rustmotion background='...'>: JSON
  object/array parsed and inserted structurally, plain strings kept
  as-is; invalid JSON is an explicit InvalidBackgroundJson error
- <scene transition=.. transition-duration=.. transition-easing=..>
  maps to the full Transition object; params without a transition
  type are a hard error, never silently dropped
- <font family=.. path|src=..> children of <rustmotion> aggregate
  into the scenario fonts array; html5ever nests siblings inside
  <font> (HTML formatting element) so the scene walker recurses
  through font subtrees
@LeadcodeDev
LeadcodeDev merged commit 916d10a into main Jul 18, 2026
@LeadcodeDev
LeadcodeDev deleted the feat/html-dialect-extensions branch July 18, 2026 20:25
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.

feat(html): animated backgrounds, parameterized transitions and fonts in the dialect

1 participant