-
Notifications
You must be signed in to change notification settings - Fork 213
Feat/spinner pulse 1739 #1944
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Karanjot786
merged 5 commits into
Karanjot786:main
from
Shan7Usmani:feat/spinner-pulse-1739
Jul 3, 2026
+557
−48
Merged
Feat/spinner pulse 1739 #1944
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
694ff90
feat: smooth fade-in/fade-out animation for Tooltip (#1737)
Shan7Usmani 53f8eaf
fix: mock caps.motion for animation tests so they pass in CI
Shan7Usmani cad7a12
feat: add smooth check/toggle animation for Checkbox and Switch
Shan7Usmani b20de70
fix(ui): add track dim transition during Switch animation
Shan7Usmani 0106346
feat(widgets): add smooth pulse animation mode to Spinner (#1739)
Shan7Usmani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import { App, Screen } from '@termuijs/core'; | ||
| import { Box, Text, Checkbox } from '@termuijs/widgets'; | ||
| import { Switch } from '@termuijs/ui'; | ||
|
|
||
| async function main() { | ||
| const root = new Box({ flexDirection: 'column', gap: 1, padding: { left: 2 } }); | ||
|
|
||
| root.addChild(new Text(' Checkbox & Switch Animation Demo', { | ||
| bold: true, fg: { type: 'named', name: 'cyan' }, height: 1, | ||
| })); | ||
| root.addChild(new Text(' Press Space/Enter to toggle • q to quit', { | ||
| fg: { type: 'named', name: 'brightBlack' }, height: 1, | ||
| })); | ||
| root.addChild(new Text('─'.repeat(40), { fg: { type: 'named', name: 'brightBlack' }, height: 1 })); | ||
|
|
||
| const cb1 = new Checkbox('Enable notifications', {}, { checked: true }); | ||
| const cb2 = new Checkbox('Dark mode', {}, { checked: false }); | ||
| const cb3 = new Checkbox('Auto-save', {}, { checked: true }); | ||
|
|
||
| const sw1 = new Switch({ defaultValue: true, label: 'Wi-Fi' }); | ||
| const sw2 = new Switch({ defaultValue: false, label: 'Bluetooth' }); | ||
| const sw3 = new Switch({ defaultValue: true, label: 'Airplane mode' }); | ||
|
|
||
| root.addChild(new Text(' Checkboxes:', { bold: true, height: 1 })); | ||
| root.addChild(cb1); | ||
| root.addChild(cb2); | ||
| root.addChild(cb3); | ||
|
|
||
| root.addChild(new Text('', { height: 1 })); | ||
|
|
||
| root.addChild(new Text(' Switches:', { bold: true, height: 1 })); | ||
| root.addChild(sw1); | ||
| root.addChild(sw2); | ||
| root.addChild(sw3); | ||
|
|
||
| const app = new App(root, { fullscreen: true, fps: 30, title: 'Animation Demo' }); | ||
|
|
||
| app.events.on('key', (event) => { | ||
| if (event.key === 'q' || (event.ctrl && event.key === 'c')) { | ||
| app.exit(0); | ||
| return; | ||
| } | ||
| if (event.key === 'space' || event.key === 'enter') { | ||
| cb1.toggle(); | ||
| cb2.toggle(); | ||
| cb3.toggle(); | ||
| sw1.toggle(); | ||
| sw2.toggle(); | ||
| sw3.toggle(); | ||
| } | ||
| app.requestRender(); | ||
| }); | ||
|
|
||
| const exitCode = await app.mount(); | ||
| process.exit(exitCode); | ||
| } | ||
|
|
||
| main().catch((err) => { | ||
| console.error(err); | ||
| process.exit(1); | ||
| }); | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.