feat(html): animated backgrounds, parameterized transitions and fonts in the dialect#32
Merged
Merged
Conversation
… 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
18 tasks
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.
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.
backgroundon<scene>and<rustmotion>: values starting with{/[parse as structured JSON (animated presets,$reftemplates, arrays); anything else stays a string. Invalid JSON → explicitInvalidBackgroundJsonerror.transition+transition-duration+transition-easingon<scene>→ fullTransitionobject; parameters without atransitiontype are a hard transpile error.<font family=".." path|src="..">under<rustmotion>→ scenariofontsarray. 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
pathandsrc, both missing-attribute errors, and absent-fonts-key behavior. Newexamples/html/showcase.htmlexercises all three features and passesrustmotion validateend-to-end (schema + geometry).Verify:
cargo test --workspace→ 151 passed ✓ ·cargo fmt --check✓ · clippy 0 warnings ✓ ·rustmotion validate -f examples/html/showcase.html✓