@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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a Thai long-tail boat in 2.5d (see iso.ts); it bobs on the water, the prop splashes.
|
|
2
|
+
import { bob, twinkle } from '../motions.js';
|
|
3
|
+
import { line, poly, rosette, spark } from '../sticker.js';
|
|
4
|
+
import { block, ISO, solid } from '../iso.js';
|
|
5
|
+
import { band, clean, disc } from './nature-iso.js';
|
|
6
|
+
import { glow, LINE } from './shared.js';
|
|
7
|
+
// a narrow hull running away up the page, its bow sweeping up high with garlands tied on, an engine on the stern
|
|
8
|
+
// and the long shaft reaching back towards the viewer into the water
|
|
9
|
+
const L = 280;
|
|
10
|
+
const along = (u) => -L / 2 + L * u;
|
|
11
|
+
const width = (u) => 40 * (1 - u ** 2.4);
|
|
12
|
+
const gunwale = (u) => 52 + 62 * u ** 4;
|
|
13
|
+
const keel = (u) => -4 + 60 * u ** 4;
|
|
14
|
+
const US = Array.from({ length: 17 }, (_, i) => i / 16);
|
|
15
|
+
// +x is the side that faces the viewer
|
|
16
|
+
const near = US.map((u) => [width(u), along(u), gunwale(u)]);
|
|
17
|
+
const far = US.map((u) => [-width(u), along(u), gunwale(u)]);
|
|
18
|
+
const bottom = US.map((u) => [width(u) * 0.8, along(u), keel(u)]);
|
|
19
|
+
const stripe = US.slice(1, -1).map((u) => [width(u) * 0.97, along(u), gunwale(u) - 12]);
|
|
20
|
+
const P = (ps) => ps.map((p) => ISO(p));
|
|
21
|
+
const SEATS = [0.3, 0.5, 0.7].map((u) => line(ISO([width(u), along(u), gunwale(u)]), ISO([-width(u), along(u), gunwale(u)])));
|
|
22
|
+
const BOW = ISO([0, L / 2, gunwale(1)]);
|
|
23
|
+
const MOUNT = ISO([0, -L / 2 + 26, 92]);
|
|
24
|
+
const PROP = ISO([0, -L / 2 - 92, -6]);
|
|
25
|
+
const ENGINE = block([-18, -L / 2 + 8, 62], [36, 0, 0], [0, 40, 0], [0, 0, 30]);
|
|
26
|
+
const drop = (o, i) => ({
|
|
27
|
+
parent: 'water',
|
|
28
|
+
a: o,
|
|
29
|
+
p: o,
|
|
30
|
+
m: [twinkle(10 + i * 8), twinkle(110 + i * 6, true)],
|
|
31
|
+
shapes: [{ d: spark(o[0], o[1], 16 - i * 2, 0.4), fill: 'white' }],
|
|
32
|
+
});
|
|
33
|
+
export const longTailBoat = {
|
|
34
|
+
name: 'long-tail-boat',
|
|
35
|
+
frames: 160,
|
|
36
|
+
line: LINE,
|
|
37
|
+
extrude: [0, 0],
|
|
38
|
+
layers: [
|
|
39
|
+
{
|
|
40
|
+
id: 'water',
|
|
41
|
+
p: [262, 300],
|
|
42
|
+
shapes: [{ d: disc([0, 0, 0], 204), fill: 'tint' }, { d: band([0, 0, 0], 160, 0) }],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'boat',
|
|
46
|
+
parent: 'water',
|
|
47
|
+
m: { ...bob, k: 1.4 },
|
|
48
|
+
shapes: [
|
|
49
|
+
{ d: poly(clean([...P(near), ...P(far).reverse()])), fill: 'gold' },
|
|
50
|
+
...SEATS.map((d) => ({ d, line: 7 })),
|
|
51
|
+
{ d: poly(clean([...P(near), ...P(bottom).reverse()])), fill: 'main' },
|
|
52
|
+
{ d: poly(clean([...P(near.slice(1, -1)), ...P(stripe).reverse()])), fill: 'white' },
|
|
53
|
+
...solid(ENGINE, { fill: 'grey', top: 'white' }, 3),
|
|
54
|
+
{ d: line(MOUNT, PROP), line: 8, round: true },
|
|
55
|
+
...['hot', 'white', 'ok'].map((fill, i) => ({
|
|
56
|
+
d: rosette(BOW[0] + 4 + i * 4, BOW[1] + 10 + i * 15, 11, 7, 0.6),
|
|
57
|
+
fill,
|
|
58
|
+
})),
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
drop([PROP[0] - 26, PROP[1] - 10], 0),
|
|
62
|
+
drop([PROP[0] + 16, PROP[1] - 22], 1),
|
|
63
|
+
drop([PROP[0] - 6, PROP[1] - 40], 2),
|
|
64
|
+
glow('water', [170, -170], 22, [twinkle(40), twinkle(130, true)]),
|
|
65
|
+
],
|
|
66
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a Thai lottery ticket (no emblem), a second one fanned behind; the six numbers
|
|
2
|
+
// turn up one by one and the prize seal shines.
|
|
3
|
+
import { glint, twinkle, wiggle } from '../motions.js';
|
|
4
|
+
import { ellipse, line, rect, rosette, spark } from '../sticker.js';
|
|
5
|
+
import { EXT, FACE, glow, LINE } from './shared.js';
|
|
6
|
+
const DIGITS = [0, 1, 2, 3, 4, 5].map((i) => -130 + i * 30);
|
|
7
|
+
export const lottery = {
|
|
8
|
+
name: 'lottery',
|
|
9
|
+
frames: 180,
|
|
10
|
+
still: 110,
|
|
11
|
+
line: LINE,
|
|
12
|
+
extrude: EXT,
|
|
13
|
+
layers: [
|
|
14
|
+
{ id: 'root', a: [-40, 90], p: [210, 390], m: { ...wiggle, k: 0.35 }, shapes: [] },
|
|
15
|
+
{
|
|
16
|
+
parent: 'root',
|
|
17
|
+
tilt: [-6, 36],
|
|
18
|
+
p: [14, -26],
|
|
19
|
+
shapes: [{ d: rect(-160, -90, 320, 180, 10), fill: 'tint', depth: 0.4 }],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'ticket',
|
|
23
|
+
parent: 'root',
|
|
24
|
+
tilt: FACE,
|
|
25
|
+
shapes: [
|
|
26
|
+
{ d: rect(-160, -90, 320, 180, 10), fill: 'white', depth: 0.4 },
|
|
27
|
+
{ d: rect(-144, -74, 288, 28, 6), fill: 'main', depth: 0.2 },
|
|
28
|
+
{ d: rect(-144, -30, 194, 50, 8), fill: 'tint', depth: 0.2 },
|
|
29
|
+
{ d: line([-144, 44], [30, 44]) },
|
|
30
|
+
{ d: line([-144, 66], [-20, 66]) },
|
|
31
|
+
{ d: rosette(100, 24, 44), fill: 'gold', depth: 0.3 },
|
|
32
|
+
{ d: ellipse(100, 24, 20), fill: 'white' },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
...DIGITS.map((x, i) => ({
|
|
36
|
+
parent: 'ticket',
|
|
37
|
+
a: [x + 12, -5],
|
|
38
|
+
p: [x + 12, -5],
|
|
39
|
+
m: [twinkle(18 + i * 8), twinkle(122 + i * 3, true)],
|
|
40
|
+
shapes: [{ d: rect(x, -20, 24, 30, 5), fill: 'deep' }],
|
|
41
|
+
})),
|
|
42
|
+
{
|
|
43
|
+
parent: 'ticket',
|
|
44
|
+
a: [86, 6],
|
|
45
|
+
p: [86, 6],
|
|
46
|
+
m: glint(70, 80),
|
|
47
|
+
shapes: [{ d: spark(86, 6, 18), fill: 'white' }],
|
|
48
|
+
},
|
|
49
|
+
glow('root', [160, -130], 22, [twinkle(64), twinkle(140, true)]),
|
|
50
|
+
],
|
|
51
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a lotus on its pad in 2.5d (see iso.ts, nature-iso.ts); the inner petals open.
|
|
2
|
+
import { float, SNAP, twinkle } from '../motions.js';
|
|
3
|
+
import { line, poly } from '../sticker.js';
|
|
4
|
+
import { ISO } from '../iso.js';
|
|
5
|
+
import { disc, farness } from './nature-iso.js';
|
|
6
|
+
import { glow, LINE } from './shared.js';
|
|
7
|
+
// a notched pad floats on a round of water; the bloom's outer petals cup open, the white inner ones close round a
|
|
8
|
+
// gold seed pod and open again
|
|
9
|
+
const ring = (r, t, z) => [r * Math.cos(t), r * Math.sin(t), z];
|
|
10
|
+
const PAD_R = 150;
|
|
11
|
+
const NOTCH = -1.2;
|
|
12
|
+
const padAt = (z) => [
|
|
13
|
+
ISO([16, 0, z]),
|
|
14
|
+
...Array.from({ length: 25 }, (_, i) => NOTCH + 0.28 + ((2 * Math.PI - 0.56) * i) / 24).map((t) => ISO(ring(PAD_R, t, z))),
|
|
15
|
+
];
|
|
16
|
+
const petals = (n, off, r1, z1, rt, zt) => Array.from({ length: n }, (_, i) => {
|
|
17
|
+
const t = ((i + off) / n) * Math.PI * 2;
|
|
18
|
+
const pts = [
|
|
19
|
+
ring(14, t - 0.3, 6),
|
|
20
|
+
ring(r1, t - 0.3, z1),
|
|
21
|
+
ring(rt, t, zt),
|
|
22
|
+
ring(r1, t + 0.3, z1),
|
|
23
|
+
ring(14, t + 0.3, 6),
|
|
24
|
+
];
|
|
25
|
+
return {
|
|
26
|
+
d: poly(pts.map((p) => ISO(p)), 3),
|
|
27
|
+
far: farness(ring(r1, t, z1)),
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
const OUTER = petals(8, 0, 84, 36, 118, 92);
|
|
31
|
+
const INNER = petals(6, 0.5, 50, 62, 58, 134);
|
|
32
|
+
const half = (ps, back, fill) => ps
|
|
33
|
+
.filter((p) => p.far > 0 === back)
|
|
34
|
+
.sort((a, b) => b.far - a.far)
|
|
35
|
+
.map((p) => ({ d: p.d, fill }));
|
|
36
|
+
const CENTER = ISO([0, 0, 30]);
|
|
37
|
+
const OPEN = {
|
|
38
|
+
s: [
|
|
39
|
+
[10, [100, 100], SNAP],
|
|
40
|
+
[40, [78, 86], 0],
|
|
41
|
+
[70, [78, 86], SNAP],
|
|
42
|
+
[100, [100, 100]],
|
|
43
|
+
],
|
|
44
|
+
};
|
|
45
|
+
export const lotus = {
|
|
46
|
+
name: 'lotus',
|
|
47
|
+
frames: 180,
|
|
48
|
+
line: LINE,
|
|
49
|
+
extrude: [0, 0],
|
|
50
|
+
layers: [
|
|
51
|
+
{
|
|
52
|
+
id: 'pond',
|
|
53
|
+
p: [250, 330],
|
|
54
|
+
shapes: [
|
|
55
|
+
{ d: disc([0, 0, -8], 214), fill: 'tint' },
|
|
56
|
+
{ d: poly(padAt(-6)), fill: 'ok' },
|
|
57
|
+
{ d: poly(padAt(0)), fill: 'ok' },
|
|
58
|
+
...[0.4, 1.6, 2.8, 4.0].map((t) => ({
|
|
59
|
+
d: line(ISO([16, 0, 0]), ISO(ring(PAD_R * 0.8, NOTCH + t, 0))),
|
|
60
|
+
})),
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{ id: 'bloom', parent: 'pond', m: { ...float, k: 0.8 }, shapes: half(OUTER, true, 'hot') },
|
|
64
|
+
{ parent: 'bloom', a: CENTER, p: CENTER, m: OPEN, shapes: half(INNER, true, 'white') },
|
|
65
|
+
{ parent: 'bloom', shapes: [{ d: disc([0, 0, 56], 30), fill: 'gold' }] },
|
|
66
|
+
{ parent: 'bloom', a: CENTER, p: CENTER, m: OPEN, shapes: half(INNER, false, 'white') },
|
|
67
|
+
{ parent: 'bloom', shapes: half(OUTER, false, 'hot') },
|
|
68
|
+
glow('pond', [130, -150], 22, [twinkle(40), twinkle(140, true)]),
|
|
69
|
+
],
|
|
70
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a Mac mini style desktop, modelled in 3d (see iso.ts). No logo.
|
|
2
|
+
import { hop, twinkle } from '../motions.js';
|
|
3
|
+
import { block, dot, faceOf, quad, solid } from '../iso.js';
|
|
4
|
+
import { glow, LINE } from './shared.js';
|
|
5
|
+
// A low square aluminium box with soft corners: two ports and a jack on the front, the power light at the corner
|
|
6
|
+
const S = 250;
|
|
7
|
+
const H = 86;
|
|
8
|
+
const BOX = block([-S / 2, -S / 2, 0], [S, 0, 0], [0, S, 0], [0, 0, H]);
|
|
9
|
+
const front = faceOf(BOX, 'front');
|
|
10
|
+
const top = faceOf(BOX, 'top');
|
|
11
|
+
const ROUND = S / H;
|
|
12
|
+
export const macMini = {
|
|
13
|
+
name: 'mac-mini',
|
|
14
|
+
frames: 160,
|
|
15
|
+
line: LINE,
|
|
16
|
+
extrude: [0, 0],
|
|
17
|
+
layers: [
|
|
18
|
+
{ id: 'mini', p: [250, 300], m: hop, shapes: [] },
|
|
19
|
+
{
|
|
20
|
+
parent: 'mini',
|
|
21
|
+
shapes: [
|
|
22
|
+
...solid(BOX, { fill: 'grey', top: 'white' }, 8),
|
|
23
|
+
{ d: quad(top, 0.1, 0.1, 0.8, 0.8, 18), fill: 'tint', line: false },
|
|
24
|
+
...[0.1, 0.17].map((s) => ({ d: quad(front, s, 0.42, 0.04, 0.2, 3), fill: 'ink' })),
|
|
25
|
+
{ d: dot(front, 0.27, 0.52, 0.014, 0.014 * ROUND), fill: 'ink' },
|
|
26
|
+
{ d: dot(front, 0.9, 0.52, 0.016, 0.016 * ROUND), fill: 'ok' },
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
glow('mini', [140, -150], 24, [twinkle(36), twinkle(120, true)]),
|
|
30
|
+
],
|
|
31
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a MacBook Air style laptop, modelled in 3d (see iso.ts). No logo.
|
|
2
|
+
import { hop, twinkle } from '../motions.js';
|
|
3
|
+
import { block, faceOf, quad, solid, stroke } from '../iso.js';
|
|
4
|
+
import { glow, LINE } from './shared.js';
|
|
5
|
+
// A thin silver laptop: black keys in a well, a wide trackpad, a notch at the top of the screen, a window on it
|
|
6
|
+
const W = 268;
|
|
7
|
+
const D = 180;
|
|
8
|
+
const T = 11;
|
|
9
|
+
const LID = 176;
|
|
10
|
+
const LEAN = (16 * Math.PI) / 180;
|
|
11
|
+
const DECK = block([-W / 2, -D / 2, 0], [W, 0, 0], [0, D, 0], [0, 0, T]);
|
|
12
|
+
const deck = faceOf(DECK, 'top');
|
|
13
|
+
const UP = [0, Math.sin(LEAN) * LID, Math.cos(LEAN) * LID];
|
|
14
|
+
const BACK = [0, Math.cos(LEAN) * 7, -Math.sin(LEAN) * 7];
|
|
15
|
+
const LIDB = block([-W / 2, D / 2, T], [W, 0, 0], BACK, UP);
|
|
16
|
+
const screen = faceOf(LIDB, 'front');
|
|
17
|
+
export const macbookAir = {
|
|
18
|
+
name: 'macbook-air',
|
|
19
|
+
frames: 160,
|
|
20
|
+
line: LINE,
|
|
21
|
+
extrude: [0, 0],
|
|
22
|
+
layers: [
|
|
23
|
+
{ id: 'mb', p: [250, 330], m: { ...hop, k: 0.7 }, shapes: [] },
|
|
24
|
+
{
|
|
25
|
+
parent: 'mb',
|
|
26
|
+
shapes: [
|
|
27
|
+
...solid(LIDB, { fill: 'grey', front: 'deep' }, 3),
|
|
28
|
+
{ d: quad(screen, 0.04, 0.04, 0.92, 0.92, 3), fill: 'tint' },
|
|
29
|
+
{ d: quad(screen, 0.43, 0.9, 0.14, 0.06, 2), fill: 'deep', line: false },
|
|
30
|
+
{ d: quad(screen, 0.14, 0.18, 0.5, 0.54, 3), fill: 'white' },
|
|
31
|
+
{ d: stroke(screen, [0.14, 0.62], [0.64, 0.62]) },
|
|
32
|
+
{ d: quad(screen, 0.58, 0.3, 0.28, 0.3, 3), fill: 'main' },
|
|
33
|
+
...solid(DECK, { fill: 'grey', top: 'white' }, 3),
|
|
34
|
+
{ d: quad(deck, 0.1, 0.52, 0.8, 0.4, 2), fill: 'deep' },
|
|
35
|
+
...[0.65, 0.78].map((t) => ({ d: stroke(deck, [0.1, t], [0.9, t]) })),
|
|
36
|
+
{ d: quad(deck, 0.28, 0.07, 0.44, 0.36, 4), fill: 'tint' },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
glow('mb', [178, -226], 22, [twinkle(36), twinkle(120, true)]),
|
|
40
|
+
],
|
|
41
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a red Thai post box on its plinth, in 3d (see street-kit.ts). No emblem.
|
|
2
|
+
import { fall, twinkle } from '../motions.js';
|
|
3
|
+
import { line, poly } from '../sticker.js';
|
|
4
|
+
import { block, faceOf, ISO, quad, solid } from '../iso.js';
|
|
5
|
+
import { face, hull } from './street-kit.js';
|
|
6
|
+
import { glow, LINE } from './shared.js';
|
|
7
|
+
// A red box with a round top over a grey plinth, two slots with white labels, a collection door; a letter slides in
|
|
8
|
+
const [X, Y, Z0, Z1] = [72, 56, 60, 224];
|
|
9
|
+
const PLINTH = block([-54, -44, 0], [108, 0, 0], [0, 88, 0], [0, 0, Z0]);
|
|
10
|
+
const BODY = block([-X, -Y, Z0], [2 * X, 0, 0], [0, 2 * Y, 0], [0, 0, Z1 - Z0]);
|
|
11
|
+
const bf = faceOf(BODY, 'front');
|
|
12
|
+
const arc = (y) => Array.from({ length: 13 }, (_, i) => {
|
|
13
|
+
const t = (i / 12) * Math.PI;
|
|
14
|
+
return [Math.cos(t) * X, y, Z1 + Math.sin(t) * X * 0.8];
|
|
15
|
+
});
|
|
16
|
+
const IN = [0, 0, Z1 - 40];
|
|
17
|
+
const ROOF = hull([...arc(-Y), ...arc(Y)].map((p) => ISO(p)));
|
|
18
|
+
const FRONT = [ISO([-X, -Y, Z0]), ISO([X, -Y, Z0]), ...arc(-Y).map((p) => ISO(p))];
|
|
19
|
+
const LETTER = [
|
|
20
|
+
[-64, -136, 196],
|
|
21
|
+
[-4, -136, 196],
|
|
22
|
+
[-4, -72, 196],
|
|
23
|
+
[-64, -72, 196],
|
|
24
|
+
];
|
|
25
|
+
const [l0, l1, l2, l3] = LETTER.map((p) => ISO(p));
|
|
26
|
+
const flapMid = ISO([-34, -104, 196]);
|
|
27
|
+
const into = ISO([0, 60, 0]);
|
|
28
|
+
export const mailboxThai = {
|
|
29
|
+
name: 'mailbox-thai',
|
|
30
|
+
frames: 160,
|
|
31
|
+
still: 30,
|
|
32
|
+
line: LINE,
|
|
33
|
+
extrude: [0, 0],
|
|
34
|
+
layers: [
|
|
35
|
+
{ id: 'box', p: [250, 410], shapes: [] },
|
|
36
|
+
{
|
|
37
|
+
parent: 'box',
|
|
38
|
+
shapes: [
|
|
39
|
+
...solid(PLINTH, { fill: 'grey', top: 'white' }, 2),
|
|
40
|
+
{ d: poly(ROOF, 2), fill: 'hot' },
|
|
41
|
+
...face([
|
|
42
|
+
[X, -Y, Z0],
|
|
43
|
+
[X, Y, Z0],
|
|
44
|
+
[X, Y, Z1],
|
|
45
|
+
[X, -Y, Z1],
|
|
46
|
+
], 'hot', IN, 2),
|
|
47
|
+
{ d: poly(FRONT, 2), fill: 'hot' },
|
|
48
|
+
...[0.08, 0.54].flatMap((s) => [
|
|
49
|
+
{ d: quad(bf, s, 0.82, 0.38, 0.07, 3), fill: 'ink' },
|
|
50
|
+
{ d: quad(bf, s + 0.04, 0.6, 0.3, 0.14, 2), fill: 'white' },
|
|
51
|
+
]),
|
|
52
|
+
{ d: quad(bf, 0.16, 0.08, 0.68, 0.4, 3), fill: 'hot' },
|
|
53
|
+
{ d: quad(bf, 0.46, 0.24, 0.08, 0.08, 1), fill: 'ink' },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
parent: 'box',
|
|
58
|
+
a: flapMid,
|
|
59
|
+
p: flapMid,
|
|
60
|
+
m: [twinkle(10), fall(into, 52, 18)],
|
|
61
|
+
op: 70,
|
|
62
|
+
shapes: [{ d: poly([l0, l1, l2, l3], 2), fill: 'white' }, { d: line(l3, flapMid, l2) }],
|
|
63
|
+
},
|
|
64
|
+
glow('box', [130, -280], 24, [twinkle(74), twinkle(140, true)]),
|
|
65
|
+
],
|
|
66
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: khao niao mamuang, sticky rice sprinkled with sesame beside a fan of ripe mango.
|
|
2
|
+
import { hop, twinkle } from '../motions.js';
|
|
3
|
+
import { ellipse } from '../sticker.js';
|
|
4
|
+
import { DOWN, plate, TABLE } from './food.js';
|
|
5
|
+
import { glow, LINE } from './shared.js';
|
|
6
|
+
export const mangoStickyRice = {
|
|
7
|
+
name: 'mango-sticky-rice',
|
|
8
|
+
frames: 160,
|
|
9
|
+
line: LINE,
|
|
10
|
+
extrude: DOWN,
|
|
11
|
+
layers: [
|
|
12
|
+
{ id: 'root', p: [250, 290], shapes: [] },
|
|
13
|
+
{
|
|
14
|
+
id: 'dish',
|
|
15
|
+
parent: 'root',
|
|
16
|
+
tilt: TABLE,
|
|
17
|
+
shapes: [
|
|
18
|
+
...plate(180),
|
|
19
|
+
{ d: ellipse(-70, 0, 70, 96), fill: 'paper', depth: 1.6 },
|
|
20
|
+
...[
|
|
21
|
+
[-80, 40],
|
|
22
|
+
[-56, 60],
|
|
23
|
+
[-90, 70],
|
|
24
|
+
].map(([x = 0, y = 0]) => ({ d: ellipse(x, y, 3), fill: 'ink', line: false })),
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
parent: 'dish',
|
|
29
|
+
a: [70, 0],
|
|
30
|
+
p: [70, 0],
|
|
31
|
+
m: { ...hop, k: 0.8 },
|
|
32
|
+
shapes: [30, 60, 90, 120].map((x) => ({
|
|
33
|
+
d: ellipse(x, 0, 26, 104),
|
|
34
|
+
fill: 'gold',
|
|
35
|
+
depth: 0.8,
|
|
36
|
+
})),
|
|
37
|
+
},
|
|
38
|
+
glow('root', [170, -80], 22, [twinkle(36), twinkle(130, true)]),
|
|
39
|
+
glow('root', [-170, -40], 16, [twinkle(60), twinkle(140, true)]),
|
|
40
|
+
],
|
|
41
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: marigolds in a terracotta pot, in 2.5d (see nature-iso.ts); the heads bob in turn.
|
|
2
|
+
import { bob, twinkle } from '../motions.js';
|
|
3
|
+
import { ellipse, line, rosette, VIEWS } from '../sticker.js';
|
|
4
|
+
import { band, blade, disc, lathe } from './nature-iso.js';
|
|
5
|
+
import { glow, LINE } from './shared.js';
|
|
6
|
+
// pompom heads lie back like the pot's rim, so they foreshorten with it; stems and leaves stand upright
|
|
7
|
+
const { tilt: LIE, extrude: DOWN } = VIEWS.flat;
|
|
8
|
+
const RIM = 88;
|
|
9
|
+
const SOIL = [0, -RIM * 0.866];
|
|
10
|
+
const HEADS = [
|
|
11
|
+
[[-26, -236], 34],
|
|
12
|
+
[[44, -214], 32],
|
|
13
|
+
[[-70, -168], 32],
|
|
14
|
+
[[66, -150], 30],
|
|
15
|
+
[[-4, -170], 36],
|
|
16
|
+
];
|
|
17
|
+
const LEAVES = [
|
|
18
|
+
[[-16, -108], Math.PI + 0.5, -0.2],
|
|
19
|
+
[[20, -112], -0.4, 0.2],
|
|
20
|
+
[[-40, -130], Math.PI + 0.2, 0.25],
|
|
21
|
+
];
|
|
22
|
+
export const marigold = {
|
|
23
|
+
name: 'marigold',
|
|
24
|
+
frames: 160,
|
|
25
|
+
line: LINE,
|
|
26
|
+
extrude: DOWN,
|
|
27
|
+
layers: [
|
|
28
|
+
{ id: 'pot', p: [250, 396], shapes: [] },
|
|
29
|
+
{
|
|
30
|
+
parent: 'pot',
|
|
31
|
+
shapes: [
|
|
32
|
+
{
|
|
33
|
+
d: lathe([0, 0, 0], [
|
|
34
|
+
[48, 0],
|
|
35
|
+
[62, RIM - 14],
|
|
36
|
+
]),
|
|
37
|
+
fill: 'main',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
d: lathe([0, 0, RIM - 16], [
|
|
41
|
+
[68, 0],
|
|
42
|
+
[68, 16],
|
|
43
|
+
]),
|
|
44
|
+
fill: 'main',
|
|
45
|
+
},
|
|
46
|
+
{ d: band([0, 0, RIM - 16], 68, 0) },
|
|
47
|
+
{ d: disc([0, 0, RIM], 68), fill: 'main' },
|
|
48
|
+
{ d: disc([0, 0, RIM], 56), fill: 'deep' },
|
|
49
|
+
...HEADS.map(([[x, y]]) => ({ d: line([x * 0.3, SOIL[1] - 6], [x, y]), line: 5 })),
|
|
50
|
+
...LEAVES.map(([o, ang, droop]) => ({
|
|
51
|
+
d: blade(o, ang, 54, 20, droop).d,
|
|
52
|
+
fill: 'ok',
|
|
53
|
+
})),
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
...HEADS.map(([p, r], i) => ({
|
|
57
|
+
parent: 'pot',
|
|
58
|
+
p,
|
|
59
|
+
tilt: LIE,
|
|
60
|
+
m: { ...bob, at: i * 16, k: 1.4 },
|
|
61
|
+
shapes: [
|
|
62
|
+
{ d: rosette(0, 0, r, 12, 0.7), fill: 'gold', depth: 0.6 },
|
|
63
|
+
{ d: rosette(0, 0, r * 0.62, 9, 0.7), fill: 'gold' },
|
|
64
|
+
{ d: ellipse(0, 0, r * 0.2), fill: 'hot' },
|
|
65
|
+
],
|
|
66
|
+
})),
|
|
67
|
+
glow('pot', [120, -250], 22, [twinkle(30), twinkle(130, true)]),
|
|
68
|
+
],
|
|
69
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { hop, twinkle } from '../motions.js';
|
|
2
|
+
import { block, faceOf, stroke } from '../iso.js';
|
|
3
|
+
import { glow, LINE } from './shared.js';
|
|
4
|
+
import { box, drum, wire } from './volume.js';
|
|
5
|
+
const basket = block([-115, -70, 0], [230, 0, 0], [0, 140, 0], [0, 0, 125]);
|
|
6
|
+
export const marketBasket = {
|
|
7
|
+
name: 'market-basket',
|
|
8
|
+
frames: 160,
|
|
9
|
+
line: LINE,
|
|
10
|
+
extrude: [0, 0],
|
|
11
|
+
layers: [
|
|
12
|
+
{ id: 'bk', p: [250, 360], m: hop, shapes: [] },
|
|
13
|
+
{
|
|
14
|
+
parent: 'bk',
|
|
15
|
+
shapes: [
|
|
16
|
+
...box([-115, 55, 0], [230, 15, 125], 'main', 'gold'),
|
|
17
|
+
wire([
|
|
18
|
+
[-95, 55, 125],
|
|
19
|
+
[-95, 55, 245],
|
|
20
|
+
[95, 55, 245],
|
|
21
|
+
[95, 55, 125],
|
|
22
|
+
], 12),
|
|
23
|
+
...drum([-38, -5, 150], 57, 52, 45, 'ok', 'deep'),
|
|
24
|
+
...drum([-64, -12, 171], 29, 35, 30, 'ok', 'main'),
|
|
25
|
+
...drum([-17, -20, 174], 30, 35, 25, 'ok', 'main'),
|
|
26
|
+
wire([
|
|
27
|
+
[-40, -24, 130],
|
|
28
|
+
[-40, -24, 190],
|
|
29
|
+
], 4),
|
|
30
|
+
...box([28, -15, 105], [22, 22, 115], 'hot', 'gold'),
|
|
31
|
+
...box([63, 0, 105], [20, 22, 90], 'hot', 'gold'),
|
|
32
|
+
wire([
|
|
33
|
+
[38, -4, 220],
|
|
34
|
+
[45, 0, 234],
|
|
35
|
+
], 6),
|
|
36
|
+
wire([
|
|
37
|
+
[73, 10, 195],
|
|
38
|
+
[82, 10, 210],
|
|
39
|
+
], 6),
|
|
40
|
+
wire([
|
|
41
|
+
[-82, 25, 110],
|
|
42
|
+
[-102, 25, 248],
|
|
43
|
+
], 8),
|
|
44
|
+
wire([
|
|
45
|
+
[-68, 25, 110],
|
|
46
|
+
[-78, 25, 236],
|
|
47
|
+
], 8),
|
|
48
|
+
...box([-115, -70, 0], [230, 18, 125], 'main', 'gold', 'gold'),
|
|
49
|
+
...box([97, -52, 0], [18, 122, 125], 'main', 'gold', 'gold'),
|
|
50
|
+
...['front', 'right'].flatMap((name) => {
|
|
51
|
+
const f = faceOf(basket, name);
|
|
52
|
+
return [
|
|
53
|
+
...[0.22, 0.48, 0.74].map((t) => ({ d: stroke(f, [0, t], [1, t]), line: 3 })),
|
|
54
|
+
...[0.2, 0.4, 0.6, 0.8].map((s) => ({ d: stroke(f, [s, 0.03], [s, 0.97]), line: 3 })),
|
|
55
|
+
];
|
|
56
|
+
}),
|
|
57
|
+
...box([-122, -78, 119], [244, 22, 17], 'main', 'gold', 'gold'),
|
|
58
|
+
...box([100, -56, 119], [22, 134, 17], 'main', 'gold'),
|
|
59
|
+
wire([
|
|
60
|
+
[-95, -66, 135],
|
|
61
|
+
[-95, -66, 245],
|
|
62
|
+
[95, -66, 245],
|
|
63
|
+
[95, -66, 135],
|
|
64
|
+
], 10),
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
glow('bk', [145, -230], 22, [twinkle(30), twinkle(130, true)]),
|
|
68
|
+
],
|
|
69
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a record player modelled in 3d (see iso.ts, object-drum.ts); play is pressed, the
|
|
2
|
+
// tone arm swings onto the record and its shine turns.
|
|
3
|
+
import { flicker, press, SNAP, twinkle } from '../motions.js';
|
|
4
|
+
import { line } from '../sticker.js';
|
|
5
|
+
import { block, faceOf, ISO, quad, solid } from '../iso.js';
|
|
6
|
+
import { drum } from './object-drum.js';
|
|
7
|
+
import { glow, LINE } from './shared.js';
|
|
8
|
+
const [W, D, H] = [320, 250, 44];
|
|
9
|
+
const PLINTH = block([-W / 2, -D / 2, 0], [W, 0, 0], [0, D, 0], [0, 0, H]);
|
|
10
|
+
const front = faceOf(PLINTH, 'front');
|
|
11
|
+
const C = [-40, 6, H];
|
|
12
|
+
const PLATTER = drum(C, [0, 0, 10], 104, 104, { side: 'grey', cap: 'grey' });
|
|
13
|
+
const RECORD = drum([C[0], C[1], H + 10], [0, 0, 6], 96, 96, { side: 'deep', cap: 'deep' });
|
|
14
|
+
const PIVOT = ISO([118, 80, H + 24]);
|
|
15
|
+
const POST = drum([118, 80, H], [0, 0, 24], 16, 16, { side: 'grey', cap: 'white' });
|
|
16
|
+
const PLAY = block([92, -96, H], [44, 0, 0], [0, 30, 0], [0, 0, 12]);
|
|
17
|
+
// the record's shine: a short arc of the groove at eight angles, stepped round
|
|
18
|
+
const shine = (from) => {
|
|
19
|
+
const pts = Array.from({ length: 6 }, (_, i) => {
|
|
20
|
+
const g = from + i * 0.16;
|
|
21
|
+
return RECORD.at(Math.cos(g) * 0.7, Math.sin(g) * 0.7);
|
|
22
|
+
});
|
|
23
|
+
return line(...pts);
|
|
24
|
+
};
|
|
25
|
+
const SHINES = Array.from({ length: 8 }, (_, i) => shine((i / 8) * Math.PI * 2));
|
|
26
|
+
export const mediaPlayer = {
|
|
27
|
+
name: 'media-player',
|
|
28
|
+
frames: 160,
|
|
29
|
+
line: LINE,
|
|
30
|
+
extrude: [0, 0],
|
|
31
|
+
layers: [
|
|
32
|
+
{ id: 'deck', p: [250, 290], shapes: [] },
|
|
33
|
+
{
|
|
34
|
+
parent: 'deck',
|
|
35
|
+
shapes: [
|
|
36
|
+
...solid(PLINTH, { fill: 'deep', top: 'main' }, 6),
|
|
37
|
+
{ d: quad(front, 0.06, 0.32, 0.2, 0.36, 2), fill: 'tint' },
|
|
38
|
+
{ d: quad(front, 0.78, 0.36, 0.06, 0.28, 2), fill: 'ok' },
|
|
39
|
+
...PLATTER.shapes,
|
|
40
|
+
...RECORD.shapes,
|
|
41
|
+
{ d: RECORD.disc(0, 0, 0.5), fill: 'deep' },
|
|
42
|
+
{ d: RECORD.disc(0, 0, 0.34), fill: 'hot' },
|
|
43
|
+
{ d: RECORD.disc(0, 0, 0.05), fill: 'white' },
|
|
44
|
+
{ d: flicker([...SHINES, ...SHINES, ...SHINES, ...SHINES], 5), line: 4 },
|
|
45
|
+
...POST.shapes,
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
parent: 'deck',
|
|
50
|
+
a: PIVOT,
|
|
51
|
+
p: PIVOT,
|
|
52
|
+
m: {
|
|
53
|
+
r: [
|
|
54
|
+
[24, -22, SNAP],
|
|
55
|
+
[50, 0, 0],
|
|
56
|
+
[130, 0, SNAP],
|
|
57
|
+
[156, -22],
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
shapes: [
|
|
61
|
+
{ d: line(PIVOT, ISO([60, 70, H + 24]), ISO([10, 10, H + 20])), line: 9, round: true },
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
parent: 'deck',
|
|
66
|
+
m: { ...press, k: 0.3, at: 4 },
|
|
67
|
+
shapes: solid(PLAY, { fill: 'grey', top: 'white' }, 3),
|
|
68
|
+
},
|
|
69
|
+
glow('deck', [-170, -150], 22, [twinkle(54), twinkle(130, true)]),
|
|
70
|
+
],
|
|
71
|
+
};
|