@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,43 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a dark storm cloud slab that jolts as a lightning bolt flashes out of it, twice.
|
|
2
|
+
import { jolt, twinkle } from '../motions.js';
|
|
3
|
+
import { poly } from '../sticker.js';
|
|
4
|
+
import { EXT, FACE, glow, LINE } from './shared.js';
|
|
5
|
+
import { cloud } from './sky-kit.js';
|
|
6
|
+
const BOLT = poly([
|
|
7
|
+
[-6, 30],
|
|
8
|
+
[40, 30],
|
|
9
|
+
[18, 92],
|
|
10
|
+
[48, 92],
|
|
11
|
+
[-18, 196],
|
|
12
|
+
[2, 120],
|
|
13
|
+
[-28, 120],
|
|
14
|
+
], 3);
|
|
15
|
+
const flash = (at) => ({
|
|
16
|
+
parent: 'st',
|
|
17
|
+
a: [10, 30],
|
|
18
|
+
p: [10, 30],
|
|
19
|
+
ip: at,
|
|
20
|
+
op: at + 50,
|
|
21
|
+
m: [twinkle(at), twinkle(at + 20, true)],
|
|
22
|
+
shapes: [{ d: BOLT, fill: 'gold', depth: 0.7 }],
|
|
23
|
+
});
|
|
24
|
+
export const storm = {
|
|
25
|
+
name: 'storm',
|
|
26
|
+
frames: 160,
|
|
27
|
+
line: LINE,
|
|
28
|
+
extrude: EXT,
|
|
29
|
+
layers: [
|
|
30
|
+
{ id: 'st', p: [250, 190], m: { ...jolt([6, 10]), at: 12 }, shapes: [] },
|
|
31
|
+
flash(14),
|
|
32
|
+
flash(70),
|
|
33
|
+
{
|
|
34
|
+
parent: 'st',
|
|
35
|
+
tilt: FACE,
|
|
36
|
+
shapes: [
|
|
37
|
+
{ d: cloud(0, 0), fill: 'deep', side: 'ink', depth: 1.2, crease: false },
|
|
38
|
+
{ d: cloud(-30, -14, 0.3), fill: 'main', line: false },
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
glow('st', [140, 110], 22, [twinkle(16), twinkle(120, true)]),
|
|
42
|
+
],
|
|
43
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a Thai street food cart under a big striped umbrella, in 3d (see street-kit.ts).
|
|
2
|
+
import { sway, twinkle } from '../motions.js';
|
|
3
|
+
import { poly } from '../sticker.js';
|
|
4
|
+
import { steam } from './food.js';
|
|
5
|
+
import { block, faceOf, ISO, quad, solid } from '../iso.js';
|
|
6
|
+
import { disc, face, hull, ring } from './street-kit.js';
|
|
7
|
+
import { glow, LINE } from './shared.js';
|
|
8
|
+
// A steel cart on two wheels with a glass case and a steaming wok; the umbrella sways on its pole
|
|
9
|
+
const CART = block([-120, -50, 40], [240, 0, 0], [0, 100, 0], [0, 0, 96]);
|
|
10
|
+
const cf = faceOf(CART, 'front');
|
|
11
|
+
const CASE = block([-108, -38, 136], [110, 0, 0], [0, 76, 0], [0, 0, 56]);
|
|
12
|
+
const X = [1, 0, 0];
|
|
13
|
+
const Z = [0, 0, 1];
|
|
14
|
+
const wheel = (x) => [
|
|
15
|
+
{ d: poly(disc([x, -56, 38], X, Z, 34), 2), fill: 'deep' },
|
|
16
|
+
{ d: poly(disc([x, -58, 38], X, Z, 11), 2), fill: 'grey' },
|
|
17
|
+
];
|
|
18
|
+
const WOK = [62, 0, 136];
|
|
19
|
+
const WOK_BODY = hull([...ring([WOK[0], WOK[1], WOK[2] + 22], 46), ...ring(WOK, 24)].map((p) => ISO(p)));
|
|
20
|
+
const WOK_RIM = ring([WOK[0], WOK[1], WOK[2] + 22], 46).map((p) => ISO(p));
|
|
21
|
+
const WOK_IN = ring([WOK[0], WOK[1], WOK[2] + 22], 36).map((p) => ISO(p));
|
|
22
|
+
const [wx, wy] = ISO([WOK[0], WOK[1], WOK[2] + 22]);
|
|
23
|
+
const POLE = [-20, 30, 136];
|
|
24
|
+
const APEX = [-20, 30, 380];
|
|
25
|
+
const RIM = ring([-20, 30, 318], 168, 8);
|
|
26
|
+
const MID = [-20, 30, 350];
|
|
27
|
+
const CANOPY = [
|
|
28
|
+
{
|
|
29
|
+
d: poly(RIM.map((p) => ISO(p)), 2),
|
|
30
|
+
fill: 'deep',
|
|
31
|
+
},
|
|
32
|
+
...RIM.flatMap((p, i) => face([APEX, p, RIM[(i + 1) % RIM.length] ?? p], i % 2 ? 'white' : 'hot', MID)),
|
|
33
|
+
];
|
|
34
|
+
const base = ISO(POLE);
|
|
35
|
+
export const streetFoodCart = {
|
|
36
|
+
name: 'street-food-cart',
|
|
37
|
+
frames: 180,
|
|
38
|
+
line: LINE,
|
|
39
|
+
extrude: [0, 0],
|
|
40
|
+
layers: [
|
|
41
|
+
{ id: 'cart', p: [250, 410], shapes: [] },
|
|
42
|
+
{
|
|
43
|
+
parent: 'cart',
|
|
44
|
+
shapes: [
|
|
45
|
+
...solid(CART, { fill: 'grey', top: 'white' }, 3),
|
|
46
|
+
{ d: quad(cf, 0.06, 0.55, 0.88, 0.2, 2), fill: 'main' },
|
|
47
|
+
{ d: quad(cf, 0.38, 0.12, 0.3, 0.3, 2), fill: 'tint' },
|
|
48
|
+
...wheel(-78),
|
|
49
|
+
...wheel(78),
|
|
50
|
+
{ d: poly(WOK_BODY, 2), fill: 'deep' },
|
|
51
|
+
{ d: poly(WOK_RIM, 2), fill: 'deep' },
|
|
52
|
+
{ d: poly(WOK_IN, 2), fill: 'gold' },
|
|
53
|
+
...solid(CASE, { fill: 'tint' }, 2),
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
steam('cart', [wx - 16, wx + 4, wx + 24], wy - 10),
|
|
57
|
+
{
|
|
58
|
+
parent: 'cart',
|
|
59
|
+
a: base,
|
|
60
|
+
p: base,
|
|
61
|
+
m: { ...sway, k: 0.6 },
|
|
62
|
+
shapes: [{ d: poly([ISO(POLE), ISO([-20, 30, 330])]), line: 9 }, ...CANOPY],
|
|
63
|
+
},
|
|
64
|
+
glow('cart', [-170, -150], 22, [twinkle(50), twinkle(140, true)]),
|
|
65
|
+
],
|
|
66
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Shape, Swatch, Vec } from '../sticker.js';
|
|
2
|
+
import type { V3 } from '../iso.js';
|
|
3
|
+
/** A flat polygon of a solid whose middle is `inside`: one shape when it faces the viewer, none when turned away. */
|
|
4
|
+
export declare function face(pts: readonly V3[], fill: Swatch, inside: V3, r?: number, P?: (p: V3) => Vec): Shape[];
|
|
5
|
+
/** Convex hull of screen points (monotone chain). */
|
|
6
|
+
export declare function hull(points: readonly Vec[]): Vec[];
|
|
7
|
+
/** A horizontal circle of n points around c. */
|
|
8
|
+
export declare const ring: (c: V3, r: number, n?: number) => V3[];
|
|
9
|
+
/** A circle in the plane of u and v (unit vectors) around c, on screen. */
|
|
10
|
+
export declare const disc: (c: V3, u: V3, v: V3, r: number, n?: number) => Vec[];
|
|
11
|
+
/** A turned body standing on c: its outline from a [z, r] profile, and its top rim. */
|
|
12
|
+
export declare function lathe(c: V3, profile: readonly (readonly [number, number])[]): {
|
|
13
|
+
outline: Vec[];
|
|
14
|
+
top: Vec[];
|
|
15
|
+
};
|
|
16
|
+
/** The half of a horizontal circle that faces the viewer, left to right on screen. */
|
|
17
|
+
export declare const frontArc: (c: V3, r: number, n?: number) => Vec[];
|
|
18
|
+
/** A point on a 3d quad (corners in order), s along the first edge, t along the last. */
|
|
19
|
+
export declare const lerp4: (q: readonly V3[], s: number, t: number) => V3;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Helpers the Thai street stickers share: solids that are not boxes, projected with ISO. A face is drawn only when it
|
|
2
|
+
// turns towards the viewer, round bodies are their silhouette (the hull of their rings), discs are circles in a plane.
|
|
3
|
+
import { poly } from '../sticker.js';
|
|
4
|
+
import { add, ISO, mul } from '../iso.js';
|
|
5
|
+
const sub = (a, b) => [a[0] - b[0], a[1] - b[1], a[2] - b[2]];
|
|
6
|
+
const cross = (a, b) => [
|
|
7
|
+
a[1] * b[2] - a[2] * b[1],
|
|
8
|
+
a[2] * b[0] - a[0] * b[2],
|
|
9
|
+
a[0] * b[1] - a[1] * b[0],
|
|
10
|
+
];
|
|
11
|
+
const dot3 = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
12
|
+
const area = (pts) => pts.reduce((a, p, i) => {
|
|
13
|
+
const q = pts[(i + 1) % pts.length] ?? p;
|
|
14
|
+
return a + p[0] * q[1] - q[0] * p[1];
|
|
15
|
+
}, 0);
|
|
16
|
+
const at = (pts, i) => pts[i] ?? [0, 0, 0];
|
|
17
|
+
/** A flat polygon of a solid whose middle is `inside`: one shape when it faces the viewer, none when turned away. */
|
|
18
|
+
export function face(pts, fill, inside, r = 0, P = ISO) {
|
|
19
|
+
const n = cross(sub(at(pts, 1), at(pts, 0)), sub(at(pts, 2), at(pts, 0)));
|
|
20
|
+
const mid = mul(pts.reduce((s, p) => add(s, p), [0, 0, 0]), 1 / pts.length);
|
|
21
|
+
const out = dot3(n, sub(mid, inside)) > 0 ? pts : [...pts].reverse();
|
|
22
|
+
const flat = out.map((p) => P(p));
|
|
23
|
+
return area(flat) < 0 ? [{ d: poly(flat, r), fill }] : [];
|
|
24
|
+
}
|
|
25
|
+
/** Convex hull of screen points (monotone chain). */
|
|
26
|
+
export function hull(points) {
|
|
27
|
+
const p = [...points].sort((a, b) => a[0] - b[0] || a[1] - b[1]);
|
|
28
|
+
const turn = (o, a, b) => (a[0] - o[0]) * (b[1] - o[1]) - (a[1] - o[1]) * (b[0] - o[0]);
|
|
29
|
+
const half = (list) => {
|
|
30
|
+
const h = [];
|
|
31
|
+
for (const q of list) {
|
|
32
|
+
while (h.length >= 2 && turn(h[h.length - 2] ?? q, h[h.length - 1] ?? q, q) <= 0)
|
|
33
|
+
h.pop();
|
|
34
|
+
h.push(q);
|
|
35
|
+
}
|
|
36
|
+
h.pop();
|
|
37
|
+
return h;
|
|
38
|
+
};
|
|
39
|
+
return [...half(p), ...half([...p].reverse())];
|
|
40
|
+
}
|
|
41
|
+
/** A horizontal circle of n points around c. */
|
|
42
|
+
export const ring = (c, r, n = 28) => Array.from({ length: n }, (_, i) => {
|
|
43
|
+
const t = (i / n) * Math.PI * 2;
|
|
44
|
+
return [c[0] + Math.cos(t) * r, c[1] + Math.sin(t) * r, c[2]];
|
|
45
|
+
});
|
|
46
|
+
/** A circle in the plane of u and v (unit vectors) around c, on screen. */
|
|
47
|
+
export const disc = (c, u, v, r, n = 24) => Array.from({ length: n }, (_, i) => {
|
|
48
|
+
const t = (i / n) * Math.PI * 2;
|
|
49
|
+
return ISO(add(c, add(mul(u, Math.cos(t) * r), mul(v, Math.sin(t) * r))));
|
|
50
|
+
});
|
|
51
|
+
/** A turned body standing on c: its outline from a [z, r] profile, and its top rim. */
|
|
52
|
+
export function lathe(c, profile) {
|
|
53
|
+
const rings = profile.map(([z, r]) => ring(add(c, [0, 0, z]), r).map((p) => ISO(p)));
|
|
54
|
+
return { outline: hull(rings.flat()), top: rings[rings.length - 1] ?? [] };
|
|
55
|
+
}
|
|
56
|
+
/** The half of a horizontal circle that faces the viewer, left to right on screen. */
|
|
57
|
+
export const frontArc = (c, r, n = 14) => Array.from({ length: n + 1 }, (_, i) => {
|
|
58
|
+
const t = ((-150 + (180 * i) / n) * Math.PI) / 180;
|
|
59
|
+
return ISO([c[0] + Math.cos(t) * r, c[1] + Math.sin(t) * r, c[2]]);
|
|
60
|
+
});
|
|
61
|
+
/** A point on a 3d quad (corners in order), s along the first edge, t along the last. */
|
|
62
|
+
export const lerp4 = (q, s, t) => {
|
|
63
|
+
const [a, b, c, d] = [at(q, 0), at(q, 1), at(q, 2), at(q, 3)];
|
|
64
|
+
const bottom = add(a, mul(sub(b, a), s));
|
|
65
|
+
const top = add(d, mul(sub(c, d), s));
|
|
66
|
+
return add(bottom, mul(sub(top, bottom), t));
|
|
67
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a Thai soi street sign on its post, in 3d (see iso.ts). No real place names.
|
|
2
|
+
import { twinkle, wiggle } from '../motions.js';
|
|
3
|
+
import { block, faceOf, ISO, quad, solid } from '../iso.js';
|
|
4
|
+
import { glow, LINE } from './shared.js';
|
|
5
|
+
// A grey post, a blue soi sign facing the street and a green one down the lane, each with a number block and two
|
|
6
|
+
// white bars for the name; the front sign rocks on its bolt
|
|
7
|
+
const POST = block([-8, -8, 0], [16, 0, 0], [0, 16, 0], [0, 0, 310]);
|
|
8
|
+
const FRONT = block([10, -12, 236], [200, 0, 0], [0, 6, 0], [0, 0, 62]);
|
|
9
|
+
const LANE = block([-3, 12, 186], [6, 0, 0], [0, 180, 0], [0, 0, 58]);
|
|
10
|
+
const lettering = (f) => [
|
|
11
|
+
{ d: quad(f, 0.05, 0.16, 0.2, 0.68, 4), fill: 'white' },
|
|
12
|
+
{ d: quad(f, 0.1, 0.3, 0.04, 0.4, 1), fill: 'ink', line: false },
|
|
13
|
+
{ d: quad(f, 0.16, 0.3, 0.04, 0.4, 1), fill: 'ink', line: false },
|
|
14
|
+
{ d: quad(f, 0.32, 0.56, 0.6, 0.16, 3), fill: 'white', line: false },
|
|
15
|
+
{ d: quad(f, 0.32, 0.26, 0.42, 0.14, 3), fill: 'white', line: false },
|
|
16
|
+
];
|
|
17
|
+
const bolt = ISO([10, -12, 267]);
|
|
18
|
+
export const streetSign = {
|
|
19
|
+
name: 'street-sign',
|
|
20
|
+
frames: 180,
|
|
21
|
+
line: LINE,
|
|
22
|
+
extrude: [0, 0],
|
|
23
|
+
layers: [
|
|
24
|
+
{ id: 'sign', p: [220, 440], shapes: [] },
|
|
25
|
+
{
|
|
26
|
+
parent: 'sign',
|
|
27
|
+
shapes: [
|
|
28
|
+
...solid(LANE, { fill: 'ok' }, 3),
|
|
29
|
+
...lettering(faceOf(LANE, 'right')),
|
|
30
|
+
...solid(POST, { fill: 'grey', top: 'white' }, 2),
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
parent: 'sign',
|
|
35
|
+
a: bolt,
|
|
36
|
+
p: bolt,
|
|
37
|
+
m: { ...wiggle, k: 0.25 },
|
|
38
|
+
shapes: [...solid(FRONT, { fill: 'main' }, 3), ...lettering(faceOf(FRONT, 'front'))],
|
|
39
|
+
},
|
|
40
|
+
glow('sign', [-90, -300], 24, [twinkle(46), twinkle(140, true)]),
|
|
41
|
+
],
|
|
42
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a pair of bookshelf studio monitors in the Edifier MR4 manner, in 3d (see iso.ts).
|
|
2
|
+
import { hop, SNAP, twinkle } from '../motions.js';
|
|
3
|
+
import { block, dot, faceOf, ISO, solid } from '../iso.js';
|
|
4
|
+
import { glow, LINE } from './shared.js';
|
|
5
|
+
// Two tall boxes, a woofer and a tweeter each, the volume knob on the right one; the cones thump on the beat
|
|
6
|
+
const SW = 140;
|
|
7
|
+
const SD = 160;
|
|
8
|
+
const SH = 230;
|
|
9
|
+
const R = SW / SH;
|
|
10
|
+
const WOOF = [0.5, 0.36];
|
|
11
|
+
const BEAT = {
|
|
12
|
+
s: [
|
|
13
|
+
[10, [100, 100], SNAP],
|
|
14
|
+
[15, [114, 114], SNAP],
|
|
15
|
+
[26, [100, 100], SNAP],
|
|
16
|
+
[34, [100, 100], SNAP],
|
|
17
|
+
[39, [114, 114], SNAP],
|
|
18
|
+
[50, [100, 100]],
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
const speaker = (id, x, at, knob) => {
|
|
22
|
+
const box = block([x, -SD / 2, 0], [SW, 0, 0], [0, SD, 0], [0, 0, SH]);
|
|
23
|
+
const f = faceOf(box, 'front');
|
|
24
|
+
const base = ISO([x + SW / 2, 0, 0]);
|
|
25
|
+
const cone = f.at(WOOF[0], WOOF[1]);
|
|
26
|
+
return [
|
|
27
|
+
{ id, parent: 'pair', a: base, p: base, m: { ...hop, k: 0.4, at }, shapes: [] },
|
|
28
|
+
{
|
|
29
|
+
parent: id,
|
|
30
|
+
shapes: [
|
|
31
|
+
...solid(box, { fill: 'grey', top: 'white', front: 'deep' }, 5),
|
|
32
|
+
{ d: dot(f, WOOF[0], WOOF[1], 0.36, 0.36 * R), fill: 'grey' },
|
|
33
|
+
{ d: dot(f, 0.5, 0.8, 0.14, 0.14 * R), fill: 'grey' },
|
|
34
|
+
{ d: dot(f, 0.5, 0.8, 0.06, 0.06 * R), fill: 'tint' },
|
|
35
|
+
...(knob
|
|
36
|
+
? [
|
|
37
|
+
{ d: dot(f, 0.16, 0.08, 0.07, 0.07 * R), fill: 'grey' },
|
|
38
|
+
{ d: dot(f, 0.84, 0.08, 0.03, 0.03 * R), fill: 'ink' },
|
|
39
|
+
]
|
|
40
|
+
: []),
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
parent: id,
|
|
45
|
+
a: cone,
|
|
46
|
+
p: cone,
|
|
47
|
+
m: { ...BEAT, at },
|
|
48
|
+
shapes: [
|
|
49
|
+
{ d: dot(f, WOOF[0], WOOF[1], 0.27, 0.27 * R), fill: 'main' },
|
|
50
|
+
{ d: dot(f, WOOF[0], WOOF[1], 0.09, 0.09 * R), fill: 'tint' },
|
|
51
|
+
],
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
};
|
|
55
|
+
export const studioMonitors = {
|
|
56
|
+
name: 'studio-monitors',
|
|
57
|
+
frames: 160,
|
|
58
|
+
line: LINE,
|
|
59
|
+
extrude: [0, 0],
|
|
60
|
+
layers: [
|
|
61
|
+
{ id: 'pair', p: [250, 340], shapes: [] },
|
|
62
|
+
...speaker('left', -170, 0, false),
|
|
63
|
+
...speaker('right', 30, 5, true),
|
|
64
|
+
glow('pair', [170, -250], 22, [twinkle(15), twinkle(110, true)]),
|
|
65
|
+
glow('pair', [-190, -200], 16, [twinkle(39), twinkle(120, true)]),
|
|
66
|
+
],
|
|
67
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a sun as a thick disc on the leaned face, its ray slabs twisting round it.
|
|
2
|
+
import { hop, twinkle, twist } from '../motions.js';
|
|
3
|
+
import { ellipse, poly } from '../sticker.js';
|
|
4
|
+
import { EXT, FACE, glow, LINE } from './shared.js';
|
|
5
|
+
import { turn } from './sky-kit.js';
|
|
6
|
+
const RAY = [
|
|
7
|
+
[-15, -118],
|
|
8
|
+
[15, -118],
|
|
9
|
+
[9, -160],
|
|
10
|
+
[-9, -160],
|
|
11
|
+
];
|
|
12
|
+
export const sun = {
|
|
13
|
+
name: 'sun',
|
|
14
|
+
frames: 180,
|
|
15
|
+
line: LINE,
|
|
16
|
+
extrude: EXT,
|
|
17
|
+
layers: [
|
|
18
|
+
{ id: 'sun', p: [250, 250], m: { ...hop, k: 0.5 }, shapes: [] },
|
|
19
|
+
{ id: 'face', parent: 'sun', tilt: FACE, shapes: [] },
|
|
20
|
+
{
|
|
21
|
+
parent: 'face',
|
|
22
|
+
m: twist,
|
|
23
|
+
shapes: Array.from({ length: 8 }, (_, i) => ({
|
|
24
|
+
d: poly(turn(RAY, i * 45), 5),
|
|
25
|
+
fill: i % 2 ? 'gold' : 'hot',
|
|
26
|
+
depth: 0.7,
|
|
27
|
+
})),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
parent: 'face',
|
|
31
|
+
shapes: [
|
|
32
|
+
{ d: ellipse(0, 0, 96), fill: 'gold', depth: 1.2 },
|
|
33
|
+
{ d: ellipse(0, 0, 70) },
|
|
34
|
+
{ d: ellipse(-30, -32, 16, 10), fill: 'white', line: false },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
glow('sun', [150, -150], 26, [twinkle(30), twinkle(140, true)]),
|
|
38
|
+
glow('sun', [-160, 120], 16, [twinkle(44), twinkle(146, true)]),
|
|
39
|
+
],
|
|
40
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { twinkle, wobble } from '../motions.js';
|
|
2
|
+
import { poly } from '../sticker.js';
|
|
3
|
+
import { block, ISO, solid } from '../iso.js';
|
|
4
|
+
import { glow, LINE } from './shared.js';
|
|
5
|
+
import { box, drum, wire } from './volume.js';
|
|
6
|
+
// A freestanding headset: the arched band has a real front, back and curved crown.
|
|
7
|
+
const arc = (rx, rz, y) => Array.from({ length: 33 }, (_, i) => {
|
|
8
|
+
const a = (i * Math.PI) / 32;
|
|
9
|
+
return [rx * Math.cos(a), y, 142 + rz * Math.sin(a)];
|
|
10
|
+
});
|
|
11
|
+
const band = (y) => poly([...arc(126, 137, y), ...arc(108, 117, y).reverse()].map(ISO));
|
|
12
|
+
const crown = poly([...arc(126, 137, 26), ...arc(126, 137, -22).reverse()].map(ISO));
|
|
13
|
+
const cup = (x) => solid(block([x, -38, 56], [39, 0, 0], [0, 82, 0], [0, 0, 111]), { fill: 'main', top: 'white', front: 'tint' }, 13);
|
|
14
|
+
export const support = {
|
|
15
|
+
name: 'support',
|
|
16
|
+
frames: 180,
|
|
17
|
+
still: 100,
|
|
18
|
+
line: LINE,
|
|
19
|
+
extrude: [0, 0],
|
|
20
|
+
layers: [
|
|
21
|
+
{ id: 'headset', p: [248, 355], m: { ...wobble, k: 0.5 }, shapes: [] },
|
|
22
|
+
{
|
|
23
|
+
parent: 'headset',
|
|
24
|
+
shapes: [
|
|
25
|
+
{ d: band(26), fill: 'deep' },
|
|
26
|
+
{ d: crown, fill: 'white' },
|
|
27
|
+
{ d: band(-22), fill: 'main' },
|
|
28
|
+
// Cushions sit inside the cups, facing the opening.
|
|
29
|
+
...box([90, -30, 65], [23, 67, 91], 'deep', 'deep'),
|
|
30
|
+
...cup(110),
|
|
31
|
+
wire([
|
|
32
|
+
[130, -40, 83],
|
|
33
|
+
[130, -74, 51],
|
|
34
|
+
[110, -99, 37],
|
|
35
|
+
[45, -99, 37],
|
|
36
|
+
], 9),
|
|
37
|
+
...drum([37, -103, 37], 22, 12, 20, 'deep', 'main'),
|
|
38
|
+
...cup(-149),
|
|
39
|
+
...box([-110, -30, 65], [23, 67, 91], 'deep', 'deep'),
|
|
40
|
+
wire([
|
|
41
|
+
[-132, -40, 90],
|
|
42
|
+
[-132, -40, 133],
|
|
43
|
+
], 4),
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
glow('headset', [152, -221], 20, [twinkle(26), twinkle(150, true)]),
|
|
47
|
+
],
|
|
48
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers, modelled in 3d (see iso.ts).
|
|
2
|
+
import { nudge, twinkle } from '../motions.js';
|
|
3
|
+
import { block, dot, faceOf, quad, solid } from '../iso.js';
|
|
4
|
+
import { glow, LINE } from './shared.js';
|
|
5
|
+
// A flat 1U switch: two rows of ports across the front, a light over each pair
|
|
6
|
+
const H = 50;
|
|
7
|
+
const BOX = block([-170, -80, 0], [340, 0, 0], [0, 160, 0], [0, 0, H]);
|
|
8
|
+
const front = faceOf(BOX, 'front');
|
|
9
|
+
const PORTS = 8;
|
|
10
|
+
export const switchBox = {
|
|
11
|
+
name: 'switch',
|
|
12
|
+
frames: 180,
|
|
13
|
+
line: LINE,
|
|
14
|
+
extrude: [0, 0],
|
|
15
|
+
layers: [
|
|
16
|
+
{ id: 'sw', p: [250, 300], m: nudge, shapes: [] },
|
|
17
|
+
{
|
|
18
|
+
parent: 'sw',
|
|
19
|
+
shapes: [
|
|
20
|
+
...solid(BOX, { fill: 'grey', top: 'white', front: 'white' }, 4),
|
|
21
|
+
...Array.from({ length: PORTS }, (_, i) => [0.14, 0.52].map((t) => ({
|
|
22
|
+
d: quad(front, 0.06 + i * 0.075, t, 0.055, 0.3, 1),
|
|
23
|
+
fill: 'ink',
|
|
24
|
+
line: false,
|
|
25
|
+
}))).flat(),
|
|
26
|
+
...[0, 1, 2, 3].map((i) => ({
|
|
27
|
+
d: dot(front, 0.7 + i * 0.065, 0.5, 0.018, 0.12),
|
|
28
|
+
fill: i === 2 ? 'gold' : 'ok',
|
|
29
|
+
})),
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
glow('sw', [190, -110], 22, [twinkle(44), twinkle(140, true)]),
|
|
33
|
+
],
|
|
34
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers after the network diagrams of Protocol Explorer (redrawn as a slab).
|
|
2
|
+
import { jolt, slide, twinkle } from '../motions.js';
|
|
3
|
+
import { ellipse, line, rect } from '../sticker.js';
|
|
4
|
+
import { EXT, FACE, glow, LINE } from './shared.js';
|
|
5
|
+
// A tablet in landscape: thin bezel, a camera dot, a small chart whose tallest bar grows on the beat
|
|
6
|
+
const BARS = [
|
|
7
|
+
[-120, 60],
|
|
8
|
+
[-84, 96],
|
|
9
|
+
[-48, 74],
|
|
10
|
+
];
|
|
11
|
+
export const tablet = {
|
|
12
|
+
name: 'tablet',
|
|
13
|
+
frames: 180,
|
|
14
|
+
line: LINE,
|
|
15
|
+
extrude: EXT,
|
|
16
|
+
layers: [
|
|
17
|
+
{ id: 'tab', p: [250, 260], m: jolt(), shapes: [] },
|
|
18
|
+
{
|
|
19
|
+
id: 'face',
|
|
20
|
+
parent: 'tab',
|
|
21
|
+
tilt: FACE,
|
|
22
|
+
shapes: [
|
|
23
|
+
{ d: rect(-180, -126, 360, 252, 28), fill: 'deep', depth: 0.7 },
|
|
24
|
+
{ d: rect(-164, -110, 328, 220, 14), fill: 'white' },
|
|
25
|
+
{ d: ellipse(172, 0, 5), fill: 'ink', line: false },
|
|
26
|
+
...BARS.map(([x, h]) => ({
|
|
27
|
+
d: rect(x, 80 - h, 26, h, 4),
|
|
28
|
+
fill: 'main',
|
|
29
|
+
depth: 0.25,
|
|
30
|
+
})),
|
|
31
|
+
{ d: line([44, -60], [134, -60]) },
|
|
32
|
+
{ d: line([44, -30], [108, -30]) },
|
|
33
|
+
{ d: rect(44, 6, 100, 64, 10), fill: 'tint', depth: 0.2 },
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
parent: 'tab',
|
|
38
|
+
tilt: FACE,
|
|
39
|
+
m: slide([0, -18], 24, 60, 40),
|
|
40
|
+
shapes: [{ d: rect(-12, -40, 26, 120, 4), fill: 'gold', depth: 0.25 }],
|
|
41
|
+
},
|
|
42
|
+
glow('tab', [190, -150], 24, [twinkle(44), twinkle(140, true)]),
|
|
43
|
+
],
|
|
44
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers, modelled in 3d (see iso.ts).
|
|
2
|
+
import { slide, sway, twinkle } from '../motions.js';
|
|
3
|
+
import { block, dot, faceOf, ISO, quad, solid } from '../iso.js';
|
|
4
|
+
import { glow, LINE } from './shared.js';
|
|
5
|
+
// A tape library: a white cabinet with a window onto shelves of cartridges, a small panel under it
|
|
6
|
+
const W = 200;
|
|
7
|
+
const D = 180;
|
|
8
|
+
const H = 250;
|
|
9
|
+
const CAB = block([-W / 2, -D / 2, 0], [W, 0, 0], [0, D, 0], [0, 0, H]);
|
|
10
|
+
const front = faceOf(CAB, 'front');
|
|
11
|
+
// cartridges stand on two shelves inside the window, one face each
|
|
12
|
+
const tape = (i, row, fill) => ({
|
|
13
|
+
d: quad(front, 0.17 + i * 0.13, 0.46 + row * 0.22, 0.1, 0.16, 2),
|
|
14
|
+
fill,
|
|
15
|
+
});
|
|
16
|
+
const FILLS = ['gold', 'main', 'gold', 'main', 'gold'];
|
|
17
|
+
export const tapeLibrary = {
|
|
18
|
+
name: 'tape-library',
|
|
19
|
+
frames: 180,
|
|
20
|
+
line: LINE,
|
|
21
|
+
extrude: [0, 0],
|
|
22
|
+
layers: [
|
|
23
|
+
{ id: 'lib', p: [250, 360], m: { ...sway, k: 0.5 }, shapes: [] },
|
|
24
|
+
{
|
|
25
|
+
parent: 'lib',
|
|
26
|
+
shapes: [
|
|
27
|
+
...solid(CAB, { fill: 'grey', top: 'white', front: 'white' }, 3),
|
|
28
|
+
{ d: quad(front, 0.1, 0.4, 0.8, 0.52, 3), fill: 'deep' },
|
|
29
|
+
...FILLS.map((f, i) => tape(i, 1, f)),
|
|
30
|
+
...FILLS.map((f, i) => (i === 2 ? null : tape(i, 0, i % 2 ? 'gold' : 'main'))).filter((s) => s !== null),
|
|
31
|
+
{ d: quad(front, 0.1, 0.1, 0.5, 0.18, 3), fill: 'tint' },
|
|
32
|
+
{ d: dot(front, 0.75, 0.19, 0.05, 0.05 * (W / H)), fill: 'ok' },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
// the picker pulls one cartridge out of its slot and puts it back
|
|
36
|
+
{
|
|
37
|
+
parent: 'lib',
|
|
38
|
+
m: slide(ISO([0, -24, 0]), 24, 40, 40),
|
|
39
|
+
shapes: [
|
|
40
|
+
(() => {
|
|
41
|
+
const b = block([-W / 2 + 0.43 * W, -D / 2 - 6, 0.46 * H], [0.1 * W, 0, 0], [0, 6, 0], [0, 0, 0.16 * H]);
|
|
42
|
+
return solid(b, { fill: 'grey', front: 'ok' }, 2);
|
|
43
|
+
})(),
|
|
44
|
+
].flat(),
|
|
45
|
+
},
|
|
46
|
+
glow('lib', [120, -300], 24, [twinkle(50), twinkle(140, true)]),
|
|
47
|
+
],
|
|
48
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a temple donation box in 3d (see iso.ts), a dharma wheel on its front; a coin
|
|
2
|
+
// drops into the slot and the box takes the hit.
|
|
3
|
+
import { fall, nudge, twinkle } from '../motions.js';
|
|
4
|
+
import { ellipse } from '../sticker.js';
|
|
5
|
+
import { block, dot, faceOf, quad, solid, stroke } from '../iso.js';
|
|
6
|
+
import { glow, LINE } from './shared.js';
|
|
7
|
+
const W = 210;
|
|
8
|
+
const D = 150;
|
|
9
|
+
const H = 190;
|
|
10
|
+
const BOX = block([-W / 2, -D / 2, 0], [W, 0, 0], [0, D, 0], [0, 0, H]);
|
|
11
|
+
const LID = block([-W / 2 - 10, -D / 2 - 10, H], [W + 20, 0, 0], [0, D + 20, 0], [0, 0, 18]);
|
|
12
|
+
const front = faceOf(BOX, 'front');
|
|
13
|
+
const top = faceOf(LID, 'top');
|
|
14
|
+
const R = W / H;
|
|
15
|
+
const C = [0.5, 0.48];
|
|
16
|
+
const SPOKES = [0, 1, 2, 3, 4, 5, 6, 7].map((i) => {
|
|
17
|
+
const a = (i * Math.PI) / 4;
|
|
18
|
+
return {
|
|
19
|
+
d: stroke(front, [C[0] + Math.cos(a) * 0.07, C[1] + Math.sin(a) * 0.07 * R], [C[0] + Math.cos(a) * 0.2, C[1] + Math.sin(a) * 0.2 * R]),
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
const SLOT = top.at(0.5, 0.5);
|
|
23
|
+
const COIN = [SLOT[0], SLOT[1] - 110];
|
|
24
|
+
export const templeDonation = {
|
|
25
|
+
name: 'temple-donation',
|
|
26
|
+
frames: 180,
|
|
27
|
+
still: 120,
|
|
28
|
+
line: LINE,
|
|
29
|
+
extrude: [0, 0],
|
|
30
|
+
layers: [
|
|
31
|
+
{ id: 'box', a: [0, 0], p: [250, 400], m: { ...nudge, at: 58 }, shapes: [] },
|
|
32
|
+
{
|
|
33
|
+
parent: 'box',
|
|
34
|
+
a: COIN,
|
|
35
|
+
p: COIN,
|
|
36
|
+
m: [twinkle(4), fall([0, 106], 34, 22)],
|
|
37
|
+
op: 58,
|
|
38
|
+
shapes: [
|
|
39
|
+
{ d: ellipse(COIN[0] + 5, COIN[1], 18, 34), fill: 'gold' },
|
|
40
|
+
{ d: ellipse(COIN[0], COIN[1], 18, 34), fill: 'gold' },
|
|
41
|
+
{ d: ellipse(COIN[0], COIN[1], 7, 18) },
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
parent: 'box',
|
|
46
|
+
shapes: [
|
|
47
|
+
...solid(BOX, { fill: 'hot' }, 4),
|
|
48
|
+
{ d: dot(front, C[0], C[1], 0.26, 0.26 * R), fill: 'gold' },
|
|
49
|
+
{ d: dot(front, C[0], C[1], 0.2, 0.2 * R), fill: 'white' },
|
|
50
|
+
...SPOKES,
|
|
51
|
+
{ d: dot(front, C[0], C[1], 0.06, 0.06 * R), fill: 'gold' },
|
|
52
|
+
{ d: quad(front, 0.1, 0.08, 0.8, 0.08, 2), fill: 'gold' },
|
|
53
|
+
...solid(LID, { fill: 'gold', top: 'white' }, 4),
|
|
54
|
+
{ d: quad(top, 0.25, 0.44, 0.5, 0.12, 4), fill: 'ink' },
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
glow('box', [140, -300], 24, [twinkle(60), twinkle(140, true)]),
|
|
58
|
+
glow('box', [-150, -230], 16, [twinkle(66), twinkle(144, true)]),
|
|
59
|
+
],
|
|
60
|
+
};
|