@20baht/stickers 0.0.0-stage → 0.1.0
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/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 +185 -0
- package/dist/icons/index.js +366 -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/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 +197 -0
- package/dist/load.js +197 -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,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
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a camping tent on a grass tile in 2.5d, modelled in 3d; the door flap rolls open.
|
|
2
|
+
import { SNAP, twinkle } from '../motions.js';
|
|
3
|
+
import { line, poly } from '../sticker.js';
|
|
4
|
+
import { ISO } from '../iso.js';
|
|
5
|
+
import { tile, tuft } from './plant-kit.js';
|
|
6
|
+
import { glow, LINE } from './shared.js';
|
|
7
|
+
const [HW, HD, H] = [104, 96, 160];
|
|
8
|
+
const P = (p) => ISO(p);
|
|
9
|
+
const [FL, FR, FT] = [P([-HW, -HD, 0]), P([HW, -HD, 0]), P([0, -HD, H])];
|
|
10
|
+
const [BL, BR, BT] = [P([-HW, HD, 0]), P([HW, HD, 0]), P([0, HD, H])];
|
|
11
|
+
const area = (pts) => pts.reduce((s, p, i) => {
|
|
12
|
+
const q = pts[(i + 1) % pts.length] ?? p;
|
|
13
|
+
return s + p[0] * q[1] - q[0] * p[1];
|
|
14
|
+
}, 0);
|
|
15
|
+
// faces wound like iso.ts blocks, so the ones turned to the viewer have negative area
|
|
16
|
+
const FACES = [
|
|
17
|
+
[[BL, BT, BR], 'main'],
|
|
18
|
+
[[FL, FT, BT, BL], 'main'],
|
|
19
|
+
[[FR, BR, BT, FT], 'main'],
|
|
20
|
+
[[FL, FR, FT], 'tint'],
|
|
21
|
+
];
|
|
22
|
+
const BODY = FACES.filter(([pts]) => area(pts) < 0).map(([pts, fill]) => ({
|
|
23
|
+
d: poly(pts, 3),
|
|
24
|
+
fill,
|
|
25
|
+
}));
|
|
26
|
+
const DOOR = [P([-44, -HD, 0]), P([44, -HD, 0]), P([0, -HD, 118])];
|
|
27
|
+
const PIN = DOOR[1];
|
|
28
|
+
export const tent = {
|
|
29
|
+
name: 'tent',
|
|
30
|
+
frames: 180,
|
|
31
|
+
still: 90,
|
|
32
|
+
line: LINE,
|
|
33
|
+
extrude: [0, 0],
|
|
34
|
+
layers: [
|
|
35
|
+
{ id: 'camp', p: [250, 320], shapes: [] },
|
|
36
|
+
{
|
|
37
|
+
parent: 'camp',
|
|
38
|
+
shapes: [
|
|
39
|
+
...tile(150, 'ok', 'gold'),
|
|
40
|
+
...[P([-120, -40, 0]), P([110, 30, 0]), P([-40, -130, 0])].map((p) => ({
|
|
41
|
+
d: tuft(p),
|
|
42
|
+
})),
|
|
43
|
+
{ d: line(FT, P([-60, -150, 0])) },
|
|
44
|
+
{ d: line(FT, P([60, -150, 0])) },
|
|
45
|
+
...BODY,
|
|
46
|
+
{ d: line(FT, BT) },
|
|
47
|
+
{ d: poly(DOOR, 2), fill: 'deep' },
|
|
48
|
+
],
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
parent: 'camp',
|
|
52
|
+
a: PIN,
|
|
53
|
+
p: PIN,
|
|
54
|
+
m: {
|
|
55
|
+
s: [
|
|
56
|
+
[16, [100, 100], SNAP],
|
|
57
|
+
[52, [22, 100], 0],
|
|
58
|
+
[136, [22, 100], SNAP],
|
|
59
|
+
[170, [100, 100]],
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
shapes: [{ d: poly(DOOR, 2), fill: 'main' }, { d: line(DOOR[2], P([0, -HD, 0])) }],
|
|
63
|
+
},
|
|
64
|
+
glow('camp', [140, -220], 22, [twinkle(54), twinkle(140, true)]),
|
|
65
|
+
],
|
|
66
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a terminal window; a command types out after the prompt, its output follows, and
|
|
2
|
+
// the cursor waits.
|
|
3
|
+
import { jolt, twinkle } from '../motions.js';
|
|
4
|
+
import { ellipse, poly, rect } from '../sticker.js';
|
|
5
|
+
import { EXT, FACE, glow, LINE } from './shared.js';
|
|
6
|
+
const chevron = (x, y) => poly([
|
|
7
|
+
[x, y - 16],
|
|
8
|
+
[x + 22, y],
|
|
9
|
+
[x, y + 16],
|
|
10
|
+
[x, y + 6],
|
|
11
|
+
[x + 9, y],
|
|
12
|
+
[x, y - 6],
|
|
13
|
+
], 2);
|
|
14
|
+
// a typed line grows from its left end
|
|
15
|
+
const typed = (y, w, start, fill) => ({
|
|
16
|
+
parent: 'win',
|
|
17
|
+
a: [-110, y],
|
|
18
|
+
p: [-110, y],
|
|
19
|
+
m: [twinkle(start), twinkle(150, true)],
|
|
20
|
+
shapes: [{ d: rect(-110, y - 8, w, 16, 8), fill, line: 3 }],
|
|
21
|
+
});
|
|
22
|
+
export const terminal = {
|
|
23
|
+
name: 'terminal',
|
|
24
|
+
frames: 180,
|
|
25
|
+
line: LINE,
|
|
26
|
+
extrude: EXT,
|
|
27
|
+
still: 120,
|
|
28
|
+
layers: [
|
|
29
|
+
{ id: 'root', a: [0, 120], p: [250, 320], m: jolt([-3, 8]), shapes: [] },
|
|
30
|
+
{
|
|
31
|
+
id: 'win',
|
|
32
|
+
parent: 'root',
|
|
33
|
+
tilt: FACE,
|
|
34
|
+
shapes: [
|
|
35
|
+
{ d: rect(-170, -124, 340, 248, 18), fill: 'deep', depth: 0.8 },
|
|
36
|
+
{ d: rect(-170, -124, 340, 40, 18), fill: 'white' },
|
|
37
|
+
{ d: ellipse(-144, -104, 8), fill: 'hot' },
|
|
38
|
+
{ d: ellipse(-118, -104, 8), fill: 'gold' },
|
|
39
|
+
{ d: ellipse(-92, -104, 8), fill: 'ok' },
|
|
40
|
+
{ d: chevron(-146, -50), fill: 'white' },
|
|
41
|
+
{ d: chevron(-146, 70), fill: 'white' },
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
typed(-50, 170, 14, 'white'),
|
|
45
|
+
typed(-10, 220, 40, 'ok'),
|
|
46
|
+
typed(26, 140, 50, 'ok'),
|
|
47
|
+
{
|
|
48
|
+
parent: 'win',
|
|
49
|
+
a: [-102, 70],
|
|
50
|
+
p: [-102, 70],
|
|
51
|
+
m: [twinkle(70), twinkle(150, true)],
|
|
52
|
+
shapes: [{ d: rect(-110, 58, 18, 26, 3), fill: 'white', line: 3 }],
|
|
53
|
+
},
|
|
54
|
+
glow('root', [180, -150], 22, [twinkle(60), twinkle(150, true)]),
|
|
55
|
+
],
|
|
56
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a raised Thai teak house on stilts, in 3d (see iso.ts, street-kit.ts).
|
|
2
|
+
import { twinkle, wiggle } from '../motions.js';
|
|
3
|
+
import { ellipse, line } from '../sticker.js';
|
|
4
|
+
import { block, faceOf, ISO, quad, solid, stroke } from '../iso.js';
|
|
5
|
+
import { face } from './street-kit.js';
|
|
6
|
+
import { glow, LINE } from './shared.js';
|
|
7
|
+
// Stilts under a veranda, plank walls with two windows and a door, a steep gable roof with crossed kalae on both
|
|
8
|
+
// ends; a little bell hangs from the eave and rings
|
|
9
|
+
const [X, Y] = [100, 56];
|
|
10
|
+
const [FLOOR, WALL, EAVE, RIDGE] = [64, 92, 168, 262];
|
|
11
|
+
const WALLS = block([-X, -Y, FLOOR + 12], [2 * X, 0, 0], [0, 2 * Y, 0], [0, 0, WALL]);
|
|
12
|
+
const front = faceOf(WALLS, 'front');
|
|
13
|
+
const right = faceOf(WALLS, 'right');
|
|
14
|
+
const DECK = block([-X - 22, -Y - 26, FLOOR], [2 * X + 44, 0, 0], [0, 2 * Y + 52, 0], [0, 0, 12]);
|
|
15
|
+
const IN = [0, 0, 230];
|
|
16
|
+
const post = (x, y) => solid(block([x - 7, y - 7, 0], [14, 0, 0], [0, 14, 0], [0, 0, FLOOR]), { fill: 'deep' });
|
|
17
|
+
const kalae = (x) => [
|
|
18
|
+
{ d: line(ISO([x, -10, RIDGE - 8]), ISO([x, 14, RIDGE + 22])), line: 7 },
|
|
19
|
+
{ d: line(ISO([x, 10, RIDGE - 8]), ISO([x, -14, RIDGE + 22])), line: 7 },
|
|
20
|
+
];
|
|
21
|
+
const BELL = [X + 4, -Y - 20, EAVE - 2];
|
|
22
|
+
const [bx, by] = ISO(BELL);
|
|
23
|
+
export const thaiHouse = {
|
|
24
|
+
name: 'thai-house',
|
|
25
|
+
frames: 180,
|
|
26
|
+
line: LINE,
|
|
27
|
+
extrude: [0, 0],
|
|
28
|
+
layers: [
|
|
29
|
+
{ id: 'th', p: [250, 400], shapes: [] },
|
|
30
|
+
{
|
|
31
|
+
parent: 'th',
|
|
32
|
+
shapes: [
|
|
33
|
+
...[-X, 0, X].flatMap((x) => [...post(x, Y), ...post(x, -Y)]),
|
|
34
|
+
...solid(DECK, { fill: 'deep', top: 'gold' }, 2),
|
|
35
|
+
...solid(WALLS, { fill: 'gold' }, 2),
|
|
36
|
+
...[0.12, 0.24, 0.36, 0.48, 0.6, 0.72, 0.84].map((s) => ({
|
|
37
|
+
d: stroke(front, [s, 0], [s, 1]),
|
|
38
|
+
})),
|
|
39
|
+
{ d: quad(front, 0.06, 0.3, 0.16, 0.45, 2), fill: 'deep' },
|
|
40
|
+
{ d: quad(front, 0.42, 0, 0.16, 0.8, 2), fill: 'deep' },
|
|
41
|
+
{ d: quad(front, 0.78, 0.3, 0.16, 0.45, 2), fill: 'deep' },
|
|
42
|
+
{ d: quad(right, 0.3, 0.3, 0.4, 0.45, 2), fill: 'deep' },
|
|
43
|
+
...face([
|
|
44
|
+
[X + 4, -Y - 18, EAVE],
|
|
45
|
+
[X + 4, Y + 18, EAVE],
|
|
46
|
+
[X + 4, 0, RIDGE - 8],
|
|
47
|
+
], 'gold', IN),
|
|
48
|
+
...face([
|
|
49
|
+
[-X - 4, -Y - 18, EAVE],
|
|
50
|
+
[-X - 4, Y + 18, EAVE],
|
|
51
|
+
[-X - 4, 0, RIDGE - 8],
|
|
52
|
+
], 'gold', IN),
|
|
53
|
+
...face([
|
|
54
|
+
[-X - 24, -Y - 22, EAVE],
|
|
55
|
+
[X + 24, -Y - 22, EAVE],
|
|
56
|
+
[X + 24, 0, RIDGE],
|
|
57
|
+
[-X - 24, 0, RIDGE],
|
|
58
|
+
], 'deep', IN, 2),
|
|
59
|
+
...face([
|
|
60
|
+
[-X - 24, Y + 22, EAVE],
|
|
61
|
+
[X + 24, Y + 22, EAVE],
|
|
62
|
+
[X + 24, 0, RIDGE],
|
|
63
|
+
[-X - 24, 0, RIDGE],
|
|
64
|
+
], 'deep', IN, 2),
|
|
65
|
+
...kalae(X + 24),
|
|
66
|
+
...kalae(-X - 24),
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
parent: 'th',
|
|
71
|
+
a: [bx, by],
|
|
72
|
+
p: [bx, by],
|
|
73
|
+
m: { ...wiggle, k: 0.8 },
|
|
74
|
+
shapes: [
|
|
75
|
+
{ d: line([bx, by], [bx, by + 18]) },
|
|
76
|
+
{
|
|
77
|
+
d: `M${String(bx - 11)} ${String(by + 36)}Q${String(bx - 11)} ${String(by + 16)} ${String(bx)} ${String(by + 16)}Q${String(bx + 11)} ${String(by + 16)} ${String(bx + 11)} ${String(by + 36)}Z`,
|
|
78
|
+
fill: 'gold',
|
|
79
|
+
},
|
|
80
|
+
{ d: ellipse(bx, by + 40, 4), fill: 'gold' },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
glow('th', [150, -320], 24, [twinkle(48), twinkle(140, true)]),
|
|
84
|
+
],
|
|
85
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: Lanna sky lanterns (khom loi) in 2.5d (see nature-iso.ts); they rise and the flame flickers.
|
|
2
|
+
import { flicker, float, twinkle } from '../motions.js';
|
|
3
|
+
import { line } from '../sticker.js';
|
|
4
|
+
import { ISO } from '../iso.js';
|
|
5
|
+
import { belt, lathe, seam } from './nature-iso.js';
|
|
6
|
+
import { glow, LINE } from './shared.js';
|
|
7
|
+
// a paper balloon rounded at the top with a red hoop round the mouth, the fuel ring hung below on wires
|
|
8
|
+
const BODY = [
|
|
9
|
+
[54, 0],
|
|
10
|
+
[64, 30],
|
|
11
|
+
[70, 90],
|
|
12
|
+
[66, 150],
|
|
13
|
+
[50, 186],
|
|
14
|
+
[24, 202],
|
|
15
|
+
[0, 206],
|
|
16
|
+
];
|
|
17
|
+
const scaled = (k) => BODY.map(([r, z]) => [r * k, z * k]);
|
|
18
|
+
const flame = (o, k, lean) => line([o[0] - 11 * k, o[1]], [o[0] - 12 * k + lean / 2, o[1] - 14 * k], [o[0] + lean, o[1] - 34 * k], [o[0] + 12 * k + lean / 2, o[1] - 14 * k], [o[0] + 11 * k, o[1]], [o[0], o[1] + 6 * k]) + 'Z';
|
|
19
|
+
const lantern = (c, k) => {
|
|
20
|
+
const prof = scaled(k);
|
|
21
|
+
const mouth = ISO([c[0], c[1], c[2] - 34 * k]);
|
|
22
|
+
return {
|
|
23
|
+
body: [
|
|
24
|
+
{ d: lathe(c, prof), fill: 'white' },
|
|
25
|
+
{ d: belt(c, 54 * k, 0, 62 * k, 24 * k), fill: 'hot' },
|
|
26
|
+
...[1.0, 1.57, 2.14].map((t) => ({ d: seam(c, prof.slice(1, -1), t) })),
|
|
27
|
+
{
|
|
28
|
+
d: line(ISO([c[0] - 46 * k, c[1], c[2]]), mouth, ISO([c[0] + 46 * k, c[1], c[2]])),
|
|
29
|
+
line: 3,
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
fire: [
|
|
33
|
+
{
|
|
34
|
+
d: flicker([
|
|
35
|
+
flame(mouth, k, 0),
|
|
36
|
+
flame(mouth, k * 0.86, 5 * k),
|
|
37
|
+
flame(mouth, k * 1.06, -4 * k),
|
|
38
|
+
]),
|
|
39
|
+
fill: 'gold',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const BIG = lantern([0, 0, 0], 1);
|
|
45
|
+
const SMALL = lantern([0, 0, 0], 0.5);
|
|
46
|
+
const rise = (id, p, at, parts) => [
|
|
47
|
+
{ id, p, m: { ...float, at, k: 1.6 }, shapes: parts.body },
|
|
48
|
+
{ parent: id, shapes: parts.fire },
|
|
49
|
+
];
|
|
50
|
+
export const thaiLantern = {
|
|
51
|
+
name: 'thai-lantern',
|
|
52
|
+
frames: 180,
|
|
53
|
+
line: LINE,
|
|
54
|
+
extrude: [0, 0],
|
|
55
|
+
layers: [
|
|
56
|
+
...rise('small', [140, 200], 30, SMALL),
|
|
57
|
+
...rise('big', [270, 360], 0, BIG),
|
|
58
|
+
glow('big', [110, -170], 22, [twinkle(40), twinkle(140, true)]),
|
|
59
|
+
glow('big', [-160, -60], 16, [twinkle(70), twinkle(150, true)]),
|
|
60
|
+
],
|
|
61
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a ThinkPad L380 style laptop, modelled in 3d (see iso.ts). No logo.
|
|
2
|
+
import { erase, jolt, twinkle } from '../motions.js';
|
|
3
|
+
import { block, dot, faceOf, quad, solid, stroke } from '../iso.js';
|
|
4
|
+
import { glow, LINE } from './shared.js';
|
|
5
|
+
// A black business laptop: a full key grid, the red pointing stick in its middle, three buttons over the trackpad
|
|
6
|
+
const W = 262;
|
|
7
|
+
const D = 176;
|
|
8
|
+
const T = 20;
|
|
9
|
+
const LID = 168;
|
|
10
|
+
const LEAN = (12 * 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) * 12, -Math.sin(LEAN) * 12];
|
|
15
|
+
const LIDB = block([-W / 2, D / 2, T], [W, 0, 0], BACK, UP);
|
|
16
|
+
const screen = faceOf(LIDB, 'front');
|
|
17
|
+
const COLS = 10;
|
|
18
|
+
const KEYS = [
|
|
19
|
+
...[0.6, 0.71, 0.82].map((t) => ({ d: stroke(deck, [0.08, t], [0.92, t]) })),
|
|
20
|
+
...Array.from({ length: COLS - 1 }, (_, i) => {
|
|
21
|
+
const s = 0.08 + ((i + 1) * 0.84) / COLS;
|
|
22
|
+
return { d: stroke(deck, [s, 0.5], [s, 0.92]) };
|
|
23
|
+
}),
|
|
24
|
+
];
|
|
25
|
+
export const thinkpadL380 = {
|
|
26
|
+
name: 'thinkpad-l380',
|
|
27
|
+
frames: 180,
|
|
28
|
+
still: 150,
|
|
29
|
+
line: LINE,
|
|
30
|
+
extrude: [0, 0],
|
|
31
|
+
layers: [
|
|
32
|
+
{ id: 'tp', p: [250, 330], m: jolt(), shapes: [] },
|
|
33
|
+
{
|
|
34
|
+
parent: 'tp',
|
|
35
|
+
shapes: [
|
|
36
|
+
...solid(LIDB, { fill: 'deep' }, 3),
|
|
37
|
+
{ d: quad(screen, 0.05, 0.06, 0.9, 0.84, 2), fill: 'tint' },
|
|
38
|
+
{ d: dot(screen, 0.5, 0.95, 0.01, 0.015), fill: 'ink' },
|
|
39
|
+
...[0.74, 0.58, 0.42, 0.26].map((t, i) => ({
|
|
40
|
+
d: stroke(screen, [0.12 + (i % 2 ? 0.08 : 0), t], [i === 3 ? 0.46 : 0.8, t]),
|
|
41
|
+
trim: erase(24 - i * 5, 90 + i * 5),
|
|
42
|
+
})),
|
|
43
|
+
...solid(DECK, { fill: 'deep' }, 3),
|
|
44
|
+
{ d: quad(deck, 0.08, 0.5, 0.84, 0.42, 2), fill: 'grey' },
|
|
45
|
+
...KEYS,
|
|
46
|
+
{ d: dot(deck, 0.5, 0.6, 0.022, 0.033), fill: 'hot' },
|
|
47
|
+
{ d: quad(deck, 0.3, 0.37, 0.4, 0.08, 2), fill: 'grey' },
|
|
48
|
+
...[0.43, 0.57].map((s) => ({ d: stroke(deck, [s, 0.37], [s, 0.45]) })),
|
|
49
|
+
{ d: quad(deck, 0.3, 0.07, 0.4, 0.28, 4), fill: 'grey' },
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
glow('tp', [178, -222], 22, [twinkle(40), twinkle(140, true)]),
|
|
53
|
+
],
|
|
54
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a delay timer; the button is pressed and the hand ticks through three seconds.
|
|
2
|
+
import { press, SNAP, twinkle } from '../motions.js';
|
|
3
|
+
import { ellipse, line, rect } from '../sticker.js';
|
|
4
|
+
import { EXT, FACE, glow, LINE } from './shared.js';
|
|
5
|
+
const tick = (i) => {
|
|
6
|
+
const a = ((-90 + i * 120) * Math.PI) / 180;
|
|
7
|
+
const [x, y] = [Math.cos(a) * 84, Math.sin(a) * 84];
|
|
8
|
+
return {
|
|
9
|
+
parent: 'face',
|
|
10
|
+
a: [x, y],
|
|
11
|
+
p: [x, y],
|
|
12
|
+
m: [twinkle(24 + i * 30), twinkle(140, true)],
|
|
13
|
+
shapes: [{ d: ellipse(x, y, 12), fill: 'ok' }],
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export const timer = {
|
|
17
|
+
name: 'timer',
|
|
18
|
+
frames: 180,
|
|
19
|
+
line: LINE,
|
|
20
|
+
extrude: EXT,
|
|
21
|
+
layers: [
|
|
22
|
+
{ id: 'root', p: [250, 280], shapes: [] },
|
|
23
|
+
{
|
|
24
|
+
parent: 'root',
|
|
25
|
+
tilt: FACE,
|
|
26
|
+
m: { ...press, k: 0.4 },
|
|
27
|
+
shapes: [{ d: rect(-26, -170, 52, 40, 10), fill: 'deep', depth: 0.8 }],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'face',
|
|
31
|
+
parent: 'root',
|
|
32
|
+
tilt: FACE,
|
|
33
|
+
shapes: [
|
|
34
|
+
{ d: rect(-12, -144, 24, 30), fill: 'grey', depth: 0.6 },
|
|
35
|
+
{ d: ellipse(0, 0, 130), fill: 'main', depth: 1 },
|
|
36
|
+
{ d: ellipse(0, 0, 108), fill: 'white', depth: 0.2 },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
tick(0),
|
|
40
|
+
tick(1),
|
|
41
|
+
tick(2),
|
|
42
|
+
{
|
|
43
|
+
parent: 'face',
|
|
44
|
+
m: {
|
|
45
|
+
r: [
|
|
46
|
+
[24, 0, SNAP],
|
|
47
|
+
[34, 120, 0],
|
|
48
|
+
[54, 120, SNAP],
|
|
49
|
+
[64, 240, 0],
|
|
50
|
+
[84, 240, SNAP],
|
|
51
|
+
[94, 360],
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
shapes: [{ d: line([0, 0], [0, -72]), line: 10, round: true }],
|
|
55
|
+
},
|
|
56
|
+
{ parent: 'face', shapes: [{ d: ellipse(0, 0, 12), fill: 'deep' }] },
|
|
57
|
+
glow('root', [-170, -130], 22, [twinkle(94), twinkle(150, true)]),
|
|
58
|
+
],
|
|
59
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: an old Thai railway card ticket, a little train on it; the stub is punched and flicks.
|
|
2
|
+
import { flick, jolt, twinkle } from '../motions.js';
|
|
3
|
+
import { ellipse, line, rect } from '../sticker.js';
|
|
4
|
+
import { EXT, FACE, glow, LINE } from './shared.js';
|
|
5
|
+
const PERF = [-60, -36, -12, 12, 36, 60].map((y) => ({
|
|
6
|
+
d: ellipse(70, y, 4),
|
|
7
|
+
fill: 'ink',
|
|
8
|
+
line: false,
|
|
9
|
+
}));
|
|
10
|
+
export const trainTicket = {
|
|
11
|
+
name: 'train-ticket',
|
|
12
|
+
frames: 160,
|
|
13
|
+
line: LINE,
|
|
14
|
+
extrude: EXT,
|
|
15
|
+
layers: [
|
|
16
|
+
{ id: 'root', a: [0, 90], p: [256, 320], m: jolt(), shapes: [] },
|
|
17
|
+
{
|
|
18
|
+
id: 'ticket',
|
|
19
|
+
parent: 'root',
|
|
20
|
+
tilt: FACE,
|
|
21
|
+
shapes: [
|
|
22
|
+
{ d: rect(-160, -84, 236, 168, 14), fill: 'gold', depth: 0.6 },
|
|
23
|
+
{ d: rect(-134, -46, 96, 46, 12), fill: 'main', depth: 0.3 },
|
|
24
|
+
{ d: rect(-124, -36, 22, 16, 3), fill: 'white' },
|
|
25
|
+
{ d: rect(-94, -36, 22, 16, 3), fill: 'white' },
|
|
26
|
+
{ d: rect(-64, -36, 18, 16, 3), fill: 'white' },
|
|
27
|
+
{ d: ellipse(-116, 6, 9), fill: 'ink', line: false },
|
|
28
|
+
{ d: ellipse(-60, 6, 9), fill: 'ink', line: false },
|
|
29
|
+
{ d: line([-140, 22], [-30, 22]) },
|
|
30
|
+
{ d: line([-14, -40], [50, -40]) },
|
|
31
|
+
{ d: line([-14, -6], [36, -6], [26, -16]) },
|
|
32
|
+
{ d: line([-14, 30], [40, 30]) },
|
|
33
|
+
...PERF,
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: 'stub',
|
|
38
|
+
parent: 'ticket',
|
|
39
|
+
a: [72, 84],
|
|
40
|
+
p: [72, 84],
|
|
41
|
+
m: { ...flick, k: -1.6 },
|
|
42
|
+
shapes: [
|
|
43
|
+
{ d: rect(72, -84, 92, 168, 14), fill: 'gold', depth: 0.6 },
|
|
44
|
+
{ d: line([96, 20], [140, 20]) },
|
|
45
|
+
{ d: line([96, 44], [128, 44]) },
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
parent: 'stub',
|
|
50
|
+
a: [118, -36],
|
|
51
|
+
p: [118, -36],
|
|
52
|
+
m: [twinkle(18), twinkle(140, true)],
|
|
53
|
+
shapes: [{ d: ellipse(118, -36, 16), fill: 'white' }],
|
|
54
|
+
},
|
|
55
|
+
glow('root', [-180, -100], 22, [twinkle(30), twinkle(130, true)]),
|
|
56
|
+
],
|
|
57
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// Drawn for @20baht/stickers: a trash can; the lid swings open, a page drops in, the lid slams and the can jolts.
|
|
2
|
+
import { fall, jolt, SNAP, twinkle } from '../motions.js';
|
|
3
|
+
import { line, poly, rect } from '../sticker.js';
|
|
4
|
+
import { page } from './paper.js';
|
|
5
|
+
import { EXT, FACE, LINE } from './shared.js';
|
|
6
|
+
export const trash = {
|
|
7
|
+
name: 'trash',
|
|
8
|
+
frames: 160,
|
|
9
|
+
line: LINE,
|
|
10
|
+
extrude: EXT,
|
|
11
|
+
layers: [
|
|
12
|
+
{
|
|
13
|
+
id: 'root',
|
|
14
|
+
a: [0, 140],
|
|
15
|
+
p: [250, 380],
|
|
16
|
+
s: [82, 82],
|
|
17
|
+
m: { ...jolt([-3, 8]), at: 66 },
|
|
18
|
+
shapes: [],
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
parent: 'can',
|
|
22
|
+
m: [twinkle(14), fall([0, 160], 36, 22)],
|
|
23
|
+
op: 60,
|
|
24
|
+
shapes: page(-50, -250, 100, 130),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'can',
|
|
28
|
+
parent: 'root',
|
|
29
|
+
tilt: FACE,
|
|
30
|
+
shapes: [
|
|
31
|
+
{
|
|
32
|
+
d: poly([
|
|
33
|
+
[-104, -90],
|
|
34
|
+
[104, -90],
|
|
35
|
+
[84, 140],
|
|
36
|
+
[-84, 140],
|
|
37
|
+
], [4, 4, 16, 16]),
|
|
38
|
+
fill: 'main',
|
|
39
|
+
depth: 1,
|
|
40
|
+
},
|
|
41
|
+
...[-50, 0, 50].map((x) => ({ d: line([x, -60], [x * 0.85, 110]) })),
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
parent: 'can',
|
|
46
|
+
a: [-116, -96],
|
|
47
|
+
p: [-116, -96],
|
|
48
|
+
m: {
|
|
49
|
+
r: [
|
|
50
|
+
[8, 0, SNAP],
|
|
51
|
+
[26, -30, 0],
|
|
52
|
+
[56, -30, SNAP],
|
|
53
|
+
[66, 0],
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
shapes: [
|
|
57
|
+
{ d: rect(-30, -132, 60, 24, 10), fill: 'deep', depth: 0.5 },
|
|
58
|
+
{ d: rect(-120, -116, 240, 30, 12), fill: 'deep', depth: 0.8 },
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
};
|