@ohmykreee/dsh-remote-control 0.0.0-stage → 1.0.3
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/AGENTS.md +556 -0
- package/INSTALLATION.md +310 -0
- package/LICENSE +21 -0
- package/README.md +195 -2
- package/client.js +3 -0
- package/components.json +20 -0
- package/cordis.patch.yml +3 -0
- package/docs/README.en.md +196 -0
- package/docs/screenshots/en/overview.png +0 -0
- package/docs/screenshots/en/question.png +0 -0
- package/docs/screenshots/zh/overview.png +0 -0
- package/docs/screenshots/zh/question.png +0 -0
- package/icon.svg +24 -0
- package/index.js +2 -0
- package/lib/account.js +1 -0
- package/lib/app-mapping.js +1 -0
- package/lib/i18n.js +1 -0
- package/lib/media-enrich.js +1 -0
- package/lib/notifications.js +1 -0
- package/lib/performance.js +1 -0
- package/lib/platform/index.js +1 -0
- package/lib/probe-adapter.js +1 -0
- package/lib/probe-daemon.js +1 -0
- package/lib/probe.js +1 -0
- package/lib/qr.js +1 -0
- package/lib/runtime.js +1 -0
- package/lib/service.js +1 -0
- package/lib/sessions.js +1 -0
- package/lib/settings.js +1 -0
- package/lib/types.js +1 -0
- package/lib/util.js +1 -0
- package/lib/weather.js +1 -0
- package/lib/ws.js +1 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +118 -4
- package/scripts/browser-shot.mjs +217 -0
- package/scripts/build-dsh.mjs +228 -0
- package/scripts/build-rust.mjs +319 -0
- package/scripts/build-web.mjs +17 -0
- package/scripts/check-npm-package.mjs +322 -0
- package/scripts/mock-preview.py +574 -0
- package/scripts/screenshot-compose.py +89 -0
- package/scripts/screenshot-device.sh +75 -0
- package/src/dsh/client/api.ts +68 -0
- package/src/dsh/client/i18n.ts +573 -0
- package/src/dsh/client/icons.ts +56 -0
- package/src/dsh/client/index.ts +95 -0
- package/src/dsh/client/logic.ts +310 -0
- package/src/dsh/client/panel.ts +483 -0
- package/src/dsh/client/sections/apps.ts +40 -0
- package/src/dsh/client/sections/balance.ts +38 -0
- package/src/dsh/client/sections/connection.ts +97 -0
- package/src/dsh/client/sections/notifications.ts +43 -0
- package/src/dsh/client/sections/pomodoro.ts +184 -0
- package/src/dsh/client/sections/preferences.ts +138 -0
- package/src/dsh/client/sections/system.ts +120 -0
- package/src/dsh/client/sections/weather.ts +276 -0
- package/src/dsh/client/styles.ts +1119 -0
- package/src/dsh/client/types.ts +366 -0
- package/src/dsh/client/ui.ts +142 -0
- package/src/dsh/index.ts +108 -0
- package/src/dsh/lib/account.ts +520 -0
- package/src/dsh/lib/app-mapping.ts +366 -0
- package/src/dsh/lib/i18n.ts +82 -0
- package/src/dsh/lib/media-enrich.ts +202 -0
- package/src/dsh/lib/notifications.ts +322 -0
- package/src/dsh/lib/performance.ts +279 -0
- package/src/dsh/lib/platform/index.ts +43 -0
- package/src/dsh/lib/probe-adapter.ts +275 -0
- package/src/dsh/lib/probe-daemon.ts +359 -0
- package/src/dsh/lib/probe.ts +395 -0
- package/src/dsh/lib/qr.ts +42 -0
- package/src/dsh/lib/runtime.ts +126 -0
- package/src/dsh/lib/service.ts +1645 -0
- package/src/dsh/lib/sessions.ts +907 -0
- package/src/dsh/lib/settings.ts +468 -0
- package/src/dsh/lib/types.ts +231 -0
- package/src/dsh/lib/util.ts +115 -0
- package/src/dsh/lib/weather.ts +532 -0
- package/src/dsh/lib/ws.ts +328 -0
- package/src/dsh/types/qrcode-generator.d.ts +16 -0
- package/src/rust/Cargo.lock +1431 -0
- package/src/rust/Cargo.toml +68 -0
- package/src/rust/src/cli.rs +233 -0
- package/src/rust/src/daemon.rs +140 -0
- package/src/rust/src/location/linux.rs +118 -0
- package/src/rust/src/location/macos.rs +26 -0
- package/src/rust/src/location/mod.rs +170 -0
- package/src/rust/src/location/windows.rs +205 -0
- package/src/rust/src/main.rs +42 -0
- package/src/rust/src/media/catalog.rs +454 -0
- package/src/rust/src/media/linux.rs +350 -0
- package/src/rust/src/media/macos/accessibility.rs +59 -0
- package/src/rust/src/media/macos.rs +366 -0
- package/src/rust/src/media/mod.rs +298 -0
- package/src/rust/src/media/vendor/apple_music.rs +90 -0
- package/src/rust/src/media/vendor/common.rs +186 -0
- package/src/rust/src/media/vendor/kugou.rs +52 -0
- package/src/rust/src/media/vendor/kuwo.rs +49 -0
- package/src/rust/src/media/vendor/mod.rs +75 -0
- package/src/rust/src/media/vendor/netease.rs +1715 -0
- package/src/rust/src/media/vendor/qishui.rs +36 -0
- package/src/rust/src/media/vendor/qqmusic.rs +33 -0
- package/src/rust/src/media/vendor/spotify.rs +46 -0
- package/src/rust/src/media/vendor/wesing.rs +39 -0
- package/src/rust/src/media/vendor/youtube_music.rs +49 -0
- package/src/rust/src/media/windows/accessibility.rs +85 -0
- package/src/rust/src/media/windows/audio.rs +116 -0
- package/src/rust/src/media/windows/private.rs +291 -0
- package/src/rust/src/media/windows.rs +775 -0
- package/src/rust/src/notifications/linux.rs +276 -0
- package/src/rust/src/notifications/macos.rs +382 -0
- package/src/rust/src/notifications/mod.rs +244 -0
- package/src/rust/src/notifications/windows.rs +565 -0
- package/src/rust/src/perf/common.rs +109 -0
- package/src/rust/src/perf/linux.rs +282 -0
- package/src/rust/src/perf/macos.rs +28 -0
- package/src/rust/src/perf/mod.rs +157 -0
- package/src/rust/src/perf/windows.rs +981 -0
- package/src/rust/src/util.rs +360 -0
- package/src/rust/src/volume/linux.rs +195 -0
- package/src/rust/src/volume/macos.rs +54 -0
- package/src/rust/src/volume/mod.rs +116 -0
- package/src/rust/src/volume/windows.rs +75 -0
- package/src/rust/tests/cli.rs +79 -0
- package/src/rust/tests/daemon.rs +107 -0
- package/src/svelte/App.svelte +385 -0
- package/src/svelte/index.html +18 -0
- package/src/svelte/lib/billing.svelte.ts +228 -0
- package/src/svelte/lib/components/BalanceCard.svelte +173 -0
- package/src/svelte/lib/components/ClockCard.svelte +183 -0
- package/src/svelte/lib/components/CountdownCard.svelte +261 -0
- package/src/svelte/lib/components/CpuMemoryCard.svelte +238 -0
- package/src/svelte/lib/components/EmptyState.svelte +34 -0
- package/src/svelte/lib/components/GpuCard.svelte +245 -0
- package/src/svelte/lib/components/HomePage.svelte +34 -0
- package/src/svelte/lib/components/MusicControls.svelte +256 -0
- package/src/svelte/lib/components/MusicCover.svelte +88 -0
- package/src/svelte/lib/components/MusicPage.svelte +116 -0
- package/src/svelte/lib/components/NotificationsCard.svelte +109 -0
- package/src/svelte/lib/components/Panel.svelte +22 -0
- package/src/svelte/lib/components/PerformancePage.svelte +55 -0
- package/src/svelte/lib/components/PomodoroCard.svelte +250 -0
- package/src/svelte/lib/components/QuestionSheet.svelte +354 -0
- package/src/svelte/lib/components/RadialGauge.svelte +99 -0
- package/src/svelte/lib/components/Rail.svelte +217 -0
- package/src/svelte/lib/components/SectionHeader.svelte +40 -0
- package/src/svelte/lib/components/SeekBar.svelte +421 -0
- package/src/svelte/lib/components/SessionList.svelte +364 -0
- package/src/svelte/lib/components/SessionStats.svelte +98 -0
- package/src/svelte/lib/components/SessionsPage.svelte +61 -0
- package/src/svelte/lib/components/SpendCard.svelte +105 -0
- package/src/svelte/lib/components/ThermalCard.svelte +249 -0
- package/src/svelte/lib/components/Toast.svelte +32 -0
- package/src/svelte/lib/components/WeatherIcon.svelte +40 -0
- package/src/svelte/lib/components/WeatherPanel.svelte +420 -0
- package/src/svelte/lib/components/ui/alert/alert-action.svelte +20 -0
- package/src/svelte/lib/components/ui/alert/alert-description.svelte +23 -0
- package/src/svelte/lib/components/ui/alert/alert-title.svelte +23 -0
- package/src/svelte/lib/components/ui/alert/alert.svelte +43 -0
- package/src/svelte/lib/components/ui/alert/index.ts +17 -0
- package/src/svelte/lib/components/ui/avatar/avatar-badge.svelte +26 -0
- package/src/svelte/lib/components/ui/avatar/avatar-fallback.svelte +20 -0
- package/src/svelte/lib/components/ui/avatar/avatar-group-count.svelte +23 -0
- package/src/svelte/lib/components/ui/avatar/avatar-group.svelte +23 -0
- package/src/svelte/lib/components/ui/avatar/avatar-image.svelte +17 -0
- package/src/svelte/lib/components/ui/avatar/avatar.svelte +26 -0
- package/src/svelte/lib/components/ui/avatar/index.ts +22 -0
- package/src/svelte/lib/components/ui/badge/badge.svelte +49 -0
- package/src/svelte/lib/components/ui/badge/index.ts +2 -0
- package/src/svelte/lib/components/ui/button/button.svelte +82 -0
- package/src/svelte/lib/components/ui/button/index.ts +17 -0
- package/src/svelte/lib/components/ui/card/card-action.svelte +23 -0
- package/src/svelte/lib/components/ui/card/card-content.svelte +20 -0
- package/src/svelte/lib/components/ui/card/card-description.svelte +20 -0
- package/src/svelte/lib/components/ui/card/card-footer.svelte +20 -0
- package/src/svelte/lib/components/ui/card/card-header.svelte +23 -0
- package/src/svelte/lib/components/ui/card/card-title.svelte +20 -0
- package/src/svelte/lib/components/ui/card/card.svelte +22 -0
- package/src/svelte/lib/components/ui/card/index.ts +25 -0
- package/src/svelte/lib/components/ui/dialog/dialog-close.svelte +11 -0
- package/src/svelte/lib/components/ui/dialog/dialog-content.svelte +48 -0
- package/src/svelte/lib/components/ui/dialog/dialog-description.svelte +17 -0
- package/src/svelte/lib/components/ui/dialog/dialog-footer.svelte +32 -0
- package/src/svelte/lib/components/ui/dialog/dialog-header.svelte +20 -0
- package/src/svelte/lib/components/ui/dialog/dialog-overlay.svelte +17 -0
- package/src/svelte/lib/components/ui/dialog/dialog-portal.svelte +7 -0
- package/src/svelte/lib/components/ui/dialog/dialog-title.svelte +17 -0
- package/src/svelte/lib/components/ui/dialog/dialog-trigger.svelte +11 -0
- package/src/svelte/lib/components/ui/dialog/dialog.svelte +7 -0
- package/src/svelte/lib/components/ui/dialog/index.ts +34 -0
- package/src/svelte/lib/components/ui/empty/empty-content.svelte +23 -0
- package/src/svelte/lib/components/ui/empty/empty-description.svelte +23 -0
- package/src/svelte/lib/components/ui/empty/empty-header.svelte +20 -0
- package/src/svelte/lib/components/ui/empty/empty-media.svelte +41 -0
- package/src/svelte/lib/components/ui/empty/empty-title.svelte +20 -0
- package/src/svelte/lib/components/ui/empty/empty.svelte +23 -0
- package/src/svelte/lib/components/ui/empty/index.ts +22 -0
- package/src/svelte/lib/components/ui/input/index.ts +7 -0
- package/src/svelte/lib/components/ui/input/input.svelte +48 -0
- package/src/svelte/lib/components/ui/progress/index.ts +7 -0
- package/src/svelte/lib/components/ui/progress/progress.svelte +27 -0
- package/src/svelte/lib/components/ui/scroll-area/index.ts +10 -0
- package/src/svelte/lib/components/ui/scroll-area/scroll-area-scrollbar.svelte +30 -0
- package/src/svelte/lib/components/ui/scroll-area/scroll-area.svelte +43 -0
- package/src/svelte/lib/components/ui/separator/index.ts +7 -0
- package/src/svelte/lib/components/ui/separator/separator.svelte +21 -0
- package/src/svelte/lib/components/ui/sheet/index.ts +34 -0
- package/src/svelte/lib/components/ui/sheet/sheet-close.svelte +7 -0
- package/src/svelte/lib/components/ui/sheet/sheet-content.svelte +55 -0
- package/src/svelte/lib/components/ui/sheet/sheet-description.svelte +17 -0
- package/src/svelte/lib/components/ui/sheet/sheet-footer.svelte +20 -0
- package/src/svelte/lib/components/ui/sheet/sheet-header.svelte +20 -0
- package/src/svelte/lib/components/ui/sheet/sheet-overlay.svelte +20 -0
- package/src/svelte/lib/components/ui/sheet/sheet-portal.svelte +7 -0
- package/src/svelte/lib/components/ui/sheet/sheet-title.svelte +17 -0
- package/src/svelte/lib/components/ui/sheet/sheet-trigger.svelte +7 -0
- package/src/svelte/lib/components/ui/sheet/sheet.svelte +7 -0
- package/src/svelte/lib/components/ui/skeleton/index.ts +7 -0
- package/src/svelte/lib/components/ui/skeleton/skeleton.svelte +17 -0
- package/src/svelte/lib/components/ui/slider/index.ts +7 -0
- package/src/svelte/lib/components/ui/slider/slider.svelte +52 -0
- package/src/svelte/lib/components/ui/tooltip/index.ts +19 -0
- package/src/svelte/lib/components/ui/tooltip/tooltip-content.svelte +51 -0
- package/src/svelte/lib/components/ui/tooltip/tooltip-portal.svelte +7 -0
- package/src/svelte/lib/components/ui/tooltip/tooltip-provider.svelte +7 -0
- package/src/svelte/lib/components/ui/tooltip/tooltip-trigger.svelte +7 -0
- package/src/svelte/lib/components/ui/tooltip/tooltip.svelte +7 -0
- package/src/svelte/lib/countdown.svelte.ts +252 -0
- package/src/svelte/lib/format.ts +199 -0
- package/src/svelte/lib/i18n.svelte.ts +583 -0
- package/src/svelte/lib/media.ts +32 -0
- package/src/svelte/lib/pages.ts +18 -0
- package/src/svelte/lib/pomodoro.svelte.ts +223 -0
- package/src/svelte/lib/session-tree.ts +80 -0
- package/src/svelte/lib/state.svelte.ts +359 -0
- package/src/svelte/lib/timer-alarm.svelte.ts +319 -0
- package/src/svelte/lib/types.ts +306 -0
- package/src/svelte/lib/utils.ts +8 -0
- package/src/svelte/lib/weather.ts +84 -0
- package/src/svelte/lib/ws.ts +104 -0
- package/src/svelte/main.ts +13 -0
- package/src/svelte/styles/global.css +315 -0
- package/src/svelte/vite-env.d.ts +12 -0
- package/static/fonts/LICENSE.txt +287 -0
- package/static/icon.svg +24 -0
- package/static/manifest.webmanifest +18 -0
- package/svelte.config.js +5 -0
- package/tsconfig.dsh-client.json +18 -0
- package/tsconfig.dsh.json +21 -0
- package/tsconfig.json +20 -0
- package/vite.config.js +31 -0
- package/web/assets/index-DLdSfnJ3.css +1 -0
- package/web/assets/index-YNE8X0Uy.js +6 -0
- package/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- package/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- package/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- package/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- package/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- package/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- package/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- package/web/assets/jetbrains-mono-cyrillic-ext-wght-normal-EocZY2iu.woff2 +0 -0
- package/web/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
- package/web/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
- package/web/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
- package/web/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
- package/web/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
- package/web/assets/noto-sans-sc-100-wght-normal-DluiXYzi.woff2 +0 -0
- package/web/assets/noto-sans-sc-101-wght-normal-CPkZHnw0.woff2 +0 -0
- package/web/assets/noto-sans-sc-102-wght-normal-gzIulUH6.woff2 +0 -0
- package/web/assets/noto-sans-sc-103-wght-normal-CJfSBxFo.woff2 +0 -0
- package/web/assets/noto-sans-sc-104-wght-normal-B3QMglgE.woff2 +0 -0
- package/web/assets/noto-sans-sc-105-wght-normal-xXh_OMfk.woff2 +0 -0
- package/web/assets/noto-sans-sc-106-wght-normal-B9n3jMjP.woff2 +0 -0
- package/web/assets/noto-sans-sc-107-wght-normal-D7fvVprN.woff2 +0 -0
- package/web/assets/noto-sans-sc-108-wght-normal-J0_LhxVo.woff2 +0 -0
- package/web/assets/noto-sans-sc-109-wght-normal-Dsp-De_0.woff2 +0 -0
- package/web/assets/noto-sans-sc-110-wght-normal-DE_6NUrb.woff2 +0 -0
- package/web/assets/noto-sans-sc-111-wght-normal-C4S-TlTn.woff2 +0 -0
- package/web/assets/noto-sans-sc-112-wght-normal-BcFuP3w6.woff2 +0 -0
- package/web/assets/noto-sans-sc-113-wght-normal-Dk932kmj.woff2 +0 -0
- package/web/assets/noto-sans-sc-114-wght-normal-CO_5Xo-i.woff2 +0 -0
- package/web/assets/noto-sans-sc-115-wght-normal-BWy07H14.woff2 +0 -0
- package/web/assets/noto-sans-sc-116-wght-normal-B4HVAfHo.woff2 +0 -0
- package/web/assets/noto-sans-sc-117-wght-normal-siZzFqgK.woff2 +0 -0
- package/web/assets/noto-sans-sc-118-wght-normal-xhBB7f6V.woff2 +0 -0
- package/web/assets/noto-sans-sc-119-wght-normal-Ck_g2FGz.woff2 +0 -0
- package/web/assets/noto-sans-sc-21-wght-normal-D0x9-yBt.woff2 +0 -0
- package/web/assets/noto-sans-sc-22-wght-normal-BBUVTShg.woff2 +0 -0
- package/web/assets/noto-sans-sc-23-wght-normal-Du1oYWkE.woff2 +0 -0
- package/web/assets/noto-sans-sc-24-wght-normal-CmWjJ0gt.woff2 +0 -0
- package/web/assets/noto-sans-sc-25-wght-normal-BFHiqilg.woff2 +0 -0
- package/web/assets/noto-sans-sc-26-wght-normal-C0sF2Z2f.woff2 +0 -0
- package/web/assets/noto-sans-sc-27-wght-normal-COFdrquJ.woff2 +0 -0
- package/web/assets/noto-sans-sc-28-wght-normal-DMgdNu1o.woff2 +0 -0
- package/web/assets/noto-sans-sc-29-wght-normal-Cmq8em30.woff2 +0 -0
- package/web/assets/noto-sans-sc-30-wght-normal-CZWqZ3yU.woff2 +0 -0
- package/web/assets/noto-sans-sc-31-wght-normal-Wfi_lutW.woff2 +0 -0
- package/web/assets/noto-sans-sc-32-wght-normal-BRJQ4PY5.woff2 +0 -0
- package/web/assets/noto-sans-sc-33-wght-normal-CUVQXNAJ.woff2 +0 -0
- package/web/assets/noto-sans-sc-34-wght-normal-Bspba0wC.woff2 +0 -0
- package/web/assets/noto-sans-sc-35-wght-normal-K8fX_YPG.woff2 +0 -0
- package/web/assets/noto-sans-sc-36-wght-normal-CkITyjoT.woff2 +0 -0
- package/web/assets/noto-sans-sc-37-wght-normal-WCZ2zfEe.woff2 +0 -0
- package/web/assets/noto-sans-sc-38-wght-normal-DeM7CUce.woff2 +0 -0
- package/web/assets/noto-sans-sc-39-wght-normal-BMZNLWQU.woff2 +0 -0
- package/web/assets/noto-sans-sc-4-wght-normal-AR5bdDjz.woff2 +0 -0
- package/web/assets/noto-sans-sc-40-wght-normal-BQ5xpS5j.woff2 +0 -0
- package/web/assets/noto-sans-sc-41-wght-normal-Hthm7FFi.woff2 +0 -0
- package/web/assets/noto-sans-sc-42-wght-normal-eaS2gKds.woff2 +0 -0
- package/web/assets/noto-sans-sc-43-wght-normal-o-T53XXV.woff2 +0 -0
- package/web/assets/noto-sans-sc-44-wght-normal-BJH5J4Ez.woff2 +0 -0
- package/web/assets/noto-sans-sc-45-wght-normal-BKuxSCOJ.woff2 +0 -0
- package/web/assets/noto-sans-sc-46-wght-normal-BR_5Mu6e.woff2 +0 -0
- package/web/assets/noto-sans-sc-47-wght-normal-CyY7gKNX.woff2 +0 -0
- package/web/assets/noto-sans-sc-48-wght-normal-BNMfTR6k.woff2 +0 -0
- package/web/assets/noto-sans-sc-49-wght-normal-DX-0y7wg.woff2 +0 -0
- package/web/assets/noto-sans-sc-5-wght-normal-CfWugllB.woff2 +0 -0
- package/web/assets/noto-sans-sc-50-wght-normal-DAOGW-Dr.woff2 +0 -0
- package/web/assets/noto-sans-sc-51-wght-normal-BlFLOjcP.woff2 +0 -0
- package/web/assets/noto-sans-sc-52-wght-normal-OZjrybnw.woff2 +0 -0
- package/web/assets/noto-sans-sc-53-wght-normal-CwyWNT6x.woff2 +0 -0
- package/web/assets/noto-sans-sc-54-wght-normal-DM0nRe18.woff2 +0 -0
- package/web/assets/noto-sans-sc-55-wght-normal-DBK2wUOR.woff2 +0 -0
- package/web/assets/noto-sans-sc-56-wght-normal-C-VKK1LS.woff2 +0 -0
- package/web/assets/noto-sans-sc-57-wght-normal-Cdbfh5kq.woff2 +0 -0
- package/web/assets/noto-sans-sc-58-wght-normal-CflMKARZ.woff2 +0 -0
- package/web/assets/noto-sans-sc-59-wght-normal-BS4Kwzxx.woff2 +0 -0
- package/web/assets/noto-sans-sc-6-wght-normal-ChnZIQfQ.woff2 +0 -0
- package/web/assets/noto-sans-sc-60-wght-normal-B7QOYsXJ.woff2 +0 -0
- package/web/assets/noto-sans-sc-61-wght-normal-C8JjQS7w.woff2 +0 -0
- package/web/assets/noto-sans-sc-62-wght-normal-bS4wq1Gg.woff2 +0 -0
- package/web/assets/noto-sans-sc-63-wght-normal-BJr8P-OB.woff2 +0 -0
- package/web/assets/noto-sans-sc-64-wght-normal-DVB11t7j.woff2 +0 -0
- package/web/assets/noto-sans-sc-65-wght-normal-DMPCXBvK.woff2 +0 -0
- package/web/assets/noto-sans-sc-66-wght-normal-BobaG10V.woff2 +0 -0
- package/web/assets/noto-sans-sc-67-wght-normal-Dzk7WhCR.woff2 +0 -0
- package/web/assets/noto-sans-sc-68-wght-normal-DGbCD9xu.woff2 +0 -0
- package/web/assets/noto-sans-sc-69-wght-normal-Ctrv1EqA.woff2 +0 -0
- package/web/assets/noto-sans-sc-70-wght-normal-RgTO941D.woff2 +0 -0
- package/web/assets/noto-sans-sc-71-wght-normal-D9sG-CWv.woff2 +0 -0
- package/web/assets/noto-sans-sc-72-wght-normal-C4oWy3ul.woff2 +0 -0
- package/web/assets/noto-sans-sc-73-wght-normal-B1ZoOTgM.woff2 +0 -0
- package/web/assets/noto-sans-sc-74-wght-normal-F7dH_rZJ.woff2 +0 -0
- package/web/assets/noto-sans-sc-75-wght-normal-Cp2wp4si.woff2 +0 -0
- package/web/assets/noto-sans-sc-76-wght-normal-B494D7xS.woff2 +0 -0
- package/web/assets/noto-sans-sc-77-wght-normal-B3MVY9Ax.woff2 +0 -0
- package/web/assets/noto-sans-sc-78-wght-normal-5jX7iNMC.woff2 +0 -0
- package/web/assets/noto-sans-sc-79-wght-normal-BIoZy8fr.woff2 +0 -0
- package/web/assets/noto-sans-sc-80-wght-normal-Bje1Fxy1.woff2 +0 -0
- package/web/assets/noto-sans-sc-81-wght-normal-B2NN7Qi3.woff2 +0 -0
- package/web/assets/noto-sans-sc-82-wght-normal-CUggNZi4.woff2 +0 -0
- package/web/assets/noto-sans-sc-83-wght-normal-99rD8YO-.woff2 +0 -0
- package/web/assets/noto-sans-sc-84-wght-normal-zMBmUocm.woff2 +0 -0
- package/web/assets/noto-sans-sc-85-wght-normal-CjI3qdxG.woff2 +0 -0
- package/web/assets/noto-sans-sc-86-wght-normal-BHY8TVEH.woff2 +0 -0
- package/web/assets/noto-sans-sc-87-wght-normal-DioZSHnU.woff2 +0 -0
- package/web/assets/noto-sans-sc-88-wght-normal-BXYxwf2t.woff2 +0 -0
- package/web/assets/noto-sans-sc-89-wght-normal-ClMFrFaL.woff2 +0 -0
- package/web/assets/noto-sans-sc-90-wght-normal-BnOlPreP.woff2 +0 -0
- package/web/assets/noto-sans-sc-91-wght-normal-DTr9RQcS.woff2 +0 -0
- package/web/assets/noto-sans-sc-97-wght-normal-9u6Aiav-.woff2 +0 -0
- package/web/assets/noto-sans-sc-98-wght-normal-BR-H2C0V.woff2 +0 -0
- package/web/assets/noto-sans-sc-99-wght-normal-BI6XPoxp.woff2 +0 -0
- package/web/assets/noto-sans-sc-cyrillic-wght-normal-BGmsQlw-.woff2 +0 -0
- package/web/assets/noto-sans-sc-latin-ext-wght-normal-DuJTpTg_.woff2 +0 -0
- package/web/assets/noto-sans-sc-latin-wght-normal-DDW8mKAR.woff2 +0 -0
- package/web/assets/noto-sans-sc-vietnamese-wght-normal-Bi3ATJ76.woff2 +0 -0
- package/web/fonts/LICENSE.txt +287 -0
- package/web/icon.svg +24 -0
- package/web/index.html +19 -0
- package/web/manifest.webmanifest +18 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { app, sendAction } from '../state.svelte';
|
|
3
|
+
import type { MediaInfo, MediaPayload } from '../types';
|
|
4
|
+
import { clampVolume, isPlaying } from '../media';
|
|
5
|
+
import { t } from '../i18n.svelte';
|
|
6
|
+
import { Slider } from '$lib/components/ui/slider/index.js';
|
|
7
|
+
import { Button } from '$lib/components/ui/button/index.js';
|
|
8
|
+
import { cn } from '$lib/utils.js';
|
|
9
|
+
import SeekBar from './SeekBar.svelte';
|
|
10
|
+
import SkipBack from '@lucide/svelte/icons/skip-back';
|
|
11
|
+
import SkipForward from '@lucide/svelte/icons/skip-forward';
|
|
12
|
+
import Play from '@lucide/svelte/icons/play';
|
|
13
|
+
import Pause from '@lucide/svelte/icons/pause';
|
|
14
|
+
import Heart from '@lucide/svelte/icons/heart';
|
|
15
|
+
import Volume2 from '@lucide/svelte/icons/volume-2';
|
|
16
|
+
import VolumeX from '@lucide/svelte/icons/volume-x';
|
|
17
|
+
|
|
18
|
+
let {
|
|
19
|
+
payload,
|
|
20
|
+
media,
|
|
21
|
+
volume,
|
|
22
|
+
}: {
|
|
23
|
+
payload: MediaPayload | null;
|
|
24
|
+
media: MediaInfo | null;
|
|
25
|
+
volume: { volume?: number; muted?: boolean } | null;
|
|
26
|
+
} = $props();
|
|
27
|
+
|
|
28
|
+
const playing = $derived(isPlaying(media));
|
|
29
|
+
const loaded = $derived(payload !== null);
|
|
30
|
+
const previousDisabled = $derived(media ? !media.canPrevious : loaded);
|
|
31
|
+
const nextDisabled = $derived(media ? !media.canNext : loaded);
|
|
32
|
+
|
|
33
|
+
const displayVolume = $derived.by(() => {
|
|
34
|
+
if (app.volumeDragging) return clampVolume(app.volumeInput);
|
|
35
|
+
if (Date.now() < app.volumeHoldUntil) return clampVolume(app.volumeTarget);
|
|
36
|
+
return volume ? clampVolume(volume.volume ?? 0.5) : 0.5;
|
|
37
|
+
});
|
|
38
|
+
const volumePercent = $derived(Math.round(displayVolume * 100));
|
|
39
|
+
|
|
40
|
+
function handleVolumeInput(value: number): void {
|
|
41
|
+
app.volumeDragging = true;
|
|
42
|
+
app.volumeInput = clampVolume(value / 100);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function handleVolumeCommit(value: number): void {
|
|
46
|
+
app.volumeDragging = false;
|
|
47
|
+
app.volumeTarget = clampVolume(value / 100);
|
|
48
|
+
app.volumeHoldUntil = Date.now() + 2200;
|
|
49
|
+
sendAction('volume', app.volumeTarget);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function handleLike(): void {
|
|
53
|
+
if (!media?.canSetLiked || typeof media.liked !== 'boolean') return;
|
|
54
|
+
sendAction('like', !media.liked);
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<div class="music-controls">
|
|
59
|
+
<div class="flex items-start justify-between gap-4">
|
|
60
|
+
<div class="min-w-0">
|
|
61
|
+
<p class="eyebrow">{media?.album || 'NOW PLAYING'}</p>
|
|
62
|
+
<h1 class="track-title">{media?.title || t('nothingPlaying')}</h1>
|
|
63
|
+
<p class="track-artist">
|
|
64
|
+
{media ? media.artist || media.albumArtist || t('unknownArtist') : t('chooseSong')}
|
|
65
|
+
</p>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
{#if typeof media?.liked === 'boolean'}
|
|
69
|
+
<Button
|
|
70
|
+
variant="outline"
|
|
71
|
+
size="icon"
|
|
72
|
+
class={cn(
|
|
73
|
+
'mt-1 size-12 shrink-0 rounded-full border-border bg-card/50 text-muted-foreground shadow-none backdrop-blur-md hover:bg-secondary hover:text-foreground',
|
|
74
|
+
media.liked && 'border-danger/25 bg-danger-soft text-danger hover:bg-danger-soft hover:text-danger',
|
|
75
|
+
)}
|
|
76
|
+
disabled={!media.canSetLiked}
|
|
77
|
+
title={media.liked ? t('unlike') : t('like')}
|
|
78
|
+
aria-label={media.liked ? t('unlike') : t('like')}
|
|
79
|
+
onclick={handleLike}
|
|
80
|
+
>
|
|
81
|
+
<Heart class={cn('size-[22px]', media.liked && 'fill-current')} strokeWidth={1.8} />
|
|
82
|
+
</Button>
|
|
83
|
+
{/if}
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
<SeekBar {media} onSeek={(value) => sendAction('seek', value)} />
|
|
87
|
+
|
|
88
|
+
<div class="transport">
|
|
89
|
+
<Button
|
|
90
|
+
variant="outline"
|
|
91
|
+
size="icon"
|
|
92
|
+
class="transport-button size-[58px] rounded-full border-border bg-card/50 text-foreground shadow-none backdrop-blur-md hover:bg-secondary"
|
|
93
|
+
type="button"
|
|
94
|
+
aria-label={t('previousTrack')}
|
|
95
|
+
disabled={previousDisabled}
|
|
96
|
+
onclick={() => sendAction('previous')}
|
|
97
|
+
>
|
|
98
|
+
<SkipBack class="size-[24px]" strokeWidth={1.7} />
|
|
99
|
+
</Button>
|
|
100
|
+
|
|
101
|
+
<Button
|
|
102
|
+
size="icon"
|
|
103
|
+
class="play-button size-[72px] rounded-full border border-brand/35 bg-primary text-primary-foreground shadow-none hover:bg-primary/90"
|
|
104
|
+
type="button"
|
|
105
|
+
aria-label={playing ? t('pause') : t('play')}
|
|
106
|
+
onclick={() => sendAction('playpause')}
|
|
107
|
+
>
|
|
108
|
+
{#if playing}
|
|
109
|
+
<Pause class="size-[30px] fill-current" strokeWidth={1.5} />
|
|
110
|
+
{:else}
|
|
111
|
+
<Play class="ml-1 size-[30px] fill-current" strokeWidth={1.5} />
|
|
112
|
+
{/if}
|
|
113
|
+
</Button>
|
|
114
|
+
|
|
115
|
+
<Button
|
|
116
|
+
variant="outline"
|
|
117
|
+
size="icon"
|
|
118
|
+
class="transport-button size-[58px] rounded-full border-border bg-card/50 text-foreground shadow-none backdrop-blur-md hover:bg-secondary"
|
|
119
|
+
type="button"
|
|
120
|
+
aria-label={t('nextTrack')}
|
|
121
|
+
disabled={nextDisabled}
|
|
122
|
+
onclick={() => sendAction('next')}
|
|
123
|
+
>
|
|
124
|
+
<SkipForward class="size-[24px]" strokeWidth={1.7} />
|
|
125
|
+
</Button>
|
|
126
|
+
</div>
|
|
127
|
+
|
|
128
|
+
<div class="volume-row">
|
|
129
|
+
<Button
|
|
130
|
+
variant="outline"
|
|
131
|
+
size="icon"
|
|
132
|
+
class="size-12 shrink-0 rounded-[14px] border-border bg-card/50 text-muted-foreground shadow-none backdrop-blur-md hover:bg-secondary hover:text-foreground"
|
|
133
|
+
type="button"
|
|
134
|
+
aria-label={t('mute')}
|
|
135
|
+
title={t('mute')}
|
|
136
|
+
onclick={() => sendAction('mute')}
|
|
137
|
+
>
|
|
138
|
+
{#if volume?.muted}
|
|
139
|
+
<VolumeX class="size-[22px]" strokeWidth={1.7} />
|
|
140
|
+
{:else}
|
|
141
|
+
<Volume2 class="size-[22px]" strokeWidth={1.7} />
|
|
142
|
+
{/if}
|
|
143
|
+
</Button>
|
|
144
|
+
<Slider
|
|
145
|
+
type="single"
|
|
146
|
+
min={0}
|
|
147
|
+
max={100}
|
|
148
|
+
step={1}
|
|
149
|
+
value={volumePercent}
|
|
150
|
+
aria-label={t('volume')}
|
|
151
|
+
class="volume-slider max-w-[280px]"
|
|
152
|
+
onValueChange={handleVolumeInput}
|
|
153
|
+
onValueCommit={handleVolumeCommit}
|
|
154
|
+
/>
|
|
155
|
+
<span class="w-14 text-right text-[16px] text-muted-foreground numeric">{volumePercent}%</span>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<style>
|
|
160
|
+
.music-controls {
|
|
161
|
+
display: flex;
|
|
162
|
+
min-width: 0;
|
|
163
|
+
flex-direction: column;
|
|
164
|
+
gap: clamp(16px, 2.8vh, 26px);
|
|
165
|
+
padding-right: clamp(0px, 2vw, 24px);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.track-title {
|
|
169
|
+
margin: 7px 0 0;
|
|
170
|
+
display: -webkit-box;
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
color: var(--foreground);
|
|
173
|
+
font-size: clamp(34px, 4.7vw, 52px);
|
|
174
|
+
font-weight: 570;
|
|
175
|
+
line-height: 1.08;
|
|
176
|
+
letter-spacing: -0.05em;
|
|
177
|
+
overflow-wrap: anywhere;
|
|
178
|
+
line-clamp: 2;
|
|
179
|
+
-webkit-box-orient: vertical;
|
|
180
|
+
-webkit-line-clamp: 2;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.track-artist {
|
|
184
|
+
margin: 8px 0 0;
|
|
185
|
+
overflow: hidden;
|
|
186
|
+
color: var(--muted-foreground);
|
|
187
|
+
font-size: clamp(17px, 2vw, 21px);
|
|
188
|
+
line-height: 1.4;
|
|
189
|
+
text-overflow: ellipsis;
|
|
190
|
+
white-space: nowrap;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
.transport {
|
|
195
|
+
display: flex;
|
|
196
|
+
align-items: center;
|
|
197
|
+
gap: clamp(12px, 2vw, 20px);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
:global(.transport-button:disabled) {
|
|
201
|
+
opacity: 0.35;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:global(.volume-slider [data-slot='slider-track']) {
|
|
205
|
+
height: 6px;
|
|
206
|
+
background: color-mix(in srgb, var(--foreground) 12%, transparent);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
:global(.volume-slider [data-slot='slider-range']) {
|
|
210
|
+
background: var(--brand);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
:global(.volume-slider [data-slot='slider-thumb']) {
|
|
214
|
+
width: 18px;
|
|
215
|
+
height: 18px;
|
|
216
|
+
border-width: 2px;
|
|
217
|
+
background: var(--background);
|
|
218
|
+
box-shadow: none;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.volume-row {
|
|
222
|
+
display: flex;
|
|
223
|
+
align-items: center;
|
|
224
|
+
gap: 12px;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
@media (max-height: 760px) {
|
|
228
|
+
.music-controls {
|
|
229
|
+
gap: 14px;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.track-title {
|
|
233
|
+
font-size: clamp(30px, 4vw, 40px);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.track-artist {
|
|
237
|
+
font-size: 17px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
:global(.transport-button) {
|
|
241
|
+
width: 62px;
|
|
242
|
+
height: 62px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
:global(.play-button) {
|
|
246
|
+
width: 80px;
|
|
247
|
+
height: 80px;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@media (orientation: portrait) {
|
|
252
|
+
.music-controls {
|
|
253
|
+
padding-right: 0;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
</style>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { MediaInfo } from '../types';
|
|
3
|
+
import { t } from '../i18n.svelte';
|
|
4
|
+
import Music2 from '@lucide/svelte/icons/music-2';
|
|
5
|
+
|
|
6
|
+
let { media }: { media: MediaInfo | null } = $props();
|
|
7
|
+
|
|
8
|
+
const thumbnail = $derived(media?.thumbnail || media?.thumbnailUrl || '');
|
|
9
|
+
const fallbackText = $derived(media ? t('nowPlaying') : t('nothingPlaying'));
|
|
10
|
+
let failed = $state(false);
|
|
11
|
+
const showArt = $derived(Boolean(thumbnail) && !failed);
|
|
12
|
+
|
|
13
|
+
$effect(() => {
|
|
14
|
+
void thumbnail;
|
|
15
|
+
failed = false;
|
|
16
|
+
});
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<div class="cover-shell" class:has-art={showArt}>
|
|
20
|
+
<div class="cover-fallback">
|
|
21
|
+
<span class="cover-fallback-icon">
|
|
22
|
+
<Music2 class="size-6" strokeWidth={1.55} />
|
|
23
|
+
</span>
|
|
24
|
+
<span>{fallbackText}</span>
|
|
25
|
+
</div>
|
|
26
|
+
{#if showArt}
|
|
27
|
+
<img
|
|
28
|
+
class="cover-art"
|
|
29
|
+
src={thumbnail}
|
|
30
|
+
alt={t('albumCover')}
|
|
31
|
+
draggable="false"
|
|
32
|
+
referrerpolicy="no-referrer"
|
|
33
|
+
onerror={() => (failed = true)}
|
|
34
|
+
/>
|
|
35
|
+
{/if}
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
<style>
|
|
39
|
+
.cover-shell {
|
|
40
|
+
position: relative;
|
|
41
|
+
width: 100%;
|
|
42
|
+
aspect-ratio: 1;
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
border: 1px solid color-mix(in srgb, var(--brand) 15%, var(--border));
|
|
45
|
+
border-radius: 22px;
|
|
46
|
+
background:
|
|
47
|
+
radial-gradient(90% 90% at 30% 18%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 62%),
|
|
48
|
+
var(--surface-2);
|
|
49
|
+
box-shadow: 0 24px 60px rgb(0 0 0 / 28%);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.cover-art {
|
|
53
|
+
position: absolute;
|
|
54
|
+
inset: 0;
|
|
55
|
+
display: block;
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 100%;
|
|
58
|
+
object-fit: cover;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.cover-fallback {
|
|
62
|
+
position: absolute;
|
|
63
|
+
inset: 0;
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: center;
|
|
68
|
+
gap: 10px;
|
|
69
|
+
color: var(--muted-foreground);
|
|
70
|
+
font-size: 10px;
|
|
71
|
+
letter-spacing: 0.02em;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cover-shell.has-art .cover-fallback {
|
|
75
|
+
display: none;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.cover-fallback-icon {
|
|
79
|
+
display: grid;
|
|
80
|
+
width: 48px;
|
|
81
|
+
height: 48px;
|
|
82
|
+
place-items: center;
|
|
83
|
+
border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
|
|
84
|
+
border-radius: 15px;
|
|
85
|
+
background: var(--brand-soft);
|
|
86
|
+
color: var(--brand);
|
|
87
|
+
}
|
|
88
|
+
</style>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { app } from '../state.svelte';
|
|
3
|
+
import { sourceLabel } from '../format';
|
|
4
|
+
import { t } from '../i18n.svelte';
|
|
5
|
+
import { Badge } from '$lib/components/ui/badge/index.js';
|
|
6
|
+
import Radio from '@lucide/svelte/icons/radio';
|
|
7
|
+
import MusicControls from './MusicControls.svelte';
|
|
8
|
+
import MusicCover from './MusicCover.svelte';
|
|
9
|
+
|
|
10
|
+
const payload = $derived(app.media);
|
|
11
|
+
const media = $derived(payload?.media?.media ?? null);
|
|
12
|
+
const volume = $derived(payload?.volume ?? null);
|
|
13
|
+
const thumbnail = $derived(media?.thumbnail || media?.thumbnailUrl || '');
|
|
14
|
+
const source = $derived(media ? String(media.appName || '').trim() || sourceLabel(media.appId) : t('mediaFallback'));
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
{#if thumbnail}
|
|
18
|
+
<img
|
|
19
|
+
class="music-backdrop"
|
|
20
|
+
src={thumbnail}
|
|
21
|
+
alt=""
|
|
22
|
+
aria-hidden="true"
|
|
23
|
+
draggable="false"
|
|
24
|
+
referrerpolicy="no-referrer"
|
|
25
|
+
/>
|
|
26
|
+
{/if}
|
|
27
|
+
<div class="music-wash" aria-hidden="true"></div>
|
|
28
|
+
|
|
29
|
+
<div class="music-layout">
|
|
30
|
+
<div class="music-visual">
|
|
31
|
+
<MusicCover {media} />
|
|
32
|
+
<div class="mt-4 flex max-w-full items-center gap-2">
|
|
33
|
+
<Badge
|
|
34
|
+
variant="outline"
|
|
35
|
+
class="h-9 max-w-full gap-2 border-border bg-card/55 px-3.5 text-[14px] font-medium text-muted-foreground backdrop-blur-md"
|
|
36
|
+
>
|
|
37
|
+
<Radio class="size-4 text-brand" strokeWidth={1.8} />
|
|
38
|
+
<span class="truncate">{source}</span>
|
|
39
|
+
</Badge>
|
|
40
|
+
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<MusicControls {payload} {media} {volume} />
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<style>
|
|
48
|
+
.music-backdrop {
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: -80px;
|
|
51
|
+
left: -80px;
|
|
52
|
+
z-index: 0;
|
|
53
|
+
width: calc(100% + 160px);
|
|
54
|
+
height: calc(100% + 160px);
|
|
55
|
+
object-fit: cover;
|
|
56
|
+
filter: blur(55px) saturate(1.2);
|
|
57
|
+
opacity: 0.42;
|
|
58
|
+
pointer-events: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.music-wash {
|
|
62
|
+
position: absolute;
|
|
63
|
+
inset: 0;
|
|
64
|
+
z-index: 1;
|
|
65
|
+
background:
|
|
66
|
+
radial-gradient(85% 120% at 12% 50%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 58%),
|
|
67
|
+
linear-gradient(90deg, color-mix(in srgb, var(--background) 52%, transparent), color-mix(in srgb, var(--background) 82%, transparent) 58%, var(--background) 100%),
|
|
68
|
+
linear-gradient(0deg, var(--background), transparent 44%);
|
|
69
|
+
pointer-events: none;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.music-layout {
|
|
73
|
+
position: relative;
|
|
74
|
+
z-index: 2;
|
|
75
|
+
display: grid;
|
|
76
|
+
grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
|
|
77
|
+
align-items: center;
|
|
78
|
+
gap: clamp(22px, 4vw, 52px);
|
|
79
|
+
width: 100%;
|
|
80
|
+
height: 100%;
|
|
81
|
+
padding: clamp(16px, 3vw, 34px) clamp(16px, 3.5vw, 42px);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.music-visual {
|
|
85
|
+
display: flex;
|
|
86
|
+
min-width: 0;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
align-items: center;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.music-visual :global(.cover-shell) {
|
|
92
|
+
width: min(100%, clamp(210px, 43vh, 330px));
|
|
93
|
+
border-radius: clamp(18px, 3vh, 28px);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@media (max-height: 760px) {
|
|
97
|
+
.music-layout {
|
|
98
|
+
gap: 24px;
|
|
99
|
+
padding: 14px 24px;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (orientation: portrait) {
|
|
104
|
+
.music-layout {
|
|
105
|
+
grid-template-columns: 1fr;
|
|
106
|
+
height: auto;
|
|
107
|
+
min-height: 100%;
|
|
108
|
+
gap: 24px;
|
|
109
|
+
padding: 26px 20px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.music-visual :global(.cover-shell) {
|
|
113
|
+
width: min(72vw, 320px);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
</style>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { app } from '../state.svelte';
|
|
3
|
+
import { appGradient, appInitial, timeAgo } from '../format';
|
|
4
|
+
import { t } from '../i18n.svelte';
|
|
5
|
+
import {
|
|
6
|
+
Avatar,
|
|
7
|
+
AvatarFallback,
|
|
8
|
+
AvatarImage,
|
|
9
|
+
} from '$lib/components/ui/avatar/index.js';
|
|
10
|
+
import { Badge } from '$lib/components/ui/badge/index.js';
|
|
11
|
+
import { ScrollArea } from '$lib/components/ui/scroll-area/index.js';
|
|
12
|
+
import { Skeleton } from '$lib/components/ui/skeleton/index.js';
|
|
13
|
+
import Bell from '@lucide/svelte/icons/bell';
|
|
14
|
+
import BellOff from '@lucide/svelte/icons/bell-off';
|
|
15
|
+
import Panel from './Panel.svelte';
|
|
16
|
+
import SectionHeader from './SectionHeader.svelte';
|
|
17
|
+
import EmptyState from './EmptyState.svelte';
|
|
18
|
+
|
|
19
|
+
const notifications = $derived(app.notifications);
|
|
20
|
+
const list = $derived(Array.isArray(notifications?.notifications) ? notifications.notifications : []);
|
|
21
|
+
const unavailable = $derived(notifications?.available === false);
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<Panel class="notifications-card flex min-h-0 flex-col p-4">
|
|
25
|
+
<SectionHeader icon={Bell} eyebrow="ALERTS" title={t('notifications')} class="mb-3">
|
|
26
|
+
{#snippet children()}
|
|
27
|
+
<Badge
|
|
28
|
+
variant="outline"
|
|
29
|
+
class="h-7 min-w-7 justify-center border-border bg-secondary px-2.5 text-[14px] font-semibold text-muted-foreground"
|
|
30
|
+
>
|
|
31
|
+
{list.length}
|
|
32
|
+
</Badge>
|
|
33
|
+
{/snippet}
|
|
34
|
+
</SectionHeader>
|
|
35
|
+
|
|
36
|
+
<div class="hairline-top pt-2"></div>
|
|
37
|
+
|
|
38
|
+
{#if notifications === null}
|
|
39
|
+
<div class="flex flex-col gap-2 pt-1">
|
|
40
|
+
{#each Array(5) as _, index (index)}
|
|
41
|
+
<div class="flex items-center gap-3 rounded-[14px] p-2.5">
|
|
42
|
+
<Skeleton class="size-11 shrink-0 rounded-[13px]" />
|
|
43
|
+
<div class="flex-1 space-y-2">
|
|
44
|
+
<Skeleton class="h-3 w-20" />
|
|
45
|
+
<Skeleton class="h-4 w-4/5" />
|
|
46
|
+
<Skeleton class="h-3 w-3/5" />
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
{/each}
|
|
50
|
+
</div>
|
|
51
|
+
{:else if unavailable}
|
|
52
|
+
<div class="flex min-h-0 flex-1 items-center justify-center">
|
|
53
|
+
<EmptyState icon={BellOff} title={t('notificationsUnavailable')} text={t('tryLater')} />
|
|
54
|
+
</div>
|
|
55
|
+
{:else if list.length === 0}
|
|
56
|
+
<div class="flex min-h-0 flex-1 items-center justify-center">
|
|
57
|
+
<EmptyState icon={BellOff} title={t('noNotifications')} text={t('noNotificationsHint')} />
|
|
58
|
+
</div>
|
|
59
|
+
{:else}
|
|
60
|
+
<ScrollArea class="-mx-1 min-h-0 flex-1" scrollbarYClasses="mr-0.5 w-2">
|
|
61
|
+
<div class="flex flex-col gap-1 pb-1 pr-1">
|
|
62
|
+
{#each list as item, index (item.id || `${item.appKey}-${item.receivedAt}-${index}`)}
|
|
63
|
+
<div class="notification-row flex gap-3 rounded-[15px] px-2 py-2.5">
|
|
64
|
+
<Avatar class="mt-0.5 size-11 shrink-0 rounded-[13px] after:rounded-[13px]">
|
|
65
|
+
{#if item.avatar}
|
|
66
|
+
<AvatarImage src={item.avatar} alt="" class="rounded-[13px]" />
|
|
67
|
+
{/if}
|
|
68
|
+
<AvatarFallback
|
|
69
|
+
class="rounded-[13px] text-[16px] font-semibold text-white ring-1 ring-white/10 ring-inset"
|
|
70
|
+
style={`background:${appGradient(item.appKey)}`}
|
|
71
|
+
>
|
|
72
|
+
{appInitial(item.appName, item.title)}
|
|
73
|
+
</AvatarFallback>
|
|
74
|
+
</Avatar>
|
|
75
|
+
|
|
76
|
+
<div class="min-w-0 flex-1">
|
|
77
|
+
<div class="flex items-center justify-between gap-3">
|
|
78
|
+
<span class="truncate text-[14px] font-semibold tracking-[0.03em] text-brand">
|
|
79
|
+
{item.appName || t('notificationFallback')}
|
|
80
|
+
</span>
|
|
81
|
+
<span class="shrink-0 text-[13px] text-muted-foreground">
|
|
82
|
+
{timeAgo(item.receivedAt, app.clockNow)}
|
|
83
|
+
</span>
|
|
84
|
+
</div>
|
|
85
|
+
<p class="mt-0.5 line-clamp-2 text-[18px] leading-snug font-medium text-foreground">
|
|
86
|
+
{item.title || ''}
|
|
87
|
+
</p>
|
|
88
|
+
{#if item.body}
|
|
89
|
+
<p class="mt-1 line-clamp-2 text-[15px] leading-snug text-muted-foreground">{item.body}</p>
|
|
90
|
+
{/if}
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
{/each}
|
|
94
|
+
</div>
|
|
95
|
+
</ScrollArea>
|
|
96
|
+
{/if}
|
|
97
|
+
</Panel>
|
|
98
|
+
|
|
99
|
+
<style>
|
|
100
|
+
.notification-row {
|
|
101
|
+
border: 1px solid transparent;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media (orientation: portrait) {
|
|
105
|
+
:global(.notifications-card) {
|
|
106
|
+
min-height: 440px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import { Card } from '$lib/components/ui/card/index.js';
|
|
4
|
+
import { cn } from '$lib/utils.js';
|
|
5
|
+
|
|
6
|
+
let {
|
|
7
|
+
class: className = '',
|
|
8
|
+
children,
|
|
9
|
+
}: {
|
|
10
|
+
class?: string;
|
|
11
|
+
children?: Snippet;
|
|
12
|
+
} = $props();
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<Card
|
|
16
|
+
class={cn(
|
|
17
|
+
'gap-0 rounded-[26px] border border-border bg-card py-0 text-card-foreground shadow-none ring-0 [--card-spacing:0px]',
|
|
18
|
+
className,
|
|
19
|
+
)}
|
|
20
|
+
>
|
|
21
|
+
{@render children?.()}
|
|
22
|
+
</Card>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import CpuMemoryCard from './CpuMemoryCard.svelte';
|
|
3
|
+
import GpuCard from './GpuCard.svelte';
|
|
4
|
+
import ThermalCard from './ThermalCard.svelte';
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div class="performance-grid">
|
|
8
|
+
<div class="performance-main">
|
|
9
|
+
<CpuMemoryCard />
|
|
10
|
+
<GpuCard />
|
|
11
|
+
</div>
|
|
12
|
+
<ThermalCard />
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<style>
|
|
16
|
+
.performance-grid {
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-columns: minmax(0, 1fr) clamp(250px, 28%, 316px);
|
|
19
|
+
gap: 12px;
|
|
20
|
+
height: 100%;
|
|
21
|
+
min-height: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.performance-main {
|
|
25
|
+
display: grid;
|
|
26
|
+
grid-template-rows: repeat(2, minmax(0, 1fr));
|
|
27
|
+
gap: 10px;
|
|
28
|
+
min-height: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media (max-height: 760px) {
|
|
32
|
+
.performance-grid {
|
|
33
|
+
grid-template-columns: minmax(0, 1fr) clamp(238px, 30%, 280px);
|
|
34
|
+
gap: 10px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.performance-main {
|
|
38
|
+
gap: 8px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@media (orientation: portrait) {
|
|
43
|
+
.performance-grid {
|
|
44
|
+
grid-template-columns: 1fr;
|
|
45
|
+
height: auto;
|
|
46
|
+
min-height: 100%;
|
|
47
|
+
gap: 10px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.performance-main {
|
|
51
|
+
grid-template-rows: auto auto;
|
|
52
|
+
gap: 10px;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
</style>
|