@20baht/stickers 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +48 -0
- package/README.md +173 -2
- package/dist/all.d.ts +4 -0
- package/dist/all.js +7 -0
- package/dist/element.d.ts +103 -0
- package/dist/element.js +181 -0
- package/dist/graph.d.ts +172 -0
- package/dist/graph.js +374 -0
- package/dist/icons/access-point.d.ts +2 -0
- package/dist/icons/access-point.js +34 -0
- package/dist/icons/ai-agent.d.ts +2 -0
- package/dist/icons/ai-agent.js +50 -0
- package/dist/icons/alarm-clock.d.ts +2 -0
- package/dist/icons/alarm-clock.js +46 -0
- package/dist/icons/all-in-one.d.ts +2 -0
- package/dist/icons/all-in-one.js +37 -0
- package/dist/icons/angpao.d.ts +2 -0
- package/dist/icons/angpao.js +46 -0
- package/dist/icons/badge-reader.d.ts +2 -0
- package/dist/icons/badge-reader.js +51 -0
- package/dist/icons/baht-note.d.ts +2 -0
- package/dist/icons/baht-note.js +42 -0
- package/dist/icons/bamboo.d.ts +2 -0
- package/dist/icons/bamboo.js +57 -0
- package/dist/icons/banana-leaf.d.ts +2 -0
- package/dist/icons/banana-leaf.js +87 -0
- package/dist/icons/banana-tree.d.ts +2 -0
- package/dist/icons/banana-tree.js +75 -0
- package/dist/icons/bear.d.ts +2 -0
- package/dist/icons/bear.js +39 -0
- package/dist/icons/blade-chassis.d.ts +2 -0
- package/dist/icons/blade-chassis.js +43 -0
- package/dist/icons/bond.d.ts +2 -0
- package/dist/icons/bond.js +48 -0
- package/dist/icons/books.d.ts +2 -0
- package/dist/icons/books.js +44 -0
- package/dist/icons/bts-card.d.ts +2 -0
- package/dist/icons/bts-card.js +47 -0
- package/dist/icons/budget-jar.d.ts +2 -0
- package/dist/icons/budget-jar.js +43 -0
- package/dist/icons/cactus.d.ts +2 -0
- package/dist/icons/cactus.js +42 -0
- package/dist/icons/calculator.d.ts +2 -0
- package/dist/icons/calculator.js +46 -0
- package/dist/icons/calendar-month.d.ts +2 -0
- package/dist/icons/calendar-month.js +66 -0
- package/dist/icons/campfire.d.ts +2 -0
- package/dist/icons/campfire.js +63 -0
- package/dist/icons/cctv.d.ts +2 -0
- package/dist/icons/cctv.js +38 -0
- package/dist/icons/certificate.d.ts +2 -0
- package/dist/icons/certificate.js +50 -0
- package/dist/icons/cha-yen.d.ts +2 -0
- package/dist/icons/cha-yen.js +68 -0
- package/dist/icons/chedi.d.ts +2 -0
- package/dist/icons/chedi.js +56 -0
- package/dist/icons/classic-phone.d.ts +2 -0
- package/dist/icons/classic-phone.js +32 -0
- package/dist/icons/clipboard.d.ts +2 -0
- package/dist/icons/clipboard.js +61 -0
- package/dist/icons/cloud.d.ts +2 -0
- package/dist/icons/cloud.js +28 -0
- package/dist/icons/coins.d.ts +2 -0
- package/dist/icons/coins.js +34 -0
- package/dist/icons/compare.d.ts +2 -0
- package/dist/icons/compare.js +33 -0
- package/dist/icons/confetti.d.ts +2 -0
- package/dist/icons/confetti.js +72 -0
- package/dist/icons/convenience-bag.d.ts +2 -0
- package/dist/icons/convenience-bag.js +51 -0
- package/dist/icons/cooling.d.ts +2 -0
- package/dist/icons/cooling.js +46 -0
- package/dist/icons/copy-files.d.ts +2 -0
- package/dist/icons/copy-files.js +37 -0
- package/dist/icons/core-switch.d.ts +2 -0
- package/dist/icons/core-switch.js +48 -0
- package/dist/icons/cron.d.ts +2 -0
- package/dist/icons/cron.js +86 -0
- package/dist/icons/cursor.d.ts +2 -0
- package/dist/icons/cursor.js +27 -0
- package/dist/icons/database.d.ts +2 -0
- package/dist/icons/database.js +24 -0
- package/dist/icons/desktop-tower.d.ts +2 -0
- package/dist/icons/desktop-tower.js +41 -0
- package/dist/icons/disc-image.d.ts +2 -0
- package/dist/icons/disc-image.js +54 -0
- package/dist/icons/dollar-note.d.ts +2 -0
- package/dist/icons/dollar-note.js +44 -0
- package/dist/icons/electric-bill.d.ts +2 -0
- package/dist/icons/electric-bill.js +51 -0
- package/dist/icons/email.d.ts +2 -0
- package/dist/icons/email.js +57 -0
- package/dist/icons/empty-state.d.ts +2 -0
- package/dist/icons/empty-state.js +75 -0
- package/dist/icons/expense.d.ts +2 -0
- package/dist/icons/expense.js +36 -0
- package/dist/icons/export-file.d.ts +2 -0
- package/dist/icons/export-file.js +35 -0
- package/dist/icons/eyedropper.d.ts +2 -0
- package/dist/icons/eyedropper.js +69 -0
- package/dist/icons/face-id.d.ts +2 -0
- package/dist/icons/face-id.js +51 -0
- package/dist/icons/file.d.ts +2 -0
- package/dist/icons/file.js +15 -0
- package/dist/icons/finance-b-coins.d.ts +8 -0
- package/dist/icons/finance-b-coins.js +14 -0
- package/dist/icons/finance-tray.d.ts +11 -0
- package/dist/icons/finance-tray.js +41 -0
- package/dist/icons/fingerprint.d.ts +2 -0
- package/dist/icons/fingerprint.js +45 -0
- package/dist/icons/firewall.d.ts +2 -0
- package/dist/icons/firewall.js +76 -0
- package/dist/icons/floating-ip.d.ts +2 -0
- package/dist/icons/floating-ip.js +59 -0
- package/dist/icons/flower.d.ts +2 -0
- package/dist/icons/flower.js +49 -0
- package/dist/icons/food.d.ts +6 -0
- package/dist/icons/food.js +18 -0
- package/dist/icons/freelance.d.ts +2 -0
- package/dist/icons/freelance.js +51 -0
- package/dist/icons/fuel.d.ts +2 -0
- package/dist/icons/fuel.js +46 -0
- package/dist/icons/goal.d.ts +2 -0
- package/dist/icons/goal.js +51 -0
- package/dist/icons/gold-bar.d.ts +2 -0
- package/dist/icons/gold-bar.js +60 -0
- package/dist/icons/hard-drive.d.ts +2 -0
- package/dist/icons/hard-drive.js +42 -0
- package/dist/icons/highlighter.d.ts +2 -0
- package/dist/icons/highlighter.js +75 -0
- package/dist/icons/home-router.d.ts +2 -0
- package/dist/icons/home-router.js +32 -0
- package/dist/icons/hot-drink.d.ts +2 -0
- package/dist/icons/hot-drink.js +33 -0
- package/dist/icons/hsm.d.ts +2 -0
- package/dist/icons/hsm.js +54 -0
- package/dist/icons/id-card.d.ts +2 -0
- package/dist/icons/id-card.js +36 -0
- package/dist/icons/income.d.ts +2 -0
- package/dist/icons/income.js +28 -0
- package/dist/icons/index.d.ts +187 -0
- package/dist/icons/index.js +370 -0
- package/dist/icons/interest.d.ts +2 -0
- package/dist/icons/interest.js +66 -0
- package/dist/icons/iot-sensor.d.ts +2 -0
- package/dist/icons/iot-sensor.js +35 -0
- package/dist/icons/ip-phone.d.ts +2 -0
- package/dist/icons/ip-phone.js +47 -0
- package/dist/icons/ipad-gen8.d.ts +2 -0
- package/dist/icons/ipad-gen8.js +58 -0
- package/dist/icons/iphone-17.d.ts +2 -0
- package/dist/icons/iphone-17.js +37 -0
- package/dist/icons/iso.d.ts +2 -0
- package/dist/icons/iso.js +3 -0
- package/dist/icons/kanban.d.ts +2 -0
- package/dist/icons/kanban.js +85 -0
- package/dist/icons/kaprao.d.ts +2 -0
- package/dist/icons/kaprao.js +70 -0
- package/dist/icons/key-pair.d.ts +2 -0
- package/dist/icons/key-pair.js +54 -0
- package/dist/icons/key.d.ts +3 -0
- package/dist/icons/key.js +37 -0
- package/dist/icons/keyboard.d.ts +2 -0
- package/dist/icons/keyboard.js +35 -0
- package/dist/icons/kite.d.ts +2 -0
- package/dist/icons/kite.js +53 -0
- package/dist/icons/kvm.d.ts +2 -0
- package/dist/icons/kvm.js +53 -0
- package/dist/icons/lamp.d.ts +2 -0
- package/dist/icons/lamp.js +49 -0
- package/dist/icons/laptop.d.ts +2 -0
- package/dist/icons/laptop.js +44 -0
- package/dist/icons/load-balancer.d.ts +2 -0
- package/dist/icons/load-balancer.js +50 -0
- package/dist/icons/lock-screen.d.ts +2 -0
- package/dist/icons/lock-screen.js +44 -0
- package/dist/icons/long-tail-boat.d.ts +2 -0
- package/dist/icons/long-tail-boat.js +66 -0
- package/dist/icons/lottery.d.ts +2 -0
- package/dist/icons/lottery.js +51 -0
- package/dist/icons/lotus.d.ts +2 -0
- package/dist/icons/lotus.js +70 -0
- package/dist/icons/mac-mini.d.ts +2 -0
- package/dist/icons/mac-mini.js +31 -0
- package/dist/icons/macbook-air.d.ts +2 -0
- package/dist/icons/macbook-air.js +41 -0
- package/dist/icons/mailbox-thai.d.ts +2 -0
- package/dist/icons/mailbox-thai.js +66 -0
- package/dist/icons/mango-sticky-rice.d.ts +2 -0
- package/dist/icons/mango-sticky-rice.js +41 -0
- package/dist/icons/marigold.d.ts +2 -0
- package/dist/icons/marigold.js +69 -0
- package/dist/icons/market-basket.d.ts +2 -0
- package/dist/icons/market-basket.js +69 -0
- package/dist/icons/media-player.d.ts +2 -0
- package/dist/icons/media-player.js +71 -0
- package/dist/icons/metrics.d.ts +2 -0
- package/dist/icons/metrics.js +58 -0
- package/dist/icons/mini-pc.d.ts +2 -0
- package/dist/icons/mini-pc.js +26 -0
- package/dist/icons/modem.d.ts +2 -0
- package/dist/icons/modem.js +37 -0
- package/dist/icons/monitor.d.ts +2 -0
- package/dist/icons/monitor.js +40 -0
- package/dist/icons/monstera.d.ts +2 -0
- package/dist/icons/monstera.js +47 -0
- package/dist/icons/moon.d.ts +2 -0
- package/dist/icons/moon.js +55 -0
- package/dist/icons/motorbike-taxi.d.ts +2 -0
- package/dist/icons/motorbike-taxi.js +42 -0
- package/dist/icons/music-note.d.ts +2 -0
- package/dist/icons/music-note.js +63 -0
- package/dist/icons/nas-2bay.d.ts +2 -0
- package/dist/icons/nas-2bay.js +49 -0
- package/dist/icons/nas.d.ts +2 -0
- package/dist/icons/nas.js +41 -0
- package/dist/icons/nature-iso.d.ts +29 -0
- package/dist/icons/nature-iso.js +74 -0
- package/dist/icons/noodle-soup.d.ts +2 -0
- package/dist/icons/noodle-soup.js +52 -0
- package/dist/icons/notebook.d.ts +2 -0
- package/dist/icons/notebook.js +44 -0
- package/dist/icons/object-drum.d.ts +18 -0
- package/dist/icons/object-drum.js +63 -0
- package/dist/icons/otp.d.ts +2 -0
- package/dist/icons/otp.js +46 -0
- package/dist/icons/over-budget.d.ts +2 -0
- package/dist/icons/over-budget.js +48 -0
- package/dist/icons/pad-see-ew.d.ts +2 -0
- package/dist/icons/pad-see-ew.js +56 -0
- package/dist/icons/palm-tree.d.ts +2 -0
- package/dist/icons/palm-tree.js +52 -0
- package/dist/icons/paper-boat.d.ts +2 -0
- package/dist/icons/paper-boat.js +67 -0
- package/dist/icons/paper.d.ts +3 -0
- package/dist/icons/paper.js +45 -0
- package/dist/icons/password.d.ts +2 -0
- package/dist/icons/password.js +45 -0
- package/dist/icons/patch-panel.d.ts +2 -0
- package/dist/icons/patch-panel.js +41 -0
- package/dist/icons/pdu.d.ts +2 -0
- package/dist/icons/pdu.js +40 -0
- package/dist/icons/phone-topup.d.ts +2 -0
- package/dist/icons/phone-topup.js +55 -0
- package/dist/icons/photo.d.ts +2 -0
- package/dist/icons/photo.js +48 -0
- package/dist/icons/phuang-malai.d.ts +2 -0
- package/dist/icons/phuang-malai.js +59 -0
- package/dist/icons/pie-chart.d.ts +2 -0
- package/dist/icons/pie-chart.js +36 -0
- package/dist/icons/piggy-bank.d.ts +2 -0
- package/dist/icons/piggy-bank.js +64 -0
- package/dist/icons/plant-kit.d.ts +23 -0
- package/dist/icons/plant-kit.js +112 -0
- package/dist/icons/plastic-stool.d.ts +2 -0
- package/dist/icons/plastic-stool.js +67 -0
- package/dist/icons/pointer.d.ts +1 -0
- package/dist/icons/pointer.js +12 -0
- package/dist/icons/pos.d.ts +2 -0
- package/dist/icons/pos.js +59 -0
- package/dist/icons/potted-plant.d.ts +2 -0
- package/dist/icons/potted-plant.js +31 -0
- package/dist/icons/power-pole.d.ts +2 -0
- package/dist/icons/power-pole.js +60 -0
- package/dist/icons/power-station.d.ts +2 -0
- package/dist/icons/power-station.js +56 -0
- package/dist/icons/printer.d.ts +2 -0
- package/dist/icons/printer.js +46 -0
- package/dist/icons/qr-code.d.ts +2 -0
- package/dist/icons/qr-code.js +45 -0
- package/dist/icons/rack.d.ts +2 -0
- package/dist/icons/rack.js +39 -0
- package/dist/icons/rain-cloud.d.ts +2 -0
- package/dist/icons/rain-cloud.js +31 -0
- package/dist/icons/rainbow.d.ts +2 -0
- package/dist/icons/rainbow.js +46 -0
- package/dist/icons/receipt.d.ts +2 -0
- package/dist/icons/receipt.js +56 -0
- package/dist/icons/redmi-note-9s-pro.d.ts +2 -0
- package/dist/icons/redmi-note-9s-pro.js +37 -0
- package/dist/icons/register.d.ts +2 -0
- package/dist/icons/register.js +40 -0
- package/dist/icons/remote-desktop.d.ts +2 -0
- package/dist/icons/remote-desktop.js +62 -0
- package/dist/icons/remote-folder.d.ts +2 -0
- package/dist/icons/remote-folder.js +55 -0
- package/dist/icons/rent.d.ts +2 -0
- package/dist/icons/rent.js +50 -0
- package/dist/icons/rock.d.ts +2 -0
- package/dist/icons/rock.js +80 -0
- package/dist/icons/router.d.ts +2 -0
- package/dist/icons/router.js +59 -0
- package/dist/icons/salary.d.ts +2 -0
- package/dist/icons/salary.js +54 -0
- package/dist/icons/saving-streak.d.ts +2 -0
- package/dist/icons/saving-streak.js +66 -0
- package/dist/icons/scan-slip.d.ts +2 -0
- package/dist/icons/scan-slip.js +53 -0
- package/dist/icons/scissors.d.ts +2 -0
- package/dist/icons/scissors.js +52 -0
- package/dist/icons/server-cabinet.d.ts +2 -0
- package/dist/icons/server-cabinet.js +49 -0
- package/dist/icons/server.d.ts +2 -0
- package/dist/icons/server.js +41 -0
- package/dist/icons/shared.d.ts +8 -0
- package/dist/icons/shared.js +18 -0
- package/dist/icons/shield.d.ts +3 -0
- package/dist/icons/shield.js +28 -0
- package/dist/icons/shooting-star.d.ts +2 -0
- package/dist/icons/shooting-star.js +37 -0
- package/dist/icons/shopping-box.d.ts +2 -0
- package/dist/icons/shopping-box.js +46 -0
- package/dist/icons/sky-kit.d.ts +19 -0
- package/dist/icons/sky-kit.js +72 -0
- package/dist/icons/smart-tv.d.ts +2 -0
- package/dist/icons/smart-tv.js +39 -0
- package/dist/icons/smartphone.d.ts +2 -0
- package/dist/icons/smartphone.js +30 -0
- package/dist/icons/sms.d.ts +2 -0
- package/dist/icons/sms.js +45 -0
- package/dist/icons/snapshots.d.ts +2 -0
- package/dist/icons/snapshots.js +45 -0
- package/dist/icons/snip.d.ts +2 -0
- package/dist/icons/snip.js +63 -0
- package/dist/icons/spirit-house.d.ts +2 -0
- package/dist/icons/spirit-house.js +73 -0
- package/dist/icons/ssl-certificate.d.ts +2 -0
- package/dist/icons/ssl-certificate.js +56 -0
- package/dist/icons/star.d.ts +2 -0
- package/dist/icons/star.js +16 -0
- package/dist/icons/stock.d.ts +2 -0
- package/dist/icons/stock.js +62 -0
- package/dist/icons/storage-array.d.ts +2 -0
- package/dist/icons/storage-array.js +40 -0
- package/dist/icons/storm.d.ts +2 -0
- package/dist/icons/storm.js +43 -0
- package/dist/icons/street-food-cart.d.ts +2 -0
- package/dist/icons/street-food-cart.js +66 -0
- package/dist/icons/street-kit.d.ts +19 -0
- package/dist/icons/street-kit.js +67 -0
- package/dist/icons/street-sign.d.ts +2 -0
- package/dist/icons/street-sign.js +42 -0
- package/dist/icons/studio-monitors.d.ts +2 -0
- package/dist/icons/studio-monitors.js +67 -0
- package/dist/icons/sun.d.ts +2 -0
- package/dist/icons/sun.js +40 -0
- package/dist/icons/support.d.ts +2 -0
- package/dist/icons/support.js +48 -0
- package/dist/icons/switch.d.ts +2 -0
- package/dist/icons/switch.js +34 -0
- package/dist/icons/tablet.d.ts +2 -0
- package/dist/icons/tablet.js +44 -0
- package/dist/icons/tape-library.d.ts +2 -0
- package/dist/icons/tape-library.js +48 -0
- package/dist/icons/temple-donation.d.ts +2 -0
- package/dist/icons/temple-donation.js +60 -0
- package/dist/icons/tent.d.ts +2 -0
- package/dist/icons/tent.js +66 -0
- package/dist/icons/terminal.d.ts +2 -0
- package/dist/icons/terminal.js +56 -0
- package/dist/icons/thai-house.d.ts +2 -0
- package/dist/icons/thai-house.js +85 -0
- package/dist/icons/thai-lantern.d.ts +2 -0
- package/dist/icons/thai-lantern.js +61 -0
- package/dist/icons/thinkpad-l380.d.ts +2 -0
- package/dist/icons/thinkpad-l380.js +54 -0
- package/dist/icons/timer.d.ts +2 -0
- package/dist/icons/timer.js +59 -0
- package/dist/icons/train-ticket.d.ts +2 -0
- package/dist/icons/train-ticket.js +57 -0
- package/dist/icons/trash.d.ts +2 -0
- package/dist/icons/trash.js +62 -0
- package/dist/icons/tree.d.ts +2 -0
- package/dist/icons/tree.js +40 -0
- package/dist/icons/tuk-tuk.d.ts +2 -0
- package/dist/icons/tuk-tuk.js +45 -0
- package/dist/icons/tulip.d.ts +2 -0
- package/dist/icons/tulip.js +56 -0
- package/dist/icons/tunnel.d.ts +2 -0
- package/dist/icons/tunnel.js +50 -0
- package/dist/icons/two-factor.d.ts +2 -0
- package/dist/icons/two-factor.js +81 -0
- package/dist/icons/ups.d.ts +2 -0
- package/dist/icons/ups.js +37 -0
- package/dist/icons/usb-drive.d.ts +2 -0
- package/dist/icons/usb-drive.js +35 -0
- package/dist/icons/verified.d.ts +2 -0
- package/dist/icons/verified.js +32 -0
- package/dist/icons/virtual-machine.d.ts +2 -0
- package/dist/icons/virtual-machine.js +66 -0
- package/dist/icons/volume.d.ts +6 -0
- package/dist/icons/volume.js +35 -0
- package/dist/icons/vpn-gateway.d.ts +2 -0
- package/dist/icons/vpn-gateway.js +51 -0
- package/dist/icons/wake-on-lan.d.ts +2 -0
- package/dist/icons/wake-on-lan.js +40 -0
- package/dist/icons/wallet.d.ts +3 -0
- package/dist/icons/wallet.js +55 -0
- package/dist/icons/water-jar.d.ts +2 -0
- package/dist/icons/water-jar.js +72 -0
- package/dist/icons/wooden-window.d.ts +2 -0
- package/dist/icons/wooden-window.js +65 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +4 -0
- package/dist/iso.d.ts +32 -0
- package/dist/iso.js +64 -0
- package/dist/load.d.ts +199 -0
- package/dist/load.js +199 -0
- package/dist/motions.d.ts +68 -0
- package/dist/motions.js +446 -0
- package/dist/sticker.d.ts +269 -0
- package/dist/sticker.js +1009 -0
- package/package.json +101 -4
package/dist/motions.js
ADDED
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
// The sticker motion presets, as After Effects keys: deltas over a rest pose, px on a 500 canvas, 60fps.
|
|
2
|
+
// From fun-isometric by Kelvin Adithya (MIT, see LICENSE).
|
|
3
|
+
import { shift } from './sticker.js';
|
|
4
|
+
// The eases every preset is built from
|
|
5
|
+
export const EASY = [0.333, 0, 0.667, 1]; // AE easy ease: sways, floats, wiggles, every half swing of a spring
|
|
6
|
+
export const POP = [0.75, 0, 0.25, 1]; // stars popping, slow returns
|
|
7
|
+
export const SNAP = [0.8, 0, 0.2, 1]; // a part travelling from one slot to another
|
|
8
|
+
export const OUT = [0, 0, 0, 1]; // dealt in, all speed up front
|
|
9
|
+
export const SOFT = [0.2, 0, 0, 1]; // a latch springing open
|
|
10
|
+
export const IN = [1, 0, 0.8, 1]; // a latch slamming shut
|
|
11
|
+
export const DROP = [1, 0, 1, 1]; // falling away
|
|
12
|
+
const SPRING = [
|
|
13
|
+
[0.17, 0.17, 0.55, 1],
|
|
14
|
+
[0.35, 0, 0.62, 1],
|
|
15
|
+
[0.31, 0, 0.67, 1],
|
|
16
|
+
[0.31, 0, 0.64, 1],
|
|
17
|
+
[0.3, 0, 0.64, 1],
|
|
18
|
+
[0.24, 0, 0.57, 1],
|
|
19
|
+
];
|
|
20
|
+
const REACH = [1.448, 0.778, 1.11, 0.95, 1.012, 1];
|
|
21
|
+
const GAPS = [13, 16, 16, 15, 15, 16];
|
|
22
|
+
/** The baked spring behind jolt, impact and the settles: overshoot to 1.448 of the travel, swings halving, 91 frames to rest. */
|
|
23
|
+
export function spring(to, start = 0, pace = 1, from = [0, 0]) {
|
|
24
|
+
let t = start;
|
|
25
|
+
const keys = [[t, from, SPRING[0] ?? 0]];
|
|
26
|
+
REACH.forEach((k, i) => {
|
|
27
|
+
t += Math.round((GAPS[i] ?? 0) * pace);
|
|
28
|
+
keys.push([
|
|
29
|
+
t,
|
|
30
|
+
[from[0] + (to[0] - from[0]) * k, from[1] + (to[1] - from[1]) * k],
|
|
31
|
+
SPRING[i + 1] ?? 0,
|
|
32
|
+
]);
|
|
33
|
+
});
|
|
34
|
+
return keys;
|
|
35
|
+
}
|
|
36
|
+
export function springTurn(to, start = 0, pace = 1, from = 0) {
|
|
37
|
+
return spring([to, 0], start, pace, [from, 0]).map(([t, v, e]) => [t, v[0], e]);
|
|
38
|
+
}
|
|
39
|
+
// Whole object presets
|
|
40
|
+
/** Containers spilling contents: winds up 20 degrees, whips past to 22, lands hard and stays still. Pivot on the edge it swings from. */
|
|
41
|
+
export const toss = {
|
|
42
|
+
r: [
|
|
43
|
+
[0, 0, [0.572, 0, 0.348, 1.001]],
|
|
44
|
+
[22, -19.9, [0.879, 0, 0.746, 1]],
|
|
45
|
+
[41, 21.8, [0.092, 0, 0, 1]],
|
|
46
|
+
[86, 0],
|
|
47
|
+
],
|
|
48
|
+
// it travels on arcs, not lines: these are its spatial tangents
|
|
49
|
+
p: [
|
|
50
|
+
[
|
|
51
|
+
0,
|
|
52
|
+
[0, 0],
|
|
53
|
+
[0.57, 0, 0.35, 1],
|
|
54
|
+
[
|
|
55
|
+
[-1.23, -6.42],
|
|
56
|
+
[5.77, 1.42],
|
|
57
|
+
],
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
22,
|
|
61
|
+
[-8.5, -11.5],
|
|
62
|
+
[0.88, 0, 0.75, 1],
|
|
63
|
+
[
|
|
64
|
+
[10.73, 10.33],
|
|
65
|
+
[2.46, -13.42],
|
|
66
|
+
],
|
|
67
|
+
],
|
|
68
|
+
[
|
|
69
|
+
41,
|
|
70
|
+
[-3.63, 22.63],
|
|
71
|
+
[0.09, 0, 0, 1],
|
|
72
|
+
[
|
|
73
|
+
[6.23, -16.52],
|
|
74
|
+
[1.54, 6.58],
|
|
75
|
+
],
|
|
76
|
+
],
|
|
77
|
+
[86, [0, 0]],
|
|
78
|
+
],
|
|
79
|
+
};
|
|
80
|
+
/** What rides inside a toss: the near one barely, the far one swings wide and slides. */
|
|
81
|
+
export const tossLag = {
|
|
82
|
+
r: [
|
|
83
|
+
[0, 0, [0.57, 0, 0.35, 1]],
|
|
84
|
+
[22, 9, [0.88, 0, 0.75, 1]],
|
|
85
|
+
[41, -2, [0.09, 0, 0, 1]],
|
|
86
|
+
[86, 0],
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
export const tossLag2 = {
|
|
90
|
+
r: [
|
|
91
|
+
[0, 0, [0.57, 0, 0.35, 1]],
|
|
92
|
+
[22, 15.5, [0.88, 0, 0.75, 1]],
|
|
93
|
+
[41, -11.3, [0.09, 0, 0, 1]],
|
|
94
|
+
[86, 0],
|
|
95
|
+
],
|
|
96
|
+
p: [
|
|
97
|
+
[0, [0, 0], [0.57, 0, 0.35, 1]],
|
|
98
|
+
[22, [9.4, 3.4], [0.88, 0, 0.75, 1]],
|
|
99
|
+
[41, [0, 0]],
|
|
100
|
+
],
|
|
101
|
+
};
|
|
102
|
+
/** Badges and hearts: rises tilting 9 degrees, slams through rest, rebounds twice. */
|
|
103
|
+
export const hop = {
|
|
104
|
+
r: [
|
|
105
|
+
[0, 0, [0.44, 0, 0.42, 1]],
|
|
106
|
+
[36, 9, [0.42, 0, 0.44, 1]],
|
|
107
|
+
[54, -4, [0.59, 0, 0.66, 1]],
|
|
108
|
+
[72, 2, [0.37, 0, 0.51, 1]],
|
|
109
|
+
[94, 0],
|
|
110
|
+
],
|
|
111
|
+
p: [
|
|
112
|
+
[0, [0, 0], [0.64, 0, 0.47, 1]],
|
|
113
|
+
[36, [7, -24.25], [0.59, 0, 0.52, 1]],
|
|
114
|
+
[54, [-7.25, 23.25], [0.24, 0, 0.16, 1]],
|
|
115
|
+
[88, [0, 0]],
|
|
116
|
+
],
|
|
117
|
+
};
|
|
118
|
+
/** Coins and tokens: springs up and right to a raised spot, holds, then drops back through rest and springs home. */
|
|
119
|
+
export const bounce = {
|
|
120
|
+
p: [
|
|
121
|
+
[0, [0, 0], EASY],
|
|
122
|
+
[11, [11.24, -14.24], EASY],
|
|
123
|
+
[24, [6.02, -7.63], EASY],
|
|
124
|
+
[37, [8.6, -10.9], EASY],
|
|
125
|
+
[49, [7.35, -9.32], EASY],
|
|
126
|
+
[62, [7.87, -9.97], EASY],
|
|
127
|
+
[79, [7.19, -8.98], EASY],
|
|
128
|
+
[93, [-3.48, 4.4], EASY],
|
|
129
|
+
[110, [1.74, -2.21], EASY],
|
|
130
|
+
[126, [-0.84, 1.06], EASY],
|
|
131
|
+
[142, [0.41, -0.52], EASY],
|
|
132
|
+
[158, [-0.11, 0.13], EASY],
|
|
133
|
+
[175, [0, 0]],
|
|
134
|
+
],
|
|
135
|
+
s: [
|
|
136
|
+
[0, [100, 100], [0.47, 0, 0.33, 1]],
|
|
137
|
+
[11, [103, 103], [0.45, 0, 0.69, 1]],
|
|
138
|
+
[31, [100, 100]],
|
|
139
|
+
],
|
|
140
|
+
};
|
|
141
|
+
/** Bells and hands: rocks back 20 degrees, taps twice and settles, sliding 12px on the second beat. */
|
|
142
|
+
export const wiggle = {
|
|
143
|
+
r: [
|
|
144
|
+
[0, 0, EASY],
|
|
145
|
+
[46, 20, EASY],
|
|
146
|
+
[71, 11, EASY],
|
|
147
|
+
[100, 19, EASY],
|
|
148
|
+
[124, -3, EASY],
|
|
149
|
+
[148, 5, EASY],
|
|
150
|
+
[177, 0],
|
|
151
|
+
],
|
|
152
|
+
p: [
|
|
153
|
+
[46, [0, 0], [0.2, 0, 0, 1]],
|
|
154
|
+
[71, [11.8, 0], [0.2, 0, 0.67, 1]],
|
|
155
|
+
[100, [0, 0]],
|
|
156
|
+
],
|
|
157
|
+
};
|
|
158
|
+
/** Cards and warnings: kicked along v with the spring, holds, eases home. */
|
|
159
|
+
export const jolt = (v = [-7.86, 13.25]) => ({
|
|
160
|
+
p: [...spring(v, 2), [98, v, [0.65, 0, 0.35, 1]], [141, [0, 0]]],
|
|
161
|
+
});
|
|
162
|
+
/** A body under a lid: takes the hit on frame 24, springs, holds, eases back as the lid lifts. */
|
|
163
|
+
export const impact = (v = [8.7, 15.3]) => ({
|
|
164
|
+
p: [...spring(v, 24, 0.92), [119, v, POP], [176, [0, 0]]],
|
|
165
|
+
});
|
|
166
|
+
/** A lid or cap: slams along v on an ease in, sits, pops back sharp at the end. */
|
|
167
|
+
export const latch = (v = [11.5, 21.3]) => ({
|
|
168
|
+
p: [
|
|
169
|
+
[0, [0, 0], IN],
|
|
170
|
+
[30, v, 0],
|
|
171
|
+
[146, v, SOFT],
|
|
172
|
+
[176, [0, 0]],
|
|
173
|
+
],
|
|
174
|
+
});
|
|
175
|
+
/** Locks and clips: lifts up and left as the shackle springs open, hangs, then slams down right and settles. 130 frame loop. */
|
|
176
|
+
export const clasp = {
|
|
177
|
+
p: [
|
|
178
|
+
[10, [0, 0], [0.31, 0, 0.12, 1]],
|
|
179
|
+
[48, [-8.13, -12.37], 0],
|
|
180
|
+
[61, [-8.13, -12.37], [0.83, 0, 0.49, 1]],
|
|
181
|
+
[85, [9.75, 14.12], [0.46, 0, 0.33, 1]],
|
|
182
|
+
[112, [0, 0]],
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
/** The shackle on the clasp's beat: swung open 33 degrees on a soft pop, back on a slam. Pivot on the leg that stays in. */
|
|
186
|
+
export const shackle = {
|
|
187
|
+
p: [
|
|
188
|
+
[8, [0, 0], SOFT],
|
|
189
|
+
[38, [-6, -16], 0],
|
|
190
|
+
[54, [-6, -16], IN],
|
|
191
|
+
[84, [0, 0]],
|
|
192
|
+
],
|
|
193
|
+
r: [
|
|
194
|
+
[8, 0, SOFT],
|
|
195
|
+
[38, -33, 0],
|
|
196
|
+
[54, -33, IN],
|
|
197
|
+
[84, 0],
|
|
198
|
+
],
|
|
199
|
+
};
|
|
200
|
+
/** Faces and mascots: dips and rocks a few degrees, never quite still. */
|
|
201
|
+
export const wobble = {
|
|
202
|
+
r: [
|
|
203
|
+
[0, 0, [0.73, 0, 0.46, 1]],
|
|
204
|
+
[28, -3.04, [0.59, 0, 0.66, 0.86]],
|
|
205
|
+
[54, 2.03, [0.36, -0.33, 0.67, 1.01]],
|
|
206
|
+
[77, 0, [0.52, -0.02, 0.66, 1]],
|
|
207
|
+
[95, 2.02, [0.47, 0, 0.11, 1]],
|
|
208
|
+
[128, -1.1, [0.58, 0, 0.56, 1]],
|
|
209
|
+
[168, 0],
|
|
210
|
+
],
|
|
211
|
+
p: [
|
|
212
|
+
[0, [0, 0], [0.62, 0, 0.31, 1]],
|
|
213
|
+
[35, [0, 17.5], [0.33, 0, 0.85, 0.63]],
|
|
214
|
+
[84, [0, -0.15], [0.57, 0.91, 0.57, 1]],
|
|
215
|
+
[108, [0, -13.9], [0.33, 0, 0.4, 1]],
|
|
216
|
+
[168, [0, 0]],
|
|
217
|
+
],
|
|
218
|
+
};
|
|
219
|
+
/** Things that fly: a lazy figure of eight with a slow bank, x and y on their own beats. */
|
|
220
|
+
export const drift = [
|
|
221
|
+
{
|
|
222
|
+
r: [
|
|
223
|
+
[0, 0, [0.6, 0, 0.58, 1]],
|
|
224
|
+
[48, 3.12, [0.68, 0, 0.44, 0.37]],
|
|
225
|
+
[110, 6.97, [0.34, 0, 0.3, 1]],
|
|
226
|
+
[156, 0],
|
|
227
|
+
],
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
p: [
|
|
231
|
+
[0, [0, 0], EASY],
|
|
232
|
+
[44, [28.5, 0], [0.33, 0, 0.68, 0.75]],
|
|
233
|
+
[76, [-28.09, 0], [0.33, 2.85, 0.72, 2.83]],
|
|
234
|
+
[106, [-33, 0], [0.34, 0.26, 0.64, 0.71]],
|
|
235
|
+
[135, [7.64, 0], [0.27, -1.41, 0.48, 1]],
|
|
236
|
+
[170, [0, 0]],
|
|
237
|
+
],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
p: [
|
|
241
|
+
[0, [0, 0], EASY],
|
|
242
|
+
[34, [0, -20.07], EASY],
|
|
243
|
+
[82, [0, -7.42], EASY],
|
|
244
|
+
[122, [0, -25.55], [0.33, 0, 0.43, 1]],
|
|
245
|
+
[167, [0, 0]],
|
|
246
|
+
],
|
|
247
|
+
},
|
|
248
|
+
];
|
|
249
|
+
/** Keys and tools: turns home sharp, then a slow 17 degree twist out and back, floating 13px. */
|
|
250
|
+
export const twist = {
|
|
251
|
+
r: [
|
|
252
|
+
[0, -7, [0.17, 0, 0, 1]],
|
|
253
|
+
[30, 0, SNAP],
|
|
254
|
+
[90, -17.27, [0.8, 0, 0, 1]],
|
|
255
|
+
[150, 0, SNAP],
|
|
256
|
+
[180, -7],
|
|
257
|
+
],
|
|
258
|
+
p: [
|
|
259
|
+
[0, [0, 0], EASY],
|
|
260
|
+
[90, [8, -10], EASY],
|
|
261
|
+
[180, [0, 0]],
|
|
262
|
+
],
|
|
263
|
+
};
|
|
264
|
+
/** A body reacting to a hit: nudged down and right, eases back. */
|
|
265
|
+
export const nudge = {
|
|
266
|
+
p: [
|
|
267
|
+
[0, [0, 0], [0.33, 0, 0.07, 1]],
|
|
268
|
+
[48, [8.88, 9.85], [0.24, 0, 0.67, 0.28]],
|
|
269
|
+
[68, [8.56, 9.38], [0.52, 0.1, 0.25, 1]],
|
|
270
|
+
[114, [0, 0]],
|
|
271
|
+
],
|
|
272
|
+
};
|
|
273
|
+
/** A small part flicking out and back, a tongue or a tab. */
|
|
274
|
+
export const flick = {
|
|
275
|
+
r: [
|
|
276
|
+
[31, 0, [0.24, 0, 0.58, 1]],
|
|
277
|
+
[47, 10, [0.3, 0, 0.64, 0.96]],
|
|
278
|
+
[62, -7.05, [0.2, -0.46, 0.83, 1]],
|
|
279
|
+
[95, 0],
|
|
280
|
+
],
|
|
281
|
+
};
|
|
282
|
+
/** Buttons and keys: pushed 23px into its base with a hint of overshoot, back, then pops 13px proud and settles. Give it a still base to sink into. */
|
|
283
|
+
export const press = {
|
|
284
|
+
p: [
|
|
285
|
+
[0, [0, 0], [0.37, 0, 0.33, 1.31]],
|
|
286
|
+
[34, [0, 22.69], [0.4, 0.2, 0.09, 1]],
|
|
287
|
+
[69, [0, 0], 0],
|
|
288
|
+
[76, [0, 0], [0.46, 0, 0.34, 1]],
|
|
289
|
+
[114, [0, -13], [0.38, 0, 0.61, 1]],
|
|
290
|
+
[145, [0, 0]],
|
|
291
|
+
],
|
|
292
|
+
x: [
|
|
293
|
+
[0, 0, [0.37, 0, 0.33, 1.3]],
|
|
294
|
+
[35, -6.2, [0.4, 0.18, 0.09, 1]],
|
|
295
|
+
[70, 0, 0],
|
|
296
|
+
[78, 0, [0.46, 0, 0.3, 1]],
|
|
297
|
+
[112, 3.2, [0.39, 0, 0.62, 1]],
|
|
298
|
+
[143, 0],
|
|
299
|
+
],
|
|
300
|
+
};
|
|
301
|
+
/** Pupils: a glance up left, a dart down right, home. */
|
|
302
|
+
export const look = {
|
|
303
|
+
p: [
|
|
304
|
+
[
|
|
305
|
+
0,
|
|
306
|
+
[0, 0],
|
|
307
|
+
[0.46, 0, 0, 1],
|
|
308
|
+
[
|
|
309
|
+
[0, 0],
|
|
310
|
+
[3.5, 2.62],
|
|
311
|
+
],
|
|
312
|
+
],
|
|
313
|
+
[
|
|
314
|
+
42,
|
|
315
|
+
[-4.5, -9],
|
|
316
|
+
[0.49, 0, 0, 1],
|
|
317
|
+
[
|
|
318
|
+
[2.69, 1.44],
|
|
319
|
+
[0, 0],
|
|
320
|
+
],
|
|
321
|
+
],
|
|
322
|
+
[82, [3, 3], [0.58, 0, 0.18, 1]],
|
|
323
|
+
[123, [0, 0]],
|
|
324
|
+
],
|
|
325
|
+
};
|
|
326
|
+
// Ambient
|
|
327
|
+
/** Idle: a 5 degree lean and back over 3 seconds. Use k to tune, at to put parts out of phase. */
|
|
328
|
+
export const sway = {
|
|
329
|
+
r: [
|
|
330
|
+
[0, 0, EASY],
|
|
331
|
+
[90, -5, EASY],
|
|
332
|
+
[180, 0],
|
|
333
|
+
],
|
|
334
|
+
loop: 180,
|
|
335
|
+
};
|
|
336
|
+
/** Idle: 10px down and up over 3 seconds; neighbours sit 20 frames apart. */
|
|
337
|
+
export const float = {
|
|
338
|
+
p: [
|
|
339
|
+
[0, [0, 0], EASY],
|
|
340
|
+
[90, [0, 10], EASY],
|
|
341
|
+
[180, [0, 0]],
|
|
342
|
+
],
|
|
343
|
+
loop: 180,
|
|
344
|
+
};
|
|
345
|
+
/** Idle: a smaller bob with a sideways lean, 160 frame period. */
|
|
346
|
+
export const bob = {
|
|
347
|
+
p: [
|
|
348
|
+
[0, [0, 0], EASY],
|
|
349
|
+
[80, [-1.5, 5], EASY],
|
|
350
|
+
[160, [0, 0]],
|
|
351
|
+
],
|
|
352
|
+
loop: 160,
|
|
353
|
+
};
|
|
354
|
+
// Builders
|
|
355
|
+
/** Scenes: dealt in from off to rest in 60 frames, all speed up front, swooping in level. Stagger parts 14 to 20 frames. */
|
|
356
|
+
export const deal = (from, turn, start = 0, grow = false) => ({
|
|
357
|
+
p: shift([
|
|
358
|
+
[
|
|
359
|
+
0,
|
|
360
|
+
from,
|
|
361
|
+
OUT,
|
|
362
|
+
[
|
|
363
|
+
[0, 0],
|
|
364
|
+
[from[0] * 0.6, 0],
|
|
365
|
+
],
|
|
366
|
+
],
|
|
367
|
+
[60, [0, 0]],
|
|
368
|
+
], start),
|
|
369
|
+
r: shift([
|
|
370
|
+
[0, turn, OUT],
|
|
371
|
+
[60, 0],
|
|
372
|
+
], start),
|
|
373
|
+
...(grow
|
|
374
|
+
? {
|
|
375
|
+
s: shift([
|
|
376
|
+
[0, [85, 85], SNAP],
|
|
377
|
+
[60, [100, 100]],
|
|
378
|
+
], start),
|
|
379
|
+
}
|
|
380
|
+
: {}),
|
|
381
|
+
});
|
|
382
|
+
/** Falls away on an ease in, 28 frames: clears a scene before it loops. */
|
|
383
|
+
export const fall = (to, start, len = 28) => ({
|
|
384
|
+
p: [
|
|
385
|
+
[start, [0, 0], DROP],
|
|
386
|
+
[start + len, to],
|
|
387
|
+
],
|
|
388
|
+
});
|
|
389
|
+
/** Toggles and tiles: one part to another slot over 60 frames on SNAP, holds, comes home. */
|
|
390
|
+
export const slide = (to, start, hold = 60, len = 60) => ({
|
|
391
|
+
p: [
|
|
392
|
+
[start, [0, 0], SNAP],
|
|
393
|
+
[start + len, to, 0],
|
|
394
|
+
[start + len + hold, to, SNAP],
|
|
395
|
+
[start + len * 2 + hold, [0, 0]],
|
|
396
|
+
],
|
|
397
|
+
});
|
|
398
|
+
/** Glare: swells out of nothing on a slow start, eases to 80%, shrinks away, drifting up and right. 71 frames. */
|
|
399
|
+
export const glint = (start, size = 100) => ({
|
|
400
|
+
s: shift([
|
|
401
|
+
[0, [0, 0], [1, 0, 0.76, 1]],
|
|
402
|
+
[30, [size, size], [0.31, 0, 0.23, 1]],
|
|
403
|
+
[54, [size * 0.8, size * 0.8], [0.17, 0, 0.83, 1]],
|
|
404
|
+
[71, [0, 0]],
|
|
405
|
+
], start),
|
|
406
|
+
p: shift([
|
|
407
|
+
[0, [0, 0], [0.9, 0, 0.83, 0.83]],
|
|
408
|
+
[30, [7.5, -4.8]],
|
|
409
|
+
], start),
|
|
410
|
+
});
|
|
411
|
+
/** Star: pops to 110 and settles in 30 frames; out reverses it. */
|
|
412
|
+
export const twinkle = (start, out = false) => ({
|
|
413
|
+
s: shift(out
|
|
414
|
+
? [
|
|
415
|
+
[0, [100, 100], POP],
|
|
416
|
+
[10, [110, 110], POP],
|
|
417
|
+
[30, [0, 0]],
|
|
418
|
+
]
|
|
419
|
+
: [
|
|
420
|
+
[0, [0, 0], POP],
|
|
421
|
+
[10, [110, 110], POP],
|
|
422
|
+
[30, [100, 100]],
|
|
423
|
+
], start),
|
|
424
|
+
});
|
|
425
|
+
/** Sparkle: grows and turns 46 degrees fast, then shrinks back on an ease in, 84 frames. */
|
|
426
|
+
export const sparkle = (start) => ({
|
|
427
|
+
s: shift([
|
|
428
|
+
[0, [0, 0], [0.13, 0, 0, 1]],
|
|
429
|
+
[42, [100, 100], [1, 0, 0.81, 1]],
|
|
430
|
+
[84, [0, 0]],
|
|
431
|
+
], start),
|
|
432
|
+
r: shift([
|
|
433
|
+
[0, 0, [0.13, 0, 0, 1]],
|
|
434
|
+
[42, 45.89, [1, 0, 0.81, 1]],
|
|
435
|
+
[84, 0],
|
|
436
|
+
], start),
|
|
437
|
+
});
|
|
438
|
+
/** Text lines: erased in 15 frames, staggered 5 apart, drawn back on a slow start. For a shape's trim. */
|
|
439
|
+
export const erase = (start, back) => [
|
|
440
|
+
[start, 1, [0.3, 0, 0.1, 1]],
|
|
441
|
+
[start + 15, 0, 0],
|
|
442
|
+
[back, 0, [0.9, 0, 0.7, 1]],
|
|
443
|
+
[back + 15, 1],
|
|
444
|
+
];
|
|
445
|
+
/** Flames: steps between drawn shapes every 40 frames, snapping out of each. For a shape's d. */
|
|
446
|
+
export const flicker = (shapes, gap = 40) => [...shapes, shapes[0] ?? ''].map((d, i) => [i * gap, d, [0.33, 0, 0, 1]]);
|