https://github.com/blobbybilb/why-animate
Simple JS animations. If you can use a graphing calculator, you can use why?animate.
https://github.com/blobbybilb/why-animate
Last synced: about 1 year ago
JSON representation
Simple JS animations. If you can use a graphing calculator, you can use why?animate.
- Host: GitHub
- URL: https://github.com/blobbybilb/why-animate
- Owner: blobbybilb
- Created: 2024-03-04T04:58:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-04T04:59:17.000Z (over 2 years ago)
- Last Synced: 2024-05-30T02:14:44.224Z (about 2 years ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# why?animate
Simple JS animations. If you can use a graphing calculator, you can use why?animate.
(incomplete, currently only supports moving things around)
Examples:
```js
// blue square moving anti-clockwise in a circle
new Particle()
.rectangle()
.color("blue")
.Y((t) => Math.sin(t))
.X((t) => Math.cos(t))
.position()
.show()
.start()
// white square still at center of screen
new Particle()
.rectangle()
.color("white")
.Y((t) => 0)
.X((t) => 0)
.position()
.show()
.start()
// blue square still at bottom left corner (of the largest square that can be fit on screen)
new Particle()
.rectangle()
.color("blue")
.Y((t) => -1)
.X((t) => -1)
.position()
.show()
.start()
```