hivedesk 0.2.1 → 1.0.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/CHANGELOG.md +49 -1
- package/FIRST-RUN.md +14 -20
- package/PROTOCOL.md +19 -3
- package/README.md +303 -238
- package/assets/banner-1.0-pt.png +0 -0
- package/assets/banner-1.0-pt.svg +6 -0
- package/assets/banner-1.0.png +0 -0
- package/assets/banner-1.0.svg +6 -0
- package/assets/banner.png +0 -0
- package/assets/banner.svg +1 -513
- package/assets/crew/designer.svg +1 -42
- package/assets/crew/dev.svg +1 -43
- package/assets/crew/mel.svg +1 -44
- package/assets/crew/qa.svg +1 -43
- package/assets/crew/writer.svg +1 -40
- package/assets/icons/1.0/achievements.svg +1 -0
- package/assets/icons/1.0/api.svg +1 -0
- package/assets/icons/1.0/auto-update.svg +1 -0
- package/assets/icons/1.0/city.svg +1 -0
- package/assets/icons/1.0/cli.svg +1 -0
- package/assets/icons/1.0/clipboard.svg +1 -0
- package/assets/icons/1.0/contact-sheet.svg +1 -0
- package/assets/icons/1.0/cpu-share.svg +1 -0
- package/assets/icons/1.0/crew.svg +1 -0
- package/assets/icons/1.0/data.svg +1 -0
- package/assets/icons/1.0/desktop.svg +1 -0
- package/assets/icons/1.0/editor.svg +1 -0
- package/assets/icons/1.0/extension.svg +1 -0
- package/assets/icons/1.0/file-send.svg +1 -0
- package/assets/icons/1.0/game.svg +1 -0
- package/assets/icons/1.0/git.svg +1 -0
- package/assets/icons/1.0/github.svg +1 -0
- package/assets/icons/1.0/gpu-share.svg +1 -0
- package/assets/icons/1.0/installer.svg +1 -0
- package/assets/icons/1.0/languages.svg +1 -0
- package/assets/icons/1.0/linkedin.svg +1 -0
- package/assets/icons/1.0/machines.svg +1 -0
- package/assets/icons/1.0/mobile.svg +1 -0
- package/assets/icons/1.0/models.svg +1 -0
- package/assets/icons/1.0/p2p-invite.svg +1 -0
- package/assets/icons/1.0/phone-remote.svg +1 -0
- package/assets/icons/1.0/playbooks.svg +1 -0
- package/assets/icons/1.0/pooled-models.svg +1 -0
- package/assets/icons/1.0/privacy.svg +1 -0
- package/assets/icons/1.0/profile.svg +1 -0
- package/assets/icons/1.0/question-card.svg +1 -0
- package/assets/icons/1.0/remote-desktop.svg +1 -0
- package/assets/icons/1.0/rotation.svg +1 -0
- package/assets/icons/1.0/security-audit.svg +1 -0
- package/assets/icons/1.0/sprite.svg +85 -0
- package/assets/icons/1.0/terminal.svg +1 -0
- package/assets/icons/1.0/tiles/achievements.svg +1 -0
- package/assets/icons/1.0/tiles/api.svg +1 -0
- package/assets/icons/1.0/tiles/auto-update.svg +1 -0
- package/assets/icons/1.0/tiles/city.svg +1 -0
- package/assets/icons/1.0/tiles/cli.svg +1 -0
- package/assets/icons/1.0/tiles/clipboard.svg +1 -0
- package/assets/icons/1.0/tiles/cpu-share.svg +1 -0
- package/assets/icons/1.0/tiles/crew.svg +1 -0
- package/assets/icons/1.0/tiles/data.svg +1 -0
- package/assets/icons/1.0/tiles/desktop.svg +1 -0
- package/assets/icons/1.0/tiles/editor.svg +1 -0
- package/assets/icons/1.0/tiles/extension.svg +1 -0
- package/assets/icons/1.0/tiles/file-send.svg +1 -0
- package/assets/icons/1.0/tiles/game.svg +1 -0
- package/assets/icons/1.0/tiles/git.svg +1 -0
- package/assets/icons/1.0/tiles/github.svg +1 -0
- package/assets/icons/1.0/tiles/gpu-share.svg +1 -0
- package/assets/icons/1.0/tiles/installer.svg +1 -0
- package/assets/icons/1.0/tiles/languages.svg +1 -0
- package/assets/icons/1.0/tiles/machines.svg +1 -0
- package/assets/icons/1.0/tiles/mobile.svg +1 -0
- package/assets/icons/1.0/tiles/models.svg +1 -0
- package/assets/icons/1.0/tiles/p2p-invite.svg +1 -0
- package/assets/icons/1.0/tiles/phone-remote.svg +1 -0
- package/assets/icons/1.0/tiles/playbooks.svg +1 -0
- package/assets/icons/1.0/tiles/pooled-models.svg +1 -0
- package/assets/icons/1.0/tiles/privacy.svg +1 -0
- package/assets/icons/1.0/tiles/profile.svg +1 -0
- package/assets/icons/1.0/tiles/question-card.svg +1 -0
- package/assets/icons/1.0/tiles/remote-desktop.svg +1 -0
- package/assets/icons/1.0/tiles/rotation.svg +1 -0
- package/assets/icons/1.0/tiles/security-audit.svg +1 -0
- package/assets/icons/1.0/tiles/terminal.svg +1 -0
- package/assets/icons/1.0/tiles/voice.svg +1 -0
- package/assets/icons/1.0/tiles/web.svg +1 -0
- package/assets/icons/1.0/voice.svg +1 -0
- package/assets/icons/1.0/web.svg +1 -0
- package/assets/icons/approval.svg +1 -1
- package/assets/icons/arrow.svg +1 -1
- package/assets/icons/chat.svg +1 -1
- package/assets/icons/check.svg +1 -1
- package/assets/icons/clock.svg +1 -1
- package/assets/icons/code.svg +1 -1
- package/assets/icons/compass.svg +1 -1
- package/assets/icons/contact-sheet.svg +1 -1
- package/assets/icons/copy.svg +1 -1
- package/assets/icons/cpu.svg +1 -1
- package/assets/icons/design.svg +1 -1
- package/assets/icons/download.svg +1 -1
- package/assets/icons/folder.svg +1 -1
- package/assets/icons/github-honey.svg +1 -1
- package/assets/icons/github.svg +1 -1
- package/assets/icons/globe.svg +1 -1
- package/assets/icons/gpu.svg +1 -1
- package/assets/icons/hire.svg +1 -1
- package/assets/icons/hive.svg +1 -1
- package/assets/icons/honey/approval.svg +1 -0
- package/assets/icons/honey/chat.svg +1 -0
- package/assets/icons/honey/code.svg +1 -0
- package/assets/icons/honey/design.svg +1 -0
- package/assets/icons/honey/github.svg +1 -0
- package/assets/icons/honey/globe.svg +1 -0
- package/assets/icons/honey/gpu.svg +1 -0
- package/assets/icons/honey/hire.svg +1 -0
- package/assets/icons/honey/hive.svg +1 -0
- package/assets/icons/honey/key.svg +1 -0
- package/assets/icons/honey/lend.svg +1 -0
- package/assets/icons/honey/lock.svg +1 -0
- package/assets/icons/honey/model.svg +1 -0
- package/assets/icons/honey/office.svg +1 -0
- package/assets/icons/honey/plan.svg +1 -0
- package/assets/icons/honey/playbook.svg +1 -0
- package/assets/icons/honey/qa.svg +1 -0
- package/assets/icons/honey/replay.svg +1 -0
- package/assets/icons/honey/sparkle.svg +1 -0
- package/assets/icons/honey/wand.svg +1 -0
- package/assets/icons/key.svg +1 -1
- package/assets/icons/lend.svg +1 -1
- package/assets/icons/linkedin-honey.svg +1 -1
- package/assets/icons/linkedin.svg +1 -1
- package/assets/icons/linux.svg +1 -1
- package/assets/icons/lock.svg +1 -1
- package/assets/icons/macos.svg +1 -1
- package/assets/icons/model.svg +1 -1
- package/assets/icons/npm.svg +1 -1
- package/assets/icons/office.svg +1 -1
- package/assets/icons/offline.svg +1 -1
- package/assets/icons/plan.svg +1 -1
- package/assets/icons/playbook.svg +1 -1
- package/assets/icons/preview.svg +1 -1
- package/assets/icons/qa.svg +1 -1
- package/assets/icons/queue.svg +1 -1
- package/assets/icons/replay.svg +1 -1
- package/assets/icons/search.svg +1 -0
- package/assets/icons/sparkle.svg +1 -1
- package/assets/icons/sprite.svg +12 -11
- package/assets/icons/star.svg +1 -1
- package/assets/icons/stop.svg +1 -1
- package/assets/icons/tag.svg +1 -1
- package/assets/icons/terminal.svg +1 -1
- package/assets/icons/wand.svg +1 -1
- package/assets/icons/windows.svg +1 -1
- package/assets/icons/words.svg +1 -1
- package/assets/icons/writer.svg +1 -1
- package/assets/icons/x.svg +1 -1
- package/assets/illustrations/1.0/hero-plain.svg +6 -0
- package/assets/illustrations/1.0/hero-pt.svg +6 -0
- package/assets/illustrations/1.0/hero.svg +6 -0
- package/assets/illustrations/1.0/how-it-works-pt.svg +6 -0
- package/assets/illustrations/1.0/how-it-works.svg +6 -0
- package/assets/illustrations/1.0/installers-pt.svg +6 -0
- package/assets/illustrations/1.0/installers.svg +6 -0
- package/assets/illustrations/1.0/p2p-gpu-pt.svg +6 -0
- package/assets/illustrations/1.0/p2p-gpu.svg +6 -0
- package/assets/illustrations/1.0/phone-remote.svg +6 -0
- package/assets/illustrations/1.0/remote-desktop-pt.svg +6 -0
- package/assets/illustrations/1.0/remote-desktop.svg +6 -0
- package/assets/illustrations/1.0/security.svg +6 -0
- package/assets/illustrations/1.0/voice-orb.svg +6 -0
- package/assets/illustrations/bee.svg +1 -27
- package/assets/illustrations/city-p2p-pt.svg +113 -0
- package/assets/illustrations/city-p2p.svg +113 -0
- package/assets/illustrations/crew.svg +1 -248
- package/assets/illustrations/first-run.svg +1 -48
- package/assets/illustrations/hardware.svg +1 -39
- package/assets/illustrations/hive-city.svg +1 -113
- package/assets/illustrations/lend.svg +1 -67
- package/assets/illustrations/privacy.svg +1 -39
- package/assets/illustrations/steps-pt.svg +1 -0
- package/assets/illustrations/steps.svg +1 -0
- package/assets/logo.svg +1 -13
- package/assets/mascot-dark.svg +1 -197
- package/assets/mascot.png +0 -0
- package/assets/mascot.svg +1 -194
- package/assets/mel-wave.svg +1 -205
- package/assets/og.svg +5 -254
- package/assets/screenshots/1.0/chat.webp +0 -0
- package/assets/screenshots/1.0/city-mobile.webp +0 -0
- package/assets/screenshots/1.0/city-room.webp +0 -0
- package/assets/screenshots/1.0/city.webp +0 -0
- package/assets/screenshots/1.0/editor.webp +0 -0
- package/assets/screenshots/1.0/machines.webp +0 -0
- package/assets/screenshots/1.0/office-mobile.webp +0 -0
- package/assets/screenshots/1.0/office.webp +0 -0
- package/assets/screenshots/1.0/profile.webp +0 -0
- package/assets/screenshots/1.0/remote.webp +0 -0
- package/assets/social-preview.png +0 -0
- package/assets/social-preview.svg +5 -254
- package/desktop/README.md +85 -10
- package/desktop/RELEASE.md +93 -0
- package/desktop/app/resources/icons/trayIconRemote.png +0 -0
- package/desktop/app/resources/icons/trayIconRemote@2x.png +0 -0
- package/desktop/controller.js +204 -11
- package/desktop/helpers/win-input.ps1 +426 -0
- package/desktop/i18n.json +480 -10
- package/desktop/icons/tray-remote.svg +5 -0
- package/desktop/installer/linux/hivedesk-linux-install.sh +124 -0
- package/desktop/installer/macos/Read me first.txt +36 -0
- package/desktop/installer/macos/background.html +43 -0
- package/desktop/installer/macos/background.png +0 -0
- package/desktop/installer/macos/background@2x.png +0 -0
- package/desktop/installer/macos/make-dmg.sh +59 -0
- package/desktop/installer/windows/Art.xaml +158 -0
- package/desktop/installer/windows/Core.cs +1019 -0
- package/desktop/installer/windows/Setup.cs +504 -0
- package/desktop/installer/windows/Theme.xaml +268 -0
- package/desktop/installer/windows/Ui.cs +1069 -0
- package/desktop/installer/windows/app.manifest +23 -0
- package/desktop/installer/windows/strings.json +1012 -0
- package/desktop/launcher/linux/hivedesk +5 -0
- package/desktop/launcher/windows/Launcher.cs +10 -0
- package/desktop/native.js +53 -1
- package/desktop/profile/avatars.json +147 -0
- package/desktop/profile/index.js +53 -0
- package/desktop/release-notes/1.0.0.json +12 -0
- package/desktop/release-notes/1.0.1.json +12 -0
- package/desktop/scripts/build-setup.mjs +86 -0
- package/desktop/scripts/dmg-art.mjs +27 -0
- package/desktop/scripts/manifest.mjs +57 -0
- package/desktop/scripts/package.mjs +134 -117
- package/desktop/scripts/shell-screens.mjs +60 -0
- package/desktop/scripts/sign-release.mjs +79 -0
- package/desktop/scripts/update-keygen.mjs +48 -0
- package/desktop/shell.html +300 -3
- package/desktop/state.js +4 -2
- package/desktop/update/apply.js +268 -0
- package/desktop/update/download.js +114 -0
- package/desktop/update/guard.js +89 -0
- package/desktop/update/layout.js +52 -0
- package/desktop/update/manifest.js +120 -0
- package/desktop/update/pubkey.js +3 -0
- package/desktop/update/service.js +310 -0
- package/desktop/update/tar.js +65 -0
- package/desktop/update/version.js +43 -0
- package/desktop/workarea.js +440 -0
- package/desktop/zip.js +75 -1
- package/i18n/README.pt-BR.md +304 -218
- package/i18n/de.json +1791 -0
- package/i18n/en.json +1791 -0
- package/i18n/es.json +1791 -0
- package/i18n/fr.json +1791 -0
- package/i18n/it.json +1791 -0
- package/i18n/ja.json +1791 -0
- package/i18n/ko.json +1791 -0
- package/i18n/parts/city.de.json +312 -0
- package/i18n/parts/city.en.json +312 -0
- package/i18n/parts/city.es.json +312 -0
- package/i18n/parts/city.fr.json +312 -0
- package/i18n/parts/city.it.json +312 -0
- package/i18n/parts/city.ja.json +312 -0
- package/i18n/parts/city.ko.json +312 -0
- package/i18n/parts/city.pt-BR.json +312 -0
- package/i18n/parts/city.ru.json +312 -0
- package/i18n/parts/city.zh-CN.json +312 -0
- package/i18n/parts/design.de.json +132 -0
- package/i18n/parts/design.en.json +132 -0
- package/i18n/parts/design.es.json +132 -0
- package/i18n/parts/design.fr.json +132 -0
- package/i18n/parts/design.it.json +132 -0
- package/i18n/parts/design.ja.json +132 -0
- package/i18n/parts/design.ko.json +132 -0
- package/i18n/parts/design.pt-BR.json +132 -0
- package/i18n/parts/design.ru.json +132 -0
- package/i18n/parts/design.zh-CN.json +132 -0
- package/i18n/parts/domains.de.json +263 -0
- package/i18n/parts/domains.en.json +263 -0
- package/i18n/parts/domains.es.json +263 -0
- package/i18n/parts/domains.fr.json +263 -0
- package/i18n/parts/domains.it.json +263 -0
- package/i18n/parts/domains.ja.json +263 -0
- package/i18n/parts/domains.ko.json +263 -0
- package/i18n/parts/domains.pt-BR.json +263 -0
- package/i18n/parts/domains.ru.json +263 -0
- package/i18n/parts/domains.zh-CN.json +263 -0
- package/i18n/parts/downloads.de.json +29 -0
- package/i18n/parts/downloads.en.json +29 -0
- package/i18n/parts/downloads.es.json +29 -0
- package/i18n/parts/downloads.fr.json +29 -0
- package/i18n/parts/downloads.it.json +29 -0
- package/i18n/parts/downloads.ja.json +29 -0
- package/i18n/parts/downloads.ko.json +29 -0
- package/i18n/parts/downloads.pt-BR.json +29 -0
- package/i18n/parts/downloads.ru.json +29 -0
- package/i18n/parts/downloads.zh-CN.json +29 -0
- package/i18n/parts/office.de.json +184 -0
- package/i18n/parts/office.en.json +184 -0
- package/i18n/parts/office.es.json +184 -0
- package/i18n/parts/office.fr.json +184 -0
- package/i18n/parts/office.it.json +184 -0
- package/i18n/parts/office.ja.json +184 -0
- package/i18n/parts/office.ko.json +184 -0
- package/i18n/parts/office.pt-BR.json +184 -0
- package/i18n/parts/office.ru.json +184 -0
- package/i18n/parts/office.zh-CN.json +184 -0
- package/i18n/parts/s1-core.de.json +33 -0
- package/i18n/parts/s1-core.en.json +33 -0
- package/i18n/parts/s1-core.es.json +33 -0
- package/i18n/parts/s1-core.fr.json +33 -0
- package/i18n/parts/s1-core.it.json +33 -0
- package/i18n/parts/s1-core.ja.json +33 -0
- package/i18n/parts/s1-core.ko.json +33 -0
- package/i18n/parts/s1-core.pt-BR.json +33 -0
- package/i18n/parts/s1-core.ru.json +33 -0
- package/i18n/parts/s1-core.zh-CN.json +33 -0
- package/i18n/parts/s2-p2p.de.json +58 -0
- package/i18n/parts/s2-p2p.en.json +58 -0
- package/i18n/parts/s2-p2p.es.json +58 -0
- package/i18n/parts/s2-p2p.fr.json +58 -0
- package/i18n/parts/s2-p2p.it.json +58 -0
- package/i18n/parts/s2-p2p.ja.json +58 -0
- package/i18n/parts/s2-p2p.ko.json +58 -0
- package/i18n/parts/s2-p2p.pt-BR.json +58 -0
- package/i18n/parts/s2-p2p.ru.json +58 -0
- package/i18n/parts/s2-p2p.zh-CN.json +58 -0
- package/i18n/parts/s3-compute.de.json +63 -0
- package/i18n/parts/s3-compute.en.json +63 -0
- package/i18n/parts/s3-compute.es.json +63 -0
- package/i18n/parts/s3-compute.fr.json +63 -0
- package/i18n/parts/s3-compute.it.json +63 -0
- package/i18n/parts/s3-compute.ja.json +63 -0
- package/i18n/parts/s3-compute.ko.json +63 -0
- package/i18n/parts/s3-compute.pt-BR.json +63 -0
- package/i18n/parts/s3-compute.ru.json +63 -0
- package/i18n/parts/s3-compute.zh-CN.json +63 -0
- package/i18n/parts/s6-remote.de.json +169 -0
- package/i18n/parts/s6-remote.en.json +169 -0
- package/i18n/parts/s6-remote.es.json +169 -0
- package/i18n/parts/s6-remote.fr.json +169 -0
- package/i18n/parts/s6-remote.it.json +169 -0
- package/i18n/parts/s6-remote.ja.json +169 -0
- package/i18n/parts/s6-remote.ko.json +169 -0
- package/i18n/parts/s6-remote.pt-BR.json +169 -0
- package/i18n/parts/s6-remote.ru.json +169 -0
- package/i18n/parts/s6-remote.zh-CN.json +169 -0
- package/i18n/parts/s7-phone.de.json +41 -0
- package/i18n/parts/s7-phone.en.json +41 -0
- package/i18n/parts/s7-phone.es.json +41 -0
- package/i18n/parts/s7-phone.fr.json +41 -0
- package/i18n/parts/s7-phone.it.json +41 -0
- package/i18n/parts/s7-phone.ja.json +41 -0
- package/i18n/parts/s7-phone.ko.json +41 -0
- package/i18n/parts/s7-phone.pt-BR.json +41 -0
- package/i18n/parts/s7-phone.ru.json +41 -0
- package/i18n/parts/s7-phone.zh-CN.json +41 -0
- package/i18n/parts/voice.de.json +135 -0
- package/i18n/parts/voice.en.json +135 -0
- package/i18n/parts/voice.es.json +135 -0
- package/i18n/parts/voice.fr.json +135 -0
- package/i18n/parts/voice.it.json +135 -0
- package/i18n/parts/voice.ja.json +135 -0
- package/i18n/parts/voice.ko.json +135 -0
- package/i18n/parts/voice.pt-BR.json +135 -0
- package/i18n/parts/voice.ru.json +135 -0
- package/i18n/parts/voice.zh-CN.json +135 -0
- package/i18n/parts/workbench.de.json +331 -0
- package/i18n/parts/workbench.en.json +331 -0
- package/i18n/parts/workbench.es.json +331 -0
- package/i18n/parts/workbench.fr.json +331 -0
- package/i18n/parts/workbench.it.json +331 -0
- package/i18n/parts/workbench.ja.json +331 -0
- package/i18n/parts/workbench.ko.json +331 -0
- package/i18n/parts/workbench.pt-BR.json +331 -0
- package/i18n/parts/workbench.ru.json +331 -0
- package/i18n/parts/workbench.zh-CN.json +331 -0
- package/i18n/pt-BR.json +1791 -0
- package/i18n/ru.json +1791 -0
- package/i18n/zh-CN.json +1791 -0
- package/package.json +11 -2
- package/src/brain/catalog/catalog.json +15790 -0
- package/src/brain/catalog/commands.js +105 -0
- package/src/brain/catalog/consent.js +90 -0
- package/src/brain/catalog/estimate.js +90 -0
- package/src/brain/catalog/families.js +196 -0
- package/src/brain/catalog/index.js +127 -0
- package/src/brain/catalog/measured.js +27 -0
- package/src/brain/catalog/pool.js +137 -0
- package/src/brain/catalog/recommend.js +226 -0
- package/src/brain/catalog/refresh.mjs +166 -0
- package/src/brain/catalog/router.js +193 -0
- package/src/brain/hardware.js +144 -13
- package/src/brain/keys.js +3 -1
- package/src/brain/local.js +24 -2
- package/src/brain/manager.js +380 -66
- package/src/brain/models.js +208 -46
- package/src/brain/pool/index.js +208 -0
- package/src/brain/pool/lender.js +247 -0
- package/src/brain/pool/llama-release.json +86 -0
- package/src/brain/pool/p2p.js +264 -0
- package/src/brain/pool/refresh-release.mjs +53 -0
- package/src/brain/pool/release.js +94 -0
- package/src/brain/pool/session.js +76 -0
- package/src/brain/pool/tunnel.js +161 -0
- package/src/brain/rotation.js +289 -0
- package/src/brain/runtime.js +64 -14
- package/src/bus.js +10 -135
- package/src/changelog/index.js +9 -1
- package/src/city/demo.js +4 -3
- package/src/city/index.js +254 -53
- package/src/city/membership.js +347 -0
- package/src/city/state.js +156 -8
- package/src/cli.js +172 -69
- package/src/compute/estimate.js +135 -0
- package/src/compute/index.js +295 -0
- package/src/compute/jobs-log.js +37 -0
- package/src/compute/probe.js +335 -0
- package/src/compute/requester.js +518 -0
- package/src/compute/scheduler.js +264 -0
- package/src/compute/share-cli.js +122 -0
- package/src/compute/share.js +178 -0
- package/src/compute/task-bridge.js +64 -0
- package/src/compute/types.js +114 -0
- package/src/compute/win-gpu.js +248 -0
- package/src/compute/wire.js +234 -0
- package/src/compute/worker.js +367 -0
- package/src/core/bus.js +254 -0
- package/src/core/city-report.js +52 -0
- package/src/core/deadline.js +78 -0
- package/src/core/demo.js +49 -0
- package/src/core/doctor-checks.js +61 -0
- package/src/core/events.js +116 -0
- package/src/core/log.js +147 -0
- package/src/core/migrate.js +145 -0
- package/src/core/origin.js +62 -0
- package/src/core/router.js +196 -0
- package/src/core/schema.js +73 -0
- package/src/core/shell.js +160 -0
- package/src/core/snapshots.js +58 -0
- package/src/core/store.js +130 -0
- package/src/crew/brief.js +2 -0
- package/src/crew/domains/attach.js +32 -0
- package/src/crew/domains/classify.js +176 -0
- package/src/crew/domains/flow.js +270 -0
- package/src/crew/domains/index.js +116 -0
- package/src/crew/domains/questions.js +551 -0
- package/src/crew/domains/security/advisories.json +35 -0
- package/src/crew/domains/security/fixes.js +98 -0
- package/src/crew/domains/security/scan.js +274 -0
- package/src/crew/domains/skeletons.js +77 -0
- package/src/crew/domains/templates/backend/README.md +27 -0
- package/src/crew/domains/templates/backend/package.json +12 -0
- package/src/crew/domains/templates/backend/src/app.js +70 -0
- package/src/crew/domains/templates/backend/src/server.js +61 -0
- package/src/crew/domains/templates/backend/test/api.test.js +47 -0
- package/src/crew/domains/templates/cli/README.md +18 -0
- package/src/crew/domains/templates/cli/bin/cli.js +48 -0
- package/src/crew/domains/templates/cli/package.json +12 -0
- package/src/crew/domains/templates/cli/src/lib.js +20 -0
- package/src/crew/domains/templates/cli/test/cli.test.js +43 -0
- package/src/crew/domains/templates/data/README.md +17 -0
- package/src/crew/domains/templates/data/bin/run.js +34 -0
- package/src/crew/domains/templates/data/data/sample.csv +7 -0
- package/src/crew/domains/templates/data/package.json +11 -0
- package/src/crew/domains/templates/data/src/csv.js +48 -0
- package/src/crew/domains/templates/data/src/report.js +39 -0
- package/src/crew/domains/templates/data/test/report.test.js +40 -0
- package/src/crew/domains/templates/desktop/README.md +17 -0
- package/src/crew/domains/templates/desktop/neutralino.config.json +34 -0
- package/src/crew/domains/templates/desktop/package.json +13 -0
- package/src/crew/domains/templates/desktop/resources/index.html +24 -0
- package/src/crew/domains/templates/desktop/resources/js/main.js +57 -0
- package/src/crew/domains/templates/desktop/resources/js/notes.js +25 -0
- package/src/crew/domains/templates/desktop/resources/styles.css +12 -0
- package/src/crew/domains/templates/desktop/test/notes.test.js +20 -0
- package/src/crew/domains/templates/extension/README.md +16 -0
- package/src/crew/domains/templates/extension/background.js +18 -0
- package/src/crew/domains/templates/extension/manifest.json +13 -0
- package/src/crew/domains/templates/extension/package.json +10 -0
- package/src/crew/domains/templates/extension/popup.css +11 -0
- package/src/crew/domains/templates/extension/popup.html +19 -0
- package/src/crew/domains/templates/extension/popup.js +34 -0
- package/src/crew/domains/templates/extension/src/notes.js +20 -0
- package/src/crew/domains/templates/extension/test/notes.test.js +25 -0
- package/src/crew/domains/templates/game/README.md +13 -0
- package/src/crew/domains/templates/game/index.html +18 -0
- package/src/crew/domains/templates/game/package.json +10 -0
- package/src/crew/domains/templates/game/src/game.js +58 -0
- package/src/crew/domains/templates/game/src/main.js +76 -0
- package/src/crew/domains/templates/game/style.css +9 -0
- package/src/crew/domains/templates/game/test/game.test.js +45 -0
- package/src/crew/domains/templates/mobile/README.md +25 -0
- package/src/crew/domains/templates/mobile/capacitor.config.json +8 -0
- package/src/crew/domains/templates/mobile/package.json +14 -0
- package/src/crew/domains/templates/mobile/test/store.test.js +27 -0
- package/src/crew/domains/templates/mobile/www/app.js +42 -0
- package/src/crew/domains/templates/mobile/www/icon.svg +1 -0
- package/src/crew/domains/templates/mobile/www/index.html +30 -0
- package/src/crew/domains/templates/mobile/www/manifest.webmanifest +12 -0
- package/src/crew/domains/templates/mobile/www/store.js +35 -0
- package/src/crew/domains/templates/mobile/www/style.css +42 -0
- package/src/crew/domains/templates/mobile/www/sw.js +16 -0
- package/src/crew/domains/text.js +34 -0
- package/src/crew/engine.js +448 -53
- package/src/crew/legacy.js +72 -0
- package/src/crew/library/checks.js +574 -0
- package/src/crew/library/entries/app-types/appointment-booking.json +53 -0
- package/src/crew/library/entries/app-types/brick-breaker-game.json +50 -0
- package/src/crew/library/entries/app-types/budget-tracker-app.json +55 -0
- package/src/crew/library/entries/app-types/calculator-app.json +48 -0
- package/src/crew/library/entries/app-types/chat-ui-local.json +53 -0
- package/src/crew/library/entries/app-types/color-sequence-game.json +50 -0
- package/src/crew/library/entries/app-types/contact-book.json +52 -0
- package/src/crew/library/entries/app-types/countdown-to-date.json +53 -0
- package/src/crew/library/entries/app-types/crud-records-manager.json +56 -0
- package/src/crew/library/entries/app-types/currency-converter.json +50 -0
- package/src/crew/library/entries/app-types/dashboard-from-json.json +53 -0
- package/src/crew/library/entries/app-types/dice-roller.json +51 -0
- package/src/crew/library/entries/app-types/drawing-canvas.json +52 -0
- package/src/crew/library/entries/app-types/expense-splitter.json +54 -0
- package/src/crew/library/entries/app-types/flashcards-spaced-repetition.json +55 -0
- package/src/crew/library/entries/app-types/four-in-a-row-game.json +50 -0
- package/src/crew/library/entries/app-types/guess-the-number.json +50 -0
- package/src/crew/library/entries/app-types/habit-tracker.json +52 -0
- package/src/crew/library/entries/app-types/hangman-game.json +50 -0
- package/src/crew/library/entries/app-types/image-filters-canvas.json +49 -0
- package/src/crew/library/entries/app-types/inventory-tracker.json +53 -0
- package/src/crew/library/entries/app-types/kanban-board-app.json +53 -0
- package/src/crew/library/entries/app-types/loan-calculator.json +52 -0
- package/src/crew/library/entries/app-types/markdown-editor-preview.json +47 -0
- package/src/crew/library/entries/app-types/markdown-notes-app.json +53 -0
- package/src/crew/library/entries/app-types/maze-game.json +48 -0
- package/src/crew/library/entries/app-types/memory-card-game.json +52 -0
- package/src/crew/library/entries/app-types/metronome-web-audio.json +51 -0
- package/src/crew/library/entries/app-types/mines-grid-game.json +49 -0
- package/src/crew/library/entries/app-types/month-calendar.json +53 -0
- package/src/crew/library/entries/app-types/music-playlist-player.json +51 -0
- package/src/crew/library/entries/app-types/name-picker-wheel.json +52 -0
- package/src/crew/library/entries/app-types/password-generator.json +48 -0
- package/src/crew/library/entries/app-types/poll-voting.json +50 -0
- package/src/crew/library/entries/app-types/pomodoro-timer.json +54 -0
- package/src/crew/library/entries/app-types/quiz-app.json +53 -0
- package/src/crew/library/entries/app-types/reading-list.json +52 -0
- package/src/crew/library/entries/app-types/recipe-box.json +52 -0
- package/src/crew/library/entries/app-types/rock-paper-scissors.json +50 -0
- package/src/crew/library/entries/app-types/shopping-list.json +50 -0
- package/src/crew/library/entries/app-types/sliding-tiles-merge-game.json +51 -0
- package/src/crew/library/entries/app-types/snake-game.json +50 -0
- package/src/crew/library/entries/app-types/stopwatch-laps.json +50 -0
- package/src/crew/library/entries/app-types/sudoku-game.json +48 -0
- package/src/crew/library/entries/app-types/table-tennis-game.json +47 -0
- package/src/crew/library/entries/app-types/tap-to-fly-game.json +51 -0
- package/src/crew/library/entries/app-types/tic-tac-toe-game.json +49 -0
- package/src/crew/library/entries/app-types/time-tracker.json +51 -0
- package/src/crew/library/entries/app-types/tip-calculator.json +52 -0
- package/src/crew/library/entries/app-types/todo-list-app.json +52 -0
- package/src/crew/library/entries/app-types/typing-speed-test.json +51 -0
- package/src/crew/library/entries/app-types/unit-converter.json +52 -0
- package/src/crew/library/entries/app-types/weather-card-json.json +50 -0
- package/src/crew/library/entries/app-types/whack-a-mole-game.json +52 -0
- package/src/crew/library/entries/app-types/word-guess-game.json +51 -0
- package/src/crew/library/entries/backend/api-docs-markdown-contract.json +41 -0
- package/src/crew/library/entries/backend/api-etag-conditional-requests.json +41 -0
- package/src/crew/library/entries/backend/api-key-quotas-sliding-window.json +41 -0
- package/src/crew/library/entries/backend/api-resource-modeling.json +41 -0
- package/src/crew/library/entries/backend/api-tests-random-port.json +42 -0
- package/src/crew/library/entries/backend/api-versioning-policy.json +41 -0
- package/src/crew/library/entries/backend/config-environments-secret-files.json +41 -0
- package/src/crew/library/entries/backend/cors-policy-decisions.json +40 -0
- package/src/crew/library/entries/backend/health-readiness-endpoints.json +43 -0
- package/src/crew/library/entries/backend/http-error-class-handler.json +42 -0
- package/src/crew/library/entries/backend/in-process-job-queue.json +42 -0
- package/src/crew/library/entries/backend/json-body-reader-limits.json +41 -0
- package/src/crew/library/entries/backend/jwt-token-pitfalls.json +43 -0
- package/src/crew/library/entries/backend/keyset-pagination-filters.json +41 -0
- package/src/crew/library/entries/backend/legacy-password-hash-migration.json +42 -0
- package/src/crew/library/entries/backend/node-http-router-module.json +42 -0
- package/src/crew/library/entries/backend/request-id-async-context.json +40 -0
- package/src/crew/library/entries/backend/role-permission-checks.json +42 -0
- package/src/crew/library/entries/backend/route-input-schemas.json +40 -0
- package/src/crew/library/entries/backend/server-session-store.json +42 -0
- package/src/crew/library/entries/backend/shutdown-order-and-test.json +42 -0
- package/src/crew/library/entries/backend/sql-file-migrations.json +41 -0
- package/src/crew/library/entries/backend/sql-params-transactions.json +41 -0
- package/src/crew/library/entries/backend/upload-stream-to-disk.json +42 -0
- package/src/crew/library/entries/backend/webhook-receiver-hmac.json +42 -0
- package/src/crew/library/entries/data/accessible-chart-fallback.json +39 -0
- package/src/crew/library/entries/data/app-data-model-design.json +38 -0
- package/src/crew/library/entries/data/backup-restore-json.json +37 -0
- package/src/crew/library/entries/data/calendar-heatmap.json +41 -0
- package/src/crew/library/entries/data/csv-export-download.json +38 -0
- package/src/crew/library/entries/data/csv-parse-quoted.json +37 -0
- package/src/crew/library/entries/data/data-cleaning-normalize.json +37 -0
- package/src/crew/library/entries/data/dates-timezones-intl.json +37 -0
- package/src/crew/library/entries/data/dedupe-records.json +36 -0
- package/src/crew/library/entries/data/file-import-json-csv.json +42 -0
- package/src/crew/library/entries/data/form-validation-client.json +39 -0
- package/src/crew/library/entries/data/fuzzy-search-ranking.json +38 -0
- package/src/crew/library/entries/data/haversine-distance.json +39 -0
- package/src/crew/library/entries/data/histogram-binning.json +38 -0
- package/src/crew/library/entries/data/ids-random-uuid.json +36 -0
- package/src/crew/library/entries/data/intl-collator-sorting.json +37 -0
- package/src/crew/library/entries/data/join-merge-datasets.json +37 -0
- package/src/crew/library/entries/data/json-group-transform.json +38 -0
- package/src/crew/library/entries/data/list-search-filter-sort.json +39 -0
- package/src/crew/library/entries/data/localstorage-versioned-state.json +37 -0
- package/src/crew/library/entries/data/log-line-parsing.json +40 -0
- package/src/crew/library/entries/data/markdown-to-html-safe.json +36 -0
- package/src/crew/library/entries/data/money-integer-cents.json +38 -0
- package/src/crew/library/entries/data/nice-axis-ticks.json +36 -0
- package/src/crew/library/entries/data/number-currency-intl.json +37 -0
- package/src/crew/library/entries/data/offline-sync-queue.json +40 -0
- package/src/crew/library/entries/data/paginate-data.json +38 -0
- package/src/crew/library/entries/data/parse-date-strings.json +36 -0
- package/src/crew/library/entries/data/personal-data-minimization.json +41 -0
- package/src/crew/library/entries/data/pubsub-state-store.json +39 -0
- package/src/crew/library/entries/data/realistic-seed-data.json +40 -0
- package/src/crew/library/entries/data/schema-validation-handwritten.json +38 -0
- package/src/crew/library/entries/data/sparkline-inline.json +38 -0
- package/src/crew/library/entries/data/stats-summary-numbers.json +38 -0
- package/src/crew/library/entries/data/svg-bar-chart.json +39 -0
- package/src/crew/library/entries/data/svg-donut-chart.json +38 -0
- package/src/crew/library/entries/data/svg-line-chart.json +39 -0
- package/src/crew/library/entries/data/table-to-chart.json +37 -0
- package/src/crew/library/entries/data/undo-redo-history.json +36 -0
- package/src/crew/library/entries/data/validator-functions.json +37 -0
- package/src/crew/library/entries/design/brand-palette-from-one-color.json +38 -0
- package/src/crew/library/entries/design/breakpoint-strategy.json +38 -0
- package/src/crew/library/entries/design/button-hierarchy.json +38 -0
- package/src/crew/library/entries/design/color-palette-aa.json +39 -0
- package/src/crew/library/entries/design/corner-radius-system.json +35 -0
- package/src/crew/library/entries/design/dark-palette-design.json +37 -0
- package/src/crew/library/entries/design/dataviz-colors.json +37 -0
- package/src/crew/library/entries/design/design-consistency-audit.json +38 -0
- package/src/crew/library/entries/design/design-critique.json +36 -0
- package/src/crew/library/entries/design/design-tokens-css.json +37 -0
- package/src/crew/library/entries/design/elevation-shadows.json +37 -0
- package/src/crew/library/entries/design/error-offline-states-design.json +38 -0
- package/src/crew/library/entries/design/fluid-type-clamp.json +37 -0
- package/src/crew/library/entries/design/font-stack-pairing.json +38 -0
- package/src/crew/library/entries/design/form-design.json +38 -0
- package/src/crew/library/entries/design/header-logo-placement.json +38 -0
- package/src/crew/library/entries/design/icon-usage.json +37 -0
- package/src/crew/library/entries/design/image-aspect-ratio.json +38 -0
- package/src/crew/library/entries/design/layout-auto-fit-grid.json +37 -0
- package/src/crew/library/entries/design/layout-bento-grid.json +37 -0
- package/src/crew/library/entries/design/layout-centered-column.json +37 -0
- package/src/crew/library/entries/design/layout-holy-grail.json +38 -0
- package/src/crew/library/entries/design/layout-magazine.json +37 -0
- package/src/crew/library/entries/design/layout-sidebar-content.json +37 -0
- package/src/crew/library/entries/design/layout-split-hero.json +39 -0
- package/src/crew/library/entries/design/layout-sticky-footer.json +35 -0
- package/src/crew/library/entries/design/line-length-rhythm.json +39 -0
- package/src/crew/library/entries/design/loading-feedback.json +38 -0
- package/src/crew/library/entries/design/micro-interactions.json +38 -0
- package/src/crew/library/entries/design/mobile-nav-patterns.json +38 -0
- package/src/crew/library/entries/design/motion-reduced.json +38 -0
- package/src/crew/library/entries/design/multi-theme.json +38 -0
- package/src/crew/library/entries/design/semantic-color-tokens.json +38 -0
- package/src/crew/library/entries/design/spacing-scale.json +38 -0
- package/src/crew/library/entries/design/style-guide-page.json +40 -0
- package/src/crew/library/entries/design/touch-target-focus.json +36 -0
- package/src/crew/library/entries/design/typography-scale.json +38 -0
- package/src/crew/library/entries/design/ui-microcopy.json +36 -0
- package/src/crew/library/entries/design/visual-direction.json +37 -0
- package/src/crew/library/entries/design/visual-hierarchy.json +37 -0
- package/src/crew/library/entries/design/whitespace-grouping.json +37 -0
- package/src/crew/library/entries/design/wireframe-lofi.json +40 -0
- package/src/crew/library/entries/desktop/desktop-app-security.json +43 -0
- package/src/crew/library/entries/desktop/desktop-auto-update.json +40 -0
- package/src/crew/library/entries/desktop/desktop-background-tasks.json +39 -0
- package/src/crew/library/entries/desktop/desktop-clipboard-integration.json +38 -0
- package/src/crew/library/entries/desktop/desktop-command-palette-registry.json +39 -0
- package/src/crew/library/entries/desktop/desktop-file-drag-drop.json +38 -0
- package/src/crew/library/entries/desktop/desktop-global-hotkeys.json +38 -0
- package/src/crew/library/entries/desktop/desktop-high-dpi-scaling.json +41 -0
- package/src/crew/library/entries/desktop/desktop-keyboard-focus-a11y.json +40 -0
- package/src/crew/library/entries/desktop/desktop-local-logs-crash-reports.json +40 -0
- package/src/crew/library/entries/desktop/desktop-localization.json +40 -0
- package/src/crew/library/entries/desktop/desktop-menus-shortcuts.json +40 -0
- package/src/crew/library/entries/desktop/desktop-offline-local-data.json +40 -0
- package/src/crew/library/entries/desktop/desktop-open-save-dialogs.json +39 -0
- package/src/crew/library/entries/desktop/desktop-os-theme-follow.json +40 -0
- package/src/crew/library/entries/desktop/desktop-packaging-installers.json +42 -0
- package/src/crew/library/entries/desktop/desktop-print-pdf-export.json +39 -0
- package/src/crew/library/entries/desktop/desktop-safe-file-writes.json +40 -0
- package/src/crew/library/entries/desktop/desktop-settings-user-data.json +38 -0
- package/src/crew/library/entries/desktop/desktop-single-instance-windows.json +38 -0
- package/src/crew/library/entries/desktop/desktop-testing-node-test.json +39 -0
- package/src/crew/library/entries/desktop/desktop-tray-notifications.json +38 -0
- package/src/crew/library/entries/desktop/desktop-web-app-migration.json +41 -0
- package/src/crew/library/entries/desktop/desktop-window-state.json +38 -0
- package/src/crew/library/entries/desktop/neutralino-app-setup.json +39 -0
- package/src/crew/library/entries/devops/backup-restore-drill.json +41 -0
- package/src/crew/library/entries/devops/ci-matrix-os-runtime.json +38 -0
- package/src/crew/library/entries/devops/ci-secrets-environments.json +39 -0
- package/src/crew/library/entries/devops/ci-test-workflow.json +39 -0
- package/src/crew/library/entries/devops/compose-app-database.json +39 -0
- package/src/crew/library/entries/devops/containerfile-python-script.json +41 -0
- package/src/crew/library/entries/devops/cron-scheduled-tasks.json +38 -0
- package/src/crew/library/entries/devops/dependency-update-routine.json +39 -0
- package/src/crew/library/entries/devops/deploy-rollback-plan.json +39 -0
- package/src/crew/library/entries/devops/deploy-script-gotchas.json +39 -0
- package/src/crew/library/entries/devops/dockerfile-node-service.json +41 -0
- package/src/crew/library/entries/devops/dockerignore-small-images.json +37 -0
- package/src/crew/library/entries/devops/healthcheck-restart-policy.json +40 -0
- package/src/crew/library/entries/devops/incident-runbook.json +40 -0
- package/src/crew/library/entries/devops/infrastructure-as-code-basics.json +39 -0
- package/src/crew/library/entries/devops/log-rotation-setup.json +38 -0
- package/src/crew/library/entries/devops/make-targets-ci-parity.json +39 -0
- package/src/crew/library/entries/devops/release-pipeline-tags.json +38 -0
- package/src/crew/library/entries/devops/reverse-proxy-node-app.json +41 -0
- package/src/crew/library/entries/devops/semver-bump-decision.json +39 -0
- package/src/crew/library/entries/devops/static-site-deploy.json +38 -0
- package/src/crew/library/entries/devops/systemd-unit-hardening.json +38 -0
- package/src/crew/library/entries/devops/tls-certificate-renewal.json +39 -0
- package/src/crew/library/entries/devops/uptime-check-monitoring.json +38 -0
- package/src/crew/library/entries/devops/zero-downtime-deploy-systemd.json +38 -0
- package/src/crew/library/entries/games/arcade-physics-velocity-gravity.json +37 -0
- package/src/crew/library/entries/games/auto-pause-blur-visibility.json +36 -0
- package/src/crew/library/entries/games/camera-follow-scrolling.json +37 -0
- package/src/crew/library/entries/games/canvas-game-profiling.json +39 -0
- package/src/crew/library/entries/games/card-deck-shuffle-rules.json +38 -0
- package/src/crew/library/entries/games/collision-aabb-circle.json +38 -0
- package/src/crew/library/entries/games/difficulty-curve-wave-spawner.json +39 -0
- package/src/crew/library/entries/games/fixed-timestep-game-loop.json +37 -0
- package/src/crew/library/entries/games/game-audio-unlock-mixer.json +39 -0
- package/src/crew/library/entries/games/game-hud-accessibility.json +42 -0
- package/src/crew/library/entries/games/game-scene-state-machine.json +38 -0
- package/src/crew/library/entries/games/grid-pathfinding-a-star.json +38 -0
- package/src/crew/library/entries/games/high-score-table-storage.json +40 -0
- package/src/crew/library/entries/games/input-action-mapping-gamepad.json +37 -0
- package/src/crew/library/entries/games/local-multiplayer-hot-seat.json +39 -0
- package/src/crew/library/entries/games/offline-game-pwa.json +40 -0
- package/src/crew/library/entries/games/particle-effects-budget.json +38 -0
- package/src/crew/library/entries/games/platformer-jump-feel.json +38 -0
- package/src/crew/library/entries/games/puzzle-undo-move-stack.json +38 -0
- package/src/crew/library/entries/games/seeded-procedural-generation.json +38 -0
- package/src/crew/library/entries/games/sprite-sheet-animation.json +38 -0
- package/src/crew/library/entries/games/tile-map-json-levels.json +40 -0
- package/src/crew/library/entries/games/top-down-shooter-basics.json +39 -0
- package/src/crew/library/entries/games/turn-based-rules-engine-tests.json +39 -0
- package/src/crew/library/entries/games/virtual-joystick-touch-controls.json +40 -0
- package/src/crew/library/entries/git-docs/api-reference-docs.json +39 -0
- package/src/crew/library/entries/git-docs/architecture-decision-record.json +39 -0
- package/src/crew/library/entries/git-docs/atomic-commits.json +36 -0
- package/src/crew/library/entries/git-docs/branching-workflow.json +38 -0
- package/src/crew/library/entries/git-docs/bug-report.json +38 -0
- package/src/crew/library/entries/git-docs/changelog-entry.json +37 -0
- package/src/crew/library/entries/git-docs/cli-help-text.json +38 -0
- package/src/crew/library/entries/git-docs/code-comments.json +37 -0
- package/src/crew/library/entries/git-docs/commit-message.json +36 -0
- package/src/crew/library/entries/git-docs/config-reference-docs.json +40 -0
- package/src/crew/library/entries/git-docs/contributing-guide.json +40 -0
- package/src/crew/library/entries/git-docs/docstrings-public-api.json +38 -0
- package/src/crew/library/entries/git-docs/faq-doc.json +36 -0
- package/src/crew/library/entries/git-docs/feature-request.json +37 -0
- package/src/crew/library/entries/git-docs/getting-started-tutorial.json +39 -0
- package/src/crew/library/entries/git-docs/git-bisect.json +38 -0
- package/src/crew/library/entries/git-docs/git-recover-mistakes.json +36 -0
- package/src/crew/library/entries/git-docs/gitignore-setup.json +35 -0
- package/src/crew/library/entries/git-docs/license-options.json +36 -0
- package/src/crew/library/entries/git-docs/merge-conflicts.json +38 -0
- package/src/crew/library/entries/git-docs/migration-guide.json +39 -0
- package/src/crew/library/entries/git-docs/pr-description.json +37 -0
- package/src/crew/library/entries/git-docs/readme-cli.json +39 -0
- package/src/crew/library/entries/git-docs/readme-library-api.json +40 -0
- package/src/crew/library/entries/git-docs/readme-project.json +40 -0
- package/src/crew/library/entries/git-docs/release-notes.json +37 -0
- package/src/crew/library/entries/git-docs/release-tag-semver.json +37 -0
- package/src/crew/library/entries/git-docs/review-reply.json +35 -0
- package/src/crew/library/entries/git-docs/security-policy.json +37 -0
- package/src/crew/library/entries/git-docs/troubleshooting-guide.json +38 -0
- package/src/crew/library/entries/mobile/capacitor-camera-geolocation-plugins.json +39 -0
- package/src/crew/library/entries/mobile/capacitor-project-setup.json +42 -0
- package/src/crew/library/entries/mobile/mobile-app-lifecycle-events.json +39 -0
- package/src/crew/library/entries/mobile/mobile-auth-secure-token-storage.json +41 -0
- package/src/crew/library/entries/mobile/mobile-camera-photo-upload.json +40 -0
- package/src/crew/library/entries/mobile/mobile-deep-links-app-links.json +41 -0
- package/src/crew/library/entries/mobile/mobile-form-keyboards-autofill.json +41 -0
- package/src/crew/library/entries/mobile/mobile-haptics-vibration.json +39 -0
- package/src/crew/library/entries/mobile/mobile-indexeddb-storage-wrapper.json +39 -0
- package/src/crew/library/entries/mobile/mobile-manifest-icon-set.json +41 -0
- package/src/crew/library/entries/mobile/mobile-media-for-phones.json +41 -0
- package/src/crew/library/entries/mobile/mobile-offline-cache-strategies.json +40 -0
- package/src/crew/library/entries/mobile/mobile-offline-location-maps.json +41 -0
- package/src/crew/library/entries/mobile/mobile-outbox-resume-sync.json +41 -0
- package/src/crew/library/entries/mobile/mobile-push-notifications-limits.json +40 -0
- package/src/crew/library/entries/mobile/mobile-pwa-app-shell.json +41 -0
- package/src/crew/library/entries/mobile/mobile-safe-area-insets.json +41 -0
- package/src/crew/library/entries/mobile/mobile-small-screen-device-testing.json +39 -0
- package/src/crew/library/entries/mobile/mobile-startup-performance-budget.json +41 -0
- package/src/crew/library/entries/mobile/mobile-store-release-checklist.json +41 -0
- package/src/crew/library/entries/mobile/mobile-system-theme-bars.json +40 -0
- package/src/crew/library/entries/mobile/mobile-tab-bar-back-button.json +40 -0
- package/src/crew/library/entries/mobile/mobile-touch-gestures.json +40 -0
- package/src/crew/library/entries/mobile/mobile-touch-screen-reader-a11y.json +41 -0
- package/src/crew/library/entries/mobile/mobile-web-bundle-versioning.json +40 -0
- package/src/crew/library/entries/planning/acceptance-criteria.json +34 -0
- package/src/crew/library/entries/planning/change-request-midjob.json +34 -0
- package/src/crew/library/entries/planning/clarifying-questions.json +34 -0
- package/src/crew/library/entries/planning/decision-log.json +35 -0
- package/src/crew/library/entries/planning/definition-of-done.json +33 -0
- package/src/crew/library/entries/planning/estimate-tasks.json +35 -0
- package/src/crew/library/entries/planning/identify-risks.json +34 -0
- package/src/crew/library/entries/planning/milestones.json +34 -0
- package/src/crew/library/entries/planning/one-task-per-file.json +33 -0
- package/src/crew/library/entries/planning/order-by-dependencies.json +33 -0
- package/src/crew/library/entries/planning/plan-accessibility.json +34 -0
- package/src/crew/library/entries/planning/plan-browser-game.json +35 -0
- package/src/crew/library/entries/planning/plan-bug-investigation.json +36 -0
- package/src/crew/library/entries/planning/plan-data-migration.json +35 -0
- package/src/crew/library/entries/planning/plan-documentation.json +34 -0
- package/src/crew/library/entries/planning/plan-for-small-models.json +34 -0
- package/src/crew/library/entries/planning/plan-multi-page-site.json +34 -0
- package/src/crew/library/entries/planning/plan-safe-refactor.json +34 -0
- package/src/crew/library/entries/planning/plan-small-api.json +34 -0
- package/src/crew/library/entries/planning/plan-tests.json +34 -0
- package/src/crew/library/entries/planning/prioritize-must-should-could.json +34 -0
- package/src/crew/library/entries/planning/recover-failed-task.json +36 -0
- package/src/crew/library/entries/planning/requirements-from-conversation.json +34 -0
- package/src/crew/library/entries/planning/review-plan-before-work.json +35 -0
- package/src/crew/library/entries/planning/scope-first-version.json +34 -0
- package/src/crew/library/entries/planning/split-into-tasks.json +35 -0
- package/src/crew/library/entries/planning/staff-the-crew.json +35 -0
- package/src/crew/library/entries/planning/success-measures.json +34 -0
- package/src/crew/library/entries/planning/timebox-work.json +33 -0
- package/src/crew/library/entries/planning/tradeoff-table.json +33 -0
- package/src/crew/library/entries/planning/user-stories.json +34 -0
- package/src/crew/library/entries/planning/vague-request-assumptions.json +33 -0
- package/src/crew/library/entries/practices/accessibility-audit.json +43 -0
- package/src/crew/library/entries/practices/accessible-names-labels.json +40 -0
- package/src/crew/library/entries/practices/add-jsdoc-types.json +36 -0
- package/src/crew/library/entries/practices/add-unit-tests.json +38 -0
- package/src/crew/library/entries/practices/algorithm-performance.json +38 -0
- package/src/crew/library/entries/practices/api-error-format.json +37 -0
- package/src/crew/library/entries/practices/async-race-condition.json +37 -0
- package/src/crew/library/entries/practices/boundary-validation.json +38 -0
- package/src/crew/library/entries/practices/bug-fix-from-error.json +39 -0
- package/src/crew/library/entries/practices/clean-console-warnings.json +38 -0
- package/src/crew/library/entries/practices/color-contrast-fix.json +38 -0
- package/src/crew/library/entries/practices/config-management.json +39 -0
- package/src/crew/library/entries/practices/consistent-code-style.json +38 -0
- package/src/crew/library/entries/practices/content-security-policy.json +38 -0
- package/src/crew/library/entries/practices/css-layout-overflow.json +41 -0
- package/src/crew/library/entries/practices/dark-mode.json +39 -0
- package/src/crew/library/entries/practices/data-format-migration.json +37 -0
- package/src/crew/library/entries/practices/debounce-throttle.json +35 -0
- package/src/crew/library/entries/practices/debug-failing-test.json +37 -0
- package/src/crew/library/entries/practices/deprecation-compat.json +37 -0
- package/src/crew/library/entries/practices/dom-batching-reflow.json +36 -0
- package/src/crew/library/entries/practices/edge-case-tests.json +36 -0
- package/src/crew/library/entries/practices/error-handling-strategy.json +38 -0
- package/src/crew/library/entries/practices/event-listener-not-firing.json +34 -0
- package/src/crew/library/entries/practices/feature-flags.json +37 -0
- package/src/crew/library/entries/practices/file-upload-handling.json +39 -0
- package/src/crew/library/entries/practices/focus-management.json +36 -0
- package/src/crew/library/entries/practices/graceful-shutdown.json +36 -0
- package/src/crew/library/entries/practices/http-caching-headers.json +36 -0
- package/src/crew/library/entries/practices/i18n-setup.json +38 -0
- package/src/crew/library/entries/practices/injection-risks.json +37 -0
- package/src/crew/library/entries/practices/keyboard-navigation-fix.json +37 -0
- package/src/crew/library/entries/practices/log-levels-redaction.json +37 -0
- package/src/crew/library/entries/practices/memory-leak-fix.json +36 -0
- package/src/crew/library/entries/practices/minimal-dependencies.json +39 -0
- package/src/crew/library/entries/practices/minimal-reproduction.json +35 -0
- package/src/crew/library/entries/practices/modernize-legacy-js.json +39 -0
- package/src/crew/library/entries/practices/money-float-precision.json +36 -0
- package/src/crew/library/entries/practices/not-a-function-error.json +36 -0
- package/src/crew/library/entries/practices/null-undefined-access.json +35 -0
- package/src/crew/library/entries/practices/off-by-one-errors.json +37 -0
- package/src/crew/library/entries/practices/page-load-performance.json +39 -0
- package/src/crew/library/entries/practices/password-session-basics.json +37 -0
- package/src/crew/library/entries/practices/plurals-number-date-format.json +36 -0
- package/src/crew/library/entries/practices/progressive-enhancement.json +37 -0
- package/src/crew/library/entries/practices/refactor-extract-function.json +35 -0
- package/src/crew/library/entries/practices/remove-dead-code.json +35 -0
- package/src/crew/library/entries/practices/rename-for-clarity.json +35 -0
- package/src/crew/library/entries/practices/responsive-fix-375.json +40 -0
- package/src/crew/library/entries/practices/responsive-images-srcset.json +38 -0
- package/src/crew/library/entries/practices/rest-api-conventions.json +39 -0
- package/src/crew/library/entries/practices/retry-backoff.json +37 -0
- package/src/crew/library/entries/practices/rtl-support.json +37 -0
- package/src/crew/library/entries/practices/secrets-handling.json +37 -0
- package/src/crew/library/entries/practices/security-review-xss.json +40 -0
- package/src/crew/library/entries/practices/seo-basics.json +42 -0
- package/src/crew/library/entries/practices/shared-mutation-bug.json +35 -0
- package/src/crew/library/entries/practices/sitemap-robots.json +38 -0
- package/src/crew/library/entries/practices/split-large-file.json +38 -0
- package/src/crew/library/entries/practices/structured-data-jsonld.json +35 -0
- package/src/crew/library/entries/practices/structured-logging.json +37 -0
- package/src/crew/library/entries/practices/test-dom-logic-split.json +37 -0
- package/src/crew/library/entries/practices/timeouts-abort.json +35 -0
- package/src/crew/library/entries/practices/user-facing-error-messages.json +36 -0
- package/src/crew/library/entries/practices/z-index-stacking.json +36 -0
- package/src/crew/library/entries/review-qa/bug-repro-triage.json +35 -0
- package/src/crew/library/entries/review-qa/cross-browser-standards.json +36 -0
- package/src/crew/library/entries/review-qa/edge-cases-dates-timezones.json +37 -0
- package/src/crew/library/entries/review-qa/edge-cases-empty-huge-data.json +35 -0
- package/src/crew/library/entries/review-qa/edge-cases-inputs.json +34 -0
- package/src/crew/library/entries/review-qa/edge-cases-numbers-money.json +37 -0
- package/src/crew/library/entries/review-qa/edge-cases-unicode.json +37 -0
- package/src/crew/library/entries/review-qa/exploratory-charter.json +35 -0
- package/src/crew/library/entries/review-qa/form-e2e-check.json +37 -0
- package/src/crew/library/entries/review-qa/game-logic-check.json +37 -0
- package/src/crew/library/entries/review-qa/keyboard-only-qa.json +36 -0
- package/src/crew/library/entries/review-qa/link-asset-check.json +36 -0
- package/src/crew/library/entries/review-qa/performance-budget-check.json +37 -0
- package/src/crew/library/entries/review-qa/persistence-reload-check.json +37 -0
- package/src/crew/library/entries/review-qa/regression-checklist.json +35 -0
- package/src/crew/library/entries/review-qa/release-signoff.json +40 -0
- package/src/crew/library/entries/review-qa/responsive-qa-breakpoints.json +37 -0
- package/src/crew/library/entries/review-qa/review-a11y-pass.json +39 -0
- package/src/crew/library/entries/review-qa/review-copy.json +36 -0
- package/src/crew/library/entries/review-qa/review-css.json +39 -0
- package/src/crew/library/entries/review-qa/review-data-migration.json +36 -0
- package/src/crew/library/entries/review-qa/review-dependencies.json +37 -0
- package/src/crew/library/entries/review-qa/review-error-handling.json +37 -0
- package/src/crew/library/entries/review-qa/review-html.json +40 -0
- package/src/crew/library/entries/review-qa/review-i18n.json +37 -0
- package/src/crew/library/entries/review-qa/review-javascript.json +39 -0
- package/src/crew/library/entries/review-qa/review-logging.json +36 -0
- package/src/crew/library/entries/review-qa/review-node-server.json +39 -0
- package/src/crew/library/entries/review-qa/review-performance-pass.json +39 -0
- package/src/crew/library/entries/review-qa/review-pr-scope.json +35 -0
- package/src/crew/library/entries/review-qa/review-python.json +39 -0
- package/src/crew/library/entries/review-qa/review-security-pass.json +39 -0
- package/src/crew/library/entries/review-qa/review-test-quality.json +36 -0
- package/src/crew/library/entries/review-qa/screen-reader-smoke.json +36 -0
- package/src/crew/library/entries/review-qa/severity-triage.json +36 -0
- package/src/crew/library/entries/review-qa/smoke-test-release.json +35 -0
- package/src/crew/library/entries/review-qa/test-plan-api.json +36 -0
- package/src/crew/library/entries/review-qa/test-plan-form.json +35 -0
- package/src/crew/library/entries/review-qa/test-plan-game.json +35 -0
- package/src/crew/library/entries/review-qa/test-plan-web-page.json +35 -0
- package/src/crew/library/entries/review-qa/verify-acceptance-criteria.json +35 -0
- package/src/crew/library/entries/review-qa/visual-qa-spacing.json +36 -0
- package/src/crew/library/entries/roles/architect-architecture-review.json +37 -0
- package/src/crew/library/entries/roles/architect-constraints-check.json +37 -0
- package/src/crew/library/entries/roles/architect-data-flow-sketch.json +38 -0
- package/src/crew/library/entries/roles/architect-interface-contracts.json +38 -0
- package/src/crew/library/entries/roles/architect-static-site-structure.json +37 -0
- package/src/crew/library/entries/roles/designer-design-qa-pass.json +36 -0
- package/src/crew/library/entries/roles/designer-look-from-brief.json +37 -0
- package/src/crew/library/entries/roles/designer-polish-existing-page.json +36 -0
- package/src/crew/library/entries/roles/designer-token-handoff.json +37 -0
- package/src/crew/library/entries/roles/designer-visual-spec.json +37 -0
- package/src/crew/library/entries/roles/developer-few-turns.json +36 -0
- package/src/crew/library/entries/roles/developer-read-before-edit.json +36 -0
- package/src/crew/library/entries/roles/developer-self-check.json +37 -0
- package/src/crew/library/entries/roles/developer-test-mjs.json +38 -0
- package/src/crew/library/entries/roles/developer-unclear-spec.json +35 -0
- package/src/crew/library/entries/roles/ops-backup-rollback.json +36 -0
- package/src/crew/library/entries/roles/ops-environment-check.json +35 -0
- package/src/crew/library/entries/roles/ops-log-triage.json +36 -0
- package/src/crew/library/entries/roles/ops-release-checklist.json +39 -0
- package/src/crew/library/entries/roles/ops-safe-commands.json +35 -0
- package/src/crew/library/entries/roles/qa-automatic-check-results.json +35 -0
- package/src/crew/library/entries/roles/qa-check-acceptance-criteria.json +36 -0
- package/src/crew/library/entries/roles/qa-findings-format.json +34 -0
- package/src/crew/library/entries/roles/qa-recheck-fixes.json +36 -0
- package/src/crew/library/entries/roles/qa-severity-calibration.json +36 -0
- package/src/crew/library/entries/roles/reviewer-constructive-comments.json +34 -0
- package/src/crew/library/entries/roles/reviewer-diff-review.json +36 -0
- package/src/crew/library/entries/roles/reviewer-fix-round.json +36 -0
- package/src/crew/library/entries/roles/reviewer-scope-creep.json +35 -0
- package/src/crew/library/entries/roles/reviewer-verdict-rules.json +35 -0
- package/src/crew/library/entries/roles/writer-copy-from-brief.json +37 -0
- package/src/crew/library/entries/roles/writer-docs-voice.json +36 -0
- package/src/crew/library/entries/roles/writer-edit-for-clarity.json +37 -0
- package/src/crew/library/entries/roles/writer-microcopy.json +39 -0
- package/src/crew/library/entries/roles/writer-translation-ready.json +36 -0
- package/src/crew/library/entries/security/auth-session-review.json +39 -0
- package/src/crew/library/entries/security/command-injection-review.json +39 -0
- package/src/crew/library/entries/security/cookie-flags-audit.json +40 -0
- package/src/crew/library/entries/security/csp-static-site-meta.json +41 -0
- package/src/crew/library/entries/security/csrf-protection.json +41 -0
- package/src/crew/library/entries/security/dependency-advisory-offline.json +41 -0
- package/src/crew/library/entries/security/extension-permission-review.json +41 -0
- package/src/crew/library/entries/security/idor-access-review.json +41 -0
- package/src/crew/library/entries/security/input-validation-review.json +38 -0
- package/src/crew/library/entries/security/log-leak-audit.json +40 -0
- package/src/crew/library/entries/security/password-storage-audit.json +40 -0
- package/src/crew/library/entries/security/path-traversal-review.json +41 -0
- package/src/crew/library/entries/security/secret-scan-rotate.json +40 -0
- package/src/crew/library/entries/security/security-audit-report.json +43 -0
- package/src/crew/library/entries/security/security-fix-triage.json +41 -0
- package/src/crew/library/entries/security/security-headers-checklist.json +40 -0
- package/src/crew/library/entries/security/sql-injection-review.json +40 -0
- package/src/crew/library/entries/security/ssrf-url-fetcher.json +41 -0
- package/src/crew/library/entries/security/threat-model-small-app.json +41 -0
- package/src/crew/library/entries/security/tls-verification-on.json +40 -0
- package/src/crew/library/entries/security/unsafe-deserialization.json +40 -0
- package/src/crew/library/entries/security/upload-attack-review.json +39 -0
- package/src/crew/library/entries/security/weak-crypto-audit.json +40 -0
- package/src/crew/library/entries/security/webview-bridge-hardening.json +42 -0
- package/src/crew/library/entries/security/xss-context-encoding.json +41 -0
- package/src/crew/library/entries/stacks/browser-es-modules.json +40 -0
- package/src/crew/library/entries/stacks/canvas-2d-animation-loop.json +38 -0
- package/src/crew/library/entries/stacks/config-ini-yaml-parsing.json +37 -0
- package/src/crew/library/entries/stacks/css-custom-properties-theme.json +43 -0
- package/src/crew/library/entries/stacks/css-grid-flex-layout.json +43 -0
- package/src/crew/library/entries/stacks/dom-event-delegation.json +39 -0
- package/src/crew/library/entries/stacks/drag-drop-reorder-api.json +38 -0
- package/src/crew/library/entries/stacks/env-config-module.json +38 -0
- package/src/crew/library/entries/stacks/fetch-timeout-abort.json +38 -0
- package/src/crew/library/entries/stacks/geolocation-permission.json +37 -0
- package/src/crew/library/entries/stacks/html-semantic-skeleton.json +51 -0
- package/src/crew/library/entries/stacks/indexeddb-wrapper.json +36 -0
- package/src/crew/library/entries/stacks/intersection-observer-uses.json +36 -0
- package/src/crew/library/entries/stacks/json-file-database.json +40 -0
- package/src/crew/library/entries/stacks/json-schema-format.json +38 -0
- package/src/crew/library/entries/stacks/makefile-task-runner.json +37 -0
- package/src/crew/library/entries/stacks/node-child-process.json +40 -0
- package/src/crew/library/entries/stacks/node-cli-parseargs.json +40 -0
- package/src/crew/library/entries/stacks/node-cors-preflight.json +38 -0
- package/src/crew/library/entries/stacks/node-file-watcher.json +40 -0
- package/src/crew/library/entries/stacks/node-folder-batch-script.json +42 -0
- package/src/crew/library/entries/stacks/node-http-crud-api.json +45 -0
- package/src/crew/library/entries/stacks/node-rate-limit.json +40 -0
- package/src/crew/library/entries/stacks/node-readline-prompts.json +39 -0
- package/src/crew/library/entries/stacks/node-scheduled-jobs.json +39 -0
- package/src/crew/library/entries/stacks/node-server-sent-events.json +39 -0
- package/src/crew/library/entries/stacks/node-static-file-server.json +41 -0
- package/src/crew/library/entries/stacks/node-streams-large-files.json +39 -0
- package/src/crew/library/entries/stacks/node-test-suite.json +40 -0
- package/src/crew/library/entries/stacks/package-json-scripts.json +37 -0
- package/src/crew/library/entries/stacks/password-hashing-scrypt.json +40 -0
- package/src/crew/library/entries/stacks/pwa-manifest-install.json +40 -0
- package/src/crew/library/entries/stacks/python-argparse-cli.json +39 -0
- package/src/crew/library/entries/stacks/python-csv-module.json +41 -0
- package/src/crew/library/entries/stacks/python-dataclasses-models.json +39 -0
- package/src/crew/library/entries/stacks/python-http-server-api.json +38 -0
- package/src/crew/library/entries/stacks/python-logging-setup.json +39 -0
- package/src/crew/library/entries/stacks/python-pathlib-files.json +41 -0
- package/src/crew/library/entries/stacks/python-re-text-processing.json +39 -0
- package/src/crew/library/entries/stacks/python-unittest-suite.json +40 -0
- package/src/crew/library/entries/stacks/python-urllib-client.json +40 -0
- package/src/crew/library/entries/stacks/python-venv-setup-notes.json +42 -0
- package/src/crew/library/entries/stacks/regex-writing-testing.json +37 -0
- package/src/crew/library/entries/stacks/service-worker-offline.json +36 -0
- package/src/crew/library/entries/stacks/shell-script-strict.json +38 -0
- package/src/crew/library/entries/stacks/sql-portable-queries.json +39 -0
- package/src/crew/library/entries/stacks/svg-icons-handwritten.json +39 -0
- package/src/crew/library/entries/stacks/web-audio-sounds.json +37 -0
- package/src/crew/library/entries/stacks/web-component-custom-element.json +38 -0
- package/src/crew/library/entries/stacks/web-worker-offload.json +36 -0
- package/src/crew/library/entries/tools/cli-batch-plan-dry-run.json +38 -0
- package/src/crew/library/entries/tools/cli-color-no-color.json +38 -0
- package/src/crew/library/entries/tools/cli-config-precedence.json +39 -0
- package/src/crew/library/entries/tools/cli-cross-platform-paths.json +38 -0
- package/src/crew/library/entries/tools/cli-exit-codes-stderr.json +39 -0
- package/src/crew/library/entries/tools/cli-help-from-option-table.json +39 -0
- package/src/crew/library/entries/tools/cli-package-bin-shebang.json +40 -0
- package/src/crew/library/entries/tools/cli-progress-output.json +38 -0
- package/src/crew/library/entries/tools/cli-prompts-noninteractive.json +38 -0
- package/src/crew/library/entries/tools/cli-stdin-pipes.json +39 -0
- package/src/crew/library/entries/tools/cli-subcommands-parseargs.json +39 -0
- package/src/crew/library/entries/tools/cli-tests-spawn-binary.json +39 -0
- package/src/crew/library/entries/tools/ext-content-scripts-isolation.json +39 -0
- package/src/crew/library/entries/tools/ext-context-menu-items.json +37 -0
- package/src/crew/library/entries/tools/ext-csp-no-remote-code.json +39 -0
- package/src/crew/library/entries/tools/ext-keyboard-commands.json +37 -0
- package/src/crew/library/entries/tools/ext-logic-node-tests.json +39 -0
- package/src/crew/library/entries/tools/ext-messaging.json +38 -0
- package/src/crew/library/entries/tools/ext-minimal-permissions.json +38 -0
- package/src/crew/library/entries/tools/ext-mv3-skeleton.json +38 -0
- package/src/crew/library/entries/tools/ext-options-page.json +40 -0
- package/src/crew/library/entries/tools/ext-popup-ui.json +41 -0
- package/src/crew/library/entries/tools/ext-storage-quotas.json +39 -0
- package/src/crew/library/entries/tools/ext-store-review-checklist.json +39 -0
- package/src/crew/library/entries/tools/python-cli-argparse-tests.json +40 -0
- package/src/crew/library/entries/ui-components/accordion-disclosure.json +42 -0
- package/src/crew/library/entries/ui-components/alert-banner.json +41 -0
- package/src/crew/library/entries/ui-components/announcement-bar.json +41 -0
- package/src/crew/library/entries/ui-components/avatar-badge.json +40 -0
- package/src/crew/library/entries/ui-components/back-to-top-button.json +38 -0
- package/src/crew/library/entries/ui-components/breadcrumb-trail.json +38 -0
- package/src/crew/library/entries/ui-components/card-grid.json +41 -0
- package/src/crew/library/entries/ui-components/carousel-accessible.json +40 -0
- package/src/crew/library/entries/ui-components/combobox-autocomplete.json +40 -0
- package/src/crew/library/entries/ui-components/command-palette.json +41 -0
- package/src/crew/library/entries/ui-components/comment-thread.json +42 -0
- package/src/crew/library/entries/ui-components/contact-card-vcard.json +41 -0
- package/src/crew/library/entries/ui-components/context-menu.json +37 -0
- package/src/crew/library/entries/ui-components/cookie-consent-banner.json +43 -0
- package/src/crew/library/entries/ui-components/copy-to-clipboard-button.json +38 -0
- package/src/crew/library/entries/ui-components/date-time-inputs.json +39 -0
- package/src/crew/library/entries/ui-components/dropdown-menu-button.json +40 -0
- package/src/crew/library/entries/ui-components/empty-state.json +41 -0
- package/src/crew/library/entries/ui-components/faq-section-jsonld.json +37 -0
- package/src/crew/library/entries/ui-components/file-upload-dropzone.json +42 -0
- package/src/crew/library/entries/ui-components/form-layout-grid.json +42 -0
- package/src/crew/library/entries/ui-components/hero-section.json +43 -0
- package/src/crew/library/entries/ui-components/image-gallery-lightbox.json +41 -0
- package/src/crew/library/entries/ui-components/inline-validation-field.json +44 -0
- package/src/crew/library/entries/ui-components/keyboard-shortcuts-dialog.json +39 -0
- package/src/crew/library/entries/ui-components/load-more-list.json +40 -0
- package/src/crew/library/entries/ui-components/modal-dialog.json +42 -0
- package/src/crew/library/entries/ui-components/multi-step-form-wizard.json +42 -0
- package/src/crew/library/entries/ui-components/navbar-responsive.json +44 -0
- package/src/crew/library/entries/ui-components/notification-center.json +40 -0
- package/src/crew/library/entries/ui-components/off-canvas-drawer.json +42 -0
- package/src/crew/library/entries/ui-components/pagination-nav.json +39 -0
- package/src/crew/library/entries/ui-components/popover-panel.json +39 -0
- package/src/crew/library/entries/ui-components/progress-bar-spinner.json +39 -0
- package/src/crew/library/entries/ui-components/quantity-stepper-input.json +41 -0
- package/src/crew/library/entries/ui-components/radio-cards-checkbox-group.json +40 -0
- package/src/crew/library/entries/ui-components/range-slider-input.json +39 -0
- package/src/crew/library/entries/ui-components/share-button-fallback.json +39 -0
- package/src/crew/library/entries/ui-components/sidebar-nav-collapsible.json +43 -0
- package/src/crew/library/entries/ui-components/site-footer.json +43 -0
- package/src/crew/library/entries/ui-components/skeleton-loader.json +38 -0
- package/src/crew/library/entries/ui-components/sortable-data-table.json +42 -0
- package/src/crew/library/entries/ui-components/star-rating-input.json +39 -0
- package/src/crew/library/entries/ui-components/stats-counter-strip.json +40 -0
- package/src/crew/library/entries/ui-components/sticky-mobile-cta-bar.json +41 -0
- package/src/crew/library/entries/ui-components/tabs-widget.json +41 -0
- package/src/crew/library/entries/ui-components/tag-chips-input.json +42 -0
- package/src/crew/library/entries/ui-components/testimonials-block.json +40 -0
- package/src/crew/library/entries/ui-components/toast-notifications.json +41 -0
- package/src/crew/library/entries/ui-components/toggle-switch.json +38 -0
- package/src/crew/library/entries/ui-components/toolbar-buttons.json +41 -0
- package/src/crew/library/entries/ui-components/tooltip-hint.json +39 -0
- package/src/crew/library/entries/ui-components/tree-view.json +39 -0
- package/src/crew/library/entries/ui-components/vertical-timeline.json +39 -0
- package/src/crew/library/entries/ui-components/video-embed-responsive.json +40 -0
- package/src/crew/library/entries/web-pages/about-page.json +48 -0
- package/src/crew/library/entries/web-pages/agency-services-page.json +49 -0
- package/src/crew/library/entries/web-pages/animal-adoption-site.json +49 -0
- package/src/crew/library/entries/web-pages/app-promo-page.json +49 -0
- package/src/crew/library/entries/web-pages/bakery-site.json +50 -0
- package/src/crew/library/entries/web-pages/band-music-site.json +50 -0
- package/src/crew/library/entries/web-pages/blog-home.json +47 -0
- package/src/crew/library/entries/web-pages/blog-post.json +49 -0
- package/src/crew/library/entries/web-pages/cafe-site.json +49 -0
- package/src/crew/library/entries/web-pages/careers-page.json +47 -0
- package/src/crew/library/entries/web-pages/clinic-site.json +50 -0
- package/src/crew/library/entries/web-pages/community-club-site.json +47 -0
- package/src/crew/library/entries/web-pages/contact-page.json +49 -0
- package/src/crew/library/entries/web-pages/course-page.json +50 -0
- package/src/crew/library/entries/web-pages/docs-site.json +50 -0
- package/src/crew/library/entries/web-pages/event-page.json +50 -0
- package/src/crew/library/entries/web-pages/gym-fitness-site.json +50 -0
- package/src/crew/library/entries/web-pages/help-center-page.json +46 -0
- package/src/crew/library/entries/web-pages/hotel-stay-site.json +51 -0
- package/src/crew/library/entries/web-pages/html-email.json +40 -0
- package/src/crew/library/entries/web-pages/landing-page.json +49 -0
- package/src/crew/library/entries/web-pages/legal-policy-page.json +46 -0
- package/src/crew/library/entries/web-pages/link-in-bio-page.json +47 -0
- package/src/crew/library/entries/web-pages/maintenance-page.json +44 -0
- package/src/crew/library/entries/web-pages/multi-page-site.json +49 -0
- package/src/crew/library/entries/web-pages/newsletter-archive-page.json +49 -0
- package/src/crew/library/entries/web-pages/nonprofit-donation-page.json +50 -0
- package/src/crew/library/entries/web-pages/not-found-404.json +45 -0
- package/src/crew/library/entries/web-pages/one-page-scroll-site.json +47 -0
- package/src/crew/library/entries/web-pages/podcast-site.json +48 -0
- package/src/crew/library/entries/web-pages/portfolio-creative.json +48 -0
- package/src/crew/library/entries/web-pages/portfolio-developer.json +50 -0
- package/src/crew/library/entries/web-pages/pricing-page.json +48 -0
- package/src/crew/library/entries/web-pages/printable-page.json +47 -0
- package/src/crew/library/entries/web-pages/product-detail-page.json +50 -0
- package/src/crew/library/entries/web-pages/product-updates-page.json +45 -0
- package/src/crew/library/entries/web-pages/qr-menu-page.json +47 -0
- package/src/crew/library/entries/web-pages/real-estate-listing.json +51 -0
- package/src/crew/library/entries/web-pages/recipe-page.json +47 -0
- package/src/crew/library/entries/web-pages/restaurant-site.json +50 -0
- package/src/crew/library/entries/web-pages/resume-page.json +48 -0
- package/src/crew/library/entries/web-pages/salon-booking-site.json +52 -0
- package/src/crew/library/entries/web-pages/sign-in-page.json +50 -0
- package/src/crew/library/entries/web-pages/status-page.json +49 -0
- package/src/crew/library/entries/web-pages/store-catalog.json +50 -0
- package/src/crew/library/entries/web-pages/store-locator-page.json +47 -0
- package/src/crew/library/entries/web-pages/thank-you-page.json +46 -0
- package/src/crew/library/entries/web-pages/trades-business-site.json +50 -0
- package/src/crew/library/entries/web-pages/travel-guide-page.json +48 -0
- package/src/crew/library/entries/web-pages/waitlist-page.json +50 -0
- package/src/crew/library/entries/web-pages/wedding-site.json +50 -0
- package/src/crew/library/hook.js +295 -0
- package/src/crew/library/index.js +245 -0
- package/src/crew/library/select.js +366 -0
- package/src/crew/planner.js +31 -13
- package/src/crew/prompts/index.js +10 -4
- package/src/crew/prompts/roles.js +51 -0
- package/src/crew/say.js +41 -0
- package/src/crew/scheduler.js +22 -5
- package/src/crew/talk.js +299 -0
- package/src/crew/taskgraph.js +12 -2
- package/src/crew/worker.js +61 -3
- package/src/crew/workers.js +16 -0
- package/src/demo.js +11 -4
- package/src/doctor.js +6 -1
- package/src/extensions/create.js +3 -1
- package/src/extensions/index.js +11 -5
- package/src/github/git.js +114 -1
- package/src/github/index.js +7 -2
- package/src/index.js +183 -22
- package/src/lend/index.js +44 -4
- package/src/lend/share.js +73 -0
- package/src/p2p/audit.js +147 -0
- package/src/p2p/caps.js +193 -0
- package/src/p2p/city-port.js +92 -0
- package/src/p2p/cli.js +300 -0
- package/src/p2p/compute-link.js +101 -0
- package/src/p2p/doctor.js +233 -0
- package/src/p2p/encoding.js +50 -0
- package/src/p2p/engine.js +268 -0
- package/src/p2p/handshake.js +339 -0
- package/src/p2p/identity.js +195 -0
- package/src/p2p/invites.js +170 -0
- package/src/p2p/keyfile.js +119 -0
- package/src/p2p/messages.js +184 -0
- package/src/p2p/node.js +926 -0
- package/src/p2p/peers.js +209 -0
- package/src/p2p/pool-port.js +119 -0
- package/src/p2p/primitives.js +129 -0
- package/src/p2p/remote-port.js +265 -0
- package/src/p2p/session.js +282 -0
- package/src/p2p/transport/base.js +70 -0
- package/src/p2p/transport/browser-pipe.js +85 -0
- package/src/p2p/transport/index.js +7 -0
- package/src/p2p/transport/inproc.js +57 -0
- package/src/p2p/transport/ws-lan.js +88 -0
- package/src/p2p/workbench-port.js +116 -0
- package/src/phone/hub.js +633 -0
- package/src/phone/index.js +85 -0
- package/src/phone/pipe.js +79 -0
- package/src/phone/port.js +187 -0
- package/src/phone/store.js +123 -0
- package/src/phone/view.js +140 -0
- package/src/profile/index.js +203 -0
- package/src/profile/sanitize.js +39 -0
- package/src/remote/address.js +96 -0
- package/src/remote/clipnative.js +119 -0
- package/src/remote/clipsync.js +412 -0
- package/src/remote/desk.js +874 -0
- package/src/remote/helper.js +126 -0
- package/src/remote/index.js +242 -0
- package/src/remote/keys.js +86 -0
- package/src/remote/policy.js +135 -0
- package/src/remote/port.js +61 -0
- package/src/remote/transfer.js +412 -0
- package/src/remote/types.js +35 -0
- package/src/remote/unattended.js +99 -0
- package/src/remote/x11.js +140 -0
- package/src/replay/reduce.js +25 -3
- package/src/server.js +72 -23
- package/src/tasks/commands.js +46 -0
- package/src/tasks/crew-executor.js +134 -0
- package/src/tasks/engine.js +469 -0
- package/src/tasks/state.js +421 -0
- package/src/tools/approvals.js +1 -1
- package/src/tools/check.js +2 -0
- package/src/tools/index.js +8 -4
- package/src/tools/run.js +10 -1
- package/src/tools/workspace.js +14 -1
- package/src/voice/catalog.js +111 -0
- package/src/voice/index.js +275 -0
- package/src/voice/piper.js +53 -0
- package/src/voice/reply.js +97 -0
- package/src/voice/store.js +150 -0
- package/src/voice/wav.js +59 -0
- package/src/voice/whisper.js +178 -0
- package/src/workbench/docs.js +185 -0
- package/src/workbench/fs.js +214 -0
- package/src/workbench/glob.js +102 -0
- package/src/workbench/index.js +569 -0
- package/src/workbench/match.js +103 -0
- package/src/workbench/origin.js +85 -0
- package/src/workbench/pty.js +223 -0
- package/src/workbench/scm.js +159 -0
- package/src/workbench/search-worker.js +52 -0
- package/src/workbench/search.js +216 -0
- package/src/workbench/settings.js +131 -0
- package/src/workbench/share.js +228 -0
- package/src/workbench/walk.js +57 -0
- package/themes/mel.hivedesk-theme.json +24 -24
- package/ui/changelog/changelog.css +4 -4
- package/ui/city/activity.js +143 -0
- package/ui/city/city.css +274 -131
- package/ui/city/city.js +265 -95
- package/ui/city/compute.js +272 -0
- package/ui/city/hub.js +91 -0
- package/ui/city/layout.js +5 -5
- package/ui/city/machines.js +135 -0
- package/ui/city/model.js +29 -6
- package/ui/city/onboarding.js +122 -0
- package/ui/city/panels.js +394 -0
- package/ui/city/peers.js +164 -0
- package/ui/city/roles.js +10 -0
- package/ui/city/scene.js +686 -869
- package/ui/city/strings.js +32 -0
- package/ui/css/hive.css +326 -376
- package/ui/css/polish.css +85 -98
- package/ui/css/tokens.css +160 -0
- package/ui/css/voice.css +35 -0
- package/ui/editor/editor.css +17 -17
- package/ui/editor/monaco.js +48 -51
- package/ui/editor/register.js +22 -9
- package/ui/editor/vendor/ts/VENDORED.txt +3 -0
- package/ui/editor/vendor/ts/tsMode.js +20 -0
- package/ui/editor/vendor/ts/tsWorker.js +51328 -0
- package/ui/favicon.svg +1 -1
- package/ui/github/github.css +4 -4
- package/ui/index.html +3 -2
- package/ui/js/actions.js +6 -3
- package/ui/js/art.js +113 -0
- package/ui/js/bees.js +60 -137
- package/ui/js/dock.js +2 -2
- package/ui/js/dom.js +23 -18
- package/ui/js/fx.js +9 -62
- package/ui/js/i18n.js +12 -0
- package/ui/js/main.js +71 -3
- package/ui/js/md.js +130 -0
- package/ui/js/net.js +6 -0
- package/ui/js/onboarding-gate.js +21 -0
- package/ui/js/palette.js +2 -2
- package/ui/js/store.js +25 -2
- package/ui/js/topbar.js +3 -3
- package/ui/js/tour.js +15 -1
- package/ui/js/voice/audio.js +82 -0
- package/ui/js/voice/capture-worklet.js +25 -0
- package/ui/js/voice/conversation.js +177 -0
- package/ui/js/voice/engines.js +64 -0
- package/ui/js/voice/index.js +588 -164
- package/ui/js/voice/intents.js +21 -3
- package/ui/js/voice/mic.js +69 -0
- package/ui/js/voice/questions.js +110 -0
- package/ui/js/voice/sentences.js +59 -0
- package/ui/js/voice/session.js +222 -21
- package/ui/js/voice/speaker.js +129 -0
- package/ui/js/voice/turn.js +107 -0
- package/ui/js/voice/vad.js +70 -0
- package/ui/js/voice/wake.js +41 -0
- package/ui/js/widgets/activity.js +66 -0
- package/ui/js/widgets/brief.js +37 -16
- package/ui/js/widgets/chat.js +57 -9
- package/ui/js/widgets/files.js +3 -3
- package/ui/js/widgets/library-strings.js +173 -0
- package/ui/js/widgets/library-used.js +118 -0
- package/ui/js/widgets/library.js +143 -0
- package/ui/js/widgets/machines.js +31 -0
- package/ui/js/widgets/memory.js +3 -3
- package/ui/js/widgets/providers.js +1 -1
- package/ui/js/widgets/question.js +295 -0
- package/ui/js/widgets/replay.js +3 -3
- package/ui/js/widgets/settings.js +16 -3
- package/ui/js/widgets/timeline.js +2 -2
- package/ui/js/widgets/worker.js +17 -6
- package/ui/lend/core/p2p-pipe.js +213 -0
- package/ui/lend/core/pairing.js +4 -2
- package/ui/lend/index.html +1 -0
- package/ui/lend/join-window.js +9 -0
- package/ui/lend/lend-screen.js +14 -1
- package/ui/lend/lend.css +23 -7
- package/ui/lend/p2p-model.js +103 -0
- package/ui/lend/p2p-screen.js +228 -0
- package/ui/lend/p2p-text.js +86 -0
- package/ui/manifest.webmanifest +2 -2
- package/ui/models/index.js +305 -0
- package/ui/models/models.css +112 -0
- package/ui/models/strings/de.json +232 -0
- package/ui/models/strings/en.json +232 -0
- package/ui/models/strings/es.json +232 -0
- package/ui/models/strings/fr.json +232 -0
- package/ui/models/strings/it.json +232 -0
- package/ui/models/strings/ja.json +232 -0
- package/ui/models/strings/ko.json +232 -0
- package/ui/models/strings/pt-BR.json +232 -0
- package/ui/models/strings/ru.json +232 -0
- package/ui/models/strings/zh-CN.json +232 -0
- package/ui/models/t.js +41 -0
- package/ui/models/window.js +432 -0
- package/ui/office/office.css +89 -91
- package/ui/office/office.js +662 -598
- package/ui/office/popout.js +5 -4
- package/ui/office/scene.js +503 -791
- package/ui/offline.html +5 -5
- package/ui/phone/bridge.js +39 -0
- package/ui/phone/core/client.js +246 -0
- package/ui/phone/core/connect.js +195 -0
- package/ui/phone/core/crypto.js +211 -0
- package/ui/phone/core/grants.js +45 -0
- package/ui/phone/core/handshake.js +353 -0
- package/ui/phone/core/invite.js +55 -0
- package/ui/phone/core/messages.js +85 -0
- package/ui/phone/core/session.js +160 -0
- package/ui/phone/desktop.js +245 -0
- package/ui/phone/phone.css +36 -0
- package/ui/phone/strings.js +45 -0
- package/ui/profile/achievements.js +96 -0
- package/ui/profile/avatars.js +68 -0
- package/ui/profile/profile.css +53 -0
- package/ui/profile/stats.js +148 -0
- package/ui/profile/ui.js +207 -0
- package/ui/remote/abr.js +73 -0
- package/ui/remote/common.js +107 -0
- package/ui/remote/digits.js +20 -0
- package/ui/remote/home.js +148 -0
- package/ui/remote/host.js +259 -0
- package/ui/remote/index.js +107 -0
- package/ui/remote/media.js +180 -0
- package/ui/remote/pipes.js +64 -0
- package/ui/remote/pointer.js +67 -0
- package/ui/remote/remote.css +88 -0
- package/ui/remote/strings.js +173 -0
- package/ui/remote/viewer.js +267 -0
- package/ui/themes/core.js +21 -21
- package/ui/themes/themes.css +19 -19
- package/ui/widget.css +13 -16
- package/ui/widget.html +11 -10
- package/ui/widget.js +35 -20
- package/ui/workbench/commands.js +141 -0
- package/ui/workbench/dialogs.js +107 -0
- package/ui/workbench/editors.js +911 -0
- package/ui/workbench/explorer.js +419 -0
- package/ui/workbench/layout.js +203 -0
- package/ui/workbench/models.js +105 -0
- package/ui/workbench/net.js +26 -0
- package/ui/workbench/problems.js +94 -0
- package/ui/workbench/quick.js +98 -0
- package/ui/workbench/scmview.js +190 -0
- package/ui/workbench/searchview.js +215 -0
- package/ui/workbench/session.js +162 -0
- package/ui/workbench/settingsview.js +89 -0
- package/ui/workbench/strings.js +26 -0
- package/ui/workbench/terminal.js +314 -0
- package/ui/workbench/theme.js +153 -0
- package/ui/workbench/util.js +128 -0
- package/ui/workbench/vendor/xterm/LICENSE +21 -0
- package/ui/workbench/vendor/xterm/VENDORED.txt +3 -0
- package/ui/workbench/vendor/xterm/addon-fit.js +2 -0
- package/ui/workbench/vendor/xterm/xterm.css +218 -0
- package/ui/workbench/vendor/xterm/xterm.js +2 -0
- package/ui/workbench/workbench.css +388 -0
- package/ui/workbench/workbench.js +712 -0
- package/ui/screenshots/city-agent-card-1440.png +0 -0
- package/ui/screenshots/city-agent-card-1920.png +0 -0
- package/ui/screenshots/city-bridge-gpu-borrow-1440.png +0 -0
- package/ui/screenshots/city-bridge-gpu-borrow-1920.png +0 -0
- package/ui/screenshots/city-friend-rising-1440.png +0 -0
- package/ui/screenshots/city-friend-rising-1920.png +0 -0
- package/ui/screenshots/city-overview-1440.png +0 -0
- package/ui/screenshots/city-overview-1920.png +0 -0
- package/ui/screenshots/city-review-room-1440.png +0 -0
- package/ui/screenshots/city-review-room-1920.png +0 -0
- package/ui/screenshots/hive-1440-de.png +0 -0
- package/ui/screenshots/hive-1440-ja.png +0 -0
- package/ui/screenshots/hive-1440-job-running.png +0 -0
- package/ui/screenshots/hive-1440-model-download.png +0 -0
- package/ui/screenshots/hive-1440-pt-BR.png +0 -0
- package/ui/screenshots/hive-1440-tooltip.png +0 -0
- package/ui/screenshots/hive-1440-tour-step1.png +0 -0
- package/ui/screenshots/hive-1440-tour-step5.png +0 -0
- package/ui/screenshots/hive-1920-context-menu.png +0 -0
- package/ui/screenshots/hive-1920-desktop-menu.png +0 -0
- package/ui/screenshots/hive-1920-hire.png +0 -0
- package/ui/screenshots/hive-1920-job-running.png +0 -0
- package/ui/screenshots/hive-1920-palette.png +0 -0
- package/ui/screenshots/hive-1920-replay.png +0 -0
- package/ui/screenshots/hive-375-phone.png +0 -0
- package/ui/screenshots/office-1440-approval.png +0 -0
- package/ui/screenshots/office-1440-celebrate.png +0 -0
- package/ui/screenshots/office-1440-working.png +0 -0
- package/ui/screenshots/office-1920-approval.png +0 -0
- package/ui/screenshots/office-1920-celebrate.png +0 -0
- package/ui/screenshots/office-1920-working.png +0 -0
- package/ui/screenshots/office-widget.png +0 -0
package/ui/office/scene.js
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
// The Office:
|
|
2
|
-
// Every pose comes from the engine state (worker.status, tasks,
|
|
3
|
-
// (hand offs, speech bubbles,
|
|
4
|
-
// Shared by the full Office mode and the mini widget.
|
|
1
|
+
// The Office: the crew's floor as a refined isometric room drawn on one canvas
|
|
2
|
+
// (docs/1.0/DESIGN.md, section 6). Every pose comes from the engine state (worker.status, tasks,
|
|
3
|
+
// queue) and every effect (hand offs, speech bubbles, check marks, success pulses) from a real
|
|
4
|
+
// engine event. Shared by the full Office mode and the mini widget. Colors come from the theme
|
|
5
|
+
// tokens through ui/js/art.js.
|
|
5
6
|
|
|
6
7
|
import { beeSvg } from '/js/bees.js';
|
|
8
|
+
import { hub } from '/city/hub.js';
|
|
9
|
+
import { artTokens, worldPalette, statusColor, tone, mixHex, alpha, shade, rgb } from '/js/art.js';
|
|
10
|
+
import { t, L } from '/js/i18n.js';
|
|
11
|
+
import { roleName } from '/js/store.js';
|
|
12
|
+
import { mdLine } from '/js/md.js';
|
|
7
13
|
|
|
8
|
-
const FONT = '"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,sans-serif';
|
|
9
|
-
const MONO = '
|
|
10
|
-
const OUT = '#24160C';
|
|
14
|
+
const FONT = '"Inter","Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,sans-serif';
|
|
15
|
+
const MONO = '"JetBrains Mono","Cascadia Mono","Cascadia Code",ui-monospace,Consolas,monospace';
|
|
11
16
|
|
|
12
17
|
// World: x runs to the lower right, y to the lower left, z is up. One unit is one floor tile.
|
|
13
18
|
const RX = 14;
|
|
@@ -24,52 +29,39 @@ const MEL_HOME = { x: 4.05, y: 1.35, z: 1.5 };
|
|
|
24
29
|
const DOOR = { x: 12.45, y: 0.35, z: 1.0 };
|
|
25
30
|
const BOARD = { u0: 0.9, u1: 6.9, t0: 0.2, t1: 2.32 };
|
|
26
31
|
const NOTE_H = 0.3;
|
|
27
|
-
const COLS = ['
|
|
32
|
+
const COLS = ['todo', 'doing', 'done']; // office.board.*
|
|
28
33
|
const COL_OF = { pending: 0, ready: 0, blocked: 0, running: 1, review: 1, failed: 1, done: 2, skipped: 2 };
|
|
29
34
|
const ACTIVE = new Set(['refining', 'awaiting_brief', 'planning', 'running']);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const GLYPHS = {
|
|
33
|
-
dev: ['{ }', '</>', '=>', '( )', ';', '01', 'fn', '[ ]', '++', '&&'],
|
|
34
|
-
designer: ['#', 'px', 'rem', ':root', 'rgb', 'em'],
|
|
35
|
-
writer: ['Aa', '##', 'md', 'abc', '...', 'txt'],
|
|
36
|
-
qa: ['ok?', 'assert', '==', '!', 'test'],
|
|
37
|
-
mel: ['plan', '1.', '2.', '3.'],
|
|
38
|
-
hired: ['{ }', 'Aa', '01', '=>'],
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/* ---------- small math and color helpers ---------- */
|
|
35
|
+
|
|
36
|
+
/* ---------- small math helpers ---------- */
|
|
42
37
|
const clamp = (v, a = 0, b = 1) => (v < a ? a : v > b ? b : v);
|
|
43
38
|
const lerp = (a, b, t) => a + (b - a) * t;
|
|
44
39
|
const easeInOut = (t) => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2);
|
|
45
40
|
const easeOut = (t) => 1 - Math.pow(1 - t, 3);
|
|
46
|
-
const easeOutBack = (t) => { const c1 = 1.70158; const c3 = c1 + 1; return 1 + c3 * Math.pow(t - 1, 3) + c1 * Math.pow(t - 1, 2); };
|
|
47
41
|
const rnd = (a, b) => a + Math.random() * (b - a);
|
|
48
|
-
const pick = (arr) => arr[(Math.random() * arr.length) | 0];
|
|
49
42
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
43
|
+
/* ---------- texts ---------- */
|
|
44
|
+
// Fixed texts drawn every frame: read once per language, then from the cache.
|
|
45
|
+
const txCache = new Map();
|
|
46
|
+
let txV = -1;
|
|
47
|
+
function tc(key) {
|
|
48
|
+
if (L.v !== txV) { txCache.clear(); txV = L.v; }
|
|
49
|
+
let v = txCache.get(key);
|
|
50
|
+
if (v === undefined) { v = t(key); txCache.set(key, v); }
|
|
51
|
+
return v;
|
|
54
52
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
/** A task title as plain text for the canvas (markdown marks gone), cached since it is drawn every frame. */
|
|
54
|
+
const plainCache = new Map();
|
|
55
|
+
function plain(text, max = 0) {
|
|
56
|
+
const k = `${max}|${text}`;
|
|
57
|
+
let v = plainCache.get(k);
|
|
58
|
+
if (v === undefined) { v = mdLine(text, max); if (plainCache.size > 400) plainCache.clear(); plainCache.set(k, v); }
|
|
59
|
+
return v;
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
-
const
|
|
61
|
+
/** One of Mel's lines, in the current language: office.bubble.<base>1..n */
|
|
62
|
+
const melLine = (base, n) => t(`office.bubble.${base}${1 + ((Math.random() * n) | 0)}`);
|
|
62
63
|
|
|
63
64
|
/* ---------- day and night ---------- */
|
|
64
|
-
const DAY = {
|
|
65
|
-
floorA: '#8C6743', floorB: '#835F3D', floorC: '#946E48', grout: '#634629', rug: '#E8A93A',
|
|
66
|
-
slabL: '#4B3625', slabR: '#3A2A1C', wallL: '#F0E3C9', wallR: '#E2D1B2', wainL: '#B98A5B', wainR: '#A67A4E',
|
|
67
|
-
trim: '#7A5636', comb: '#C9A979', deskTop: '#ECD6AA', deskL: '#D2B07A', deskR: '#B99560', panel: '#94724A',
|
|
68
|
-
board: '#FBF6EA', frame: '#7A5636', bg0: '#1A1511', bg1: '#0E0C0A',
|
|
69
|
-
};
|
|
70
|
-
const NIGHT_TINT = '#141A2B';
|
|
71
|
-
const DUSK_TINT = '#FF9A55';
|
|
72
|
-
|
|
73
65
|
/** 0 at noon, 1 at night. */
|
|
74
66
|
export function nightFactor(h) {
|
|
75
67
|
if (h >= 8 && h <= 16.5) return 0;
|
|
@@ -82,11 +74,11 @@ function goldenFactor(h) {
|
|
|
82
74
|
return clamp(1 - d / 1.6);
|
|
83
75
|
}
|
|
84
76
|
export function dayPhase(h) {
|
|
85
|
-
if (h >= 5 && h < 8) return '
|
|
86
|
-
if (h >= 8 && h < 12) return '
|
|
87
|
-
if (h >= 12 && h < 17) return '
|
|
88
|
-
if (h >= 17 && h < 20) return '
|
|
89
|
-
return '
|
|
77
|
+
if (h >= 5 && h < 8) return t('office.shift.morning');
|
|
78
|
+
if (h >= 8 && h < 12) return t('office.shift.day');
|
|
79
|
+
if (h >= 12 && h < 17) return t('office.shift.afternoon');
|
|
80
|
+
if (h >= 17 && h < 20) return t('office.shift.evening');
|
|
81
|
+
return t('office.shift.night');
|
|
90
82
|
}
|
|
91
83
|
|
|
92
84
|
export class OfficeScene {
|
|
@@ -128,7 +120,7 @@ export class OfficeScene {
|
|
|
128
120
|
this.noteHits = [];
|
|
129
121
|
this.highlight = null;
|
|
130
122
|
this.dragTask = null;
|
|
131
|
-
this.stars = Array.from({ length:
|
|
123
|
+
this.stars = Array.from({ length: 18 }, (_, i) => ({ u: ((i * 73) % 97) / 97, t: ((i * 41) % 61) / 61, r: 0.6 + ((i * 7) % 5) / 5, ph: i }));
|
|
132
124
|
this.palAt = -1;
|
|
133
125
|
}
|
|
134
126
|
|
|
@@ -161,7 +153,7 @@ export class OfficeScene {
|
|
|
161
153
|
const height = span * this.b + (WALL + SLAB) * this.c;
|
|
162
154
|
this.ox = pad.l + (w - pad.l - pad.r - width) / 2 + RY * a;
|
|
163
155
|
this.oy = pad.t + (h - pad.t - pad.b - height) / 2 + WALL * this.c;
|
|
164
|
-
this.k = (a * 1.
|
|
156
|
+
this.k = (a * 1.25) / 64; // bee sprite scale: px per SVG unit
|
|
165
157
|
this.buildPaths();
|
|
166
158
|
this.bgGrad = null;
|
|
167
159
|
if (!this.running) this.draw();
|
|
@@ -173,7 +165,7 @@ export class OfficeScene {
|
|
|
173
165
|
/* ---------- state sync ---------- */
|
|
174
166
|
reduced() { return this.reducedFn(); }
|
|
175
167
|
|
|
176
|
-
/** Creates and removes actors to match the crew. `animate`
|
|
168
|
+
/** Creates and removes actors to match the crew. `animate` walks new hires in through the door. */
|
|
177
169
|
syncCrew(animate = false) {
|
|
178
170
|
const s = this.getState();
|
|
179
171
|
const seen = new Set();
|
|
@@ -205,15 +197,15 @@ export class OfficeScene {
|
|
|
205
197
|
id: w.id, w, isMel, slot, desk, home,
|
|
206
198
|
pos: { ...home }, mode: 'idle', modeSince: this.now, pending: null, pendingSince: 0,
|
|
207
199
|
status: 'idle', idleSince: this.now - 60000, route: [], seg: null, item: null,
|
|
208
|
-
bubble: null, badge: null, hopAt: -9, squashAt: -9,
|
|
200
|
+
bubble: null, badge: null, hopAt: -9, squashAt: -9, ph: Math.random() * 6.28,
|
|
209
201
|
nextGlyph: 0, nextZ: 0, nextBubble: 0, alpha: 1, fadeAt: -9, build: animate ? this.now : -9, leaving: false,
|
|
210
202
|
level: 1, sx: 0, sy: 0,
|
|
211
203
|
};
|
|
212
204
|
if (animate && !this.reduced()) {
|
|
213
205
|
a.pos = { ...DOOR };
|
|
214
206
|
a.alpha = 0;
|
|
215
|
-
a.fadeAt = this.now +
|
|
216
|
-
a.route.push({ to: { ...home }, dur: 1.
|
|
207
|
+
a.fadeAt = this.now + 0.6;
|
|
208
|
+
a.route.push({ to: { ...home }, dur: 1.4, lift: 0.5, delay: 0.7 });
|
|
217
209
|
this.sound('build');
|
|
218
210
|
}
|
|
219
211
|
this.actors.set(w.id, a);
|
|
@@ -223,7 +215,7 @@ export class OfficeScene {
|
|
|
223
215
|
removeActor(a, animate) {
|
|
224
216
|
if (!animate || this.reduced()) { this.actors.delete(a.id); this.slotOf.delete(a.id); return; }
|
|
225
217
|
a.leaving = true;
|
|
226
|
-
a.route = [{ to: { ...DOOR }, dur: 1.
|
|
218
|
+
a.route = [{ to: { ...DOOR }, dur: 1.2, lift: 0.5, after: () => { this.actors.delete(a.id); this.slotOf.delete(a.id); } }];
|
|
227
219
|
a.seg = null;
|
|
228
220
|
}
|
|
229
221
|
|
|
@@ -244,7 +236,6 @@ export class OfficeScene {
|
|
|
244
236
|
handle(ev) {
|
|
245
237
|
const d = ev.data || {};
|
|
246
238
|
const s = this.getState();
|
|
247
|
-
const reduced = this.reduced();
|
|
248
239
|
switch (ev.type) {
|
|
249
240
|
case 'crew.hired': case 'crew.updated': case 'crew.fired':
|
|
250
241
|
this.syncCrew(true);
|
|
@@ -265,50 +256,48 @@ export class OfficeScene {
|
|
|
265
256
|
this.briefWrite = null;
|
|
266
257
|
this.briefWait = ev.jobId || true;
|
|
267
258
|
const mel = this.actors.get('mel');
|
|
268
|
-
if (mel) { mel.bubble = { text: '
|
|
259
|
+
if (mel) { mel.bubble = { text: t('office.bubble.briefReady'), at: this.now, until: this.now + 6 }; this.sound('stuck'); }
|
|
269
260
|
break;
|
|
270
261
|
}
|
|
271
262
|
case 'brief.approved': {
|
|
272
263
|
this.briefWait = null; this.briefWrite = null;
|
|
273
264
|
const mel = this.actors.get('mel');
|
|
274
|
-
if (mel) { this.
|
|
265
|
+
if (mel) { this.pulse(mel, 'ok'); this.sound('pop'); }
|
|
275
266
|
if (d.by !== 'auto') this.melReact('nod');
|
|
276
267
|
break;
|
|
277
268
|
}
|
|
278
269
|
case 'job.planning': {
|
|
279
270
|
this.briefWait = null; this.briefWrite = null;
|
|
280
271
|
const mel = this.actors.get('mel');
|
|
281
|
-
if (mel) mel.bubble = { text: '
|
|
272
|
+
if (mel) mel.bubble = { text: t('office.bubble.planning'), at: this.now, until: this.now + 2.5 };
|
|
282
273
|
break;
|
|
283
274
|
}
|
|
284
275
|
case 'job.planned':
|
|
285
276
|
case 'task.added':
|
|
286
277
|
this.layoutNotes(false);
|
|
287
|
-
if (ev.type === 'task.added' && d.task?.kind === 'fix') {
|
|
288
|
-
// QA walks the issue over to whoever fixes it.
|
|
289
|
-
const t = s.tasks[d.task.id];
|
|
290
|
-
if (t) this.handoff('qa', t.assignee, 'bad');
|
|
291
|
-
}
|
|
292
278
|
break;
|
|
279
|
+
case 'task.handoff': {
|
|
280
|
+
// The task engine says who handed what to whom (PLAN section 10): the bee carries it over.
|
|
281
|
+
const from = d.from || d.fromAgent || d.fromWorker;
|
|
282
|
+
const to = d.to || d.toAgent || d.toWorker;
|
|
283
|
+
if (from && to && from !== to) this.handoff(from, to, d.kind === 'fix' || d.reason === 'rejected' ? 'bad' : 'parcel');
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
293
286
|
case 'task.status': {
|
|
294
287
|
this.layoutNotes(false);
|
|
295
288
|
const t = s.tasks[d.taskId];
|
|
296
289
|
if (!t) break;
|
|
297
290
|
const a = this.actors.get(t.assignee);
|
|
298
291
|
if (d.status === 'done' && a) {
|
|
299
|
-
|
|
300
|
-
this.
|
|
301
|
-
a
|
|
302
|
-
|
|
303
|
-
const to = [...new Set(next.map((x) => x.assignee))].slice(0, 2);
|
|
304
|
-
for (const id of to) this.handoff(t.assignee, id, 'parcel');
|
|
292
|
+
// quiet success: a check mark and one short pulse; the count in the HUD goes up
|
|
293
|
+
a.badge = { kind: 'ok', at: this.now, until: this.now + 1.8 };
|
|
294
|
+
this.pulse(a, 'ok');
|
|
295
|
+
this.opts.onHoney?.();
|
|
305
296
|
const lv = levelOf(s, t.assignee);
|
|
306
|
-
if (lv > (this.levelSeen.get(t.assignee) || 1)) {
|
|
297
|
+
if (lv != null && lv > (this.levelSeen.get(t.assignee) || 1)) {
|
|
298
|
+
// the level is a quiet badge in the name tag, never a burst
|
|
307
299
|
this.levelSeen.set(t.assignee, lv);
|
|
308
300
|
a.level = lv;
|
|
309
|
-
this.label(a, `Level ${lv}!`, '#FFD072', 1.2);
|
|
310
|
-
this.sparkle(a, 14);
|
|
311
|
-
this.sound('level');
|
|
312
301
|
}
|
|
313
302
|
}
|
|
314
303
|
if (d.status === 'failed' && a) { a.badge = { kind: 'bad', at: this.now, until: this.now + 3 }; this.sound('fail'); }
|
|
@@ -324,10 +313,7 @@ export class OfficeScene {
|
|
|
324
313
|
this.calls.set(d.callId, { workerId: d.workerId, tool: d.tool });
|
|
325
314
|
const a = this.actors.get(d.workerId);
|
|
326
315
|
if (!a) break;
|
|
327
|
-
if (d.tool === 'write_file' || d.tool === 'edit_file') {
|
|
328
|
-
for (let i = 0; i < (reduced ? 0 : 6); i++) this.glyph(a, true);
|
|
329
|
-
this.sound('type');
|
|
330
|
-
}
|
|
316
|
+
if (d.tool === 'write_file' || d.tool === 'edit_file') { a.wroteAt = this.now; this.sound('type'); }
|
|
331
317
|
break;
|
|
332
318
|
}
|
|
333
319
|
case 'tool.result': {
|
|
@@ -336,11 +322,13 @@ export class OfficeScene {
|
|
|
336
322
|
if (!c) break;
|
|
337
323
|
const a = this.actors.get(c.workerId);
|
|
338
324
|
if (!a) break;
|
|
339
|
-
if (c.tool === 'check') {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
325
|
+
if (c.tool === 'check' && typeof d.passed === 'boolean') {
|
|
326
|
+
// tool.result.passed: the structured verdict of the checks. Without it no mark is shown.
|
|
327
|
+
a.badge = { kind: d.passed ? 'ok' : 'bad', at: this.now, until: this.now + 2.6 };
|
|
328
|
+
this.sound(d.passed ? 'pass' : 'fail');
|
|
329
|
+
} else if (c.tool === 'check' && !d.ok) {
|
|
330
|
+
a.badge = { kind: 'bad', at: this.now, until: this.now + 2.6 };
|
|
331
|
+
this.sound('fail');
|
|
344
332
|
}
|
|
345
333
|
break;
|
|
346
334
|
}
|
|
@@ -354,14 +342,14 @@ export class OfficeScene {
|
|
|
354
342
|
const a = this.actors.get('qa') || this.actors.get(s.tasks[d.taskId]?.assignee);
|
|
355
343
|
if (a) {
|
|
356
344
|
a.badge = { kind: d.passed ? 'ok' : 'bad', at: this.now, until: this.now + 3.4, big: true };
|
|
357
|
-
if (d.passed) this.
|
|
345
|
+
if (d.passed) this.pulse(a, 'ok');
|
|
358
346
|
this.sound(d.passed ? 'pass' : 'fail');
|
|
359
347
|
}
|
|
360
348
|
break;
|
|
361
349
|
}
|
|
362
350
|
case 'file.changed': {
|
|
363
351
|
const a = this.actors.get(d.workerId);
|
|
364
|
-
if (a) this.label(a, `${d.op === 'create' ? '+ ' : ''}${String(d.path || '').split('/').pop()}`,
|
|
352
|
+
if (a) this.label(a, `${d.op === 'create' ? '+ ' : ''}${String(d.path || '').split('/').pop()}`, artTokens().text2, 1.2);
|
|
365
353
|
break;
|
|
366
354
|
}
|
|
367
355
|
case 'approval.requested': {
|
|
@@ -387,17 +375,12 @@ export class OfficeScene {
|
|
|
387
375
|
}
|
|
388
376
|
|
|
389
377
|
/* ---------- effects ---------- */
|
|
378
|
+
/** A finished job: one calm success pulse on every bee. No confetti, no burst. */
|
|
390
379
|
celebrate() {
|
|
391
380
|
this.celebrateAt = this.now;
|
|
392
|
-
this.celebrateUntil = this.now + 6
|
|
381
|
+
this.celebrateUntil = this.now + 0.6;
|
|
393
382
|
this.sound('confetti');
|
|
394
|
-
|
|
395
|
-
const n = this.mini ? 40 : 150;
|
|
396
|
-
const colors = ['#FFB531', '#FFD072', '#7DC49B', '#86A9D6', '#FF7AB6', '#F2E9DA', '#E57B6E'];
|
|
397
|
-
for (let i = 0; i < n; i++) {
|
|
398
|
-
this.spawn({ kind: 'confetti', x: rnd(this.w * 0.1, this.w * 0.9), y: rnd(-80, this.h * 0.15), vx: rnd(-40, 40), vy: rnd(10, 120), g: 140, life: rnd(3.2, 5.5), rot: rnd(0, 6.28), vr: rnd(-6, 6), size: rnd(5, 9), color: pick(colors), hex: Math.random() < 0.5 });
|
|
399
|
-
}
|
|
400
|
-
for (const a of this.actors.values()) this.sparkle(a, 8);
|
|
383
|
+
for (const a of this.actors.values()) this.pulse(a, 'ok');
|
|
401
384
|
}
|
|
402
385
|
|
|
403
386
|
/** Mel answers what the user does: a nod on approve, a curious tilt on a new request. */
|
|
@@ -405,9 +388,9 @@ export class OfficeScene {
|
|
|
405
388
|
const mel = this.actors.get('mel');
|
|
406
389
|
if (!mel) return;
|
|
407
390
|
mel.react = { kind, at: this.now };
|
|
408
|
-
if (kind === 'nod')
|
|
409
|
-
if (kind === 'curious') mel.bubble = { text:
|
|
410
|
-
if (kind === 'shake') mel.bubble = { text: '
|
|
391
|
+
if (kind === 'nod') mel.bubble = { text: melLine('nod', 3), at: this.now, until: this.now + 2.6 };
|
|
392
|
+
if (kind === 'curious') mel.bubble = { text: melLine('curious', 2), at: this.now, until: this.now + 2.8 };
|
|
393
|
+
if (kind === 'shake') mel.bubble = { text: t('office.bubble.skip'), at: this.now, until: this.now + 2.6 };
|
|
411
394
|
mel.idleSince = this.now;
|
|
412
395
|
}
|
|
413
396
|
|
|
@@ -416,10 +399,11 @@ export class OfficeScene {
|
|
|
416
399
|
const b = this.actors.get(toId);
|
|
417
400
|
if (!a || !b || a === b || a.leaving) return;
|
|
418
401
|
const spot = this.visitSpot(b);
|
|
419
|
-
const
|
|
402
|
+
const T = artTokens();
|
|
403
|
+
const color = item === 'bad' ? T.bad : a.w.color;
|
|
420
404
|
a.route.push(
|
|
421
|
-
{ to: spot, dur: null, lift: 0.
|
|
422
|
-
{ to: 'home', dur: null, lift: 0.
|
|
405
|
+
{ to: spot, dur: null, lift: 0.5, item, color, hold: 0.5, onArrive: () => { this.pulse(b, 'info'); this.sound('pop'); }, dropItem: true },
|
|
406
|
+
{ to: 'home', dur: null, lift: 0.4 },
|
|
423
407
|
);
|
|
424
408
|
}
|
|
425
409
|
|
|
@@ -428,34 +412,23 @@ export class OfficeScene {
|
|
|
428
412
|
return { x: b.desk.x + DW / 2 + 0.15, y: b.desk.y + DD + 0.55, z: 1.0 };
|
|
429
413
|
}
|
|
430
414
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
if (this.reduced() || !target) { this.opts.onHoney?.(); return; }
|
|
434
|
-
this.spawn({ kind: 'jar', x0: a.sx, y0: a.sy - 30, x1: target.x, y1: target.y, t: 0, life: 1.25, max: 1.25, done: () => this.opts.onHoney?.() });
|
|
435
|
-
}
|
|
415
|
+
/** Kept for the HUD counter hook: a finished task counts at once, nothing flies. */
|
|
416
|
+
honeyJar() { this.opts.onHoney?.(); }
|
|
436
417
|
|
|
437
418
|
label(a, text, color, life = 1.4) {
|
|
438
419
|
if (this.mini) return;
|
|
439
|
-
this.spawn({ kind: 'label', x: a.sx
|
|
420
|
+
this.spawn({ kind: 'label', x: a.sx, y: a.sy - 46 * this.k, vy: -10, text, color, life, max: life });
|
|
440
421
|
}
|
|
441
422
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
glyph(a, burst = false) {
|
|
447
|
-
const kind = KIND[a.id] || 'hired';
|
|
448
|
-
const base = this.P(a.desk ? a.desk.x + 0.75 : a.pos.x, a.desk ? a.desk.y + 0.3 : a.pos.y, a.desk ? DH + 0.55 : a.pos.z);
|
|
449
|
-
if (kind === 'designer' && Math.random() < 0.5) {
|
|
450
|
-
this.spawn({ kind: 'dot', x: base[0] + rnd(-14, 14), y: base[1], vx: rnd(-14, 14), vy: rnd(-48, -28), life: rnd(1, 1.6), size: rnd(2.5, 4.5), color: pick(['#FF7AB6', '#6CC4FF', '#FFD072', '#7DC49B']) });
|
|
451
|
-
return;
|
|
452
|
-
}
|
|
453
|
-
this.spawn({ kind: 'glyph', x: base[0] + rnd(-16, 16), y: base[1] - rnd(0, 6), vx: rnd(-10, 10), vy: burst ? rnd(-70, -40) : rnd(-46, -30), life: rnd(1.1, 1.7), text: pick(GLYPHS[kind]), color: a.w.color || '#FFD072', size: this.mini ? 6 : Math.max(9, this.a * 0.2) });
|
|
423
|
+
/** A short ring that grows and fades at the bee's feet: the one shot feedback (at most 400 ms). */
|
|
424
|
+
pulse(a, kind = 'ok') {
|
|
425
|
+
if (this.reduced()) return;
|
|
426
|
+
this.spawn({ kind: 'pulse', id: a.id, tone: kind, life: 0.4, max: 0.4 });
|
|
454
427
|
}
|
|
455
428
|
|
|
456
429
|
spawn(p) {
|
|
457
430
|
if (this.reduced() && p.kind !== 'jar') return;
|
|
458
|
-
if (this.parts.length >
|
|
431
|
+
if (this.parts.length > 120) this.parts.shift();
|
|
459
432
|
p.age = 0;
|
|
460
433
|
if (p.max == null) p.max = p.life;
|
|
461
434
|
this.parts.push(p);
|
|
@@ -531,17 +504,18 @@ export class OfficeScene {
|
|
|
531
504
|
const job = this.melQueue.shift();
|
|
532
505
|
const n = job.note;
|
|
533
506
|
if (this.reduced()) { n.state = 'free'; n.alpha = 1; n.pop = this.now; n.u = n.tu; n.t = n.tt; return; }
|
|
507
|
+
const T = artTokens();
|
|
534
508
|
if (job.type === 'place') {
|
|
535
|
-
mel.route.push({ to: this.notePoint(n, n.tu, n.tt), dur: 0.45 * speed, lift: 0.
|
|
509
|
+
mel.route.push({ to: this.notePoint(n, n.tu, n.tt), dur: 0.45 * speed, lift: 0.08, item: 'note', color: n.task?.assignee ? this.actors.get(n.task.assignee)?.w.color : T.accent, hold: 0.12 * speed,
|
|
536
510
|
onArrive: () => { n.state = 'free'; n.u = n.tu; n.t = n.tt; n.alpha = 1; n.pop = this.now; this.sound('stick'); }, dropItem: true });
|
|
537
511
|
} else {
|
|
538
512
|
mel.route.push(
|
|
539
|
-
{ to: this.notePoint(n), dur: 0.5 * speed, lift: 0.
|
|
540
|
-
{ to: () => this.notePoint(n, n.tu, n.tt), dur: 0.7 * speed, lift: 0.
|
|
513
|
+
{ to: this.notePoint(n), dur: 0.5 * speed, lift: 0.1, hold: 0.12 * speed, onArrive: () => { n.state = 'carried'; this.sound('peel'); } },
|
|
514
|
+
{ to: () => this.notePoint(n, n.tu, n.tt), dur: 0.7 * speed, lift: 0.2, item: 'note', color: T.accent, hold: 0.15 * speed,
|
|
541
515
|
onArrive: () => { n.state = 'free'; n.u = n.tu; n.t = n.tt; n.pop = this.now; this.sound('stick'); }, dropItem: true },
|
|
542
516
|
);
|
|
543
517
|
}
|
|
544
|
-
if (!this.melQueue.length) mel.route.push({ to: 'home', dur: null, lift: 0.
|
|
518
|
+
if (!this.melQueue.length) mel.route.push({ to: 'home', dur: null, lift: 0.15, delay: 0.3 });
|
|
545
519
|
}
|
|
546
520
|
|
|
547
521
|
/* ---------- per frame update ---------- */
|
|
@@ -562,7 +536,7 @@ export class OfficeScene {
|
|
|
562
536
|
|
|
563
537
|
isCalm() {
|
|
564
538
|
if (this.parts.length || this.melQueue.length || this.now < this.celebrateUntil) return false;
|
|
565
|
-
for (const a of this.actors.values()) if (a.seg || a.route.length || (a.mode !== 'sleep' && a.mode !== 'idle' && a.mode !== 'paused')) return false;
|
|
539
|
+
for (const a of this.actors.values()) if (a.seg || a.route.length || a.badge || (a.mode !== 'sleep' && a.mode !== 'idle' && a.mode !== 'paused')) return false;
|
|
566
540
|
return true;
|
|
567
541
|
}
|
|
568
542
|
|
|
@@ -574,18 +548,15 @@ export class OfficeScene {
|
|
|
574
548
|
this.briefWaiting = !!this.briefWait || (s.jobs || []).some((j) => j.status === 'awaiting_brief');
|
|
575
549
|
this.briefWriting = !!this.briefWrite || (s.jobs || []).some((j) => j.status === 'refining');
|
|
576
550
|
this.pumpMel();
|
|
577
|
-
// with nothing to do, Mel
|
|
551
|
+
// with nothing to do, Mel says something useful now and then
|
|
578
552
|
const mel = this.actors.get('mel');
|
|
579
553
|
if (mel && !jobRunning && !this.mini && !mel.seg && !mel.bubble) {
|
|
580
554
|
if (!this.nextIdleTalk) this.nextIdleTalk = now + 6;
|
|
581
555
|
if (now > this.nextIdleTalk) {
|
|
582
|
-
const
|
|
583
|
-
|
|
584
|
-
: ['Quiet day. Want to build something?', 'Type a request in the box above.', 'The crew is ready when you are.', 'A landing page? A small app? Just ask.'];
|
|
585
|
-
mel.bubble = { text: pick(lines), at: now, until: now + 4 };
|
|
556
|
+
const said = (s.jobs || []).length ? melLine('idleDone', 3) : melLine('idleNew', 3);
|
|
557
|
+
mel.bubble = { text: said, at: now, until: now + 4 };
|
|
586
558
|
mel.idleSince = now;
|
|
587
|
-
|
|
588
|
-
this.nextIdleTalk = now + rnd(24, 34);
|
|
559
|
+
this.nextIdleTalk = now + rnd(28, 40);
|
|
589
560
|
}
|
|
590
561
|
}
|
|
591
562
|
let typing = 0;
|
|
@@ -614,11 +585,11 @@ export class OfficeScene {
|
|
|
614
585
|
a.route.shift();
|
|
615
586
|
const to = typeof next.to === 'function' ? next.to() : next.to === 'home' ? { ...a.home } : next.to;
|
|
616
587
|
const dist = Math.hypot(to.x - a.pos.x, to.y - a.pos.y);
|
|
617
|
-
const dur = reduced ? 0 : next.dur ?? clamp(0.
|
|
618
|
-
a.seg = { ...next, from: { ...a.pos }, to, t0: now, dur, lift: (next.lift ?? 0.
|
|
588
|
+
const dur = reduced ? 0 : next.dur ?? clamp(0.6 + dist * 0.12, 0.6, 2);
|
|
589
|
+
a.seg = { ...next, from: { ...a.pos }, to, t0: now, dur, lift: (next.lift ?? 0.5) + dist * 0.03 };
|
|
619
590
|
a.item = next.item || null;
|
|
620
591
|
a.itemColor = next.color;
|
|
621
|
-
if (dur > 0)
|
|
592
|
+
if (dur > 0) this.sound('whoosh');
|
|
622
593
|
else a.fadeAt = now;
|
|
623
594
|
}
|
|
624
595
|
}
|
|
@@ -632,7 +603,6 @@ export class OfficeScene {
|
|
|
632
603
|
a.flyU = u;
|
|
633
604
|
if (u >= 1 && !g.arrived) {
|
|
634
605
|
g.arrived = now;
|
|
635
|
-
a.squashAt = now;
|
|
636
606
|
g.onArrive?.();
|
|
637
607
|
if (g.dropItem) a.item = null;
|
|
638
608
|
}
|
|
@@ -643,32 +613,18 @@ export class OfficeScene {
|
|
|
643
613
|
}
|
|
644
614
|
if (a.seg && a.seg.dur && !a.seg.arrived) flying++;
|
|
645
615
|
} else {
|
|
646
|
-
//
|
|
647
|
-
const hx = a.mode === 'plan' && a.isMel ? a.home.x + Math.sin(now * 0.
|
|
616
|
+
// glide home smoothly
|
|
617
|
+
const hx = a.mode === 'plan' && a.isMel ? a.home.x + Math.sin(now * 0.5) * 0.9 : a.home.x;
|
|
648
618
|
const k = 1 - Math.pow(0.002, dt);
|
|
649
619
|
a.pos.x = lerp(a.pos.x, hx, k);
|
|
650
620
|
a.pos.y = lerp(a.pos.y, a.home.y, k);
|
|
651
|
-
a.pos.z = lerp(a.pos.z, a.home.z + (a.mode === 'sleep' || a.mode === 'paused' ? -0.
|
|
621
|
+
a.pos.z = lerp(a.pos.z, a.home.z + (a.mode === 'sleep' || a.mode === 'paused' ? -0.12 : 0), k);
|
|
652
622
|
a.flyU = null;
|
|
653
623
|
}
|
|
654
624
|
|
|
655
|
-
if (a.fadeAt > 0) a.alpha = clamp((now - a.fadeAt) / 0.
|
|
625
|
+
if (a.fadeAt > 0) a.alpha = clamp((now - a.fadeAt) / 0.25);
|
|
656
626
|
if (a.leaving && a.seg) a.alpha = 1 - clamp((now - a.seg.t0) / (a.seg.dur || 0.3));
|
|
657
|
-
|
|
658
|
-
// ambient effects by mode
|
|
659
|
-
if (!reduced && !a.seg) {
|
|
660
|
-
if (a.mode === 'type') {
|
|
661
|
-
typing++;
|
|
662
|
-
if (now > a.nextGlyph) { this.glyph(a); a.nextGlyph = now + rnd(0.12, 0.26); }
|
|
663
|
-
} else if (a.mode === 'sleep' || a.mode === 'paused') {
|
|
664
|
-
if (now > a.nextZ) { this.spawn({ kind: 'z', x: a.sx + 10 * this.k * 1.3, y: a.sy - 18 * this.k * 1.3, vx: rnd(8, 16), vy: -16, life: 2.2, size: this.mini ? 6 : Math.max(9, this.a * 0.2) }); a.nextZ = now + 1.1; }
|
|
665
|
-
} else if (a.mode === 'test') {
|
|
666
|
-
if (now > a.nextGlyph) { this.spawn({ kind: 'bubble', x: a.sx + rnd(-8, 8) + 30 * this.k, y: a.sy - 52 * this.k, vx: rnd(-6, 6), vy: rnd(-34, -20), life: rnd(0.7, 1.2), size: rnd(1.5, 3.2), color: '#7DC49B' }); a.nextGlyph = now + rnd(0.08, 0.2); }
|
|
667
|
-
} else if (a.mode === 'plan') {
|
|
668
|
-
if (now > a.nextGlyph) { this.glyph(a); a.nextGlyph = now + rnd(0.3, 0.5); }
|
|
669
|
-
} else if (a.mode === 'celebrate' && Math.random() < dt * 3) this.sparkle(a, 1);
|
|
670
|
-
}
|
|
671
|
-
if (now > a.blinkAt + 0.14) a.blinkAt = now + rnd(2.2, 5.5);
|
|
627
|
+
if (a.mode === 'type') typing++;
|
|
672
628
|
if (a.bubble && now > a.bubble.until) a.bubble = null;
|
|
673
629
|
if (a.badge && now > a.badge.until) a.badge = null;
|
|
674
630
|
}
|
|
@@ -689,9 +645,7 @@ export class OfficeScene {
|
|
|
689
645
|
const p = this.parts[i];
|
|
690
646
|
p.age += dt;
|
|
691
647
|
if (p.age >= p.max) { this.parts.splice(i, 1); p.done?.(); continue; }
|
|
692
|
-
if (p.kind === 'jar') continue;
|
|
693
648
|
p.vy += (p.g || 0) * dt;
|
|
694
|
-
if (p.kind === 'confetti') { p.vx *= 1 - dt * 0.6; p.vy = Math.min(p.vy, 150); p.rot += p.vr * dt; p.x += Math.sin(p.age * 3 + p.rot) * 12 * dt; }
|
|
695
649
|
p.x += (p.vx || 0) * dt;
|
|
696
650
|
p.y += (p.vy || 0) * dt;
|
|
697
651
|
}
|
|
@@ -699,7 +653,6 @@ export class OfficeScene {
|
|
|
699
653
|
|
|
700
654
|
targetMode(a, st, jobRunning) {
|
|
701
655
|
if (a.leaving) return 'fly';
|
|
702
|
-
if (this.now < this.celebrateUntil) return 'celebrate';
|
|
703
656
|
if (a.w.paused) return 'paused';
|
|
704
657
|
if (a.isMel && st.status === 'idle') {
|
|
705
658
|
if (this.briefWaiting) return 'stuck';
|
|
@@ -726,68 +679,38 @@ export class OfficeScene {
|
|
|
726
679
|
/* ---------- drawing ---------- */
|
|
727
680
|
palette() {
|
|
728
681
|
const h = this.hourFn();
|
|
729
|
-
const
|
|
682
|
+
const T = artTokens();
|
|
683
|
+
const key = `${Math.round(h * 12)}|${T.bg}|${T.accent}|${T.scheme}`;
|
|
730
684
|
if (key === this.palAt && this.pal) return this.pal;
|
|
731
685
|
this.palAt = key;
|
|
732
686
|
const night = nightFactor(h);
|
|
733
687
|
const gold = goldenFactor(h) * (1 - night * 0.6);
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
if (gold) c = mixHex(c, DUSK_TINT, gold * 0.1);
|
|
739
|
-
out[k] = c;
|
|
740
|
-
}
|
|
741
|
-
this.pal = out;
|
|
742
|
-
this.combLeft = null;
|
|
743
|
-
return out;
|
|
688
|
+
const W = worldPalette(night);
|
|
689
|
+
this.pal = { ...W, night, gold, hour: h };
|
|
690
|
+
this.bgGrad = null;
|
|
691
|
+
return this.pal;
|
|
744
692
|
}
|
|
745
693
|
|
|
746
694
|
buildPaths() {
|
|
747
|
-
// hexagon floor
|
|
695
|
+
// hexagon floor grid in floor units (hairlines only: the honeycomb stays, quietly)
|
|
748
696
|
const r = 0.44;
|
|
749
697
|
const hw = Math.sqrt(3) * r;
|
|
750
698
|
const vh = 1.5 * r;
|
|
751
|
-
const
|
|
752
|
-
const grout = new Path2D();
|
|
699
|
+
const grid = new Path2D();
|
|
753
700
|
for (let row = -1; row * vh < RY + r; row++) {
|
|
754
701
|
for (let col = -1; col * hw < RX + hw; col++) {
|
|
755
702
|
const cx = col * hw + (row & 1 ? hw / 2 : 0);
|
|
756
703
|
const cy = row * vh;
|
|
757
|
-
const q = col - (row - (row & 1)) / 2;
|
|
758
|
-
const shadeIdx = (((q - row) % 3) + 3) % 3;
|
|
759
|
-
const path = new Path2D();
|
|
760
704
|
for (let i = 0; i < 6; i++) {
|
|
761
705
|
const ang = (Math.PI / 180) * (60 * i - 30);
|
|
762
706
|
const px = cx + r * Math.cos(ang);
|
|
763
707
|
const py = cy + r * Math.sin(ang);
|
|
764
|
-
if (i === 0)
|
|
765
|
-
}
|
|
766
|
-
path.closePath();
|
|
767
|
-
fill[shadeIdx].addPath(path);
|
|
768
|
-
grout.addPath(path);
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
this.floorFill = fill;
|
|
772
|
-
this.floorGrout = grout;
|
|
773
|
-
// honeycomb wallpaper (wall units, t grows downward)
|
|
774
|
-
const wr = 0.2;
|
|
775
|
-
const comb = new Path2D();
|
|
776
|
-
const whw = Math.sqrt(3) * wr;
|
|
777
|
-
for (let row = 0; row * 1.5 * wr < WALL; row++) {
|
|
778
|
-
for (let col = -1; col * whw < Math.max(RX, RY) + 1; col++) {
|
|
779
|
-
const cx = col * whw + (row & 1 ? whw / 2 : 0);
|
|
780
|
-
const cy = row * 1.5 * wr;
|
|
781
|
-
for (let i = 0; i < 6; i++) {
|
|
782
|
-
const ang = (Math.PI / 180) * (60 * i - 30);
|
|
783
|
-
const px = cx + wr * 0.9 * Math.cos(ang);
|
|
784
|
-
const py = cy + wr * 0.9 * Math.sin(ang);
|
|
785
|
-
if (i === 0) comb.moveTo(px, py); else comb.lineTo(px, py);
|
|
708
|
+
if (i === 0) grid.moveTo(px, py); else grid.lineTo(px, py);
|
|
786
709
|
}
|
|
787
|
-
|
|
710
|
+
grid.closePath();
|
|
788
711
|
}
|
|
789
712
|
}
|
|
790
|
-
this.
|
|
713
|
+
this.floorGrout = grid;
|
|
791
714
|
}
|
|
792
715
|
|
|
793
716
|
base() { this.ctx.setTransform(this.dpr, 0, 0, this.dpr, 0, 0); }
|
|
@@ -807,7 +730,7 @@ export class OfficeScene {
|
|
|
807
730
|
if (stroke) { ctx.strokeStyle = stroke; ctx.lineWidth = lw; ctx.stroke(); }
|
|
808
731
|
}
|
|
809
732
|
|
|
810
|
-
box(x, y, z, dx, dy, dz, top, left, right, edge = 'rgba(
|
|
733
|
+
box(x, y, z, dx, dy, dz, top, left, right, edge = 'rgba(0,0,0,.28)') {
|
|
811
734
|
const P = (X, Y, Z) => this.P(X, Y, Z);
|
|
812
735
|
this.poly([P(x, y + dy, z), P(x + dx, y + dy, z), P(x + dx, y + dy, z + dz), P(x, y + dy, z + dz)], left, edge);
|
|
813
736
|
this.poly([P(x + dx, y, z), P(x + dx, y + dy, z), P(x + dx, y + dy, z + dz), P(x + dx, y, z + dz)], right, edge);
|
|
@@ -827,9 +750,8 @@ export class OfficeScene {
|
|
|
827
750
|
ctx.ellipse(bx, ty, rx, ry, 0, Math.PI, 0, true);
|
|
828
751
|
ctx.closePath();
|
|
829
752
|
ctx.fill();
|
|
830
|
-
ctx.strokeStyle = 'rgba(36,22,12,.35)'; ctx.lineWidth = 1; ctx.stroke();
|
|
831
753
|
ctx.fillStyle = top;
|
|
832
|
-
ctx.beginPath(); ctx.ellipse(bx, ty, rx, ry, 0, 0, Math.PI * 2); ctx.fill();
|
|
754
|
+
ctx.beginPath(); ctx.ellipse(bx, ty, rx, ry, 0, 0, Math.PI * 2); ctx.fill();
|
|
833
755
|
}
|
|
834
756
|
|
|
835
757
|
draw() {
|
|
@@ -838,10 +760,10 @@ export class OfficeScene {
|
|
|
838
760
|
const ctx = this.ctx;
|
|
839
761
|
const pal = this.palette();
|
|
840
762
|
this.base();
|
|
841
|
-
// backdrop
|
|
763
|
+
// backdrop: the graphite void
|
|
842
764
|
if (!this.bgGrad) {
|
|
843
|
-
const g = ctx.createRadialGradient(this.w * 0.5, this.h * 0.
|
|
844
|
-
g.addColorStop(0,
|
|
765
|
+
const g = ctx.createRadialGradient(this.w * 0.5, this.h * 0.4, 10, this.w * 0.5, this.h * 0.5, Math.max(this.w, this.h) * 0.75);
|
|
766
|
+
g.addColorStop(0, pal.void0); g.addColorStop(1, pal.void1);
|
|
845
767
|
this.bgGrad = g;
|
|
846
768
|
}
|
|
847
769
|
ctx.fillStyle = this.bgGrad;
|
|
@@ -860,9 +782,7 @@ export class OfficeScene {
|
|
|
860
782
|
}
|
|
861
783
|
list.push({ k: MEL_HOME.x + MEL_HOME.y - 0.05, f: () => this.drawPodium(pal) });
|
|
862
784
|
list.push({ k: 0.6 + 9.3, f: () => this.drawPlant(0.6, 9.3, 1.0) });
|
|
863
|
-
list.push({ k: 13.
|
|
864
|
-
list.push({ k: 13.3 + 4.9, f: () => this.drawPlant(13.3, 4.9, 1.15) });
|
|
865
|
-
list.push({ k: 13.1 + 9.1, f: () => this.drawCooler(13.1, 9.1, pal) });
|
|
785
|
+
list.push({ k: 13.3 + 4.9, f: () => this.drawPlant(13.3, 4.9, 1.1) });
|
|
866
786
|
list.push({ k: 0.4 + 1.2, f: () => this.drawShelfUnit(pal) });
|
|
867
787
|
list.sort((p, q) => p.k - q.k);
|
|
868
788
|
for (const it of list) it.f();
|
|
@@ -874,67 +794,49 @@ export class OfficeScene {
|
|
|
874
794
|
|
|
875
795
|
drawRoom(pal) {
|
|
876
796
|
const ctx = this.ctx;
|
|
797
|
+
const T = pal.T;
|
|
877
798
|
const P = (x, y, z) => this.P(x, y, z);
|
|
878
|
-
// floor slab
|
|
879
|
-
this.poly([P(-0.16, RY, 0), P(RX, RY, 0), P(RX, RY, -SLAB), P(-0.16, RY, -SLAB)], pal.
|
|
880
|
-
this.poly([P(RX, -0.16, 0), P(RX, RY, 0), P(RX, RY, -SLAB), P(RX, -0.16, -SLAB)], pal.
|
|
881
|
-
|
|
799
|
+
// floor slab: two crisp faces
|
|
800
|
+
this.poly([P(-0.16, RY, 0), P(RX, RY, 0), P(RX, RY, -SLAB), P(-0.16, RY, -SLAB)], pal.sideA);
|
|
801
|
+
this.poly([P(RX, -0.16, 0), P(RX, RY, 0), P(RX, RY, -SLAB), P(RX, -0.16, -SLAB)], pal.sideB);
|
|
802
|
+
this.poly([P(-0.16, RY, 0), P(RX, RY, 0)], null, alpha(T.text, 0.08));
|
|
803
|
+
// floor with a hairline honeycomb grid and the team zone
|
|
882
804
|
this.floorT();
|
|
883
805
|
ctx.save();
|
|
884
806
|
ctx.beginPath(); ctx.rect(0, 0, RX, RY); ctx.clip();
|
|
885
|
-
ctx.fillStyle = pal.
|
|
886
|
-
ctx.
|
|
887
|
-
ctx.
|
|
888
|
-
ctx.
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
hexPath(ctx, 6.6, 5.5, 4.2);
|
|
892
|
-
ctx.fillStyle = alpha(pal.rug, 0.16); ctx.fill();
|
|
893
|
-
ctx.lineWidth = 0.06; ctx.strokeStyle = alpha(pal.rug, 0.38); ctx.stroke();
|
|
894
|
-
ctx.beginPath(); hexPath(ctx, 6.6, 5.5, 3.85);
|
|
895
|
-
ctx.lineWidth = 0.025; ctx.setLineDash([0.12, 0.1]); ctx.stroke(); ctx.setLineDash([]);
|
|
896
|
-
// daylight from the windows
|
|
807
|
+
ctx.fillStyle = pal.floor; ctx.fillRect(0, 0, RX, RY);
|
|
808
|
+
ctx.strokeStyle = pal.floorLine; ctx.lineWidth = 0.018; ctx.stroke(this.floorGrout);
|
|
809
|
+
ctx.beginPath(); hexPath(ctx, 6.6, 5.5, 4.2);
|
|
810
|
+
ctx.fillStyle = alpha(T.accent, 0.025); ctx.fill();
|
|
811
|
+
ctx.lineWidth = 0.025; ctx.strokeStyle = alpha(T.accent, 0.28); ctx.stroke();
|
|
812
|
+
// soft daylight through the windows
|
|
897
813
|
if (pal.night < 0.85) {
|
|
898
|
-
const al = (1 - pal.night) * 0.
|
|
899
|
-
ctx.fillStyle =
|
|
814
|
+
const al = (1 - pal.night) * 0.05;
|
|
815
|
+
ctx.fillStyle = alpha(T.text, al);
|
|
900
816
|
for (const [y0, y1] of [[2.2, 4.0], [5.6, 7.4]]) {
|
|
901
817
|
ctx.beginPath(); ctx.moveTo(0, y0); ctx.lineTo(0, y1); ctx.lineTo(2.6, y1 + 1.5); ctx.lineTo(2.6, y0 + 1.5); ctx.closePath(); ctx.fill();
|
|
902
818
|
}
|
|
903
819
|
}
|
|
904
820
|
ctx.restore();
|
|
905
821
|
this.base();
|
|
906
|
-
// walls
|
|
822
|
+
// walls: graphite planes with a thin base rule and a soft shade into the corner
|
|
907
823
|
this.poly([P(0, 0, 0), P(0, RY, 0), P(0, RY, WALL), P(0, 0, WALL)], pal.wallL);
|
|
908
824
|
this.poly([P(0, 0, 0), P(RX, 0, 0), P(RX, 0, WALL), P(0, 0, WALL)], pal.wallR);
|
|
909
|
-
// honeycomb wallpaper, a soft wainscot and the trim
|
|
910
825
|
for (const side of ['L', 'R']) {
|
|
911
826
|
if (side === 'L') this.leftT(); else this.rightT();
|
|
912
|
-
|
|
913
|
-
ctx.
|
|
914
|
-
ctx.strokeStyle = alpha(pal.comb, 0.55); ctx.lineWidth = 0.012; ctx.stroke(this.comb);
|
|
915
|
-
ctx.restore();
|
|
916
|
-
ctx.fillStyle = side === 'L' ? pal.wainL : pal.wainR;
|
|
917
|
-
ctx.fillRect(0, WALL - 0.8, side === 'L' ? RY : RX, 0.8);
|
|
918
|
-
ctx.fillStyle = pal.trim;
|
|
919
|
-
ctx.fillRect(0, WALL - 0.84, side === 'L' ? RY : RX, 0.06);
|
|
920
|
-
ctx.fillRect(0, WALL - 0.1, side === 'L' ? RY : RX, 0.1);
|
|
921
|
-
// vertical wainscot boards
|
|
922
|
-
ctx.strokeStyle = 'rgba(36,22,12,.13)'; ctx.lineWidth = 0.02;
|
|
923
|
-
ctx.beginPath();
|
|
924
|
-
for (let u = 0.5; u < (side === 'L' ? RY : RX); u += 0.5) { ctx.moveTo(u, WALL - 0.78); ctx.lineTo(u, WALL - 0.1); }
|
|
925
|
-
ctx.stroke();
|
|
926
|
-
// a soft shade toward the corner
|
|
827
|
+
const len = side === 'L' ? RY : RX;
|
|
828
|
+
ctx.fillStyle = alpha(T.text, 0.035); ctx.fillRect(0, WALL - 0.12, len, 0.12);
|
|
927
829
|
const g = ctx.createLinearGradient(side === 'L' ? RY : 0, 0, side === 'L' ? RY - 2.5 : 2.5, 0);
|
|
928
|
-
g.addColorStop(0, 'rgba(
|
|
929
|
-
ctx.fillStyle = g; ctx.fillRect(0, 0,
|
|
830
|
+
g.addColorStop(0, 'rgba(0,0,0,.18)'); g.addColorStop(1, 'rgba(0,0,0,0)');
|
|
831
|
+
ctx.fillStyle = g; ctx.fillRect(0, 0, len, WALL);
|
|
930
832
|
}
|
|
931
833
|
this.base();
|
|
932
|
-
// wall caps and ends
|
|
933
|
-
const
|
|
934
|
-
this.poly([P(0, 0, WALL), P(0, RY, WALL), P(-
|
|
935
|
-
this.poly([P(-
|
|
936
|
-
this.poly([P(RX, -
|
|
937
|
-
this.poly([P(0, 0, 0), P(0, 0, WALL)], null, 'rgba(
|
|
834
|
+
// wall caps and ends
|
|
835
|
+
const Tt = 0.12;
|
|
836
|
+
this.poly([P(0, 0, WALL), P(0, RY, WALL), P(-Tt, RY, WALL), P(-Tt, -Tt, WALL), P(RX, -Tt, WALL), P(RX, 0, WALL)], pal.cap);
|
|
837
|
+
this.poly([P(-Tt, RY, 0), P(0, RY, 0), P(0, RY, WALL), P(-Tt, RY, WALL)], pal.capSide);
|
|
838
|
+
this.poly([P(RX, -Tt, 0), P(RX, 0, 0), P(RX, 0, WALL), P(RX, -Tt, WALL)], shade(pal.capSide, -0.15));
|
|
839
|
+
this.poly([P(0, 0, 0), P(0, 0, WALL)], null, 'rgba(0,0,0,.25)');
|
|
938
840
|
|
|
939
841
|
this.drawWindows(pal);
|
|
940
842
|
this.drawDoor(pal);
|
|
@@ -944,62 +846,34 @@ export class OfficeScene {
|
|
|
944
846
|
|
|
945
847
|
drawWindows(pal) {
|
|
946
848
|
const ctx = this.ctx;
|
|
947
|
-
const
|
|
849
|
+
const T = pal.T;
|
|
948
850
|
const night = pal.night;
|
|
949
|
-
const top = mixHex(mixHex('#78B9E6', '#0B1430', night), '#4A3F7E', pal.gold * 0.7);
|
|
950
|
-
const bot = mixHex(mixHex('#D6EEF8', '#1E2B4E', night), '#F5A766', pal.gold * 0.85);
|
|
951
851
|
this.leftT();
|
|
952
852
|
for (const [u0, u1] of [[2.6, 4.4], [6.0, 7.8]]) {
|
|
953
853
|
const t0 = WALL - 2.28; const t1 = WALL - 0.98;
|
|
954
854
|
ctx.save();
|
|
955
855
|
ctx.beginPath(); ctx.rect(u0, t0, u1 - u0, t1 - t0); ctx.clip();
|
|
956
856
|
const g = ctx.createLinearGradient(0, t0, 0, t1);
|
|
957
|
-
g.addColorStop(0,
|
|
857
|
+
g.addColorStop(0, pal.glassTop); g.addColorStop(1, pal.glassBot);
|
|
958
858
|
ctx.fillStyle = g; ctx.fillRect(u0, t0, u1 - u0, t1 - t0);
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
for (const s of this.stars) {
|
|
962
|
-
const tw = 0.6 + 0.4 * Math.sin(this.now * 1.5 + s.ph);
|
|
963
|
-
ctx.globalAlpha = tw;
|
|
964
|
-
ctx.fillRect(u0 + s.u * (u1 - u0), t0 + s.t * (t1 - t0) * 0.75, 0.025 * s.r, 0.025 * s.r);
|
|
965
|
-
}
|
|
966
|
-
ctx.globalAlpha = 1;
|
|
967
|
-
}
|
|
968
|
-
if (u0 > 5) {
|
|
969
|
-
// sun or moon, its height follows the clock
|
|
970
|
-
const arc = night > 0.5 ? (((h + 24 - 19) % 24) / 11) : clamp((h - 6) / 13);
|
|
971
|
-
const cy = t0 + 0.3 + Math.abs(arc - 0.5) * 1.6;
|
|
972
|
-
const cx = u0 + 0.5 + arc * 0.8;
|
|
973
|
-
if (night > 0.5) {
|
|
974
|
-
ctx.fillStyle = '#F4EBCF'; ctx.beginPath(); ctx.arc(cx, cy, 0.17, 0, 6.28); ctx.fill();
|
|
975
|
-
ctx.fillStyle = top; ctx.beginPath(); ctx.arc(cx + 0.07, cy - 0.04, 0.15, 0, 6.28); ctx.fill();
|
|
976
|
-
} else {
|
|
977
|
-
ctx.fillStyle = 'rgba(255,236,170,.35)'; ctx.beginPath(); ctx.arc(cx, cy, 0.32, 0, 6.28); ctx.fill();
|
|
978
|
-
ctx.fillStyle = pal.gold > 0.3 ? '#FFC072' : '#FFF1B8'; ctx.beginPath(); ctx.arc(cx, cy, 0.19, 0, 6.28); ctx.fill();
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
// drifting clouds (or a faint mist at night)
|
|
982
|
-
ctx.fillStyle = night > 0.5 ? 'rgba(160,170,210,.12)' : 'rgba(255,255,255,.75)';
|
|
983
|
-
const span = u1 - u0 + 1.2;
|
|
984
|
-
for (let i = 0; i < 2; i++) {
|
|
985
|
-
const cx = u0 - 0.6 + ((this.now * 0.03 + i * 0.55 + u0) % 1) * span;
|
|
986
|
-
const cy = t0 + 0.45 + i * 0.38;
|
|
987
|
-
ctx.beginPath(); ctx.ellipse(cx, cy, 0.3, 0.08, 0, 0, 6.28); ctx.ellipse(cx + 0.18, cy - 0.06, 0.16, 0.09, 0, 0, 6.28); ctx.fill();
|
|
988
|
-
}
|
|
989
|
-
// a hint of the city skyline
|
|
990
|
-
ctx.fillStyle = mixHex('#5E6B86', '#0A0F1E', night);
|
|
859
|
+
// a distant skyline, lit windows at night
|
|
860
|
+
ctx.fillStyle = mixHex(pal.glassBot, T.bg, 0.5);
|
|
991
861
|
for (let i = 0; i < 7; i++) { const bw = 0.22 + ((i * 37) % 5) * 0.03; const bh = 0.12 + ((i * 53) % 7) * 0.05; ctx.fillRect(u0 + i * 0.27, t1 - bh, bw, bh); }
|
|
992
862
|
if (night > 0.5) {
|
|
993
|
-
ctx.fillStyle =
|
|
994
|
-
for (let i = 0; i <
|
|
863
|
+
ctx.fillStyle = alpha(T.accent2, 0.55);
|
|
864
|
+
for (let i = 0; i < 7; i++) ctx.fillRect(u0 + 0.06 + ((i * 29) % 17) * 0.1, t1 - 0.05 - ((i * 13) % 5) * 0.05, 0.025, 0.02);
|
|
865
|
+
ctx.fillStyle = alpha(T.text, (night - 0.5) * 0.6);
|
|
866
|
+
for (const s of this.stars) ctx.fillRect(u0 + s.u * (u1 - u0), t0 + s.t * (t1 - t0) * 0.6, 0.016 * s.r, 0.016 * s.r);
|
|
995
867
|
}
|
|
868
|
+
// one diagonal reflection
|
|
869
|
+
ctx.fillStyle = pal.glassHi;
|
|
870
|
+
ctx.beginPath(); ctx.moveTo(u0 + 0.2, t0); ctx.lineTo(u0 + 0.55, t0); ctx.lineTo(u0 + 0.15, t1); ctx.lineTo(u0 - 0.2, t1); ctx.closePath(); ctx.fill();
|
|
996
871
|
ctx.restore();
|
|
997
|
-
// frame and
|
|
998
|
-
ctx.strokeStyle =
|
|
872
|
+
// a thin frame and one mullion
|
|
873
|
+
ctx.strokeStyle = pal.cap; ctx.lineWidth = 0.035;
|
|
999
874
|
ctx.strokeRect(u0, t0, u1 - u0, t1 - t0);
|
|
1000
|
-
ctx.lineWidth = 0.
|
|
1001
|
-
ctx.beginPath(); ctx.moveTo((u0 + u1) / 2, t0); ctx.lineTo((u0 + u1) / 2, t1); ctx.
|
|
1002
|
-
ctx.fillStyle = shade(pal.trim, 0.2); ctx.fillRect(u0 - 0.08, t1, u1 - u0 + 0.16, 0.07);
|
|
875
|
+
ctx.lineWidth = 0.02;
|
|
876
|
+
ctx.beginPath(); ctx.moveTo((u0 + u1) / 2, t0); ctx.lineTo((u0 + u1) / 2, t1); ctx.stroke();
|
|
1003
877
|
}
|
|
1004
878
|
this.base();
|
|
1005
879
|
}
|
|
@@ -1008,124 +882,109 @@ export class OfficeScene {
|
|
|
1008
882
|
const ctx = this.ctx;
|
|
1009
883
|
this.rightT();
|
|
1010
884
|
const u0 = 11.9; const u1 = 13.0; const t0 = WALL - 2.05;
|
|
1011
|
-
ctx.fillStyle =
|
|
1012
|
-
ctx.fillStyle =
|
|
1013
|
-
// a
|
|
1014
|
-
ctx.fillStyle =
|
|
1015
|
-
ctx.
|
|
1016
|
-
ctx.strokeStyle = OUT; ctx.lineWidth = 0.025; ctx.stroke();
|
|
1017
|
-
ctx.fillStyle = '#FFD072'; ctx.beginPath(); ctx.arc(u1 - 0.14, t0 + 1.1, 0.04, 0, 6.28); ctx.fill();
|
|
1018
|
-
ctx.strokeStyle = 'rgba(36,22,12,.25)'; ctx.lineWidth = 0.02; ctx.strokeRect(u0 + 0.12, t0 + 0.9, u1 - u0 - 0.24, 0.9);
|
|
885
|
+
ctx.fillStyle = pal.cap; ctx.fillRect(u0 - 0.04, t0 - 0.04, u1 - u0 + 0.08, WALL - t0 + 0.04);
|
|
886
|
+
ctx.fillStyle = shade(pal.wallR, -0.25); ctx.fillRect(u0, t0, u1 - u0, WALL - t0);
|
|
887
|
+
// a slim glass slit and the handle
|
|
888
|
+
ctx.fillStyle = pal.glassTop; ctx.fillRect(u0 + 0.16, t0 + 0.16, 0.08, 1.2);
|
|
889
|
+
ctx.fillStyle = pal.metal; ctx.fillRect(u1 - 0.2, t0 + 1.0, 0.04, 0.22);
|
|
1019
890
|
this.base();
|
|
1020
891
|
}
|
|
1021
892
|
|
|
1022
893
|
drawClock(pal) {
|
|
1023
894
|
const ctx = this.ctx;
|
|
895
|
+
const T = pal.T;
|
|
1024
896
|
this.rightT();
|
|
1025
|
-
const cu = 8.25; const ct = 0.78; const r = 0.
|
|
1026
|
-
ctx.fillStyle =
|
|
1027
|
-
ctx.
|
|
1028
|
-
ctx.strokeStyle =
|
|
897
|
+
const cu = 8.25; const ct = 0.78; const r = 0.3;
|
|
898
|
+
ctx.fillStyle = pal.screen; ctx.beginPath(); ctx.arc(cu, ct, r, 0, 6.28); ctx.fill();
|
|
899
|
+
ctx.strokeStyle = alpha(T.text, 0.18); ctx.lineWidth = 0.015; ctx.stroke();
|
|
900
|
+
ctx.strokeStyle = alpha(T.text, 0.4); ctx.lineWidth = 0.015;
|
|
1029
901
|
for (let i = 0; i < 12; i++) {
|
|
1030
902
|
const an = (i / 12) * 6.283;
|
|
1031
|
-
ctx.beginPath(); ctx.moveTo(cu + Math.sin(an) * r * 0.
|
|
903
|
+
ctx.beginPath(); ctx.moveTo(cu + Math.sin(an) * r * 0.8, ct - Math.cos(an) * r * 0.8); ctx.lineTo(cu + Math.sin(an) * r * 0.9, ct - Math.cos(an) * r * 0.9); ctx.stroke();
|
|
1032
904
|
}
|
|
1033
905
|
const h = pal.hour;
|
|
1034
906
|
const mins = (h % 1) * 60;
|
|
1035
907
|
const ha = ((h % 12) / 12) * 6.283;
|
|
1036
908
|
const ma = (mins / 60) * 6.283;
|
|
1037
909
|
ctx.lineCap = 'round';
|
|
1038
|
-
ctx.
|
|
1039
|
-
ctx.lineWidth = 0.03; ctx.beginPath(); ctx.moveTo(cu, ct); ctx.lineTo(cu + Math.sin(
|
|
910
|
+
ctx.strokeStyle = T.text;
|
|
911
|
+
ctx.lineWidth = 0.03; ctx.beginPath(); ctx.moveTo(cu, ct); ctx.lineTo(cu + Math.sin(ha) * r * 0.48, ct - Math.cos(ha) * r * 0.48); ctx.stroke();
|
|
912
|
+
ctx.lineWidth = 0.02; ctx.beginPath(); ctx.moveTo(cu, ct); ctx.lineTo(cu + Math.sin(ma) * r * 0.72, ct - Math.cos(ma) * r * 0.72); ctx.stroke();
|
|
1040
913
|
ctx.lineCap = 'butt';
|
|
1041
|
-
ctx.fillStyle =
|
|
914
|
+
ctx.fillStyle = T.accent; ctx.beginPath(); ctx.arc(cu, ct, 0.025, 0, 6.28); ctx.fill();
|
|
1042
915
|
this.base();
|
|
1043
916
|
}
|
|
1044
917
|
|
|
1045
|
-
/** A wall
|
|
918
|
+
/** A small wall display with the number of finished tasks (it replaced the honey shelf). */
|
|
1046
919
|
drawHoneyShelf(pal) {
|
|
1047
920
|
const ctx = this.ctx;
|
|
1048
|
-
const
|
|
1049
|
-
const done =
|
|
921
|
+
const T = pal.T;
|
|
922
|
+
const done = doneCount(this.getState());
|
|
1050
923
|
this.rightT();
|
|
1051
|
-
const u0 = 9.15; const u1 = 11.45; const
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
ctx.fillStyle = 'rgba(36,22,12,.2)'; ctx.fillRect(u0, ty + 0.06, u1 - u0, 0.04);
|
|
1056
|
-
const n = clamp(done - row * 8, 0, 8);
|
|
1057
|
-
for (let i = 0; i < n; i++) {
|
|
1058
|
-
const cx = u0 + 0.16 + i * 0.27;
|
|
1059
|
-
ctx.fillStyle = '#F3A42A'; roundRect(ctx, cx - 0.09, ty - 0.24, 0.18, 0.24, 0.05); ctx.fill();
|
|
1060
|
-
ctx.fillStyle = '#FFD072'; ctx.fillRect(cx - 0.06, ty - 0.17, 0.04, 0.12);
|
|
1061
|
-
ctx.fillStyle = '#7A4A1E'; ctx.fillRect(cx - 0.1, ty - 0.29, 0.2, 0.06);
|
|
1062
|
-
}
|
|
1063
|
-
}
|
|
1064
|
-
ctx.fillStyle = alpha(pal.trim, 0.9);
|
|
1065
|
-
ctx.font = `700 13px ${FONT}`;
|
|
924
|
+
const u0 = 9.15; const u1 = 11.45; const t0 = 0.6; const t1 = 1.55;
|
|
925
|
+
ctx.fillStyle = pal.screen; ctx.fillRect(u0, t0, u1 - u0, t1 - t0);
|
|
926
|
+
ctx.strokeStyle = alpha(T.text, 0.12); ctx.lineWidth = 0.012; ctx.strokeRect(u0, t0, u1 - u0, t1 - t0);
|
|
927
|
+
ctx.fillStyle = T.ok; ctx.fillRect(u0, t0, 0.03, t1 - t0);
|
|
1066
928
|
this.rightT(100);
|
|
1067
|
-
ctx.fillStyle =
|
|
1068
|
-
ctx.
|
|
1069
|
-
ctx.
|
|
929
|
+
ctx.fillStyle = alpha(T.text, 0.5); ctx.font = `600 11px ${FONT}`;
|
|
930
|
+
ctx.fillText(tc('office.board.tasksDone').toLocaleUpperCase(), (u0 + 0.14) * 100, (t0 + 0.24) * 100);
|
|
931
|
+
ctx.fillStyle = T.text; ctx.font = `600 40px ${MONO}`;
|
|
932
|
+
ctx.fillText(String(done), (u0 + 0.12) * 100, (t1 - 0.18) * 100);
|
|
1070
933
|
this.base();
|
|
1071
934
|
}
|
|
1072
935
|
|
|
1073
936
|
drawBoard(pal) {
|
|
1074
937
|
const ctx = this.ctx;
|
|
938
|
+
const T = pal.T;
|
|
1075
939
|
const { u0, u1, t0, t1 } = BOARD;
|
|
1076
940
|
this.rightT();
|
|
1077
|
-
//
|
|
1078
|
-
ctx.fillStyle = 'rgba(
|
|
1079
|
-
ctx.fillStyle = pal.frame; ctx.fillRect(u0 - 0.07, t0 - 0.07, u1 - u0 + 0.14, t1 - t0 + 0.14);
|
|
941
|
+
// the kanban as a wall display
|
|
942
|
+
ctx.fillStyle = 'rgba(0,0,0,.25)'; ctx.fillRect(u0 + 0.04, t0 + 0.05, u1 - u0, t1 - t0);
|
|
1080
943
|
ctx.fillStyle = pal.board; ctx.fillRect(u0, t0, u1 - u0, t1 - t0);
|
|
944
|
+
ctx.strokeStyle = alpha(T.text, 0.12); ctx.lineWidth = 0.012; ctx.strokeRect(u0, t0, u1 - u0, t1 - t0);
|
|
1081
945
|
const cw = (u1 - u0 - 0.16) / 3;
|
|
1082
|
-
ctx.strokeStyle =
|
|
946
|
+
ctx.strokeStyle = alpha(T.text, 0.07); ctx.lineWidth = 0.012;
|
|
1083
947
|
ctx.beginPath();
|
|
1084
948
|
for (let c = 1; c < 3; c++) { const x = u0 + 0.08 + c * cw; ctx.moveTo(x, t0 + 0.08); ctx.lineTo(x, t1 - 0.06); }
|
|
1085
949
|
ctx.moveTo(u0 + 0.08, t0 + 0.36); ctx.lineTo(u1 - 0.08, t0 + 0.36);
|
|
1086
950
|
ctx.stroke();
|
|
1087
|
-
//
|
|
1088
|
-
ctx.fillStyle = shade(pal.frame, 0.15); ctx.fillRect(u0 + 0.5, t1 + 0.06, 1.4, 0.07);
|
|
1089
|
-
ctx.fillStyle = '#E57B6E'; ctx.fillRect(u0 + 0.62, t1 + 0.02, 0.28, 0.05);
|
|
1090
|
-
ctx.fillStyle = '#86A9D6'; ctx.fillRect(u0 + 1.0, t1 + 0.02, 0.28, 0.05);
|
|
1091
|
-
// column titles
|
|
951
|
+
// column titles with counts
|
|
1092
952
|
this.rightT(100);
|
|
1093
|
-
ctx.font = `
|
|
953
|
+
ctx.font = `600 ${this.mini ? 18 : 13}px ${FONT}`;
|
|
1094
954
|
ctx.textBaseline = 'middle';
|
|
1095
955
|
const counts = [0, 0, 0];
|
|
1096
956
|
for (const n of this.notes.values()) if (!n.gone) counts[n.col]++;
|
|
1097
957
|
COLS.forEach((name, c) => {
|
|
1098
958
|
const x = (u0 + 0.08 + c * cw + 0.1) * 100;
|
|
1099
|
-
ctx.fillStyle = [
|
|
1100
|
-
ctx.
|
|
1101
|
-
ctx.fillStyle =
|
|
1102
|
-
ctx.fillText(
|
|
959
|
+
ctx.fillStyle = [T.muted, T.accent, T.ok][c];
|
|
960
|
+
ctx.fillRect(x, (t0 + 0.2) * 100 - 4, 8, 8);
|
|
961
|
+
ctx.fillStyle = alpha(T.text, 0.7);
|
|
962
|
+
ctx.fillText(tc(`office.board.${name}`).toLocaleUpperCase(), x + 14, (t0 + 0.2) * 100);
|
|
963
|
+
ctx.fillStyle = alpha(T.text, 0.4);
|
|
964
|
+
ctx.font = `500 ${this.mini ? 18 : 13}px ${MONO}`;
|
|
965
|
+
ctx.textAlign = 'right';
|
|
966
|
+
ctx.fillText(String(counts[c]), (u0 + 0.08 + (c + 1) * cw - 0.12) * 100, (t0 + 0.2) * 100);
|
|
967
|
+
ctx.textAlign = 'left';
|
|
968
|
+
ctx.font = `600 ${this.mini ? 18 : 13}px ${FONT}`;
|
|
1103
969
|
});
|
|
1104
970
|
ctx.textBaseline = 'alphabetic';
|
|
1105
|
-
// an empty board says so,
|
|
971
|
+
// an empty board says so, plainly
|
|
1106
972
|
let live = 0;
|
|
1107
973
|
for (const n of this.notes.values()) if (!n.gone) live++;
|
|
1108
974
|
if (!live && !this.mini) {
|
|
1109
975
|
const cu = (u0 + u1) / 2; const ct = (t0 + t1) / 2 + 0.15;
|
|
1110
|
-
|
|
1111
|
-
ctx.
|
|
1112
|
-
ctx.
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
ctx.
|
|
1116
|
-
ctx.fillStyle = '#2B1D12'; ctx.fillRect(bx - 0.02, by - 0.08, 0.03, 0.16);
|
|
1117
|
-
ctx.fillStyle = 'rgba(255,255,255,.85)'; ctx.beginPath(); ctx.ellipse(bx - 0.03, by - 0.11, 0.06, 0.035, -0.5, 0, 6.28); ctx.fill();
|
|
1118
|
-
this.rightT(100);
|
|
1119
|
-
ctx.fillStyle = 'rgba(43,29,18,.62)'; ctx.font = `700 19px ${FONT}`;
|
|
1120
|
-
ctx.fillText('Nothing on the board yet', (cu - 0.8) * 100, (ct - 0.08) * 100);
|
|
1121
|
-
ctx.fillStyle = 'rgba(43,29,18,.42)'; ctx.font = `600 14px ${FONT}`;
|
|
1122
|
-
ctx.fillText('Ask the crew in the box above', (cu - 0.8) * 100, (ct + 0.16) * 100);
|
|
976
|
+
ctx.textAlign = 'center';
|
|
977
|
+
ctx.fillStyle = alpha(T.text, 0.62); ctx.font = `600 17px ${FONT}`;
|
|
978
|
+
ctx.fillText(tc('office.board.empty'), cu * 100, (ct - 0.06) * 100);
|
|
979
|
+
ctx.fillStyle = alpha(T.text, 0.38); ctx.font = `400 13px ${FONT}`;
|
|
980
|
+
ctx.fillText(tc('office.board.emptyHint'), cu * 100, (ct + 0.16) * 100);
|
|
981
|
+
ctx.textAlign = 'left';
|
|
1123
982
|
}
|
|
1124
983
|
// the notes
|
|
1125
984
|
this.noteHits = [];
|
|
1126
985
|
for (const n of this.notes.values()) {
|
|
1127
986
|
if (n.state === 'hidden' || n.state === 'carried') continue;
|
|
1128
|
-
const fade = n.gone ? 1 - clamp((this.now - n.gone) / 0.
|
|
987
|
+
const fade = n.gone ? 1 - clamp((this.now - n.gone) / 0.25) : 1;
|
|
1129
988
|
if (fade <= 0) continue;
|
|
1130
989
|
this.drawNote(n, fade);
|
|
1131
990
|
}
|
|
@@ -1134,33 +993,29 @@ export class OfficeScene {
|
|
|
1134
993
|
|
|
1135
994
|
drawNote(n, fade) {
|
|
1136
995
|
const ctx = this.ctx;
|
|
996
|
+
const T = artTokens();
|
|
1137
997
|
const t = n.task || {};
|
|
1138
|
-
const
|
|
1139
|
-
const sc = 0.6 + 0.4 * pop;
|
|
998
|
+
const appear = this.reduced() ? 1 : easeOut(clamp((this.now - n.pop) / 0.2));
|
|
1140
999
|
const w = n.w; const hgt = NOTE_H;
|
|
1141
1000
|
const cx = n.u + w / 2; const cy = n.t + hgt / 2;
|
|
1142
1001
|
this.rightT();
|
|
1143
1002
|
ctx.save();
|
|
1144
|
-
ctx.globalAlpha = fade *
|
|
1003
|
+
ctx.globalAlpha = fade * appear;
|
|
1145
1004
|
ctx.translate(cx, cy);
|
|
1146
|
-
ctx.scale(sc, sc);
|
|
1147
|
-
ctx.rotate(((hash(n.id) % 7) - 3) * 0.012);
|
|
1148
1005
|
const failed = t.status === 'failed' || t.status === 'blocked';
|
|
1149
|
-
const
|
|
1150
|
-
ctx.fillStyle =
|
|
1151
|
-
ctx.fillStyle =
|
|
1152
|
-
|
|
1153
|
-
ctx.fillStyle = a?.w.color || '#FFB531'; ctx.fillRect(-w / 2, -hgt / 2, 0.05, hgt);
|
|
1154
|
-
if (this.highlight === n.id || this.dragTask === n.id) { ctx.strokeStyle = '#E8951E'; ctx.lineWidth = 0.035; ctx.strokeRect(-w / 2 - 0.02, -hgt / 2 - 0.02, w + 0.04, hgt + 0.04); }
|
|
1006
|
+
const rule = failed ? T.bad : t.status === 'done' ? T.ok : t.status === 'skipped' ? T.faint : n.col === 1 ? T.accent : T.muted;
|
|
1007
|
+
ctx.fillStyle = this.pal?.card || T.panel3; ctx.fillRect(-w / 2, -hgt / 2, w, hgt);
|
|
1008
|
+
ctx.fillStyle = rule; ctx.fillRect(-w / 2, -hgt / 2, 0.035, hgt);
|
|
1009
|
+
if (this.highlight === n.id || this.dragTask === n.id) { ctx.strokeStyle = T.accent; ctx.lineWidth = 0.02; ctx.strokeRect(-w / 2, -hgt / 2, w, hgt); }
|
|
1155
1010
|
ctx.scale(0.01, 0.01);
|
|
1156
1011
|
if (!this.mini) {
|
|
1157
|
-
ctx.fillStyle = '
|
|
1158
|
-
ctx.font = `
|
|
1012
|
+
ctx.fillStyle = t.status === 'done' ? alpha(T.text, 0.6) : T.text;
|
|
1013
|
+
ctx.font = `500 14px ${FONT}`;
|
|
1159
1014
|
const right = t.status === 'done' || failed ? 0.2 : 0.06;
|
|
1160
|
-
const line = wrap(ctx, t.title || '', (w - 0.
|
|
1161
|
-
ctx.fillText(line, (-w / 2 + 0.
|
|
1162
|
-
if (t.status === 'done') { ctx.
|
|
1163
|
-
if (failed) { ctx.fillStyle =
|
|
1015
|
+
const line = wrap(ctx, plain(t.title || ''), (w - 0.14 - right) * 100, 1)[0] || '';
|
|
1016
|
+
ctx.fillText(line, (-w / 2 + 0.09) * 100, 0.05 * 100);
|
|
1017
|
+
if (t.status === 'done') { ctx.strokeStyle = T.ok; ctx.lineWidth = 2.4; ctx.lineCap = 'round'; ctx.beginPath(); ctx.moveTo((w / 2 - 0.17) * 100, 0); ctx.lineTo((w / 2 - 0.13) * 100, 4); ctx.lineTo((w / 2 - 0.06) * 100, -4); ctx.stroke(); ctx.lineCap = 'butt'; }
|
|
1018
|
+
if (failed) { ctx.fillStyle = T.bad; ctx.font = `700 15px ${FONT}`; ctx.fillText('!', (w / 2 - 0.11) * 100, 0.06 * 100); }
|
|
1164
1019
|
}
|
|
1165
1020
|
ctx.restore();
|
|
1166
1021
|
// hit box in screen space for the DOM layer
|
|
@@ -1174,23 +1029,24 @@ export class OfficeScene {
|
|
|
1174
1029
|
this.floorT();
|
|
1175
1030
|
for (const a of this.actors.values()) {
|
|
1176
1031
|
const z = Math.max(0, a.pos.z);
|
|
1177
|
-
const r = clamp(0.
|
|
1178
|
-
ctx.fillStyle = `rgba(
|
|
1032
|
+
const r = clamp(0.32 - z * 0.05, 0.14, 0.3);
|
|
1033
|
+
ctx.fillStyle = `rgba(0,0,0,${0.3 * a.alpha * clamp(1.4 - z * 0.25, 0.25, 1)})`;
|
|
1179
1034
|
ctx.beginPath(); ctx.ellipse(a.pos.x, a.pos.y, r, r, 0, 0, 6.28); ctx.fill();
|
|
1180
1035
|
}
|
|
1181
1036
|
// desk shadows
|
|
1182
1037
|
for (const a of this.actors.values()) {
|
|
1183
1038
|
if (!a.desk) continue;
|
|
1184
|
-
ctx.fillStyle = 'rgba(
|
|
1185
|
-
ctx.fillRect(a.desk.x + 0.
|
|
1039
|
+
ctx.fillStyle = 'rgba(0,0,0,.2)';
|
|
1040
|
+
ctx.fillRect(a.desk.x + 0.08, a.desk.y + 0.08, DW, DD);
|
|
1186
1041
|
}
|
|
1187
1042
|
this.base();
|
|
1188
1043
|
}
|
|
1189
1044
|
|
|
1190
1045
|
drawPodium(pal) {
|
|
1191
1046
|
const ctx = this.ctx;
|
|
1047
|
+
const T = pal.T;
|
|
1192
1048
|
const x = MEL_HOME.x; const y = MEL_HOME.y;
|
|
1193
|
-
// a hexagon
|
|
1049
|
+
// a hexagon podium with an amber rim
|
|
1194
1050
|
const r = 0.42; const hgt = 0.62;
|
|
1195
1051
|
const ring = [];
|
|
1196
1052
|
for (let i = 0; i < 6; i++) { const an = (Math.PI / 3) * i + Math.PI / 6; ring.push([x + r * Math.cos(an), y + r * Math.sin(an)]); }
|
|
@@ -1198,136 +1054,85 @@ export class OfficeScene {
|
|
|
1198
1054
|
const p = ring[i]; const q = ring[(i + 1) % 6];
|
|
1199
1055
|
const nx = (p[0] + q[0]) / 2 - x; const ny = (p[1] + q[1]) / 2 - y;
|
|
1200
1056
|
if (nx + ny <= 0.01) continue;
|
|
1201
|
-
this.poly([this.P(p[0], p[1], 0), this.P(q[0], q[1], 0), this.P(q[0], q[1], hgt), this.P(p[0], p[1], hgt)], nx > ny ? pal.deskR : pal.deskL
|
|
1057
|
+
this.poly([this.P(p[0], p[1], 0), this.P(q[0], q[1], 0), this.P(q[0], q[1], hgt), this.P(p[0], p[1], hgt)], nx > ny ? pal.deskR : pal.deskL);
|
|
1202
1058
|
}
|
|
1203
|
-
this.poly(ring.map((p) => this.P(p[0], p[1], hgt)), pal.deskTop,
|
|
1204
|
-
ctx
|
|
1205
|
-
const c = this.P(x, y, hgt);
|
|
1206
|
-
ctx.beginPath(); ctx.ellipse(c[0], c[1], this.a * 0.22, this.a * 0.11, 0, 0, 6.28); ctx.fill();
|
|
1059
|
+
this.poly(ring.map((p) => this.P(p[0], p[1], hgt)), pal.deskTop, alpha(T.accent, 0.55), 1);
|
|
1060
|
+
void ctx;
|
|
1207
1061
|
}
|
|
1208
1062
|
|
|
1209
1063
|
drawDesk(a, pal) {
|
|
1210
1064
|
const ctx = this.ctx;
|
|
1065
|
+
const T = pal.T;
|
|
1211
1066
|
const { x, y } = a.desk;
|
|
1212
1067
|
let sc = 1;
|
|
1213
1068
|
if (a.build > 0) {
|
|
1214
|
-
const u = clamp((this.now - a.build) /
|
|
1215
|
-
sc =
|
|
1216
|
-
if (u < 1 && Math.random() < 0.5 && !this.reduced()) {
|
|
1217
|
-
const c = this.P(x + DW / 2, y + DD / 2, 0.2);
|
|
1218
|
-
this.spawn({ kind: 'puff', x: c[0] + rnd(-40, 40) * this.a / 60, y: c[1] + rnd(-6, 10), vx: rnd(-20, 20), vy: rnd(-20, -4), life: rnd(0.6, 1), size: rnd(6, 14) * this.a / 60 });
|
|
1219
|
-
}
|
|
1069
|
+
const u = clamp((this.now - a.build) / 0.5);
|
|
1070
|
+
sc = easeOut(u);
|
|
1220
1071
|
if (u >= 1) a.build = -9;
|
|
1221
|
-
if (sc <= 0) return;
|
|
1222
1072
|
}
|
|
1223
1073
|
const fade = a.leaving ? clamp(1 - (a.seg ? (this.now - a.seg.t0) / 1.2 : 1)) : 1;
|
|
1224
|
-
const base = this.P(x + DW / 2, y + DD, 0);
|
|
1225
1074
|
ctx.save();
|
|
1226
|
-
ctx.globalAlpha = fade;
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
this.box(x + 0.
|
|
1230
|
-
this.box(x
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
this.box(x, y, DH - 0.06, DW, DD, 0.07, pal.deskTop, pal.deskL, pal.deskR);
|
|
1234
|
-
const z = DH + 0.01;
|
|
1235
|
-
const kind = KIND[a.id] || 'hired';
|
|
1236
|
-
const col = a.w.color || '#FFB531';
|
|
1075
|
+
ctx.globalAlpha = fade * sc;
|
|
1076
|
+
// a clean workstation: two slim legs, a slab top
|
|
1077
|
+
this.box(x + 0.06, y + 0.1, 0, 0.06, DD - 0.2, DH - 0.06, pal.leg, pal.leg, shade(pal.leg, -0.2));
|
|
1078
|
+
this.box(x + DW - 0.12, y + 0.1, 0, 0.06, DD - 0.2, DH - 0.06, pal.leg, pal.leg, shade(pal.leg, -0.2));
|
|
1079
|
+
this.box(x, y, DH - 0.06, DW, DD, 0.06, pal.deskTop, pal.deskL, pal.deskR, 'rgba(0,0,0,.2)');
|
|
1080
|
+
const z = DH;
|
|
1081
|
+
const col = tone(a.w.color || T.accent);
|
|
1237
1082
|
const active = ['type', 'test', 'read', 'wait', 'stuck'].includes(a.mode);
|
|
1238
|
-
//
|
|
1239
|
-
const
|
|
1240
|
-
this.box(
|
|
1241
|
-
this.box(
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1244
|
-
ctx.
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
// the lamp
|
|
1253
|
-
const lpx = x + 0.2; const lpy = y + 0.25;
|
|
1254
|
-
this.cyl(lpx, lpy, z, 0.07, 0.03, '#4A3A2B', '#5A4836');
|
|
1255
|
-
const s0 = this.P(lpx, lpy, z + 0.03); const s1 = this.P(lpx, lpy, z + 0.55);
|
|
1256
|
-
ctx.strokeStyle = '#4A3A2B'; ctx.lineWidth = Math.max(1, this.a * 0.03); ctx.beginPath(); ctx.moveTo(s0[0], s0[1]); ctx.lineTo(s1[0], s1[1]); ctx.stroke();
|
|
1257
|
-
const shadeW = this.a * 0.2;
|
|
1258
|
-
ctx.fillStyle = pal.night > 0.3 ? '#FFE3A1' : '#F0B54A';
|
|
1259
|
-
ctx.beginPath(); ctx.moveTo(s1[0] - shadeW * 0.45, s1[1] - this.a * 0.12); ctx.lineTo(s1[0] + shadeW * 0.45, s1[1] - this.a * 0.12); ctx.lineTo(s1[0] + shadeW, s1[1] + this.a * 0.04); ctx.lineTo(s1[0] - shadeW, s1[1] + this.a * 0.04); ctx.closePath(); ctx.fill();
|
|
1260
|
-
ctx.strokeStyle = 'rgba(36,22,12,.5)'; ctx.lineWidth = 1; ctx.stroke();
|
|
1261
|
-
a.lampAt = [s1[0], s1[1] + this.a * 0.04];
|
|
1262
|
-
// role props at the front corner
|
|
1263
|
-
const px = x + DW - 0.42; const py = y + DD - 0.3;
|
|
1264
|
-
if (kind === 'dev') {
|
|
1265
|
-
this.cyl(px, py, z, 0.1, 0.18, '#F2E9DA', '#3B2414');
|
|
1266
|
-
const d = this.P(px - 0.55, py + 0.06, z + 0.08);
|
|
1267
|
-
ctx.fillStyle = '#FFD23F'; ctx.beginPath(); ctx.ellipse(d[0], d[1], this.a * 0.1, this.a * 0.07, 0, 0, 6.28); ctx.fill();
|
|
1268
|
-
ctx.beginPath(); ctx.arc(d[0] - this.a * 0.05, d[1] - this.a * 0.08, this.a * 0.055, 0, 6.28); ctx.fill();
|
|
1269
|
-
ctx.fillStyle = '#F08A24'; ctx.beginPath(); ctx.moveTo(d[0] - this.a * 0.1, d[1] - this.a * 0.09); ctx.lineTo(d[0] - this.a * 0.16, d[1] - this.a * 0.07); ctx.lineTo(d[0] - this.a * 0.1, d[1] - this.a * 0.05); ctx.fill();
|
|
1270
|
-
} else if (kind === 'designer') {
|
|
1271
|
-
this.box(px - 0.45, py - 0.12, z, 0.5, 0.34, 0.02, '#2C2620', '#221D18', '#1A1612');
|
|
1272
|
-
['#FF7AB6', '#6CC4FF', '#FFD072', '#7DC49B'].forEach((c, i) => { const p = this.P(px - 0.38 + i * 0.11, py + 0.05, z + 0.025); ctx.fillStyle = c; ctx.beginPath(); ctx.ellipse(p[0], p[1], this.a * 0.04, this.a * 0.022, 0, 0, 6.28); ctx.fill(); });
|
|
1273
|
-
this.cyl(px + 0.18, py - 0.05, z, 0.09, 0.2, '#86A9D6', '#3E5E86');
|
|
1274
|
-
} else if (kind === 'qa') {
|
|
1275
|
-
this.box(px - 0.5, py - 0.08, z, 0.55, 0.16, 0.08, '#8C6A3E', '#7A5A33', '#6B4E2C');
|
|
1276
|
-
['#7DC49B', '#FFB531', '#86A9D6'].forEach((c, i) => this.cyl(px - 0.42 + i * 0.17, py, z + 0.08, 0.045, 0.26, alpha(c, 0.85), '#F2E9DA'));
|
|
1277
|
-
} else if (kind === 'writer') {
|
|
1278
|
-
for (let i = 0; i < 4; i++) this.box(px - 0.5 + i * 0.015, py - 0.16 - i * 0.01, z + i * 0.03, 0.42, 0.3, 0.03, '#FFFDF6', '#E9E1D2', '#D9D0C0');
|
|
1279
|
-
this.cyl(px + 0.15, py - 0.05, z, 0.08, 0.2, '#B9895A', '#3B2414');
|
|
1280
|
-
} else {
|
|
1281
|
-
this.cyl(px, py - 0.04, z, 0.11, 0.17, '#C46A3A', '#4A2E1A');
|
|
1282
|
-
const leaf = this.P(px, py - 0.04, z + 0.28);
|
|
1283
|
-
ctx.fillStyle = '#5FA36F';
|
|
1284
|
-
for (let i = 0; i < 5; i++) { ctx.beginPath(); ctx.ellipse(leaf[0] + Math.cos(i * 1.3) * this.a * 0.07, leaf[1] - Math.abs(Math.sin(i * 1.3)) * this.a * 0.06, this.a * 0.06, this.a * 0.025, i * 1.3, 0, 6.28); ctx.fill(); }
|
|
1083
|
+
// the monitor: a thin slab facing the bee, its screen line lit in the agent color while it works
|
|
1084
|
+
const mx = x + 0.45; const my = y + 0.32; const mw = 0.9; const mh = 0.5;
|
|
1085
|
+
this.box(mx + mw / 2 - 0.05, my + 0.05, z, 0.1, 0.1, 0.12, pal.metal, pal.leg, pal.leg, null);
|
|
1086
|
+
this.box(mx, my, z + 0.12, mw, 0.04, mh, pal.screen, pal.screen, shade(pal.screen, -0.2), 'rgba(0,0,0,.35)');
|
|
1087
|
+
const s0 = this.P(mx + 0.06, my, z + 0.18); const s1 = this.P(mx + mw - 0.06, my, z + 0.18);
|
|
1088
|
+
ctx.strokeStyle = active ? col : alpha(T.text, 0.12); ctx.lineWidth = Math.max(1, this.a * 0.02);
|
|
1089
|
+
ctx.beginPath(); ctx.moveTo(s0[0], s0[1]); ctx.lineTo(s1[0], s1[1]); ctx.stroke();
|
|
1090
|
+
if (active) {
|
|
1091
|
+
// two code lines on the screen
|
|
1092
|
+
for (const [k, len] of [[0.36, 0.55], [0.28, 0.35]]) {
|
|
1093
|
+
const p0 = this.P(mx + 0.1, my, z + 0.12 + mh * (k + 0.2)); const p1 = this.P(mx + 0.1 + mw * len, my, z + 0.12 + mh * (k + 0.2));
|
|
1094
|
+
ctx.strokeStyle = alpha(col, 0.55); ctx.lineWidth = Math.max(0.8, this.a * 0.012);
|
|
1095
|
+
ctx.beginPath(); ctx.moveTo(p0[0], p0[1]); ctx.lineTo(p1[0], p1[1]); ctx.stroke();
|
|
1096
|
+
}
|
|
1285
1097
|
}
|
|
1098
|
+
a.lampAt = this.P(mx + mw / 2, my, z + 0.4);
|
|
1286
1099
|
ctx.restore();
|
|
1287
1100
|
}
|
|
1288
1101
|
|
|
1289
1102
|
drawChair(a, pal) {
|
|
1290
1103
|
if (!a.desk) return;
|
|
1291
|
-
const x = a.home.x - 0.
|
|
1292
|
-
this.cyl(x + 0.
|
|
1293
|
-
this.box(x, y - 0.
|
|
1294
|
-
this.box(x, y - 0.
|
|
1295
|
-
void pal;
|
|
1104
|
+
const x = a.home.x - 0.22; const y = a.home.y - 0.3;
|
|
1105
|
+
this.cyl(x + 0.22, y + 0.2, 0.02, 0.04, 0.4, pal.leg, pal.leg);
|
|
1106
|
+
this.box(x, y - 0.04, 0.42, 0.44, 0.44, 0.06, pal.partL, pal.partR, shade(pal.partR, -0.2), null);
|
|
1107
|
+
this.box(x, y - 0.08, 0.48, 0.44, 0.05, 0.5, pal.partL, pal.partL, shade(pal.partR, -0.25), null);
|
|
1296
1108
|
}
|
|
1297
1109
|
|
|
1110
|
+
/** A minimal planter: a dark box and a faceted low poly crown. */
|
|
1298
1111
|
drawPlant(x, y, s) {
|
|
1299
1112
|
const ctx = this.ctx;
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
const
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
ctx.ellipse(c[0] + Math.cos(an) * len * 0.5, c[1] + Math.sin(an) * len * 0.5, len * 0.5, len * 0.16, an, 0, 6.28);
|
|
1309
|
-
ctx.fill();
|
|
1310
|
-
}
|
|
1113
|
+
const pal = this.pal;
|
|
1114
|
+
this.box(x - 0.18 * s, y - 0.18 * s, 0, 0.36 * s, 0.36 * s, 0.34 * s, pal.capSide, pal.leg, shade(pal.leg, -0.2), null);
|
|
1115
|
+
const b = this.P(x, y, 0.34 * s); const t = this.P(x, y, 1.15 * s);
|
|
1116
|
+
const w = this.a * 0.3 * s;
|
|
1117
|
+
ctx.fillStyle = pal.tree;
|
|
1118
|
+
ctx.beginPath(); ctx.moveTo(t[0], t[1]); ctx.lineTo(b[0] + w, b[1] - w * 0.2); ctx.lineTo(b[0], b[1] + w * 0.25); ctx.closePath(); ctx.fill();
|
|
1119
|
+
ctx.fillStyle = pal.treeB;
|
|
1120
|
+
ctx.beginPath(); ctx.moveTo(t[0], t[1]); ctx.lineTo(b[0] - w, b[1] - w * 0.2); ctx.lineTo(b[0], b[1] + w * 0.25); ctx.closePath(); ctx.fill();
|
|
1311
1121
|
}
|
|
1312
1122
|
|
|
1313
|
-
drawCooler(
|
|
1314
|
-
const ctx = this.ctx;
|
|
1315
|
-
this.box(x - 0.22, y - 0.22, 0, 0.44, 0.44, 0.9, pal.wallL, shade(pal.wallL, -0.1), shade(pal.wallL, -0.22));
|
|
1316
|
-
this.cyl(x, y, 0.9, 0.17, 0.42, 'rgba(255,190,70,.85)', '#FFD072');
|
|
1317
|
-
const s = this.P(x + 0.22, y + 0.05, 0.6);
|
|
1318
|
-
ctx.fillStyle = '#7A4A1E'; ctx.fillRect(s[0] - 2, s[1] - 2, 5, 4);
|
|
1319
|
-
}
|
|
1123
|
+
drawCooler() { /* removed in 1.0: no decorative props without meaning */ }
|
|
1320
1124
|
|
|
1321
1125
|
drawShelfUnit(pal) {
|
|
1322
|
-
// a
|
|
1126
|
+
// a storage rack against the left wall near the back, neutral spines
|
|
1323
1127
|
const x = 0.02; const y = 0.55;
|
|
1324
|
-
this.box(x, y, 0, 0.42, 1.3, 1.75, pal.
|
|
1325
|
-
const
|
|
1128
|
+
this.box(x, y, 0, 0.42, 1.3, 1.75, pal.capSide, pal.leg, shade(pal.leg, -0.2), null);
|
|
1129
|
+
const T = pal.T;
|
|
1130
|
+
const spines = [pal.partL, pal.part, mixHex(pal.partL, T.info, 0.2), pal.partR, mixHex(pal.partL, T.accent, 0.18)];
|
|
1326
1131
|
for (let row = 0; row < 3; row++) {
|
|
1327
1132
|
const zz = 0.12 + row * 0.55;
|
|
1328
1133
|
for (let i = 0; i < 5; i++) {
|
|
1329
1134
|
const yy = y + 0.12 + i * 0.22;
|
|
1330
|
-
this.poly([this.P(x + 0.42, yy, zz), this.P(x + 0.42, yy + 0.16, zz), this.P(x + 0.42, yy + 0.16, zz + 0.32 + ((i + row) % 3) * 0.05), this.P(x + 0.42, yy, zz + 0.32 + ((i + row) % 3) * 0.05)],
|
|
1135
|
+
this.poly([this.P(x + 0.42, yy, zz), this.P(x + 0.42, yy + 0.16, zz), this.P(x + 0.42, yy + 0.16, zz + 0.32 + ((i + row) % 3) * 0.05), this.P(x + 0.42, yy, zz + 0.32 + ((i + row) % 3) * 0.05)], spines[(i * 2 + row) % spines.length]);
|
|
1331
1136
|
}
|
|
1332
1137
|
}
|
|
1333
1138
|
}
|
|
@@ -1337,123 +1142,70 @@ export class OfficeScene {
|
|
|
1337
1142
|
const now = this.now;
|
|
1338
1143
|
const reduced = this.reduced();
|
|
1339
1144
|
const k = this.k;
|
|
1340
|
-
|
|
1145
|
+
const T = artTokens();
|
|
1146
|
+
let hover = 0;
|
|
1147
|
+
let wingAmp = 0.12;
|
|
1148
|
+
let wingRate = 18;
|
|
1341
1149
|
const m = a.seg ? 'fly' : a.mode;
|
|
1342
1150
|
if (!reduced) {
|
|
1343
1151
|
switch (m) {
|
|
1344
|
-
case 'fly':
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
sy = 1 + st; sx = 1 - st * 0.6;
|
|
1349
|
-
tilt = (a.seg && a.seg.to.x - a.seg.from.x - (a.seg.to.y - a.seg.from.y) > 0 ? 0.12 : -0.12) * Math.sin(Math.PI * u);
|
|
1350
|
-
break;
|
|
1351
|
-
}
|
|
1352
|
-
case 'type': bob = Math.sin(now * 16 + a.ph) * 0.018; wingRate = 26; break;
|
|
1353
|
-
case 'plan': bob = Math.sin(now * 3 + a.ph) * 0.05; break;
|
|
1354
|
-
case 'wait': {
|
|
1355
|
-
// foot tapping: a short dip on every beat
|
|
1356
|
-
const beat = (now * 2.2 + a.ph) % 1;
|
|
1357
|
-
bob = beat < 0.2 ? -Math.sin((beat / 0.2) * Math.PI) * 0.05 : 0;
|
|
1358
|
-
if (beat < 0.2) { sy = 0.96; sx = 1.03; }
|
|
1359
|
-
wingRate = 14; wingAmp = 0.18;
|
|
1360
|
-
break;
|
|
1361
|
-
}
|
|
1362
|
-
case 'stuck': bob = -0.04 + Math.sin(now * 1.4 + a.ph) * 0.02; tilt = Math.sin(now * 1.3) * 0.07; wingRate = 8; wingAmp = 0.12; break;
|
|
1363
|
-
case 'sleep': case 'paused': bob = Math.sin(now * 1.1 + a.ph) * 0.012; tilt = 0.24; eyes = true; wingRate = 0; wingAmp = 0; sy = 1 + Math.sin(now * 1.1 + a.ph) * 0.015; break;
|
|
1364
|
-
case 'error': jx = (now % 2 < 0.4) ? Math.sin(now * 60) * 1.6 : 0; bob = Math.sin(now * 2) * 0.02; break;
|
|
1365
|
-
case 'celebrate': {
|
|
1366
|
-
const hop = Math.abs(Math.sin((now - this.celebrateAt) * 5.5 + a.ph));
|
|
1367
|
-
bob = hop * 0.42;
|
|
1368
|
-
if (hop < 0.2) { sy = 0.86; sx = 1.12; } else { sy = 1.06; sx = 0.96; }
|
|
1369
|
-
sx *= Math.cos((now - this.celebrateAt) * 3 + a.ph) > -0.2 ? 1 : -1;
|
|
1370
|
-
wingRate = 40; wingAmp = 0.5;
|
|
1371
|
-
break;
|
|
1372
|
-
}
|
|
1373
|
-
case 'test': bob = Math.sin(now * 5 + a.ph) * 0.03; break;
|
|
1374
|
-
case 'read': bob = Math.sin(now * 2 + a.ph) * 0.03; tilt = Math.sin(now * 1.2) * 0.05; break;
|
|
1375
|
-
default: bob = Math.sin(now * 2.2 + a.ph) * 0.05;
|
|
1152
|
+
case 'fly': wingAmp = 0.22; wingRate = 30; break;
|
|
1153
|
+
case 'sleep': case 'paused': wingAmp = 0; hover = 0; break;
|
|
1154
|
+
case 'type': case 'test': case 'read': hover = Math.sin(now * 2.4 + a.ph) * 0.012; break;
|
|
1155
|
+
default: hover = Math.sin(now * 1.6 + a.ph) * 0.02;
|
|
1376
1156
|
}
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
if (sq < 0.5) { const d = Math.exp(-sq * 9) * Math.cos(sq * 22) * 0.16; sy *= 1 - d; sx *= 1 + d * 0.8; }
|
|
1380
|
-
const hp = now - a.hopAt;
|
|
1381
|
-
if (hp < 0.6) { bob += Math.sin((hp / 0.6) * Math.PI) * 0.3; }
|
|
1382
|
-
} else if (m === 'sleep' || m === 'paused') { tilt = 0.18; eyes = true; wingAmp = 0; }
|
|
1383
|
-
else { wingAmp = 0.2; wingRate = 0; }
|
|
1384
|
-
if (now >= a.blinkAt && now < a.blinkAt + 0.13) eyes = true;
|
|
1385
|
-
// Mel's reactions to what the user does
|
|
1386
|
-
if (a.react && !reduced) {
|
|
1387
|
-
const rt = now - a.react.at;
|
|
1388
|
-
if (rt > 1.4) a.react = null;
|
|
1389
|
-
else if (a.react.kind === 'nod') { const n = Math.sin(rt * 14) * Math.exp(-rt * 2.2); bob += n * 0.05; sy *= 1 - Math.max(0, n) * 0.06; tilt += 0; }
|
|
1390
|
-
else if (a.react.kind === 'curious') { tilt += Math.sin(Math.min(1, rt * 3) * Math.PI / 2) * 0.22 * (1 - clamp((rt - 1) / 0.4)); bob += 0.06 * Math.sin(Math.min(1, rt * 4) * Math.PI); }
|
|
1391
|
-
else if (a.react.kind === 'shake') { tilt += Math.sin(rt * 16) * 0.12 * Math.exp(-rt * 2.5); }
|
|
1392
|
-
} else if (a.react && reduced && now - a.react.at > 1.4) a.react = null;
|
|
1393
|
-
// ease between poses so a change of state never snaps
|
|
1394
|
-
if (!reduced) {
|
|
1395
|
-
const kk = 1 - Math.pow(0.0004, Math.min(0.05, now - (a.lastPoseAt || now)));
|
|
1396
|
-
a.tiltS = lerp(a.tiltS ?? tilt, tilt, a.seg ? 1 : kk);
|
|
1397
|
-
a.bobS = lerp(a.bobS ?? bob, bob, Math.abs(bob - (a.bobS ?? bob)) > 0.12 ? kk : 1);
|
|
1398
|
-
tilt = a.tiltS; bob = a.bobS;
|
|
1399
|
-
}
|
|
1400
|
-
a.lastPoseAt = now;
|
|
1401
|
-
|
|
1402
|
-
const p = this.P(a.pos.x, a.pos.y, a.pos.z + bob);
|
|
1157
|
+
} else wingAmp = 0;
|
|
1158
|
+
const p = this.P(a.pos.x, a.pos.y, a.pos.z + hover);
|
|
1403
1159
|
a.sx = p[0]; a.sy = p[1];
|
|
1160
|
+
const ground = this.P(a.pos.x, a.pos.y, 0);
|
|
1161
|
+
// the status ring under the unit
|
|
1162
|
+
const sc = statusColor(m === 'fly' ? 'idle' : m, T);
|
|
1163
|
+
const sleep = m === 'sleep' || m === 'paused';
|
|
1164
|
+
const pulsing = (m === 'plan' || m === 'type') && !reduced;
|
|
1165
|
+
const ringA = sleep ? 0.45 : pulsing ? 0.55 + 0.35 * (0.5 + 0.5 * Math.sin(now * 3.4 + a.ph)) : 0.85;
|
|
1166
|
+
ctx.save();
|
|
1167
|
+
ctx.globalAlpha = a.alpha * ringA;
|
|
1168
|
+
ctx.strokeStyle = sc; ctx.lineWidth = Math.max(1.2, k * 2.2);
|
|
1169
|
+
if (sleep) ctx.setLineDash([3, 3]);
|
|
1170
|
+
// on the floor under the unit, like a selection ring
|
|
1171
|
+
ctx.beginPath(); ctx.ellipse(ground[0], ground[1], 18 * k, 7.5 * k, 0, 0, 6.28); ctx.stroke();
|
|
1172
|
+
ctx.restore();
|
|
1404
1173
|
const img = this.sprite(a.w);
|
|
1405
1174
|
ctx.save();
|
|
1406
|
-
ctx.globalAlpha = a.alpha * (m === 'paused' ? 0.
|
|
1407
|
-
ctx.translate(p[0]
|
|
1408
|
-
// anchor: SVG point (32, 44) sits on the world point
|
|
1409
|
-
ctx.translate(
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
ctx.
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
ctx.strokeStyle = 'rgba(36,22,12,.5)';
|
|
1417
|
-
ctx.lineWidth = Math.max(0.6, k * 1);
|
|
1418
|
-
for (const [wx, dir] of [[13.5, -1], [50.5, 1]]) {
|
|
1175
|
+
ctx.globalAlpha = a.alpha * (m === 'paused' ? 0.6 : 1);
|
|
1176
|
+
ctx.translate(p[0], p[1]);
|
|
1177
|
+
// anchor: SVG point (32, 44) sits on the world point
|
|
1178
|
+
ctx.translate(-32 * k, -44 * k);
|
|
1179
|
+
// translucent wings behind the body, a low flutter
|
|
1180
|
+
const flap = wingAmp ? Math.sin(now * wingRate + a.ph) * wingAmp : 0;
|
|
1181
|
+
ctx.fillStyle = alpha(T.text, 0.12);
|
|
1182
|
+
ctx.strokeStyle = alpha(T.text, 0.42);
|
|
1183
|
+
ctx.lineWidth = Math.max(0.6, k);
|
|
1184
|
+
for (const [wx, dir] of [[19, -1], [45, 1]]) {
|
|
1419
1185
|
ctx.save();
|
|
1420
|
-
ctx.translate(
|
|
1421
|
-
ctx.rotate(dir * (0.
|
|
1422
|
-
ctx.beginPath(); ctx.ellipse(dir *
|
|
1186
|
+
ctx.translate(wx * k, 27 * k);
|
|
1187
|
+
ctx.rotate(dir * (0.42 - flap));
|
|
1188
|
+
ctx.beginPath(); ctx.ellipse(dir * 4 * k, -2 * k, 11 * k, 5.4 * k, 0, 0, 6.28);
|
|
1423
1189
|
ctx.fill(); ctx.stroke();
|
|
1424
1190
|
ctx.restore();
|
|
1425
1191
|
}
|
|
1426
1192
|
if (img) ctx.drawImage(img, -4 * k, -2 * k, 72 * k, 76 * k);
|
|
1427
|
-
else { ctx.fillStyle = a.w.color ||
|
|
1428
|
-
if (eyes) {
|
|
1429
|
-
ctx.fillStyle = '#FCC041';
|
|
1430
|
-
ctx.strokeStyle = OUT; ctx.lineWidth = Math.max(0.8, 1.3 * k); ctx.lineCap = 'round';
|
|
1431
|
-
for (const ex of [25.6, 38.4]) {
|
|
1432
|
-
ctx.beginPath(); ctx.ellipse(ex * k, 31.6 * k, 4.3 * k, 5.1 * k, 0, 0, 6.28); ctx.fill();
|
|
1433
|
-
ctx.beginPath(); ctx.moveTo((ex - 3) * k, 32 * k); ctx.quadraticCurveTo(ex * k, 34.8 * k, (ex + 3) * k, 32 * k); ctx.stroke();
|
|
1434
|
-
}
|
|
1435
|
-
ctx.lineCap = 'butt';
|
|
1436
|
-
}
|
|
1437
|
-
if (m === 'stuck' && !this.mini) {
|
|
1438
|
-
// worried brows
|
|
1439
|
-
ctx.strokeStyle = OUT; ctx.lineWidth = Math.max(0.8, 1.2 * k);
|
|
1440
|
-
ctx.beginPath(); ctx.moveTo(22 * k, 24 * k); ctx.lineTo(28 * k, 26 * k); ctx.moveTo(42 * k, 24 * k); ctx.lineTo(36 * k, 26 * k); ctx.stroke();
|
|
1441
|
-
}
|
|
1193
|
+
else { ctx.fillStyle = tone(a.w.color || T.accent); ctx.beginPath(); ctx.arc(32 * k, 40 * k, 14 * k, 0, 6.28); ctx.fill(); }
|
|
1442
1194
|
ctx.restore();
|
|
1443
1195
|
// the thing in its hands
|
|
1444
1196
|
if (a.item) {
|
|
1445
|
-
const hx = p[0]; const hy = p[1] +
|
|
1446
|
-
if (a.item === 'note' || a.item === 'bad') drawNoteIcon(ctx, hx, hy, 15 * k * 1.25, a.item === 'bad' ?
|
|
1447
|
-
else drawParcel(ctx, hx, hy,
|
|
1197
|
+
const hx = p[0]; const hy = p[1] + 18 * k;
|
|
1198
|
+
if (a.item === 'note' || a.item === 'bad') drawNoteIcon(ctx, hx, hy, 15 * k * 1.25, null, a.item === 'bad' ? T.bad : a.itemColor);
|
|
1199
|
+
else drawParcel(ctx, hx, hy, 14 * k * 1.25, a.itemColor || T.accent);
|
|
1448
1200
|
}
|
|
1449
1201
|
// the hit box for the DOM layer
|
|
1450
|
-
this.hits.push({ id: a.id, x: p[0] - 26 * k, y: p[1] -
|
|
1202
|
+
this.hits.push({ id: a.id, x: p[0] - 26 * k, y: p[1] - 40 * k, w: 52 * k, h: 70 * k });
|
|
1451
1203
|
}
|
|
1452
1204
|
|
|
1453
1205
|
sprite(w) {
|
|
1454
1206
|
const px = Math.max(16, Math.round(this.k * 72 * this.dpr));
|
|
1455
1207
|
const key = `${w.color}|${w.role}|${w.name}|${px}`;
|
|
1456
|
-
|
|
1208
|
+
const sp = this.sprites.get(w.id);
|
|
1457
1209
|
if (sp && sp.key === key) return sp.ready ? sp.img : sp.prev;
|
|
1458
1210
|
const img = new Image();
|
|
1459
1211
|
const svg = beeSvg(w, { title: '' })
|
|
@@ -1467,148 +1219,94 @@ export class OfficeScene {
|
|
|
1467
1219
|
}
|
|
1468
1220
|
|
|
1469
1221
|
drawLights(pal) {
|
|
1470
|
-
if (pal.night < 0.25) return;
|
|
1471
1222
|
const ctx = this.ctx;
|
|
1472
1223
|
ctx.save();
|
|
1473
1224
|
ctx.globalCompositeOperation = 'lighter';
|
|
1474
|
-
|
|
1225
|
+
// screens throw a faint light on busy units, a little more at night
|
|
1475
1226
|
for (const a of this.actors.values()) {
|
|
1476
|
-
if (!a.lampAt) continue;
|
|
1227
|
+
if (!['type', 'test', 'read'].includes(a.mode) || a.seg || !a.lampAt) continue;
|
|
1228
|
+
const r = this.a * 0.7;
|
|
1229
|
+
const [r0, g0, b0] = rgb(tone(a.w.color || pal.T.accent));
|
|
1477
1230
|
const [x, y] = a.lampAt;
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
ctx.fillStyle = g; ctx.fillRect(x - r, y - r, r * 2, r * 2.2);
|
|
1482
|
-
}
|
|
1483
|
-
// screens glow on the faces of busy bees
|
|
1484
|
-
for (const a of this.actors.values()) {
|
|
1485
|
-
if (!['type', 'test', 'read'].includes(a.mode) || a.seg) continue;
|
|
1486
|
-
const r = this.a * 0.6;
|
|
1487
|
-
const [r0, g0, b0] = rgb(a.w.color);
|
|
1488
|
-
const g = ctx.createRadialGradient(a.sx, a.sy + this.a * 0.2, 1, a.sx, a.sy + this.a * 0.2, r);
|
|
1489
|
-
g.addColorStop(0, `rgba(${r0},${g0},${b0},${0.12 + pal.night * 0.1})`); g.addColorStop(1, `rgba(${r0},${g0},${b0},0)`);
|
|
1490
|
-
ctx.fillStyle = g; ctx.fillRect(a.sx - r, a.sy - r * 0.8, r * 2, r * 2);
|
|
1231
|
+
const g = ctx.createRadialGradient(x, y, 1, x, y, r);
|
|
1232
|
+
g.addColorStop(0, `rgba(${r0},${g0},${b0},${0.06 + pal.night * 0.06})`); g.addColorStop(1, `rgba(${r0},${g0},${b0},0)`);
|
|
1233
|
+
ctx.fillStyle = g; ctx.fillRect(x - r, y - r, r * 2, r * 2);
|
|
1491
1234
|
}
|
|
1492
1235
|
ctx.restore();
|
|
1493
1236
|
}
|
|
1494
1237
|
|
|
1495
|
-
/**
|
|
1238
|
+
/** Tags, bubbles, check marks and the waiting state: always on top, never darkened. */
|
|
1496
1239
|
drawOverlay() {
|
|
1497
1240
|
const ctx = this.ctx;
|
|
1498
1241
|
const now = this.now;
|
|
1499
1242
|
const k = this.k;
|
|
1500
1243
|
const reduced = this.reduced();
|
|
1501
1244
|
const s = this.getState();
|
|
1502
|
-
|
|
1245
|
+
const T = artTokens();
|
|
1246
|
+
// info tags first, so bubbles sit on top of them
|
|
1503
1247
|
if (!this.mini) {
|
|
1504
1248
|
for (const a of this.actors.values()) {
|
|
1505
1249
|
const at = a.desk ? this.P(a.desk.x + DW, a.desk.y + DD, 0) : this.P(MEL_HOME.x + 0.42, MEL_HOME.y + 0.42, 0);
|
|
1506
|
-
|
|
1250
|
+
const on = this.highlight === a.id;
|
|
1251
|
+
const t = a.taskId && s.tasks?.[a.taskId];
|
|
1252
|
+
drawNameTag(ctx, at[0], at[1] + 6, a.w.name, levelOf(s, a.id), a.w.color, on, Math.max(10.5, Math.min(12, this.a * 0.2)),
|
|
1253
|
+
{ status: statusColor(a.seg ? 'idle' : a.mode, T), role: roleName(a.w), task: plain(t?.title || '', 80) });
|
|
1507
1254
|
}
|
|
1508
1255
|
}
|
|
1509
1256
|
for (const a of this.actors.values()) {
|
|
1510
|
-
const headY = a.sy -
|
|
1511
|
-
const ix = a.sx + 22 * k;
|
|
1512
|
-
const iy = headY - 6 * k;
|
|
1513
|
-
const pop = reduced ? clamp((now - a.modeSince) / 0.25) : easeOutBack(clamp((now - a.modeSince) / 0.35));
|
|
1514
|
-
const sz = (this.mini ? 9 : Math.max(14, Math.min(27, this.a * 0.42))) * (reduced ? 1 : Math.max(0.01, pop));
|
|
1515
|
-
ctx.globalAlpha = a.alpha * (reduced ? pop : 1);
|
|
1257
|
+
const headY = a.sy - 40 * k;
|
|
1516
1258
|
const m = a.seg ? 'fly' : a.mode;
|
|
1517
|
-
|
|
1518
|
-
if (
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
const pulse = reduced ? 0.5 : (Math.sin(now * 4) + 1) / 2;
|
|
1523
|
-
ctx.strokeStyle = `rgba(232,180,92,${0.35 + pulse * 0.4})`; ctx.lineWidth = 2.5;
|
|
1524
|
-
ctx.beginPath(); ctx.ellipse(a.sx, a.sy + 30 * k, (30 + pulse * 5) * k, (12 + pulse * 2) * k, 0, 0, 6.28); ctx.stroke();
|
|
1525
|
-
iconCloud(ctx, a.sx, headY - sz * 1.3 + wob, sz * 1.9, reduced ? 0 : now);
|
|
1526
|
-
if (!this.mini) drawPill(ctx, a.sx, headY - sz * 2.75 + wob, a.isMel ? 'Check the brief' : 'Needs your OK', '#E8B45C', Math.max(10, Math.min(12, this.a * 0.19)));
|
|
1527
|
-
}
|
|
1528
|
-
else if (m === 'paused') iconPause(ctx, ix, iy, sz);
|
|
1529
|
-
else if (m === 'error') iconBang(ctx, ix, iy + wob, sz);
|
|
1530
|
-
else if (m === 'test') iconFlask(ctx, ix, iy + wob, sz, reduced ? 0 : now);
|
|
1531
|
-
else if (m === 'read') iconMag(ctx, ix, iy + wob, sz, reduced ? 0 : now);
|
|
1532
|
-
else if (m === 'celebrate') iconJar(ctx, a.sx, headY - sz * 0.8 - (reduced ? 0 : Math.abs(Math.sin(now * 4 + a.ph)) * 6), sz * 1.1);
|
|
1533
|
-
else if (m === 'plan') iconDots(ctx, ix, iy + wob, sz, reduced ? 0 : now);
|
|
1259
|
+
ctx.globalAlpha = a.alpha;
|
|
1260
|
+
if (m === 'stuck' && !this.mini) {
|
|
1261
|
+
// waiting for the user: a calm warn chip over the unit
|
|
1262
|
+
drawPill(ctx, a.sx, headY - 4, a.isMel ? tc('office.pill.brief') : tc('office.pill.ok'), T.warn, Math.max(10.5, Math.min(12, this.a * 0.19)));
|
|
1263
|
+
} else if (m === 'error') iconBang(ctx, a.sx + 20 * k, headY + 6 * k, Math.max(12, Math.min(18, this.a * 0.3)));
|
|
1534
1264
|
if (a.badge) {
|
|
1535
1265
|
const age = now - a.badge.at;
|
|
1536
|
-
const
|
|
1537
|
-
const
|
|
1538
|
-
const bs = sz * (a.badge.big ? 1.5 : 1.15) * pop;
|
|
1266
|
+
const fade = clamp((a.badge.until - now) / 0.3) * (reduced ? 1 : easeOut(clamp(age / 0.2)));
|
|
1267
|
+
const bs = Math.max(12, Math.min(20, this.a * 0.3)) * (a.badge.big ? 1.2 : 1);
|
|
1539
1268
|
ctx.globalAlpha = fade * a.alpha;
|
|
1540
|
-
(a.badge.kind === 'ok' ? iconCheck : iconX)(ctx, a.sx -
|
|
1269
|
+
(a.badge.kind === 'ok' ? iconCheck : iconX)(ctx, a.sx - 20 * k, headY + 8 * k - (reduced ? 0 : Math.min(age, 0.4) * 10), bs);
|
|
1541
1270
|
}
|
|
1542
1271
|
ctx.globalAlpha = 1;
|
|
1543
1272
|
if (a.bubble && !this.mini) {
|
|
1544
1273
|
const age = now - a.bubble.at;
|
|
1545
|
-
const fade = Math.min(clamp(age / 0.2), clamp((a.bubble.until - now) / 0.
|
|
1274
|
+
const fade = Math.min(clamp(age / 0.2), clamp((a.bubble.until - now) / 0.25));
|
|
1546
1275
|
ctx.globalAlpha = fade;
|
|
1547
|
-
drawBubble(ctx, a.sx, headY -
|
|
1276
|
+
drawBubble(ctx, a.sx, headY - (m === 'stuck' ? 26 : 2), a.bubble.text, Math.max(11, Math.min(12.5, this.a * 0.2)), this.w, a.w.color);
|
|
1548
1277
|
ctx.globalAlpha = 1;
|
|
1549
1278
|
}
|
|
1550
|
-
if (this.highlight === a.id && !this.mini) {
|
|
1551
|
-
ctx.strokeStyle = 'rgba(255,208,114,.9)'; ctx.lineWidth = 2; ctx.setLineDash([4, 4]);
|
|
1552
|
-
ctx.beginPath(); ctx.ellipse(a.sx, a.sy + 30 * k, 26 * k, 10 * k, 0, 0, 6.28); ctx.stroke(); ctx.setLineDash([]);
|
|
1553
|
-
}
|
|
1554
1279
|
}
|
|
1555
1280
|
// carried notes ride with Mel
|
|
1556
1281
|
const mel = this.actors.get('mel');
|
|
1557
|
-
if (mel) for (const n of this.notes.values()) if (n.state === 'carried') drawNoteIcon(ctx, mel.sx - 4, mel.sy +
|
|
1282
|
+
if (mel) for (const n of this.notes.values()) if (n.state === 'carried') drawNoteIcon(ctx, mel.sx - 4, mel.sy + 18 * k, 16 * k * 1.3, null, this.actors.get(n.task?.assignee)?.w.color || T.accent);
|
|
1558
1283
|
}
|
|
1559
1284
|
|
|
1560
1285
|
drawParticles() {
|
|
1561
1286
|
const ctx = this.ctx;
|
|
1287
|
+
const T = artTokens();
|
|
1562
1288
|
for (const p of this.parts) {
|
|
1563
1289
|
const life = 1 - p.age / p.max;
|
|
1564
|
-
ctx.globalAlpha = clamp(life * 1.6);
|
|
1565
1290
|
switch (p.kind) {
|
|
1566
|
-
case '
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
ctx.
|
|
1574
|
-
ctx.fillText('z', p.x, p.y);
|
|
1575
|
-
break;
|
|
1576
|
-
case 'dot': case 'bubble':
|
|
1577
|
-
ctx.fillStyle = p.color; ctx.beginPath(); ctx.arc(p.x, p.y, p.size, 0, 6.28); ctx.fill();
|
|
1578
|
-
if (p.kind === 'bubble') { ctx.strokeStyle = 'rgba(255,255,255,.6)'; ctx.lineWidth = 1; ctx.stroke(); }
|
|
1579
|
-
break;
|
|
1580
|
-
case 'spark': {
|
|
1581
|
-
ctx.fillStyle = p.color;
|
|
1582
|
-
const r = p.size * (0.6 + life * 0.6);
|
|
1583
|
-
ctx.beginPath(); ctx.moveTo(p.x, p.y - r * 2); ctx.lineTo(p.x + r * 0.5, p.y - r * 0.5); ctx.lineTo(p.x + r * 2, p.y); ctx.lineTo(p.x + r * 0.5, p.y + r * 0.5); ctx.lineTo(p.x, p.y + r * 2); ctx.lineTo(p.x - r * 0.5, p.y + r * 0.5); ctx.lineTo(p.x - r * 2, p.y); ctx.lineTo(p.x - r * 0.5, p.y - r * 0.5); ctx.closePath(); ctx.fill();
|
|
1291
|
+
case 'pulse': {
|
|
1292
|
+
const a = this.actors.get(p.id);
|
|
1293
|
+
if (!a) break;
|
|
1294
|
+
const u = easeOut(p.age / p.max);
|
|
1295
|
+
ctx.globalAlpha = (1 - u) * 0.8 * a.alpha;
|
|
1296
|
+
ctx.strokeStyle = p.tone === 'info' ? T.info : T.ok; ctx.lineWidth = 1.5;
|
|
1297
|
+
const g = this.P(a.pos.x, a.pos.y, 0);
|
|
1298
|
+
ctx.beginPath(); ctx.ellipse(g[0], g[1], (18 + u * 12) * this.k, (7.5 + u * 5) * this.k, 0, 0, 6.28); ctx.stroke();
|
|
1584
1299
|
break;
|
|
1585
1300
|
}
|
|
1586
|
-
case 'puff':
|
|
1587
|
-
ctx.fillStyle = 'rgba(242,233,218,.5)'; ctx.beginPath(); ctx.arc(p.x, p.y, p.size * (1 + p.age * 1.5), 0, 6.28); ctx.fill();
|
|
1588
|
-
break;
|
|
1589
|
-
case 'confetti':
|
|
1590
|
-
ctx.save(); ctx.translate(p.x, p.y); ctx.rotate(p.rot); ctx.scale(1, Math.abs(Math.cos(p.rot * 1.3)) * 0.8 + 0.2);
|
|
1591
|
-
ctx.fillStyle = p.color;
|
|
1592
|
-
if (p.hex) { ctx.beginPath(); hexScreen(ctx, 0, 0, p.size * 0.55); ctx.fill(); } else ctx.fillRect(-p.size / 2, -p.size / 4, p.size, p.size / 2);
|
|
1593
|
-
ctx.restore();
|
|
1594
|
-
break;
|
|
1595
1301
|
case 'label': {
|
|
1596
|
-
ctx.
|
|
1302
|
+
ctx.globalAlpha = clamp(life * 3);
|
|
1303
|
+
ctx.font = `500 ${Math.max(10, Math.min(11.5, this.a * 0.18))}px ${MONO}`;
|
|
1597
1304
|
const tw = ctx.measureText(p.text).width;
|
|
1598
|
-
ctx.fillStyle =
|
|
1599
|
-
roundRect(ctx, p.x - tw / 2 - 6, p.y - 12, tw + 12,
|
|
1305
|
+
ctx.fillStyle = alpha(T.panel, 0.9);
|
|
1306
|
+
roundRect(ctx, p.x - tw / 2 - 6, p.y - 12, tw + 12, 17, 4); ctx.fill();
|
|
1600
1307
|
ctx.fillStyle = p.color; ctx.textAlign = 'center'; ctx.fillText(p.text, p.x, p.y + 1); ctx.textAlign = 'left';
|
|
1601
1308
|
break;
|
|
1602
1309
|
}
|
|
1603
|
-
case 'jar': {
|
|
1604
|
-
const u = easeInOut(clamp(p.age / p.max));
|
|
1605
|
-
const cx = (p.x0 + p.x1) / 2; const cy = Math.min(p.y0, p.y1) - 120;
|
|
1606
|
-
const x = (1 - u) * (1 - u) * p.x0 + 2 * (1 - u) * u * cx + u * u * p.x1;
|
|
1607
|
-
const y = (1 - u) * (1 - u) * p.y0 + 2 * (1 - u) * u * cy + u * u * p.y1;
|
|
1608
|
-
ctx.globalAlpha = 1;
|
|
1609
|
-
iconJar(ctx, x, y, 18 - u * 6);
|
|
1610
|
-
break;
|
|
1611
|
-
}
|
|
1612
1310
|
default: break;
|
|
1613
1311
|
}
|
|
1614
1312
|
}
|
|
@@ -1618,10 +1316,12 @@ export class OfficeScene {
|
|
|
1618
1316
|
}
|
|
1619
1317
|
|
|
1620
1318
|
/* ---------- state helpers ---------- */
|
|
1319
|
+
/** The agent's level from the City (xp the engine counts), or null when the engine has no city. */
|
|
1621
1320
|
export function levelOf(s, id) {
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1321
|
+
const agents = hub.view?.()?.agents || s?.city?.agents;
|
|
1322
|
+
if (!agents) return null;
|
|
1323
|
+
const a = agents[id] || Object.values(agents).find((x) => x.workerId === id && !x.retired);
|
|
1324
|
+
return a ? a.level || 1 : null;
|
|
1625
1325
|
}
|
|
1626
1326
|
|
|
1627
1327
|
export function doneCount(s) {
|
|
@@ -1630,15 +1330,11 @@ export function doneCount(s) {
|
|
|
1630
1330
|
return n;
|
|
1631
1331
|
}
|
|
1632
1332
|
|
|
1333
|
+
/** A chat line as a plain bubble: markdown gone, one line, cut at 88 characters. */
|
|
1633
1334
|
function cleanText(text) {
|
|
1634
|
-
|
|
1635
|
-
t = t.replace(/^Plan: /, '');
|
|
1636
|
-
if (t.length > 88) t = `${t.slice(0, 85).replace(/\s+\S*$/, '')}...`;
|
|
1637
|
-
return t;
|
|
1335
|
+
return mdLine(String(text || '').trim().replace(/^Plan: /, ''), 88);
|
|
1638
1336
|
}
|
|
1639
1337
|
|
|
1640
|
-
function hash(s) { let h = 0; for (let i = 0; i < s.length; i++) h = (h * 31 + s.charCodeAt(i)) | 0; return Math.abs(h); }
|
|
1641
|
-
|
|
1642
1338
|
function wrap(ctx, text, maxW, maxLines) {
|
|
1643
1339
|
const words = String(text).split(/\s+/);
|
|
1644
1340
|
const lines = [];
|
|
@@ -1660,7 +1356,7 @@ function wrap(ctx, text, maxW, maxLines) {
|
|
|
1660
1356
|
return lines;
|
|
1661
1357
|
}
|
|
1662
1358
|
|
|
1663
|
-
/* ---------- drawing helpers (screen space) ---------- */
|
|
1359
|
+
/* ---------- drawing helpers (screen space), shared with the City ---------- */
|
|
1664
1360
|
function roundRect(ctx, x, y, w, h, r) {
|
|
1665
1361
|
ctx.beginPath();
|
|
1666
1362
|
ctx.moveTo(x + r, y);
|
|
@@ -1688,159 +1384,175 @@ function hexScreen(ctx, cx, cy, r) {
|
|
|
1688
1384
|
ctx.closePath();
|
|
1689
1385
|
}
|
|
1690
1386
|
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
const
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
ctx.
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
ctx.
|
|
1711
|
-
|
|
1387
|
+
/**
|
|
1388
|
+
* The compact info tag under an agent: a status dot, the name and a quiet level badge. Hovered or
|
|
1389
|
+
* selected (`on`) with `more`, it expands to the role and the current task.
|
|
1390
|
+
* @param {{ status?: string, role?: string, task?: string }} [more]
|
|
1391
|
+
*/
|
|
1392
|
+
function drawNameTag(ctx, x, y, name, level, color, on, fs, more) {
|
|
1393
|
+
const T = artTokens();
|
|
1394
|
+
const lv = level != null ? t('office.level', { level }) : '';
|
|
1395
|
+
ctx.font = `600 ${fs}px ${FONT}`;
|
|
1396
|
+
const nw = ctx.measureText(name).width;
|
|
1397
|
+
ctx.font = `500 ${fs * 0.82}px ${MONO}`;
|
|
1398
|
+
const lw = lv ? ctx.measureText(lv).width + 6 : 0;
|
|
1399
|
+
const h = Math.round(fs + 8);
|
|
1400
|
+
const lines = [];
|
|
1401
|
+
if (on && more) {
|
|
1402
|
+
ctx.font = `400 ${fs * 0.92}px ${FONT}`;
|
|
1403
|
+
if (more.role) lines.push(wrap(ctx, more.role, 200, 1)[0] || '');
|
|
1404
|
+
if (more.task) lines.push(wrap(ctx, more.task, 200, 1)[0] || '');
|
|
1405
|
+
}
|
|
1406
|
+
ctx.font = `400 ${fs * 0.92}px ${FONT}`;
|
|
1407
|
+
const extraW = Math.max(0, ...lines.map((l) => ctx.measureText(l).width));
|
|
1408
|
+
const w = Math.max(nw + lw + fs + 14, extraW + 18);
|
|
1409
|
+
const H = h + lines.length * (fs + 4) + (lines.length ? 4 : 0);
|
|
1410
|
+
const x0 = Math.round(x - w / 2);
|
|
1411
|
+
ctx.fillStyle = alpha(T.panel, on ? 0.96 : 0.82);
|
|
1412
|
+
roundRect(ctx, x0, y, w, H, 4); ctx.fill();
|
|
1413
|
+
ctx.strokeStyle = on ? alpha(T.accent, 0.7) : alpha(T.text, 0.1); ctx.lineWidth = 1; ctx.stroke();
|
|
1414
|
+
// status dot (the ring color), then the name and the level
|
|
1415
|
+
ctx.fillStyle = more?.status || tone(color || T.accent);
|
|
1416
|
+
ctx.beginPath(); ctx.arc(x0 + 9, y + h / 2, Math.max(2.5, fs * 0.24), 0, 6.28); ctx.fill();
|
|
1417
|
+
ctx.font = `600 ${fs}px ${FONT}`;
|
|
1418
|
+
ctx.fillStyle = T.text;
|
|
1419
|
+
ctx.fillText(name, x0 + 16, y + h / 2 + fs * 0.36);
|
|
1420
|
+
if (lv) {
|
|
1421
|
+
ctx.font = `500 ${fs * 0.82}px ${MONO}`;
|
|
1422
|
+
ctx.fillStyle = T.muted;
|
|
1423
|
+
ctx.fillText(lv, x0 + 16 + nw + 6, y + h / 2 + fs * 0.32);
|
|
1424
|
+
}
|
|
1425
|
+
if (lines.length) {
|
|
1426
|
+
ctx.font = `400 ${fs * 0.92}px ${FONT}`;
|
|
1427
|
+
lines.forEach((l, i) => {
|
|
1428
|
+
ctx.fillStyle = i === 0 && more.role ? T.muted : T.text2;
|
|
1429
|
+
ctx.fillText(l, x0 + 9, y + h + 2 + (i + 1) * (fs + 4) - 4);
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1712
1432
|
}
|
|
1713
1433
|
|
|
1714
1434
|
function drawBubble(ctx, x, y, text, fs, W, color) {
|
|
1715
|
-
|
|
1716
|
-
|
|
1435
|
+
const T = artTokens();
|
|
1436
|
+
ctx.font = `400 ${fs}px ${FONT}`;
|
|
1437
|
+
const maxW = Math.min(240, W * 0.3);
|
|
1717
1438
|
const lines = wrap(ctx, text, maxW, 2);
|
|
1718
1439
|
const tw = Math.max(...lines.map((l) => ctx.measureText(l).width));
|
|
1719
|
-
const pw = tw + 20; const ph = lines.length * (fs +
|
|
1440
|
+
const pw = tw + 20; const ph = lines.length * (fs + 5) + 12;
|
|
1720
1441
|
let bx = x - pw / 2;
|
|
1721
1442
|
bx = Math.max(6, Math.min(W - pw - 6, bx));
|
|
1722
|
-
const by = y - ph -
|
|
1723
|
-
ctx.fillStyle =
|
|
1724
|
-
roundRect(ctx, bx
|
|
1725
|
-
ctx.
|
|
1726
|
-
|
|
1727
|
-
ctx.
|
|
1728
|
-
ctx.fillStyle = color ||
|
|
1729
|
-
ctx.fillRect(bx +
|
|
1730
|
-
ctx.fillStyle =
|
|
1731
|
-
lines.forEach((l, i) => ctx.fillText(l, bx +
|
|
1443
|
+
const by = y - ph - 8;
|
|
1444
|
+
ctx.fillStyle = alpha(T.panel2, 0.96);
|
|
1445
|
+
roundRect(ctx, bx, by, pw, ph, 6); ctx.fill();
|
|
1446
|
+
ctx.strokeStyle = alpha(T.text, 0.12); ctx.lineWidth = 1; ctx.stroke();
|
|
1447
|
+
ctx.beginPath(); ctx.moveTo(x - 5, by + ph - 0.5); ctx.lineTo(x, by + ph + 6); ctx.lineTo(x + 5, by + ph - 0.5); ctx.closePath();
|
|
1448
|
+
ctx.fillStyle = alpha(T.panel2, 0.96); ctx.fill();
|
|
1449
|
+
ctx.fillStyle = tone(color || T.accent);
|
|
1450
|
+
ctx.fillRect(bx, by + 6, 2, ph - 12);
|
|
1451
|
+
ctx.fillStyle = T.text;
|
|
1452
|
+
lines.forEach((l, i) => ctx.fillText(l, bx + 11, by + 6 + fs * 0.92 + i * (fs + 5)));
|
|
1732
1453
|
}
|
|
1733
1454
|
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
ctx.
|
|
1455
|
+
/** A round status chip: panel fill, a hairline in the tone, a glyph drawn by `glyph`. */
|
|
1456
|
+
function circleIcon(ctx, x, y, s, toneColor) {
|
|
1457
|
+
const T = artTokens();
|
|
1458
|
+
ctx.fillStyle = alpha(T.panel2, 0.96); ctx.beginPath(); ctx.arc(x, y, s / 2, 0, 6.28); ctx.fill();
|
|
1459
|
+
ctx.strokeStyle = alpha(toneColor, 0.75); ctx.lineWidth = 1; ctx.stroke();
|
|
1738
1460
|
}
|
|
1739
|
-
function iconClock(ctx, x, y, s
|
|
1740
|
-
|
|
1741
|
-
ctx
|
|
1742
|
-
|
|
1743
|
-
ctx.beginPath(); ctx.moveTo(x, y
|
|
1461
|
+
function iconClock(ctx, x, y, s) {
|
|
1462
|
+
const T = artTokens();
|
|
1463
|
+
circleIcon(ctx, x, y, s, T.warn);
|
|
1464
|
+
ctx.strokeStyle = T.warn; ctx.lineCap = 'round'; ctx.lineWidth = Math.max(1.2, s * 0.08);
|
|
1465
|
+
ctx.beginPath(); ctx.moveTo(x, y - s * 0.24); ctx.lineTo(x, y); ctx.lineTo(x + s * 0.18, y + s * 0.1); ctx.stroke();
|
|
1744
1466
|
ctx.lineCap = 'butt';
|
|
1745
|
-
ctx.fillStyle = '#E8951E'; ctx.fillRect(x - s * 0.12, y - s * 0.66, s * 0.24, s * 0.12);
|
|
1746
|
-
}
|
|
1747
|
-
function iconCloud(ctx, x, y, s, t) {
|
|
1748
|
-
ctx.fillStyle = '#9AA3B5';
|
|
1749
|
-
ctx.strokeStyle = OUT; ctx.lineWidth = Math.max(1, s * 0.06);
|
|
1750
|
-
ctx.beginPath();
|
|
1751
|
-
ctx.arc(x - s * 0.3, y, s * 0.26, Math.PI * 0.5, Math.PI * 1.5);
|
|
1752
|
-
ctx.arc(x - s * 0.05, y - s * 0.2, s * 0.3, Math.PI * 1.05, Math.PI * 1.9);
|
|
1753
|
-
ctx.arc(x + s * 0.3, y - s * 0.02, s * 0.24, Math.PI * 1.3, Math.PI * 0.5);
|
|
1754
|
-
ctx.closePath(); ctx.fill(); ctx.stroke();
|
|
1755
|
-
ctx.fillStyle = '#F2E9DA'; ctx.font = `800 ${s * 0.42}px ${FONT}`; ctx.textAlign = 'center'; ctx.fillText('?', x, y + s * 0.08); ctx.textAlign = 'left';
|
|
1756
|
-
ctx.strokeStyle = '#86A9D6'; ctx.lineWidth = Math.max(1, s * 0.06); ctx.lineCap = 'round';
|
|
1757
|
-
for (let i = 0; i < 3; i++) {
|
|
1758
|
-
const ph = ((t * 1.6 + i / 3) % 1);
|
|
1759
|
-
const dx = x - s * 0.25 + i * s * 0.25; const dy = y + s * 0.3 + ph * s * 0.45;
|
|
1760
|
-
ctx.globalAlpha = 1 - ph;
|
|
1761
|
-
ctx.beginPath(); ctx.moveTo(dx, dy); ctx.lineTo(dx - s * 0.04, dy + s * 0.1); ctx.stroke();
|
|
1762
|
-
}
|
|
1763
|
-
ctx.globalAlpha = 1; ctx.lineCap = 'butt';
|
|
1764
1467
|
}
|
|
1765
1468
|
function iconCheck(ctx, x, y, s) {
|
|
1766
|
-
|
|
1767
|
-
ctx
|
|
1768
|
-
ctx.
|
|
1469
|
+
const T = artTokens();
|
|
1470
|
+
circleIcon(ctx, x, y, s, T.ok);
|
|
1471
|
+
ctx.strokeStyle = T.ok; ctx.lineWidth = Math.max(1.4, s * 0.1); ctx.lineCap = 'round'; ctx.lineJoin = 'round';
|
|
1472
|
+
ctx.beginPath(); ctx.moveTo(x - s * 0.2, y + s * 0.01); ctx.lineTo(x - s * 0.05, y + s * 0.15); ctx.lineTo(x + s * 0.21, y - s * 0.13); ctx.stroke();
|
|
1769
1473
|
ctx.lineCap = 'butt'; ctx.lineJoin = 'miter';
|
|
1770
1474
|
}
|
|
1771
1475
|
function iconX(ctx, x, y, s) {
|
|
1772
|
-
|
|
1773
|
-
ctx
|
|
1774
|
-
ctx.
|
|
1476
|
+
const T = artTokens();
|
|
1477
|
+
circleIcon(ctx, x, y, s, T.bad);
|
|
1478
|
+
ctx.strokeStyle = T.bad; ctx.lineWidth = Math.max(1.4, s * 0.1); ctx.lineCap = 'round';
|
|
1479
|
+
ctx.beginPath(); ctx.moveTo(x - s * 0.14, y - s * 0.14); ctx.lineTo(x + s * 0.14, y + s * 0.14); ctx.moveTo(x + s * 0.14, y - s * 0.14); ctx.lineTo(x - s * 0.14, y + s * 0.14); ctx.stroke();
|
|
1775
1480
|
ctx.lineCap = 'butt';
|
|
1776
1481
|
}
|
|
1482
|
+
/** A small chip: a dot in the tone and the text, on dark glass. `y` is the text baseline. */
|
|
1777
1483
|
function drawPill(ctx, x, y, text, color, fs) {
|
|
1778
|
-
|
|
1484
|
+
const T = artTokens();
|
|
1485
|
+
ctx.font = `500 ${fs}px ${FONT}`;
|
|
1779
1486
|
const tw = ctx.measureText(text).width;
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
ctx.
|
|
1783
|
-
ctx
|
|
1487
|
+
const w = tw + 24; const h = fs + 9;
|
|
1488
|
+
const x0 = Math.round(x - w / 2); const y0 = Math.round(y - fs - 2);
|
|
1489
|
+
ctx.fillStyle = alpha(T.panel, 0.92);
|
|
1490
|
+
roundRect(ctx, x0, y0, w, h, 4); ctx.fill();
|
|
1491
|
+
ctx.strokeStyle = alpha(color, 0.5); ctx.lineWidth = 1; ctx.stroke();
|
|
1492
|
+
ctx.fillStyle = color; ctx.beginPath(); ctx.arc(x0 + 9, y0 + h / 2, 2.6, 0, 6.28); ctx.fill();
|
|
1493
|
+
ctx.fillStyle = T.text; ctx.fillText(text, x0 + 16, y0 + h / 2 + fs * 0.35);
|
|
1784
1494
|
}
|
|
1785
1495
|
function iconQuestion(ctx, x, y, s) {
|
|
1786
|
-
|
|
1787
|
-
ctx
|
|
1496
|
+
const T = artTokens();
|
|
1497
|
+
circleIcon(ctx, x, y, s, T.info);
|
|
1498
|
+
ctx.fillStyle = T.info; ctx.font = `600 ${s * 0.56}px ${FONT}`; ctx.textAlign = 'center'; ctx.fillText('?', x, y + s * 0.2); ctx.textAlign = 'left';
|
|
1788
1499
|
}
|
|
1789
1500
|
function iconPause(ctx, x, y, s) {
|
|
1790
|
-
|
|
1791
|
-
ctx
|
|
1501
|
+
const T = artTokens();
|
|
1502
|
+
circleIcon(ctx, x, y, s, T.muted);
|
|
1503
|
+
ctx.fillStyle = T.muted; ctx.fillRect(x - s * 0.15, y - s * 0.18, s * 0.1, s * 0.36); ctx.fillRect(x + s * 0.05, y - s * 0.18, s * 0.1, s * 0.36);
|
|
1792
1504
|
}
|
|
1793
1505
|
function iconBang(ctx, x, y, s) {
|
|
1794
|
-
|
|
1795
|
-
ctx
|
|
1506
|
+
const T = artTokens();
|
|
1507
|
+
circleIcon(ctx, x, y, s, T.bad);
|
|
1508
|
+
ctx.fillStyle = T.bad; ctx.font = `700 ${s * 0.56}px ${FONT}`; ctx.textAlign = 'center'; ctx.fillText('!', x, y + s * 0.2); ctx.textAlign = 'left';
|
|
1796
1509
|
}
|
|
1797
|
-
function iconFlask(ctx, x, y, s
|
|
1798
|
-
|
|
1799
|
-
ctx
|
|
1800
|
-
ctx.
|
|
1801
|
-
ctx.
|
|
1802
|
-
ctx.
|
|
1510
|
+
function iconFlask(ctx, x, y, s) {
|
|
1511
|
+
const T = artTokens();
|
|
1512
|
+
circleIcon(ctx, x, y, s, T.ok);
|
|
1513
|
+
ctx.strokeStyle = T.ok; ctx.lineWidth = Math.max(1.2, s * 0.08); ctx.lineJoin = 'round';
|
|
1514
|
+
ctx.beginPath(); ctx.moveTo(x - s * 0.07, y - s * 0.22); ctx.lineTo(x - s * 0.07, y - s * 0.04); ctx.lineTo(x - s * 0.2, y + s * 0.2); ctx.lineTo(x + s * 0.2, y + s * 0.2); ctx.lineTo(x + s * 0.07, y - s * 0.04); ctx.lineTo(x + s * 0.07, y - s * 0.22); ctx.stroke();
|
|
1515
|
+
ctx.lineJoin = 'miter';
|
|
1803
1516
|
}
|
|
1804
|
-
function iconMag(ctx, x, y, s
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
ctx.strokeStyle =
|
|
1808
|
-
ctx.beginPath(); ctx.arc(x - s * 0.
|
|
1809
|
-
ctx.beginPath(); ctx.moveTo(x + s * 0.06
|
|
1517
|
+
function iconMag(ctx, x, y, s) {
|
|
1518
|
+
const T = artTokens();
|
|
1519
|
+
circleIcon(ctx, x, y, s, T.info);
|
|
1520
|
+
ctx.strokeStyle = T.info; ctx.lineWidth = Math.max(1.2, s * 0.08); ctx.lineCap = 'round';
|
|
1521
|
+
ctx.beginPath(); ctx.arc(x - s * 0.05, y - s * 0.05, s * 0.15, 0, 6.28); ctx.stroke();
|
|
1522
|
+
ctx.beginPath(); ctx.moveTo(x + s * 0.06, y + s * 0.06); ctx.lineTo(x + s * 0.2, y + s * 0.2); ctx.stroke();
|
|
1523
|
+
ctx.lineCap = 'butt';
|
|
1810
1524
|
}
|
|
1811
1525
|
function iconDots(ctx, x, y, s, t) {
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
ctx.
|
|
1526
|
+
const T = artTokens();
|
|
1527
|
+
ctx.fillStyle = alpha(T.panel2, 0.96);
|
|
1528
|
+
roundRect(ctx, x - s * 0.5, y - s * 0.3, s, s * 0.6, s * 0.3); ctx.fill();
|
|
1529
|
+
ctx.strokeStyle = alpha(T.accent, 0.6); ctx.lineWidth = 1; ctx.stroke();
|
|
1815
1530
|
for (let i = 0; i < 3; i++) {
|
|
1816
|
-
const on = Math.floor(t *
|
|
1817
|
-
ctx.fillStyle = on ?
|
|
1818
|
-
ctx.beginPath(); ctx.arc(x - s * 0.
|
|
1531
|
+
const on = Math.floor(t * 2) % 3 === i;
|
|
1532
|
+
ctx.fillStyle = on ? T.accent : T.muted;
|
|
1533
|
+
ctx.beginPath(); ctx.arc(x - s * 0.22 + i * s * 0.22, y, s * 0.06, 0, 6.28); ctx.fill();
|
|
1819
1534
|
}
|
|
1820
1535
|
}
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
ctx.strokeStyle = OUT; ctx.lineWidth = Math.max(1, s * 0.06); ctx.stroke();
|
|
1825
|
-
ctx.fillStyle = '#FFD072'; roundRect(ctx, x - s * 0.24, y - s * 0.16, s * 0.12, s * 0.45, s * 0.06); ctx.fill();
|
|
1826
|
-
ctx.fillStyle = '#7A4A1E'; roundRect(ctx, x - s * 0.42, y - s * 0.46, s * 0.84, s * 0.2, s * 0.06); ctx.fill(); ctx.stroke();
|
|
1827
|
-
ctx.fillStyle = '#FFF1CF'; ctx.beginPath(); hexScreen(ctx, x + s * 0.06, y + s * 0.1, s * 0.15); ctx.fill();
|
|
1828
|
-
}
|
|
1536
|
+
/** Kept for older callers: a finished task, drawn as a quiet check chip (no jars in 1.0). */
|
|
1537
|
+
export function iconJar(ctx, x, y, s) { iconCheck(ctx, x, y, s); }
|
|
1538
|
+
/** A compute packet: a small hexagon outline in the link or agent color. */
|
|
1829
1539
|
function drawParcel(ctx, x, y, s, color) {
|
|
1830
|
-
|
|
1831
|
-
ctx.fillStyle =
|
|
1832
|
-
ctx.strokeStyle =
|
|
1833
|
-
ctx.fillStyle = color; ctx.
|
|
1834
|
-
ctx.beginPath(); ctx.ellipse(x - s * 0.14, y - s * 0.42, s * 0.14, s * 0.08, -0.5, 0, 6.28); ctx.ellipse(x + s * 0.14, y - s * 0.42, s * 0.14, s * 0.08, 0.5, 0, 6.28); ctx.fill();
|
|
1540
|
+
const T = artTokens();
|
|
1541
|
+
ctx.fillStyle = alpha(T.panel2, 0.95); ctx.beginPath(); hexScreen(ctx, x, y, s * 0.42); ctx.fill();
|
|
1542
|
+
ctx.strokeStyle = color || T.link; ctx.lineWidth = 1.2; ctx.stroke();
|
|
1543
|
+
ctx.fillStyle = color || T.link; ctx.beginPath(); hexScreen(ctx, x, y, s * 0.16); ctx.fill();
|
|
1835
1544
|
}
|
|
1545
|
+
/** A task card in flight: a dark card with a colored rule. `fill` is ignored (kept for older callers). */
|
|
1836
1546
|
function drawNoteIcon(ctx, x, y, s, fill, strip) {
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
ctx.
|
|
1840
|
-
ctx.fillStyle =
|
|
1841
|
-
ctx.
|
|
1547
|
+
const T = artTokens();
|
|
1548
|
+
void fill;
|
|
1549
|
+
ctx.save(); ctx.translate(Math.round(x), Math.round(y));
|
|
1550
|
+
ctx.fillStyle = alpha(T.panel3, 0.97); roundRect(ctx, -s * 0.5, -s * 0.34, s, s * 0.68, 2); ctx.fill();
|
|
1551
|
+
ctx.strokeStyle = alpha(T.text, 0.14); ctx.lineWidth = 1; ctx.stroke();
|
|
1552
|
+
ctx.fillStyle = strip || T.accent; ctx.fillRect(-s * 0.5, -s * 0.34, Math.max(1.5, s * 0.08), s * 0.68);
|
|
1553
|
+
ctx.fillStyle = alpha(T.text, 0.45); ctx.fillRect(-s * 0.28, -s * 0.12, s * 0.62, Math.max(1, s * 0.06)); ctx.fillRect(-s * 0.28, s * 0.06, s * 0.42, Math.max(1, s * 0.06));
|
|
1842
1554
|
ctx.restore();
|
|
1843
1555
|
}
|
|
1844
1556
|
|
|
1845
|
-
// Shared with the City scene (ui/city/scene.js), which reuses the Office
|
|
1846
|
-
export { roundRect, hexPath, hexScreen, wrap, drawNameTag, drawBubble, drawPill, iconClock, iconCheck, iconX, iconDots, iconMag, iconFlask, iconQuestion, iconPause, drawNoteIcon, drawParcel, mixHex, shade, alpha, rgb, goldenFactor };
|
|
1557
|
+
// Shared with the City scene (ui/city/scene.js), which reuses the Office kit.
|
|
1558
|
+
export { roundRect, hexPath, hexScreen, wrap, drawNameTag, drawBubble, drawPill, iconClock, iconCheck, iconX, iconDots, iconMag, iconFlask, iconQuestion, iconPause, iconBang, drawNoteIcon, drawParcel, mixHex, shade, alpha, rgb, goldenFactor };
|