feat(demos): Floating Languages — multilingual physics demo with live reflow#93
Open
RAKKUNN wants to merge 1 commit intochenglou:mainfrom
Open
feat(demos): Floating Languages — multilingual physics demo with live reflow#93RAKKUNN wants to merge 1 commit intochenglou:mainfrom
RAKKUNN wants to merge 1 commit intochenglou:mainfrom
Conversation
Multilingual phrases float across the screen with physics simulation, showcasing Pretext DOM-free text measurement across 27 phrases in 12+ languages. Features: - Script-family color coding (CJK=gold, Arabic=emerald, Indic=coral, etc.) - Three physics modes: free float, orbit, and gravity - Click-to-reflow animation with live line-break recalculation and particle bursts - User text input with automatic script detection - Canvas background with proximity lines and radial glow per family - FPS counter and bubble count display Uses prepare(), layout(), prepareWithSegments(), and walkLineRanges() for all text measurement — zero DOM reads at runtime.
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.

What
New demo page: Floating Languages — everyday phrases from 12+ languages
float on screen with physics, colored by script family, and respond to
interaction with live Pretext-powered reflow visualization.
Demo URL
/demos/floating-languagesFeatures
English, Spanish, French, German, Portuguese, Russian, Emoji, Mixed bidi)
Thai/SEA → green, European → purple, Emoji → yellow, Mixed → lavender
recalculates line breaks each frame; particle burst on line-count change
Pretext APIs used
prepare()layout()prepareWithSegments()walkLineRangeswalkLineRanges()Files changed
pages/demos/floating-languages.html— newpages/demos/floating-languages.ts— newpages/demos/index.html— added demo card to grid