diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b85adaeda..634c8627b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -33,7 +33,6 @@ "ms-python.python", "ms-python.pylint", "ms-python.black-formatter", - "bradlc.vscode-tailwindcss", "vue.volar", "ms-vscode.vscode-typescript-next" ], diff --git a/docker/init_scripts/init b/docker/init_scripts/init index 427f62fbf..a41397d49 100755 --- a/docker/init_scripts/init +++ b/docker/init_scripts/init @@ -99,7 +99,7 @@ start_bin_gunicorn() { opentelemetry-instrument \ --service_name "${OTEL_SERVICE_NAME_PREFIX-}api" \ gunicorn \ - --bind=0.0.0.0:5000 \ + --bind=0.0.0.0:"${DEV_PORT:-5000}" \ --bind=unix:/tmp/gunicorn.sock \ --pid=/tmp/gunicorn.pid \ --forwarded-allow-ips="*" \ diff --git a/frontend/assets/console/default/backgrounds/background.svg b/frontend/assets/console/default/backgrounds/background.svg new file mode 100644 index 000000000..18bf0618b --- /dev/null +++ b/frontend/assets/console/default/backgrounds/background.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/bezels/snes.png b/frontend/assets/console/default/bezels/snes.png new file mode 100644 index 000000000..aa7c91e11 Binary files /dev/null and b/frontend/assets/console/default/bezels/snes.png differ diff --git a/frontend/assets/console/default/systems/32x.svg b/frontend/assets/console/default/systems/32x.svg new file mode 100644 index 000000000..13ba7a1e2 --- /dev/null +++ b/frontend/assets/console/default/systems/32x.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/3do.svg b/frontend/assets/console/default/systems/3do.svg new file mode 100644 index 000000000..d49c11bc2 --- /dev/null +++ b/frontend/assets/console/default/systems/3do.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/amiga.svg b/frontend/assets/console/default/systems/amiga.svg new file mode 100644 index 000000000..a53a4b1ed --- /dev/null +++ b/frontend/assets/console/default/systems/amiga.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/arcade.svg b/frontend/assets/console/default/systems/arcade.svg new file mode 100644 index 000000000..d05d0d1dd --- /dev/null +++ b/frontend/assets/console/default/systems/arcade.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/atari2600.svg b/frontend/assets/console/default/systems/atari2600.svg new file mode 100644 index 000000000..b475c60df --- /dev/null +++ b/frontend/assets/console/default/systems/atari2600.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/gamegear.svg b/frontend/assets/console/default/systems/gamegear.svg new file mode 100644 index 000000000..cacd841ca --- /dev/null +++ b/frontend/assets/console/default/systems/gamegear.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/gb.svg b/frontend/assets/console/default/systems/gb.svg new file mode 100644 index 000000000..52f53bd07 --- /dev/null +++ b/frontend/assets/console/default/systems/gb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/gba.svg b/frontend/assets/console/default/systems/gba.svg new file mode 100644 index 000000000..f4f5b0eb6 --- /dev/null +++ b/frontend/assets/console/default/systems/gba.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/gbc.svg b/frontend/assets/console/default/systems/gbc.svg new file mode 100644 index 000000000..55a8f2b0b --- /dev/null +++ b/frontend/assets/console/default/systems/gbc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/genesis.svg b/frontend/assets/console/default/systems/genesis.svg new file mode 100644 index 000000000..857ddd3e7 --- /dev/null +++ b/frontend/assets/console/default/systems/genesis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/n64.svg b/frontend/assets/console/default/systems/n64.svg new file mode 100644 index 000000000..48971efb6 --- /dev/null +++ b/frontend/assets/console/default/systems/n64.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/nds.svg b/frontend/assets/console/default/systems/nds.svg new file mode 100644 index 000000000..9cbb9b7bc --- /dev/null +++ b/frontend/assets/console/default/systems/nds.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/nes.svg b/frontend/assets/console/default/systems/nes.svg new file mode 100644 index 000000000..6ca140572 --- /dev/null +++ b/frontend/assets/console/default/systems/nes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/ngp.svg b/frontend/assets/console/default/systems/ngp.svg new file mode 100644 index 000000000..c95a5e822 --- /dev/null +++ b/frontend/assets/console/default/systems/ngp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/psp.svg b/frontend/assets/console/default/systems/psp.svg new file mode 100644 index 000000000..297bcb329 --- /dev/null +++ b/frontend/assets/console/default/systems/psp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/psx.svg b/frontend/assets/console/default/systems/psx.svg new file mode 100644 index 000000000..50f618a1b --- /dev/null +++ b/frontend/assets/console/default/systems/psx.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/snes.svg b/frontend/assets/console/default/systems/snes.svg new file mode 100644 index 000000000..6c359b9dc --- /dev/null +++ b/frontend/assets/console/default/systems/snes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/tg16.svg b/frontend/assets/console/default/systems/tg16.svg new file mode 100644 index 000000000..6a71292ce --- /dev/null +++ b/frontend/assets/console/default/systems/tg16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/systems/turbografx-cd.svg b/frontend/assets/console/default/systems/turbografx-cd.svg new file mode 100644 index 000000000..bfe17e949 --- /dev/null +++ b/frontend/assets/console/default/systems/turbografx-cd.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/default/theme.css b/frontend/assets/console/default/theme.css new file mode 100644 index 000000000..a871752fc --- /dev/null +++ b/frontend/assets/console/default/theme.css @@ -0,0 +1,174 @@ +/* Default Console Theme */ +:root { + /* ================================ */ + /* THEME FOUNDATION COLORS */ + /* ================================ */ + --console-accent-primary: #553f99; + --console-accent-secondary: #e1a38e; + --console-accent-tertiary: #bda5cf; + --console-accent-fallback: #f8b400; + + --console-text-primary: #ffffff; + --console-text-secondary: #cccccc; + --console-text-muted: #aaaaaa; + --console-text-dimmed: #888888; + + /* ================================ */ + /* GLOBAL MODALS */ + /* ================================ */ + --console-modal-bg: #0f0f0f; + --console-modal-header-bg: #131313; + --console-modal-text: var(--console-text-primary); + --console-modal-text-secondary: var(--console-text-secondary); + --console-modal-border: #333333; + --console-modal-border-secondary: #222222; + --console-modal-shadow: rgba(0, 0, 0, 0.5); + + /* Modal Tiles */ + --console-modal-tile-bg: #1a1a1a; + --console-modal-tile-border: rgba(255, 255, 255, 0.1); + --console-modal-tile-selected-bg: #2a2a2a; + --console-modal-tile-selected-border: var(--console-accent-secondary); + + /* Modal Buttons and Controls */ + --console-modal-button-bg: rgba(255, 255, 255, 0.1); + --console-modal-button-border: rgba(255, 255, 255, 0.2); + --console-modal-button-text: var(--console-text-primary); + --console-modal-button-indicator: var(--console-accent-secondary); + + /* Modal Navigation Hints */ + --console-nav-hint-modal-text: var(--console-modal-text-secondary); + --console-nav-hint-modal-accent: rgba(255, 255, 255, 0.2); + --console-nav-hint-modal-keycap: var(--console-text-primary); + + /* ================================ */ + /* GLOBAL NAVIGATION */ + /* ================================ */ + --console-nav-back-button-bg: rgba(255, 255, 255, 0.1); + --console-nav-back-button-text: var(--console-text-primary); + --console-nav-back-button-border: rgba(255, 255, 255, 0.2); + --console-nav-back-button-hover-bg: rgba(255, 255, 255, 0.2); + + /* Standalone Navigation Hints */ + --console-nav-hint-bg: rgba(0, 0, 0, 0.7); + --console-nav-hint-border: rgba(255, 255, 255, 0.2); + --console-nav-hint-text: var(--console-text-muted); + --console-nav-hint-accent: rgba(255, 255, 255, 0.2); + --console-nav-hint-keycap: var(--console-text-primary); + + /* ================================ */ + /* GLOBAL TEXT */ + /* ================================ */ + --console-loading-text: var(--console-text-muted); + --console-error-text: #f87171; /* red-400 equivalent */ + + /* ================================ */ + /* GLOBAL UI */ + /* ================================ */ + /* System Cards */ + --console-system-card-bg-fallback: linear-gradient( + 135deg, + #2b3242 0%, + #1b2233 100% + ); + --console-system-accent-fallback: var(--console-accent-fallback); + --console-system-card-text: var(--console-text-primary); + + /* Game Cards */ + --console-game-card-bg: linear-gradient(180deg, #1f2430 0%, #2b3242 100%); + --console-game-card-text: var(--console-text-primary); + --console-game-card-focus-border: var(--console-accent-secondary); + --console-game-card-star: var(--console-accent-secondary); + + /* Collections Cards */ + --console-collection-card-bg: linear-gradient( + 180deg, + #1f2430 0%, + #2b3242 100% + ); + --console-collection-card-text: var(--console-text-primary); + --console-collection-card-text-secondary: var(--console-accent-secondary); + --console-collection-card-focus-border: var(--console-accent-secondary); + + /* ================================ */ + /* HOME VIEW */ + /* ================================ */ + /* Title and Branding */ + --console-home-title-text: var(--console-text-primary); + + /* Category Headers */ + --console-home-category-text: var(--console-text-primary); + + /* Carousel Navigation */ + --console-home-carousel-button-bg: rgba(0, 0, 0, 0.7); + --console-home-carousel-button-text: #ffffff; + --console-home-carousel-button-border: rgba(255, 255, 255, 0.2); + + /* Control Buttons */ + --console-home-control-button-bg: rgba(255, 255, 255, 0.1); + --console-home-control-button-text: var(--console-text-primary); + --console-home-control-button-border: rgba(255, 255, 255, 0.2); + --console-home-control-button-focus-border: var(--console-accent-secondary); + + /* ================================ */ + /* GAME VIEW */ + /* ================================ */ + /* Text Elements */ + --console-game-title-text: var(--console-text-primary); + --console-game-description-text: #dddddd; + --console-game-metadata-text: var(--console-text-secondary); + --console-game-section-header: #d1d5db; + + /* Action Buttons */ + --console-game-play-button-bg: var(--console-accent-primary); + --console-game-play-button-text: #ffffff; + --console-game-play-button-focus-border: var(--console-accent-secondary); + + --console-game-details-button-bg: var(--console-accent-tertiary); + --console-game-details-button-text: #ffffff; + --console-game-details-button-focus-border: var(--console-accent-secondary); + + /* Platform Badge */ + --console-game-platform-badge-bg: var(--console-accent-primary); + --console-game-platform-badge-text: #ffffff; + + /* Screenshot Panel */ + --console-game-screenshot-panel-bg: rgba(0, 0, 0, 0.4); + --console-game-screenshot-panel-border: rgba(255, 255, 255, 0.1); + + /* Screenshot Thumbnails */ + --console-game-screenshot-thumbnail-focus-border: var( + --console-accent-secondary + ); + + /* State Cards */ + --console-game-state-card-border: rgba(255, 255, 255, 0.1); + --console-game-state-card-focus-border: var(--console-accent-secondary); + + /* ================================ */ + /* GAMESLIST VIEW */ + /* ================================ */ + /* Alphabet Navigation */ + --console-gameslist-scrollbar-bg: rgba(0, 0, 0, 0.3); + --console-gameslist-alphabet-bg: rgba(255, 255, 255, 0.05); + --console-gameslist-alphabet-border: rgba(0, 0, 0, 0.1); + --console-gameslist-alphabet-text: var(--console-text-muted); + --console-gameslist-alphabet-active-text: #ffffff; + --console-gameslist-alphabet-active-bg: var(--console-accent-secondary); + + /* ================================ */ + /* PLAY VIEW */ + /* ================================ */ + /* Control Hints */ + --console-play-hint-bg: rgba(0, 0, 0, 0.6); + --console-play-hint-border: rgba(255, 255, 255, 0.1); + --console-play-hint-text: rgba(255, 255, 255, 0.8); + + /* Save State Dialog */ + --console-play-save-status-text: var(--console-accent-secondary); + --console-play-save-separator-border: rgba(255, 255, 255, 0.1); +} + +.console-root::before { + background: rgba(0, 0, 0, 0.15); +} diff --git a/frontend/assets/console/neon/backgrounds/background.svg b/frontend/assets/console/neon/backgrounds/background.svg new file mode 100644 index 000000000..201eada72 --- /dev/null +++ b/frontend/assets/console/neon/backgrounds/background.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/bezels/snes.png b/frontend/assets/console/neon/bezels/snes.png new file mode 100644 index 000000000..aa7c91e11 Binary files /dev/null and b/frontend/assets/console/neon/bezels/snes.png differ diff --git a/frontend/assets/console/neon/systems/32x.svg b/frontend/assets/console/neon/systems/32x.svg new file mode 100644 index 000000000..72a6ad974 --- /dev/null +++ b/frontend/assets/console/neon/systems/32x.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/3do.svg b/frontend/assets/console/neon/systems/3do.svg new file mode 100644 index 000000000..7c121e4df --- /dev/null +++ b/frontend/assets/console/neon/systems/3do.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/amiga.svg b/frontend/assets/console/neon/systems/amiga.svg new file mode 100644 index 000000000..4aed00073 --- /dev/null +++ b/frontend/assets/console/neon/systems/amiga.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/arcade.svg b/frontend/assets/console/neon/systems/arcade.svg new file mode 100644 index 000000000..804d1d82e --- /dev/null +++ b/frontend/assets/console/neon/systems/arcade.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/atari2600.svg b/frontend/assets/console/neon/systems/atari2600.svg new file mode 100644 index 000000000..e37f6a9a5 --- /dev/null +++ b/frontend/assets/console/neon/systems/atari2600.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/atari5200.svg b/frontend/assets/console/neon/systems/atari5200.svg new file mode 100644 index 000000000..134353645 --- /dev/null +++ b/frontend/assets/console/neon/systems/atari5200.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/atari7800.svg b/frontend/assets/console/neon/systems/atari7800.svg new file mode 100644 index 000000000..91865525c --- /dev/null +++ b/frontend/assets/console/neon/systems/atari7800.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/c64.svg b/frontend/assets/console/neon/systems/c64.svg new file mode 100644 index 000000000..86ec5089a --- /dev/null +++ b/frontend/assets/console/neon/systems/c64.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/colecovision.svg b/frontend/assets/console/neon/systems/colecovision.svg new file mode 100644 index 000000000..541d039f9 --- /dev/null +++ b/frontend/assets/console/neon/systems/colecovision.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/dos.svg b/frontend/assets/console/neon/systems/dos.svg new file mode 100644 index 000000000..a78202519 --- /dev/null +++ b/frontend/assets/console/neon/systems/dos.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/famicom.svg b/frontend/assets/console/neon/systems/famicom.svg new file mode 100644 index 000000000..4f2679bf8 --- /dev/null +++ b/frontend/assets/console/neon/systems/famicom.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/gamegear.svg b/frontend/assets/console/neon/systems/gamegear.svg new file mode 100644 index 000000000..50c154e3b --- /dev/null +++ b/frontend/assets/console/neon/systems/gamegear.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/gb.svg b/frontend/assets/console/neon/systems/gb.svg new file mode 100644 index 000000000..1383c8e52 --- /dev/null +++ b/frontend/assets/console/neon/systems/gb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/gba.svg b/frontend/assets/console/neon/systems/gba.svg new file mode 100644 index 000000000..b5de63b0a --- /dev/null +++ b/frontend/assets/console/neon/systems/gba.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/gbc.svg b/frontend/assets/console/neon/systems/gbc.svg new file mode 100644 index 000000000..41a6deac7 --- /dev/null +++ b/frontend/assets/console/neon/systems/gbc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/genesis.svg b/frontend/assets/console/neon/systems/genesis.svg new file mode 100644 index 000000000..1f0f84215 --- /dev/null +++ b/frontend/assets/console/neon/systems/genesis.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/jaguar.svg b/frontend/assets/console/neon/systems/jaguar.svg new file mode 100644 index 000000000..71e97f38f --- /dev/null +++ b/frontend/assets/console/neon/systems/jaguar.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/lynx.svg b/frontend/assets/console/neon/systems/lynx.svg new file mode 100644 index 000000000..f5a8859fb --- /dev/null +++ b/frontend/assets/console/neon/systems/lynx.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/n64.svg b/frontend/assets/console/neon/systems/n64.svg new file mode 100644 index 000000000..1325f3a25 --- /dev/null +++ b/frontend/assets/console/neon/systems/n64.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/nds.svg b/frontend/assets/console/neon/systems/nds.svg new file mode 100644 index 000000000..cd4621f16 --- /dev/null +++ b/frontend/assets/console/neon/systems/nds.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/nes.svg b/frontend/assets/console/neon/systems/nes.svg new file mode 100644 index 000000000..5561526b2 --- /dev/null +++ b/frontend/assets/console/neon/systems/nes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/ngp.svg b/frontend/assets/console/neon/systems/ngp.svg new file mode 100644 index 000000000..7b67a8142 --- /dev/null +++ b/frontend/assets/console/neon/systems/ngp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/ngpc.svg b/frontend/assets/console/neon/systems/ngpc.svg new file mode 100644 index 000000000..25878722f --- /dev/null +++ b/frontend/assets/console/neon/systems/ngpc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/pcfx.svg b/frontend/assets/console/neon/systems/pcfx.svg new file mode 100644 index 000000000..11c8d98d1 --- /dev/null +++ b/frontend/assets/console/neon/systems/pcfx.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/psp.svg b/frontend/assets/console/neon/systems/psp.svg new file mode 100644 index 000000000..97c3021f3 --- /dev/null +++ b/frontend/assets/console/neon/systems/psp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/psx.svg b/frontend/assets/console/neon/systems/psx.svg new file mode 100644 index 000000000..17f4c8082 --- /dev/null +++ b/frontend/assets/console/neon/systems/psx.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/snes.svg b/frontend/assets/console/neon/systems/snes.svg new file mode 100644 index 000000000..c27a5d831 --- /dev/null +++ b/frontend/assets/console/neon/systems/snes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/tg16.svg b/frontend/assets/console/neon/systems/tg16.svg new file mode 100644 index 000000000..046941a32 --- /dev/null +++ b/frontend/assets/console/neon/systems/tg16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/systems/turbografx-cd.svg b/frontend/assets/console/neon/systems/turbografx-cd.svg new file mode 100644 index 000000000..8099ad068 --- /dev/null +++ b/frontend/assets/console/neon/systems/turbografx-cd.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend/assets/console/neon/theme.css b/frontend/assets/console/neon/theme.css new file mode 100644 index 000000000..07d290923 --- /dev/null +++ b/frontend/assets/console/neon/theme.css @@ -0,0 +1,174 @@ +/* Neon Console Theme */ +:root { + /* ================================ */ + /* THEME FOUNDATION COLORS */ + /* ================================ */ + --console-accent-primary: #0d6efd; + --console-accent-secondary: #ffd601; + --console-accent-tertiary: #6f42c1; + --console-accent-fallback: #f8b400; + + --console-text-primary: #212529; + --console-text-secondary: #ffffff; + --console-text-muted: #868e96; + --console-text-dimmed: #adb5bd; + + /* ================================ */ + /* GLOBAL MODALS */ + /* ================================ */ + --console-modal-bg: #ffffff; + --console-modal-header-bg: #f8f9fa; + --console-modal-text: var(--console-text-primary); + --console-modal-text-secondary: #6b7280; + --console-modal-border: #dee2e6; + --console-modal-border-secondary: #e9ecef; + --console-modal-shadow: rgba(0, 0, 0, 0.25); + + /* Modal Tiles */ + --console-modal-tile-bg: #f1f3f4; + --console-modal-tile-border: rgba(0, 0, 0, 0.1); + --console-modal-tile-selected-bg: #e8f0fe; + --console-modal-tile-selected-border: var(--console-accent-secondary); + + /* Modal Buttons and Controls */ + --console-modal-button-bg: #f8f9fa; + --console-modal-button-border: rgba(0, 0, 0, 0.25); + --console-modal-button-text: #000000; + --console-modal-button-indicator: var(--console-accent-tertiary); + + /* Modal Navigation Hints */ + --console-nav-hint-modal-text: var(--console-text-primary); + --console-nav-hint-modal-accent: rgba(0, 0, 0, 0.15); + --console-nav-hint-modal-keycap: rgba(0, 0, 0, 0.7); + + /* ================================ */ + /* GLOBAL NAVIGATION */ + /* ================================ */ + --console-nav-back-button-bg: rgba(255, 255, 255, 0.5); + --console-nav-back-button-text: var(--console-text-secondary); + --console-nav-back-button-border: rgba(0, 0, 0, 0.2); + --console-nav-back-button-hover-bg: rgba(0, 0, 0, 0.2); + + /* Standalone Navigation Hints */ + --console-nav-hint-bg: rgba(255, 255, 255, 0.5); + --console-nav-hint-border: rgba(0, 0, 0, 0.2); + --console-nav-hint-text: var(--console-text-primary); + --console-nav-hint-accent: rgba(0, 0, 0, 0.15); + --console-nav-hint-keycap: rgba(0, 0, 0, 0.7); + + /* ================================ */ + /* GLOBAL TEXT */ + /* ================================ */ + --console-loading-text: var(--console-text-muted); + --console-error-text: #ff6b6b; /* neon red variant */ + + /* ================================ */ + /* GLOBAL UI */ + /* ================================ */ + /* System Cards */ + --console-system-card-bg-fallback: linear-gradient( + 135deg, + #e2e6ea 0%, + #d6dae0 100% + ); + --console-system-accent-fallback: var(--console-accent-tertiary); + --console-system-card-text: var(--console-text-secondary); + + /* Game Cards */ + --console-game-card-bg: linear-gradient(180deg, #212121 0%, #303030 100%); + --console-game-card-text: var(--console-text-secondary); + --console-game-card-focus-border: var(--console-accent-secondary); + --console-game-card-star: var(--console-accent-secondary); + + /* Collections Cards */ + --console-collection-card-bg: linear-gradient( + 180deg, + #212121 0%, + #303030 100% + ); + --console-collection-card-text: var(--console-text-secondary); + --console-collection-card-text-secondary: var(--console-accent-secondary); + --console-collection-card-focus-border: var(--console-accent-secondary); + + /* ================================ */ + /* HOME VIEW */ + /* ================================ */ + /* Title and Branding */ + --console-home-title-text: var(--console-text-secondary); + + /* Category Headers */ + --console-home-category-text: var(--console-text-secondary); + + /* Carousel Navigation */ + --console-home-carousel-button-bg: rgba(0, 0, 0, 0.2); + --console-home-carousel-button-text: #ffffff; + --console-home-carousel-button-border: rgba(255, 255, 255, 0.2); + + /* Control Buttons */ + --console-home-control-button-bg: rgba(0, 0, 0, 0.1); + --console-home-control-button-text: var(--console-text-secondary); + --console-home-control-button-border: rgba(0, 0, 0, 0.2); + --console-home-control-button-focus-border: var(--console-accent-secondary); + + /* ================================ */ + /* GAME VIEW */ + /* ================================ */ + /* Text Elements */ + --console-game-title-text: var(--console-text-secondary); + --console-game-description-text: var(--console-text-secondary); + --console-game-metadata-text: var(--console-text-secondary); + --console-game-section-header: var(--console-text-secondary); + + /* Action Buttons */ + --console-game-play-button-bg: var(--console-accent-primary); + --console-game-play-button-text: #ffffff; + --console-game-play-button-focus-border: var(--console-accent-secondary); + + --console-game-details-button-bg: var(--console-accent-tertiary); + --console-game-details-button-text: #ffffff; + --console-game-details-button-focus-border: var(--console-accent-secondary); + + /* Platform Badge */ + --console-game-platform-badge-bg: var(--console-accent-primary); + --console-game-platform-badge-text: #ffffff; + + /* Screenshot Panel */ + --console-game-screenshot-panel-bg: rgba(0, 0, 0, 0.4); + --console-game-screenshot-panel-border: rgba(0, 0, 0, 0.1); + + /* Screenshot Thumbnails */ + --console-game-screenshot-thumbnail-focus-border: var( + --console-accent-secondary + ); + + /* State Cards */ + --console-game-state-card-border: rgba(0, 0, 0, 0.1); + --console-game-state-card-focus-border: var(--console-accent-secondary); + + /* ================================ */ + /* GAMESLIST VIEW */ + /* ================================ */ + /* Alphabet Navigation */ + --console-gameslist-scrollbar-bg: rgba(0, 0, 0, 0.3); + --console-gameslist-alphabet-bg: rgba(0, 0, 0, 0.05); + --console-gameslist-alphabet-border: rgba(0, 0, 0, 0.1); + --console-gameslist-alphabet-text: var(--console-text-secondary); + --console-gameslist-alphabet-active-text: var(--console-text-secondary); + --console-gameslist-alphabet-active-bg: rgba(248, 180, 0, 1); + + /* ================================ */ + /* PLAY VIEW */ + /* ================================ */ + /* Control Hints */ + --console-play-hint-bg: rgba(0, 0, 0, 0.6); + --console-play-hint-border: rgba(0, 0, 0, 0.1); + --console-play-hint-text: rgba(255, 255, 255, 0.8); + + /* Save State Dialog */ + --console-play-save-status-text: var(--console-accent-secondary); + --console-play-save-separator-border: rgba(0, 0, 0, 0.1); +} + +.console-root::before { + background: rgba(0, 0, 0, 0.15); +} diff --git a/frontend/package-lock.json b/frontend/package-lock.json index d3b41f68f..cc9e07999 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -10,6 +10,7 @@ "license": "AGPL-3.0-only", "dependencies": { "@mdi/font": "7.4.47", + "@vueuse/core": "^13.7.0", "axios": "^1.8.4", "cronstrue": "^2.57.0", "date-fns": "^4.1.0", @@ -31,6 +32,7 @@ }, "devDependencies": { "@eslint/js": "^9.21.0", + "@tailwindcss/vite": "^4.1.12", "@types/eslint__js": "^9.14.0", "@types/js-cookie": "^3.0.6", "@types/lodash": "^4.17.16", @@ -43,6 +45,7 @@ "eslint-plugin-vue": "^9.26.0", "globals": "^16.0.0", "openapi-typescript-codegen": "^0.29.0", + "tailwindcss": "^4.0.0", "typescript": "^5.7.3", "typescript-eslint": "^8.28.0", "vite": "^6.3.5", @@ -2587,6 +2590,19 @@ "url": "https://github.com/sponsors/kazupon" } }, + "node_modules/@isaacs/fs-minipass": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz", + "integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==", + "dev": true, + "license": "ISC", + "dependencies": { + "minipass": "^7.0.4" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.8", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz", @@ -2601,6 +2617,17 @@ "node": ">=6.0.0" } }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", @@ -3243,6 +3270,293 @@ "sourcemap-codec": "^1.4.8" } }, + "node_modules/@tailwindcss/node": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.1.12.tgz", + "integrity": "sha512-3hm9brwvQkZFe++SBt+oLjo4OLDtkvlE8q2WalaD/7QWaeM7KEJbAiY/LJZUaCs7Xa8aUu4xy3uoyX4q54UVdQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.4", + "enhanced-resolve": "^5.18.3", + "jiti": "^2.5.1", + "lightningcss": "1.30.1", + "magic-string": "^0.30.17", + "source-map-js": "^1.2.1", + "tailwindcss": "4.1.12" + } + }, + "node_modules/@tailwindcss/node/node_modules/jiti": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.5.1.tgz", + "integrity": "sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, + "node_modules/@tailwindcss/oxide": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.1.12.tgz", + "integrity": "sha512-gM5EoKHW/ukmlEtphNwaGx45fGoEmP10v51t9unv55voWh6WrOL19hfuIdo2FjxIaZzw776/BUQg7Pck++cIVw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.4", + "tar": "^7.4.3" + }, + "engines": { + "node": ">= 10" + }, + "optionalDependencies": { + "@tailwindcss/oxide-android-arm64": "4.1.12", + "@tailwindcss/oxide-darwin-arm64": "4.1.12", + "@tailwindcss/oxide-darwin-x64": "4.1.12", + "@tailwindcss/oxide-freebsd-x64": "4.1.12", + "@tailwindcss/oxide-linux-arm-gnueabihf": "4.1.12", + "@tailwindcss/oxide-linux-arm64-gnu": "4.1.12", + "@tailwindcss/oxide-linux-arm64-musl": "4.1.12", + "@tailwindcss/oxide-linux-x64-gnu": "4.1.12", + "@tailwindcss/oxide-linux-x64-musl": "4.1.12", + "@tailwindcss/oxide-wasm32-wasi": "4.1.12", + "@tailwindcss/oxide-win32-arm64-msvc": "4.1.12", + "@tailwindcss/oxide-win32-x64-msvc": "4.1.12" + } + }, + "node_modules/@tailwindcss/oxide-android-arm64": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-android-arm64/-/oxide-android-arm64-4.1.12.tgz", + "integrity": "sha512-oNY5pq+1gc4T6QVTsZKwZaGpBb2N1H1fsc1GD4o7yinFySqIuRZ2E4NvGasWc6PhYJwGK2+5YT1f9Tp80zUQZQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-arm64": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.1.12.tgz", + "integrity": "sha512-cq1qmq2HEtDV9HvZlTtrj671mCdGB93bVY6J29mwCyaMYCP/JaUBXxrQQQm7Qn33AXXASPUb2HFZlWiiHWFytw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-darwin-x64": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-x64/-/oxide-darwin-x64-4.1.12.tgz", + "integrity": "sha512-6UCsIeFUcBfpangqlXay9Ffty9XhFH1QuUFn0WV83W8lGdX8cD5/+2ONLluALJD5+yJ7k8mVtwy3zMZmzEfbLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-freebsd-x64": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-freebsd-x64/-/oxide-freebsd-x64-4.1.12.tgz", + "integrity": "sha512-JOH/f7j6+nYXIrHobRYCtoArJdMJh5zy5lr0FV0Qu47MID/vqJAY3r/OElPzx1C/wdT1uS7cPq+xdYYelny1ww==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm-gnueabihf": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm-gnueabihf/-/oxide-linux-arm-gnueabihf-4.1.12.tgz", + "integrity": "sha512-v4Ghvi9AU1SYgGr3/j38PD8PEe6bRfTnNSUE3YCMIRrrNigCFtHZ2TCm8142X8fcSqHBZBceDx+JlFJEfNg5zQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-gnu": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-gnu/-/oxide-linux-arm64-gnu-4.1.12.tgz", + "integrity": "sha512-YP5s1LmetL9UsvVAKusHSyPlzSRqYyRB0f+Kl/xcYQSPLEw/BvGfxzbH+ihUciePDjiXwHh+p+qbSP3SlJw+6g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-arm64-musl": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-arm64-musl/-/oxide-linux-arm64-musl-4.1.12.tgz", + "integrity": "sha512-V8pAM3s8gsrXcCv6kCHSuwyb/gPsd863iT+v1PGXC4fSL/OJqsKhfK//v8P+w9ThKIoqNbEnsZqNy+WDnwQqCA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-gnu": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-gnu/-/oxide-linux-x64-gnu-4.1.12.tgz", + "integrity": "sha512-xYfqYLjvm2UQ3TZggTGrwxjYaLB62b1Wiysw/YE3Yqbh86sOMoTn0feF98PonP7LtjsWOWcXEbGqDL7zv0uW8Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-linux-x64-musl": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-linux-x64-musl/-/oxide-linux-x64-musl-4.1.12.tgz", + "integrity": "sha512-ha0pHPamN+fWZY7GCzz5rKunlv9L5R8kdh+YNvP5awe3LtuXb5nRi/H27GeL2U+TdhDOptU7T6Is7mdwh5Ar3A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-wasm32-wasi": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-wasm32-wasi/-/oxide-wasm32-wasi-4.1.12.tgz", + "integrity": "sha512-4tSyu3dW+ktzdEpuk6g49KdEangu3eCYoqPhWNsZgUhyegEda3M9rG0/j1GV/JjVVsj+lG7jWAyrTlLzd/WEBg==", + "bundleDependencies": [ + "@napi-rs/wasm-runtime", + "@emnapi/core", + "@emnapi/runtime", + "@tybys/wasm-util", + "@emnapi/wasi-threads", + "tslib" + ], + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "^1.4.5", + "@emnapi/runtime": "^1.4.5", + "@emnapi/wasi-threads": "^1.0.4", + "@napi-rs/wasm-runtime": "^0.2.12", + "@tybys/wasm-util": "^0.10.0", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@tailwindcss/oxide-win32-arm64-msvc": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-arm64-msvc/-/oxide-win32-arm64-msvc-4.1.12.tgz", + "integrity": "sha512-iGLyD/cVP724+FGtMWslhcFyg4xyYyM+5F4hGvKA7eifPkXHRAUDFaimu53fpNg9X8dfP75pXx/zFt/jlNF+lg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/oxide-win32-x64-msvc": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/oxide-win32-x64-msvc/-/oxide-win32-x64-msvc-4.1.12.tgz", + "integrity": "sha512-NKIh5rzw6CpEodv/++r0hGLlfgT/gFN+5WNdZtvh6wpU2BpGNgdjvj6H2oFc8nCM839QM1YOhjpgbAONUb4IxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@tailwindcss/vite": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.1.12.tgz", + "integrity": "sha512-4pt0AMFDx7gzIrAOIYgYP0KCBuKWqyW8ayrdiLEjoJTT4pKTjrzG/e4uzWtTLDziC+66R9wbUqZBccJalSE5vQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tailwindcss/node": "4.1.12", + "@tailwindcss/oxide": "4.1.12", + "tailwindcss": "4.1.12" + }, + "peerDependencies": { + "vite": "^5.2.0 || ^6 || ^7" + } + }, "node_modules/@types/eslint__js": { "version": "9.14.0", "resolved": "https://registry.npmjs.org/@types/eslint__js/-/eslint__js-9.14.0.tgz", @@ -3337,6 +3651,11 @@ "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", "dev": true }, + "node_modules/@types/web-bluetooth": { + "version": "0.0.21", + "resolved": "https://registry.npmjs.org/@types/web-bluetooth/-/web-bluetooth-0.0.21.tgz", + "integrity": "sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==" + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.28.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.28.0.tgz", @@ -3818,6 +4137,41 @@ "vuetify": "^3.0.0" } }, + "node_modules/@vueuse/core": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/@vueuse/core/-/core-13.7.0.tgz", + "integrity": "sha512-myagn09+c6BmS6yHc1gTwwsdZilAovHslMjyykmZH3JNyzI5HoWhv114IIdytXiPipdHJ2gDUx0PB93jRduJYg==", + "dependencies": { + "@types/web-bluetooth": "^0.0.21", + "@vueuse/metadata": "13.7.0", + "@vueuse/shared": "13.7.0" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, + "node_modules/@vueuse/metadata": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/@vueuse/metadata/-/metadata-13.7.0.tgz", + "integrity": "sha512-8okFhS/1ite8EwUdZZfvTYowNTfXmVCOrBFlA31O0HD8HKXhY+WtTRyF0LwbpJfoFPc+s9anNJIXMVrvP7UTZg==", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/@vueuse/shared": { + "version": "13.7.0", + "resolved": "https://registry.npmjs.org/@vueuse/shared/-/shared-13.7.0.tgz", + "integrity": "sha512-Wi2LpJi4UA9kM0OZ0FCZslACp92HlVNw1KPaDY6RAzvQ+J1s7seOtcOpmkfbD5aBSmMn9NvOakc8ZxMxmDXTIg==", + "funding": { + "url": "https://github.com/sponsors/antfu" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + }, "node_modules/acorn": { "version": "8.15.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", @@ -4181,9 +4535,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001697", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001697.tgz", - "integrity": "sha512-GwNPlWJin8E+d7Gxq96jxM6w0w+VFeyyXRsjU58emtkYqnbwHqXm5uT2uCmO0RQE9htWknOP4xtBlLmM/gWxvQ==", + "version": "1.0.30001735", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001735.tgz", + "integrity": "sha512-EV/laoX7Wq2J9TQlyIXRxTJqIw4sxfXS4OYgudGxBYRuTv0q7AM6yMEpU/Vo1I94thg9U6EZ2NfZx9GJq83u7w==", "dev": true, "funding": [ { @@ -4198,7 +4552,8 @@ "type": "github", "url": "https://github.com/sponsors/ai" } - ] + ], + "license": "CC-BY-4.0" }, "node_modules/chalk": { "version": "4.1.2", @@ -4216,6 +4571,16 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/chownr": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz", + "integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, "node_modules/cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", @@ -4534,6 +4899,16 @@ "node": ">=0.4.0" } }, + "node_modules/detect-libc": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.4.tgz", + "integrity": "sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==", + "devOptional": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, "node_modules/dijkstrajs": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz", @@ -4614,6 +4989,20 @@ "node": ">=10.0.0" } }, + "node_modules/enhanced-resolve": { + "version": "5.18.3", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz", + "integrity": "sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/entities": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", @@ -6138,6 +6527,17 @@ "node": ">=10" } }, + "node_modules/jiti": { + "version": "1.21.7", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", + "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", + "license": "MIT", + "optional": true, + "peer": true, + "bin": { + "jiti": "bin/jiti.js" + } + }, "node_modules/js-cookie": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz", @@ -6267,6 +6667,235 @@ "node": ">= 0.8.0" } }, + "node_modules/lightningcss": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.30.1.tgz", + "integrity": "sha512-xi6IyHML+c9+Q3W0S4fCQJOym42pyurFiJUHEcEyHS0CeKzia4yZDEsLlqOFykxOdHpNy0NmvVO31vcSqAxJCg==", + "devOptional": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-darwin-arm64": "1.30.1", + "lightningcss-darwin-x64": "1.30.1", + "lightningcss-freebsd-x64": "1.30.1", + "lightningcss-linux-arm-gnueabihf": "1.30.1", + "lightningcss-linux-arm64-gnu": "1.30.1", + "lightningcss-linux-arm64-musl": "1.30.1", + "lightningcss-linux-x64-gnu": "1.30.1", + "lightningcss-linux-x64-musl": "1.30.1", + "lightningcss-win32-arm64-msvc": "1.30.1", + "lightningcss-win32-x64-msvc": "1.30.1" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.30.1.tgz", + "integrity": "sha512-c8JK7hyE65X1MHMN+Viq9n11RRC7hgin3HhYKhrMyaXflk5GVplZ60IxyoVtzILeKr+xAJwg6zK6sjTBJ0FKYQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.30.1.tgz", + "integrity": "sha512-k1EvjakfumAQoTfcXUcHQZhSpLlkAuEkdMBsI/ivWw9hL+7FtilQc0Cy3hrx0AAQrVtQAbMI7YjCgYgvn37PzA==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.30.1.tgz", + "integrity": "sha512-kmW6UGCGg2PcyUE59K5r0kWfKPAVy4SltVeut+umLCFoJ53RdCUWxcRDzO1eTaxf/7Q2H7LTquFHPL5R+Gjyig==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.30.1.tgz", + "integrity": "sha512-MjxUShl1v8pit+6D/zSPq9S9dQ2NPFSQwGvxBCYaBYLPlCWuPh9/t1MRS8iUaR8i+a6w7aps+B4N0S1TYP/R+Q==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.30.1.tgz", + "integrity": "sha512-gB72maP8rmrKsnKYy8XUuXi/4OctJiuQjcuqWNlJQ6jZiWqtPvqFziskH3hnajfvKB27ynbVCucKSm2rkQp4Bw==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.30.1.tgz", + "integrity": "sha512-jmUQVx4331m6LIX+0wUhBbmMX7TCfjF5FoOH6SD1CttzuYlGNVpA7QnrmLxrsub43ClTINfGSYyHe2HWeLl5CQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.30.1.tgz", + "integrity": "sha512-piWx3z4wN8J8z3+O5kO74+yr6ze/dKmPnI7vLqfSqI8bccaTGY5xiSGVIJBDd5K5BHlvVLpUB3S2YCfelyJ1bw==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.30.1.tgz", + "integrity": "sha512-rRomAK7eIkL+tHY0YPxbc5Dra2gXlI63HL+v1Pdi1a3sC+tJTcFrHX+E86sulgAXeI7rSzDYhPSeHHjqFhqfeQ==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.30.1.tgz", + "integrity": "sha512-mSL4rqPi4iXq5YVqzSsJgMVFENoa4nGTT/GjO2c0Yl9OuQfPsIfncvLrEW6RbbB24WtZ3xP/2CCmI3tNkNV4oA==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.30.1.tgz", + "integrity": "sha512-PVqXh48wh4T53F/1CCu8PIPCxLzWyCnn/9T5W1Jpmdy5h9Cwd+0YQS6/LwhHXSafuc61/xg9Lv5OrCby6a++jg==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, "node_modules/linkify-it": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", @@ -6489,11 +7118,50 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/minizlib": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", + "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", + "dev": true, + "license": "MIT", + "dependencies": { + "minipass": "^7.1.2" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/mitt": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==" }, + "node_modules/mkdirp": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz", + "integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==", + "dev": true, + "license": "MIT", + "bin": { + "mkdirp": "dist/cjs/src/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -7736,6 +8404,51 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/tailwindcss": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.1.12.tgz", + "integrity": "sha512-DzFtxOi+7NsFf7DBtI3BJsynR+0Yp6etH+nRPTbpWnS2pZBaSksv/JGctNwSWzbFjp0vxSqknaUylseZqMDGrA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tapable": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.2.tgz", + "integrity": "sha512-Re10+NauLTMCudc7T5WLFLAwDhQ0JWdrMK+9B2M8zR5hRExKmsRDCBA7/aV/pNJFltmBFO5BAMlQFi/vq3nKOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/tar": { + "version": "7.4.3", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz", + "integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@isaacs/fs-minipass": "^4.0.0", + "chownr": "^3.0.0", + "minipass": "^7.1.2", + "minizlib": "^3.0.1", + "mkdirp": "^3.0.1", + "yallist": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/tar/node_modules/yallist": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz", + "integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=18" + } + }, "node_modules/temp-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", @@ -9070,6 +9783,20 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true }, + "node_modules/yaml": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.1.tgz", + "integrity": "sha512-lcYcMxX2PO9XMGvAJkJ3OsNMw+/7FKes7/hgerGUYWIoWu5j/+YQqcZr5JnPZWzOsEBgMbSbiSTn/dv/69Mkpw==", + "license": "ISC", + "optional": true, + "peer": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + } + }, "node_modules/yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index da0bacd23..4d6a82144 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -28,6 +28,7 @@ }, "dependencies": { "@mdi/font": "7.4.47", + "@vueuse/core": "^13.7.0", "axios": "^1.8.4", "cronstrue": "^2.57.0", "date-fns": "^4.1.0", @@ -49,6 +50,7 @@ }, "devDependencies": { "@eslint/js": "^9.21.0", + "@tailwindcss/vite": "^4.1.12", "@types/eslint__js": "^9.14.0", "@types/js-cookie": "^3.0.6", "@types/lodash": "^4.17.16", @@ -61,6 +63,7 @@ "eslint-plugin-vue": "^9.26.0", "globals": "^16.0.0", "openapi-typescript-codegen": "^0.29.0", + "tailwindcss": "^4.0.0", "typescript": "^5.7.3", "typescript-eslint": "^8.28.0", "vite": "^6.3.5", diff --git a/frontend/src/RomM.vue b/frontend/src/RomM.vue index 5e986a758..62a5835f0 100644 --- a/frontend/src/RomM.vue +++ b/frontend/src/RomM.vue @@ -1,11 +1,15 @@ - + @@ -40,6 +48,11 @@ storeLanguage.setLanguage(selectedLanguage.value); transition: none; } +#application.mouse-hidden, +#application.mouse-hidden * { + cursor: none !important; +} + .fade-enter-active, .fade-leave-active { transition: opacity 0.35s ease; diff --git a/frontend/src/components/common/Collection/Dialog/RemoveRoms.vue b/frontend/src/components/common/Collection/Dialog/RemoveRoms.vue index c1a6dad43..4e18b411b 100644 --- a/frontend/src/components/common/Collection/Dialog/RemoveRoms.vue +++ b/frontend/src/components/common/Collection/Dialog/RemoveRoms.vue @@ -13,6 +13,7 @@ import { inject, ref, watch } from "vue"; import { useDisplay } from "vuetify"; import { useI18n } from "vue-i18n"; import { useRouter } from "vue-router"; +import { ROUTES } from "@/plugins/router"; const { t } = useI18n(); const { mdAndUp } = useDisplay(); @@ -66,7 +67,7 @@ async function removeRomsFromCollection() { emitter?.emit("showLoadingDialog", { loading: false, scrim: false }); romsStore.resetSelection(); if (selectedCollection.value?.rom_ids.length == 0) { - router.push({ name: "home" }); + router.push({ name: ROUTES.HOME }); } closeDialog(); }); diff --git a/frontend/src/components/common/Game/AdminMenu.vue b/frontend/src/components/common/Game/AdminMenu.vue index 0dadcee8c..e01fd32e1 100644 --- a/frontend/src/components/common/Game/AdminMenu.vue +++ b/frontend/src/components/common/Game/AdminMenu.vue @@ -1,18 +1,17 @@ {{ - collectionsStore.isFavorite(rom) ? "mdi-star" : "mdi-star-outline" - }} + + {{ collectionsStore.isFavorite(rom) ? "mdi-star" : "mdi-star-outline" }} + + diff --git a/frontend/src/components/common/Navigation/ConsoleModeBtn.vue b/frontend/src/components/common/Navigation/ConsoleModeBtn.vue new file mode 100644 index 000000000..fd8b3c61f --- /dev/null +++ b/frontend/src/components/common/Navigation/ConsoleModeBtn.vue @@ -0,0 +1,61 @@ + + + + + + + mdi-television-play + + + + Play + + + + + diff --git a/frontend/src/components/common/Navigation/MainAppBar.vue b/frontend/src/components/common/Navigation/MainAppBar.vue index aae03350b..5d374fd3b 100644 --- a/frontend/src/components/common/Navigation/MainAppBar.vue +++ b/frontend/src/components/common/Navigation/MainAppBar.vue @@ -10,6 +10,7 @@ import PlatformsDrawer from "@/components/common/Navigation/PlatformsDrawer.vue" import CollectionsDrawer from "@/components/common/Navigation/CollectionsDrawer.vue"; import UploadRomDialog from "@/components/common/Game/Dialog/UploadRom.vue"; import SettingsDrawer from "@/components/common/Navigation/SettingsDrawer.vue"; +import ConsoleModeBtn from "@/components/common/Navigation/ConsoleModeBtn.vue"; import storeNavigation from "@/stores/navigation"; import { storeToRefs } from "pinia"; import { useDisplay } from "vuetify"; @@ -56,6 +57,7 @@ function collapse() { + @@ -121,6 +123,7 @@ function collapse() { block tabindex="7" /> + { ) { + const collectionsStore = storeCollections(); + const romsStore = storeRoms(); + const { favoriteCollection } = storeToRefs(collectionsStore); + + async function ensureFavoriteCollection() { + if (favoriteCollection.value) return favoriteCollection.value; + // Attempt to refetch collections if not already present + if (!collectionsStore.allCollections.length) { + await collectionsStore.fetchCollections(); + } + if (favoriteCollection.value) return favoriteCollection.value; + // Create if still missing + const { data } = await collectionApi.createCollection({ + collection: { name: "Favourites", rom_ids: [] }, + }); + collectionsStore.addCollection(data); + collectionsStore.setFavoriteCollection(data); + emitter?.emit("snackbarShow", { + msg: `Collection ${data.name} created successfully!`, + icon: "mdi-check-bold", + color: "green", + timeout: 2000, + }); + return data; + } + + function isFavorite(rom: SimpleRom) { + return collectionsStore.isFavorite(rom); + } + + async function toggleFavorite(rom: SimpleRom) { + const fav = await ensureFavoriteCollection(); + if (!fav.rom_ids) (fav as Collection).rom_ids = [] as unknown as number[]; // ensure array exists + + const currentlyFav = fav.rom_ids.includes(rom.id); + if (currentlyFav) { + fav.rom_ids = fav.rom_ids.filter((id) => id !== rom.id); + if (romsStore.currentCollection?.id === fav.id) { + romsStore.remove([rom]); + } + } else { + fav.rom_ids.push(rom.id); + } + + try { + const { data } = await collectionApi.updateCollection({ + collection: fav as Collection, + }); + collectionsStore.updateCollection(data); + collectionsStore.setFavoriteCollection(data); + emitter?.emit("snackbarShow", { + msg: `${rom.name} ${currentlyFav ? "removed from" : "added to"} ${data.name} successfully!`, + icon: "mdi-check-bold", + color: "green", + timeout: 2000, + }); + } catch (error: unknown) { + // Rollback + if (currentlyFav) { + fav.rom_ids.push(rom.id); + } else { + fav.rom_ids = fav.rom_ids.filter((id) => id !== rom.id); + } + const detail = (error as { response?: { data?: { detail?: string } } }) + ?.response?.data?.detail; + emitter?.emit("snackbarShow", { + msg: detail || "Failed to update favourites", + icon: "mdi-close-circle", + color: "red", + }); + throw error; + } finally { + emitter?.emit("showLoadingDialog", { loading: false, scrim: false }); + } + } + + return { + favoriteCollection, + ensureFavoriteCollection, + toggleFavorite, + isFavorite, + }; +} + +export default useFavoriteToggle; diff --git a/frontend/src/console/Layout.vue b/frontend/src/console/Layout.vue new file mode 100644 index 000000000..ab826d031 --- /dev/null +++ b/frontend/src/console/Layout.vue @@ -0,0 +1,96 @@ + + + + + + + + + + + + + diff --git a/frontend/src/console/components/BackButton.vue b/frontend/src/console/components/BackButton.vue new file mode 100644 index 000000000..56838f812 --- /dev/null +++ b/frontend/src/console/components/BackButton.vue @@ -0,0 +1,34 @@ + + + + + + ← + + + {{ text }} + + + diff --git a/frontend/src/console/components/CollectionCard.vue b/frontend/src/console/components/CollectionCard.vue new file mode 100644 index 000000000..87394b343 --- /dev/null +++ b/frontend/src/console/components/CollectionCard.vue @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + 🗂️ + + {{ collection.name }} + + + + + + + + + {{ collection.rom_count || 0 }} games + + + + + + {{ collection.name }} + + + + + diff --git a/frontend/src/console/components/GameCard.vue b/frontend/src/console/components/GameCard.vue new file mode 100644 index 000000000..7e72ead15 --- /dev/null +++ b/frontend/src/console/components/GameCard.vue @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + mdi-star + + + + + + + {{ rom.name || "Untitled Game" }} + + + {{ + rom.metadatum.first_release_date + ? new Date(rom.metadatum.first_release_date * 1000).getFullYear() + : "" + }} + + • + + {{ rom.metadatum.companies?.[0] || "" }} + + + + + + + diff --git a/frontend/src/console/components/NavigationHint.vue b/frontend/src/console/components/NavigationHint.vue new file mode 100644 index 000000000..dd0437744 --- /dev/null +++ b/frontend/src/console/components/NavigationHint.vue @@ -0,0 +1,41 @@ + + + + + + + diff --git a/frontend/src/console/components/NavigationText.vue b/frontend/src/console/components/NavigationText.vue new file mode 100644 index 000000000..d123b0871 --- /dev/null +++ b/frontend/src/console/components/NavigationText.vue @@ -0,0 +1,152 @@ + + + + + + + + + Navigation + + + + Select + + + + Back + + + + Favorite + + + + Menu + + + + Delete + + + + + + + Navigation + + + Enter + Select + + + Bkspc + Back + + + F + Favorite + + + X + Menu + + + X + Delete + + + + + + diff --git a/frontend/src/console/components/ScreenshotLightbox.vue b/frontend/src/console/components/ScreenshotLightbox.vue new file mode 100644 index 000000000..0de881533 --- /dev/null +++ b/frontend/src/console/components/ScreenshotLightbox.vue @@ -0,0 +1,184 @@ + + + + + + + + Screenshots + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/console/components/SettingsModal.vue b/frontend/src/console/components/SettingsModal.vue new file mode 100644 index 000000000..5a14db74a --- /dev/null +++ b/frontend/src/console/components/SettingsModal.vue @@ -0,0 +1,287 @@ + + + + + + + + Console Settings + + + + + + + + + {{ option.label }} + + + + + ‹ + {{ getCurrentThemeLabel() }} + › + + + + + ‹ + {{ + sfxEnabled ? "Enabled" : "Disabled" + }} + › + + + + + + + + + + + + + diff --git a/frontend/src/console/components/SystemCard.vue b/frontend/src/console/components/SystemCard.vue new file mode 100644 index 000000000..3f84218ef --- /dev/null +++ b/frontend/src/console/components/SystemCard.vue @@ -0,0 +1,118 @@ + + + + + + + + + + 🎮 + + {{ theme.shortName }} + + + + + + 🎮 + + {{ theme.shortName }} + + + + + + + {{ platform.rom_count || 0 }} games + + + + diff --git a/frontend/src/console/components/icons/ArrowKeysIcon.vue b/frontend/src/console/components/icons/ArrowKeysIcon.vue new file mode 100644 index 000000000..2d4e220b9 --- /dev/null +++ b/frontend/src/console/components/icons/ArrowKeysIcon.vue @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/console/components/icons/DPadIcon.vue b/frontend/src/console/components/icons/DPadIcon.vue new file mode 100644 index 000000000..5ff9aaa98 --- /dev/null +++ b/frontend/src/console/components/icons/DPadIcon.vue @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/console/components/icons/FaceButtons.vue b/frontend/src/console/components/icons/FaceButtons.vue new file mode 100644 index 000000000..ca2b7a494 --- /dev/null +++ b/frontend/src/console/components/icons/FaceButtons.vue @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + diff --git a/frontend/src/console/composables/useElementRegistry.ts b/frontend/src/console/composables/useElementRegistry.ts new file mode 100644 index 000000000..7f8727884 --- /dev/null +++ b/frontend/src/console/composables/useElementRegistry.ts @@ -0,0 +1,30 @@ +import { ref } from "vue"; + +export function useElementRegistry() { + const elements = ref([]); + + const registerElement = (index: number, element: HTMLElement) => { + elements.value[index] = element; + }; + + const getElement = (index: number): HTMLElement | undefined => { + return elements.value[index]; + }; + + const clearElements = () => { + elements.value = []; + }; + + return { + elements, + registerElement, + getElement, + clearElements, + }; +} + +// Create a shared registry instance for each section +export const systemElementRegistry = useElementRegistry(); +export const recentElementRegistry = useElementRegistry(); +export const collectionElementRegistry = useElementRegistry(); +export const gamesListElementRegistry = useElementRegistry(); diff --git a/frontend/src/console/composables/useInputScope.ts b/frontend/src/console/composables/useInputScope.ts new file mode 100644 index 000000000..ff4131d5b --- /dev/null +++ b/frontend/src/console/composables/useInputScope.ts @@ -0,0 +1,35 @@ +import { inject, onMounted, onUnmounted } from "vue"; +import { InputBus, InputBusSymbol } from "@/console/input/bus"; +import type { InputListener } from "@/console/input/actions"; + +export function useInputScope() { + const bus = inject(InputBusSymbol); + + if (!bus) { + throw new Error( + "useInputScope must be used within a component that provides InputBus", + ); + } + + let unsubscribe: (() => void) | null = null; + + onMounted(() => { + unsubscribe = bus.pushScope(); + }); + + onUnmounted(() => { + if (unsubscribe) { + unsubscribe(); + unsubscribe = null; + } + }); + + const subscribe = (listener: InputListener) => { + return bus.subscribe(listener); + }; + + return { + bus, + subscribe, + }; +} diff --git a/frontend/src/console/composables/useRovingDom.ts b/frontend/src/console/composables/useRovingDom.ts new file mode 100644 index 000000000..19ddc5b36 --- /dev/null +++ b/frontend/src/console/composables/useRovingDom.ts @@ -0,0 +1,45 @@ +import { watch, type Ref } from "vue"; + +interface RovingOptions { + scroll?: boolean; // default true + block?: ScrollLogicalPosition; // vertical alignment + inline?: ScrollLogicalPosition; // horizontal alignment + behavior?: ScrollBehavior; // smooth vs auto + focus?: boolean; // default true +} + +export function useRovingDom( + index: Ref, + getEl: (i: number) => HTMLElement | undefined, + opts: RovingOptions = {}, +) { + const { + scroll = true, + block = "center", + inline = "nearest", + behavior = "smooth", + focus = true, + } = opts; + + watch( + index, + (newIdx, oldIdx) => { + if (oldIdx != null) { + const prev = getEl(oldIdx); + if (prev) prev.setAttribute("tabindex", "-1"); + } + const el = getEl(newIdx); + if (!el) return; + el.setAttribute("tabindex", "0"); + if (focus) { + el.focus({ preventScroll: true }); + } + if (scroll) { + setTimeout(() => { + el.scrollIntoView({ block, inline, behavior }); + }, 0); + } + }, + { immediate: true }, + ); +} diff --git a/frontend/src/console/composables/useSpatialNav.ts b/frontend/src/console/composables/useSpatialNav.ts new file mode 100644 index 000000000..8687a7ba8 --- /dev/null +++ b/frontend/src/console/composables/useSpatialNav.ts @@ -0,0 +1,29 @@ +import type { Ref } from "vue"; + +export function useSpatialNav( + selectedIndex: Ref, + getCols: () => number, + getCount: () => number, +) { + const moveLeft = () => { + selectedIndex.value = Math.max(0, selectedIndex.value - 1); + }; + const moveRight = () => { + const cols = getCols(); + const last = getCount() - 1; + const atRight = (selectedIndex.value + 1) % cols === 0; + if (!atRight) selectedIndex.value = Math.min(last, selectedIndex.value + 1); + }; + const moveUp = () => { + const cols = getCols(); + const ni = selectedIndex.value - cols; + if (ni >= 0) selectedIndex.value = ni; + }; + const moveDown = () => { + const cols = getCols(); + const ni = selectedIndex.value + cols; + if (ni < getCount()) selectedIndex.value = ni; + }; + + return { moveLeft, moveRight, moveUp, moveDown }; +} diff --git a/frontend/src/console/composables/useThemeAssets.ts b/frontend/src/console/composables/useThemeAssets.ts new file mode 100644 index 000000000..dada5f0ff --- /dev/null +++ b/frontend/src/console/composables/useThemeAssets.ts @@ -0,0 +1,73 @@ +import { computed, type ComputedRef } from "vue"; +import { useConsoleTheme } from "@/stores/consoleTheme"; +import { + resolveAsset, + type AssetType, + type SupportedFormat, +} from "@/console/utils/assetResolver"; + +// provides reactive asset paths for theme-aware components +// this is the single source of truth for all asset path resolution +export function useThemeAssets() { + const themeStore = useConsoleTheme(); + + function getAssetPath( + assetType: AssetType, + filename: string, + preferredFormat: SupportedFormat = "svg", + ): ComputedRef { + return computed(() => + resolveAsset(assetType, filename, preferredFormat, themeStore.themeName), + ); + } + + function getSystemImagePath( + platformSlug: string, + preferredFormat: SupportedFormat = "svg", + ): ComputedRef { + return computed(() => + resolveAsset( + "systems", + platformSlug, + preferredFormat, + themeStore.themeName, + ), + ); + } + + function getBezelImagePath( + platformSlug: string, + preferredFormat: SupportedFormat = "png", + ): ComputedRef { + return computed(() => + resolveAsset( + "bezels", + platformSlug, + preferredFormat, + themeStore.themeName, + ), + ); + } + + function getBackgroundImagePath( + backgroundName: string = "background", + preferredFormat: SupportedFormat = "svg", + ): ComputedRef { + return computed(() => + resolveAsset( + "backgrounds", + backgroundName, + preferredFormat, + themeStore.themeName, + ), + ); + } + + return { + getAssetPath, + getSystemImagePath, + getBezelImagePath, + getBackgroundImagePath, + themeName: computed(() => themeStore.themeName), + }; +} diff --git a/frontend/src/console/constants/platforms.ts b/frontend/src/console/constants/platforms.ts new file mode 100644 index 000000000..267727cca --- /dev/null +++ b/frontend/src/console/constants/platforms.ts @@ -0,0 +1,233 @@ +export type SupportedPlatform = { + label: string; + shortName: string; + background: string; + accent: string; +}; + +const _SUPPORTED_PLATFORMS: Record = { + "3do": { + label: "3DO", + shortName: "3DO", + background: "linear-gradient(135deg,#4e4376,#2b5876)", + accent: "#6f63b4", + }, + amiga: { + label: "Amiga", + shortName: "Amiga", + background: "linear-gradient(135deg,#0093e9,#80d0c7)", + accent: "#33b1ff", + }, + arcade: { + label: "Arcade / MAME", + shortName: "Arcade", + background: "linear-gradient(135deg,#d73266,#8b1538)", + accent: "#d73266", + }, + mame: { + label: "Arcade / MAME", + shortName: "Arcade", + background: "linear-gradient(135deg,#d73266,#8b1538)", + accent: "#d73266", + }, + atari2600: { + label: "Atari 2600", + shortName: "2600", + background: "linear-gradient(135deg,#c04848,#480048)", + accent: "#ff6a6a", + }, + atari5200: { + label: "Atari 5200", + shortName: "5200", + background: "linear-gradient(135deg,#3a6073,#16222a)", + accent: "#4fa3c7", + }, + atari7800: { + label: "Atari 7800", + shortName: "7800", + background: "linear-gradient(135deg,#870000,#190a05)", + accent: "#ff3030", + }, + jaguar: { + label: "Atari Jaguar", + shortName: "Jaguar", + background: "linear-gradient(135deg,#000000,#434343)", + accent: "#ff0015", + }, + lynx: { + label: "Atari Lynx", + shortName: "Lynx", + background: "linear-gradient(135deg,#485563,#29323c)", + accent: "#ffa733", + }, + c64: { + label: "Commodore 64", + shortName: "C64", + background: "linear-gradient(135deg,#614385,#516395)", + accent: "#8b7ad6", + }, + colecovision: { + label: "ColecoVision", + shortName: "Coleco", + background: "linear-gradient(135deg,#134e5e,#71b280)", + accent: "#34c686", + }, + doom: { + label: "DOOM", + shortName: "DOOM", + background: "linear-gradient(135deg,#636363,#0f0f0f)", + accent: "#ff9800", + }, + "neo-geo-pocket": { + label: "Neo Geo Pocket", + shortName: "NGP", + background: "linear-gradient(135deg,#1e3c72,#2a5298)", + accent: "#2e6dff", + }, + "neo-geo-pocket-color": { + label: "Neo Geo Pocket Color", + shortName: "NGPC", + background: "linear-gradient(135deg,#42275a,#734b6d)", + accent: "#b667d0", + }, + dos: { + label: "MS-DOS", + shortName: "DOS", + background: "linear-gradient(135deg,#203a43,#2c5364)", + accent: "#3fa7d6", + }, + n64: { + label: "Nintendo 64", + shortName: "N64", + background: "linear-gradient(135deg,#ffd700,#ff8c00)", + accent: "#ffd700", + }, + nes: { + label: "Nintendo Entertainment System (NES)", + shortName: "NES", + background: "linear-gradient(135deg,#cc2936,#8b1538)", + accent: "#cc2936", + }, + famicom: { + label: "Nintendo Family Computer (Famicom)", + shortName: "Famicom", + background: "linear-gradient(135deg,#cc2936,#8b1538)", + accent: "#cc2936", + }, + nds: { + label: "Nintendo DS", + shortName: "NDS", + background: "linear-gradient(135deg,#56ccf2,#2f80ed)", + accent: "#2f80ed", + }, + gb: { + label: "Game Boy", + shortName: "GB", + background: "linear-gradient(135deg,#8fbc8f,#556b2f)", + accent: "#8fbc8f", + }, + gbc: { + label: "Game Boy Color", + shortName: "GBC", + background: "linear-gradient(135deg,#20b2aa,#008b8b)", + accent: "#20b2aa", + }, + gba: { + label: "Game Boy Advance", + shortName: "GBA", + background: "linear-gradient(135deg,#9370db,#4b0082)", + accent: "#9370db", + }, + "pc-fx": { + label: "PC-FX", + shortName: "PC-FX", + background: "linear-gradient(135deg,#41295a,#2f0743)", + accent: "#b44cff", + }, + psx: { + label: "PlayStation (PS)", + shortName: "PS1", + background: "linear-gradient(135deg,#4169e1,#191970)", + accent: "#4169e1", + }, + sega32: { + label: "Sega 32X", + shortName: "32X", + background: "linear-gradient(135deg,#f7971e,#ffd200)", + accent: "#ffbf00", + }, + segacd: { + label: "Sega CD", + shortName: "Sega CD", + background: "linear-gradient(135deg,#2980b9,#2c3e50)", + accent: "#4fa3ff", + }, + gamegear: { + label: "Sega Game Gear", + shortName: "GG", + background: "linear-gradient(135deg,#141e30,#243b55)", + accent: "#4f7fbf", + }, + sms: { + label: "Sega Master System", + shortName: "SMS", + background: "linear-gradient(135deg,#ff6347,#dc143c)", + accent: "#ff6347", + }, + genesis: { + label: "Sega Genesis / Megadrive", + shortName: "Genesis", + background: "linear-gradient(135deg,#1e90ff,#0f4c75)", + accent: "#1e90ff", + }, + saturn: { + label: "Sega Saturn", + shortName: "Saturn", + background: "linear-gradient(135deg,#141e30,#243b55)", + accent: "#4f7fbf", + }, + snes: { + label: "Super Nintendo Entertainment System (SNES)", + shortName: "SNES", + background: "linear-gradient(135deg,#e22828,#f81414)", + accent: "#e22828", + }, + sfam: { + label: "Super Famicom", + shortName: "SFC", + background: "linear-gradient(135deg,#e22828,#f81414)", + accent: "#e22828", + }, + tg16: { + label: "TurboGrafx-16 / PC Engine", + shortName: "TG-16", + background: "linear-gradient(135deg,#ff9966,#ff5e62)", + accent: "#ff7b54", + }, + virtualboy: { + label: "Virtual Boy", + shortName: "VBoy", + background: "linear-gradient(135deg,#8e0e00,#1f1c18)", + accent: "#ff2a2a", + }, + wonderswan: { + label: "WonderSwan", + shortName: "WS", + background: "linear-gradient(135deg,#457fca,#5691c8)", + accent: "#4f8edb", + }, + "wonderswan-color": { + label: "WonderSwan Color", + shortName: "WSC", + background: "linear-gradient(135deg,#396afc,#2948ff)", + accent: "#456dff", + }, +}; + +export function isSupportedPlatform(slug: string): boolean { + return Object.keys(_SUPPORTED_PLATFORMS).includes(slug); +} + +export function getPlatformTheme(slug: string): SupportedPlatform | undefined { + return _SUPPORTED_PLATFORMS[slug]; +} diff --git a/frontend/src/console/index.css b/frontend/src/console/index.css new file mode 100644 index 000000000..75806af63 --- /dev/null +++ b/frontend/src/console/index.css @@ -0,0 +1,195 @@ +@import "tailwindcss"; + +:root { + --motion-fast: 150ms; + --motion-med: 220ms; + --motion-slow: 360ms; + --elev-1: 0 6px 24px rgba(0, 0, 0, 0.35); + --elev-2: 0 10px 32px rgba(0, 0, 0, 0.45); +} + +html, +body, +#app { + height: 100%; + background: #38286a; +} + +* { + box-sizing: border-box; +} + +@keyframes shimmer { + 0% { + background-position: 200% 0; + } + 100% { + background-position: -200% 0; + } +} + +/* Hide scrollbars (cross-browser) */ +.no-scrollbar { + -ms-overflow-style: none !important; /* IE and Edge */ + scrollbar-width: none !important; /* Firefox */ + scrollbar-color: transparent transparent !important; /* Firefox ensure transparent */ +} +.no-scrollbar::-webkit-scrollbar { + width: 0 !important; /* Chrome, Safari */ + height: 0 !important; + display: none !important; + background: transparent !important; + -webkit-appearance: none !important; +} +.no-scrollbar::-webkit-scrollbar:horizontal { + height: 0 !important; + display: none !important; +} +.no-scrollbar::-webkit-scrollbar-thumb { + background: transparent !important; + border: none !important; +} +.no-scrollbar::-webkit-scrollbar-track { + background: transparent !important; +} +.no-scrollbar::-webkit-scrollbar-corner { + background: transparent !important; +} +.no-scrollbar::-webkit-scrollbar-button { + width: 0 !important; + height: 0 !important; + display: none !important; +} + +/* Console Page Transitions */ +/* Slide Left (Going Forward/Deeper) */ +.slide-left-enter-active, +.slide-left-leave-active { + transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1); + position: relative; + width: 100%; + height: 100%; + min-height: 100vh; + overflow: hidden; +} +.slide-left-enter-from { + opacity: 0; + transform: translateX(60px); +} +.slide-left-leave-to { + opacity: 0; + transform: translateX(-60px); +} + +/* Slide Right (Going Back) */ +.slide-right-enter-active, +.slide-right-leave-active { + transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1); + position: relative; + width: 100%; + height: 100%; + min-height: 100vh; + overflow: hidden; +} +.slide-right-enter-from { + opacity: 0; + transform: translateX(-60px); +} +.slide-right-leave-to { + opacity: 0; + transform: translateX(60px); +} + +/* Slide Up (Entering Play Mode) */ +.slide-up-enter-active, +.slide-up-leave-active { + transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); + position: relative; + width: 100%; + height: 100%; + min-height: 100vh; + overflow: hidden; +} +.slide-up-enter-from { + opacity: 0; + transform: translateY(30px); +} +.slide-up-leave-to { + opacity: 0; + transform: translateY(-30px); +} + +/* Slide Down (Exiting Play Mode) */ +.slide-down-enter-active, +.slide-down-leave-active { + transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); + position: relative; + width: 100%; + height: 100%; + min-height: 100vh; + overflow: hidden; +} +.slide-down-enter-from { + opacity: 0; + transform: translateY(-30px); +} +.slide-down-leave-to { + opacity: 0; + transform: translateY(30px); +} + +/* Fade (Same Level or First Load) */ +.fade-enter-active, +.fade-leave-active { + transition: all 0.2s cubic-bezier(0.23, 1, 0.32, 1); + position: relative; + width: 100%; + height: 100%; + min-height: 100vh; + overflow: hidden; +} +.fade-enter-from, +.fade-leave-to { + opacity: 0; +} + +/* Ensure smooth transitions */ +.slide-left-enter-active > *, +.slide-right-enter-active > *, +.slide-up-enter-active > *, +.slide-down-enter-active > *, +.fade-enter-active > * { + transition: inherit; +} + +.console-root { + background: + var( + --theme-background, + url("/assets/console/default/backgrounds/background.svg") + ) + center/cover fixed, + #38286a !important; + min-height: 100vh; + width: 100%; +} + +.console-root::before { + content: ""; + position: fixed; + inset: 0; + pointer-events: none; + z-index: 0; +} + +.console-root > * { + position: relative; + z-index: 1; +} + +.play-root { + position: fixed !important; + inset: 0 !important; + z-index: 70 !important; + transform: none !important; +} diff --git a/frontend/src/console/input/actions.ts b/frontend/src/console/input/actions.ts new file mode 100644 index 000000000..81ba3b9dc --- /dev/null +++ b/frontend/src/console/input/actions.ts @@ -0,0 +1,14 @@ +export type InputAction = + | "moveUp" + | "moveDown" + | "moveLeft" + | "moveRight" + | "confirm" + | "back" + | "menu" + | "delete" + | "tabNext" + | "tabPrev" + | "toggleFavorite"; + +export type InputListener = (action: InputAction) => boolean | void; diff --git a/frontend/src/console/input/bus.ts b/frontend/src/console/input/bus.ts new file mode 100644 index 000000000..1ec842de2 --- /dev/null +++ b/frontend/src/console/input/bus.ts @@ -0,0 +1,57 @@ +import type { InputAction, InputListener } from "./actions"; +import { sfxForAction, playSfx } from "../utils/sfx"; + +export class InputBus { + private scopes: Array> = []; + private globalShortcuts: Set = new Set(); + + pushScope(): () => void { + const set = new Set(); + this.scopes.push(set); + return () => this.popScope(set); + } + + private popScope(scope: Set) { + const idx = this.scopes.lastIndexOf(scope); + if (idx >= 0) this.scopes.splice(idx, 1); + } + + subscribe(listener: InputListener): () => void { + const top = this.scopes[this.scopes.length - 1]; + if (!top) throw new Error("No active input scope. Call pushScope() first."); + top.add(listener); + return () => top.delete(listener); + } + + subscribeGlobal(listener: InputListener): () => void { + this.globalShortcuts.add(listener); + return () => this.globalShortcuts.delete(listener); + } + + dispatch(action: InputAction): boolean { + for (let i = this.scopes.length - 1; i >= 0; i--) { + const scope = this.scopes[i]; + for (const listener of scope) { + const handled = listener(action); + if (handled) { + const kind = sfxForAction(action); + if (kind) playSfx(kind); + return true; + } + } + } + + for (const listener of this.globalShortcuts) { + const handled = listener(action); + if (handled) { + const kind = sfxForAction(action); + if (kind) playSfx(kind); + return true; + } + } + + return false; + } +} + +export const InputBusSymbol = Symbol("InputBus"); diff --git a/frontend/src/console/input/config.ts b/frontend/src/console/input/config.ts new file mode 100644 index 000000000..c6e7140ea --- /dev/null +++ b/frontend/src/console/input/config.ts @@ -0,0 +1,62 @@ +export interface InputConfig { + rtl: boolean; + repeat: { initialDelayMs: number; repeatEveryMs: number }; + deadzone: number; + keyMap: Record; + gamepad: { + axesThreshold: number; + axisToAction: { + x: { + neg: import("./actions").InputAction; + pos: import("./actions").InputAction; + }; + y: { + neg: import("./actions").InputAction; + pos: import("./actions").InputAction; + }; + }; + buttons: Record; + }; +} + +import type { InputAction } from "./actions"; + +export const defaultInputConfig: InputConfig = { + rtl: false, + repeat: { initialDelayMs: 350, repeatEveryMs: 120 }, + deadzone: 0.2, + keyMap: { + ArrowUp: "moveUp", + ArrowDown: "moveDown", + ArrowLeft: "moveLeft", + ArrowRight: "moveRight", + Enter: "confirm", + " ": "confirm", + Backspace: "back", + f: "toggleFavorite", + F: "toggleFavorite", + x: "delete", + X: "delete", + Tab: undefined, + }, + gamepad: { + axesThreshold: 0.5, + axisToAction: { + x: { neg: "moveLeft" as InputAction, pos: "moveRight" as InputAction }, + y: { neg: "moveUp" as InputAction, pos: "moveDown" as InputAction }, + }, + buttons: { + 0: "confirm", + 1: "back", + 2: "delete", + 3: "toggleFavorite", + 8: "back", + 9: "menu", + // Standard mapping D-pad (12: Up, 13: Down, 14: Left, 15: Right) + 12: "moveUp", + 13: "moveDown", + 14: "moveLeft", + 15: "moveRight", + }, + }, +}; diff --git a/frontend/src/console/input/gamepad.ts b/frontend/src/console/input/gamepad.ts new file mode 100644 index 000000000..f8b767835 --- /dev/null +++ b/frontend/src/console/input/gamepad.ts @@ -0,0 +1,95 @@ +import { InputBus } from "./bus"; +import { defaultInputConfig } from "./config"; +import type { InputAction } from "./actions"; + +interface ButtonState { + pressed: boolean; + nextRepeatAt: number; +} + +export function attachGamepad(bus: InputBus) { + const states: Record< + string, + { + buttons: Record; + axesRepeatAt: Record<"x" | "y", number>; + } + > = {}; + const now = () => performance.now(); + + const onConnect = () => {}; + const onDisconnect = () => {}; + window.addEventListener("gamepadconnected", onConnect); + window.addEventListener("gamepaddisconnected", onDisconnect); + + let rafId = 0; + const loop = () => { + const pads = navigator.getGamepads?.() || []; + const t = now(); + for (const pad of pads) { + if (!pad) continue; + const key = `${pad.index}:${pad.id}`; + const st = (states[key] ||= { + buttons: {}, + axesRepeatAt: { x: 0, y: 0 }, + }); + + const x = pad.axes[0] || 0; + const y = pad.axes[1] || 0; + const thr = defaultInputConfig.gamepad.axesThreshold; + const delay = defaultInputConfig.repeat.initialDelayMs; + const rep = defaultInputConfig.repeat.repeatEveryMs; + const fireAxis = (axis: "x" | "y", v: number) => { + if (Math.abs(v) < thr) { + st.axesRepeatAt[axis] = 0; + return; + } + const dirAction: InputAction = + v < 0 + ? axis === "x" + ? defaultInputConfig.gamepad.axisToAction.x.neg + : defaultInputConfig.gamepad.axisToAction.y.neg + : axis === "x" + ? defaultInputConfig.gamepad.axisToAction.x.pos + : defaultInputConfig.gamepad.axisToAction.y.pos; + if (st.axesRepeatAt[axis] === 0) { + bus.dispatch(dirAction); + st.axesRepeatAt[axis] = t + delay; + } else if (t >= st.axesRepeatAt[axis]) { + bus.dispatch(dirAction); + st.axesRepeatAt[axis] = t + rep; + } + }; + fireAxis("x", x); + fireAxis("y", y); + + for (let i = 0; i < pad.buttons.length; i++) { + const b = pad.buttons[i]; + const action = defaultInputConfig.gamepad.buttons[i]; + if (!action) continue; + const prev = (st.buttons[i] ||= { pressed: false, nextRepeatAt: 0 }); + if (b.pressed) { + if (!prev.pressed) { + bus.dispatch(action); + prev.pressed = true; + prev.nextRepeatAt = t + delay; + } else if (t >= prev.nextRepeatAt) { + bus.dispatch(action); + prev.nextRepeatAt = t + rep; + } + } else { + prev.pressed = false; + prev.nextRepeatAt = 0; + } + } + } + rafId = requestAnimationFrame(loop); + }; + rafId = requestAnimationFrame(loop); + + return () => { + cancelAnimationFrame(rafId); + window.removeEventListener("gamepadconnected", onConnect); + window.removeEventListener("gamepaddisconnected", onDisconnect); + }; +} diff --git a/frontend/src/console/input/keyboard.ts b/frontend/src/console/input/keyboard.ts new file mode 100644 index 000000000..1a36bc602 --- /dev/null +++ b/frontend/src/console/input/keyboard.ts @@ -0,0 +1,22 @@ +import { InputBus } from "./bus"; +import { defaultInputConfig } from "./config"; + +export function attachKeyboard(bus: InputBus) { + const onKey = (e: KeyboardEvent) => { + const target = e.target as HTMLElement | null; + if ( + target && + (target.tagName === "INPUT" || + target.tagName === "TEXTAREA" || + target.isContentEditable) + ) { + return; + } + const action = defaultInputConfig.keyMap[e.key]; + if (!action) return; + const handled = bus.dispatch(action); + if (handled) e.preventDefault(); + }; + window.addEventListener("keydown", onKey); + return () => window.removeEventListener("keydown", onKey); +} diff --git a/frontend/src/console/utils/assetResolver.ts b/frontend/src/console/utils/assetResolver.ts new file mode 100644 index 000000000..b8bca7a18 --- /dev/null +++ b/frontend/src/console/utils/assetResolver.ts @@ -0,0 +1,34 @@ +import { useConsoleTheme } from "@/stores/consoleTheme"; + +// supported image formats +export type SupportedFormat = "svg" | "png" | "jpg" | "jpeg" | "webp"; + +export type AssetType = "systems" | "bezels" | "backgrounds"; + +// cache to avoid redundant checks +const assetCache = new Map(); + +export function resolveAsset( + assetType: AssetType, + filename: string, + preferredFormat: SupportedFormat = "svg", + themeName?: string, +): string { + const themeStore = useConsoleTheme(); + const currentTheme = themeName || themeStore.themeName; + const baseFilename = filename.replace(/\.(svg|png|jpg|jpeg|webp)$/i, ""); + + // check cache first + const cacheKey = `${currentTheme}:${assetType}:${baseFilename}`; + if (assetCache.has(cacheKey)) { + return assetCache.get(cacheKey)!; + } + + const assetPath = `/assets/console/${currentTheme}/${assetType}/${baseFilename}.${preferredFormat}`; + assetCache.set(cacheKey, assetPath); + return assetPath; +} + +export function clearAssetCache(): void { + assetCache.clear(); +} diff --git a/frontend/src/console/utils/sfx.ts b/frontend/src/console/utils/sfx.ts new file mode 100644 index 000000000..d2ad82043 --- /dev/null +++ b/frontend/src/console/utils/sfx.ts @@ -0,0 +1,263 @@ +let sfxEnabled = true; + +export function setSfxEnabled(enabled: boolean): void { + sfxEnabled = enabled; + localStorage.setItem("console-sfx-enabled", enabled ? "true" : "false"); +} + +export function getSfxEnabled(): boolean { + return sfxEnabled; +} + +export function initializeSfx(): void { + const saved = localStorage.getItem("console-sfx-enabled"); + if (saved !== null) { + sfxEnabled = saved === "true"; + } +} + +let ctx: AudioContext | null = null; +function ensureCtx() { + if (ctx) return ctx; + if (typeof window === "undefined") return null; + if (!window.AudioContext) return null; + + ctx = new window.AudioContext(); + return ctx; +} + +export type SfxType = + | "move" + | "confirm" + | "back" + | "error" + | "delete" + | "favorite"; + +interface ClickOpts { + toneHz?: number; // fundamental pitch component + noise?: number; // 0..1 noise mix + duration?: number; // seconds + gain?: number; // peak gain + lowpass?: number; // low-pass cutoff + pitchDecay?: number; // seconds until pitch falls + startFreq?: number; // optional sweep start frequency +} + +function playClick(opts: ClickOpts = {}) { + const audio = ensureCtx(); + if (!audio) return; + const now = audio.currentTime; + const { + toneHz = 420, + noise = 0.35, + duration = 0.11, + gain = 0.18, + lowpass = 3200, + pitchDecay = 0.04, + startFreq, + } = opts; + + const master = audio.createGain(); + master.gain.setValueAtTime(gain, now); + master.gain.exponentialRampToValueAtTime(0.0008, now + duration); + + // Tone (short sine/square blend for soft attack) + const osc = audio.createOscillator(); + osc.type = "sine"; + const baseFreq = startFreq ?? toneHz; + osc.frequency.setValueAtTime(baseFreq, now); + if (startFreq) { + // gentle sweep toward toneHz + osc.frequency.exponentialRampToValueAtTime(toneHz, now + pitchDecay); + } else { + // tiny downward drift for organic feel + osc.frequency.exponentialRampToValueAtTime( + Math.max(40, toneHz * 0.9), + now + pitchDecay, + ); + } + + // Light saturation via waveshaper + const shaper = audio.createWaveShaper(); + const curve = new Float32Array(128); + for (let i = 0; i < curve.length; i++) { + const x = (i / (curve.length - 1)) * 2 - 1; + curve[i] = Math.tanh(x * 1.5); + } + shaper.curve = curve; + + const toneGain = audio.createGain(); + toneGain.gain.setValueAtTime(1, now); + toneGain.gain.exponentialRampToValueAtTime(0.001, now + duration * 0.9); + + osc.connect(shaper).connect(toneGain).connect(master); + + // Noise burst + if (noise > 0) { + const noiseBuf = audio.createBuffer( + 1, + Math.max(1, audio.sampleRate * duration), + audio.sampleRate, + ); + const data = noiseBuf.getChannelData(0); + for (let i = 0; i < data.length; i++) + data[i] = (Math.random() * 2 - 1) * (1 - i / data.length); + const noiseSrc = audio.createBufferSource(); + noiseSrc.buffer = noiseBuf; + const nGain = audio.createGain(); + nGain.gain.setValueAtTime(noise, now); + nGain.gain.exponentialRampToValueAtTime(0.0001, now + duration); + noiseSrc.connect(nGain).connect(master); + noiseSrc.start(now); + noiseSrc.stop(now + duration); + } + + // Filtering for softness + const lp = audio.createBiquadFilter(); + lp.type = "lowpass"; + lp.frequency.setValueAtTime(lowpass, now); + lp.frequency.exponentialRampToValueAtTime( + lowpass * 0.6, + now + duration * 0.6, + ); + master.connect(lp).connect(audio.destination); + + osc.start(now); + osc.stop(now + duration); +} + +export function playSfx(kind: SfxType) { + if (!sfxEnabled) return; + + // Lazy resume (required on some browsers until user gesture) + ensureCtx() + ?.resume() + .catch(() => {}); + switch (kind) { + case "move": + playClick({ + toneHz: 860, + noise: 0.1, + duration: 0.02, + gain: 0.085, + lowpass: 2800, + pitchDecay: 0.035, + }); + break; + case "confirm": + playClick({ + toneHz: 680, + startFreq: 760, + noise: 0.12, + duration: 0.12, + gain: 0.1, + lowpass: 3000, + }); + setTimeout( + () => + playClick({ + toneHz: 880, + noise: 0.08, + duration: 0.07, + gain: 0.11, + lowpass: 3100, + }), + 55, + ); + break; + case "back": + playClick({ + toneHz: 300, + noise: 0.2, + duration: 0.085, + gain: 0.12, + lowpass: 1700, + }); + break; + case "error": + playClick({ + toneHz: 180, + noise: 0.4, + duration: 0.18, + gain: 0.22, + lowpass: 1500, + }); + setTimeout( + () => + playClick({ + toneHz: 140, + noise: 0.25, + duration: 0.14, + gain: 0.16, + lowpass: 1300, + }), + 70, + ); + break; + case "delete": + playClick({ + toneHz: 260, + noise: 0.35, + duration: 0.11, + gain: 0.2, + lowpass: 1600, + }); + setTimeout( + () => + playClick({ + toneHz: 180, + noise: 0.3, + duration: 0.09, + gain: 0.16, + lowpass: 1400, + }), + 55, + ); + break; + case "favorite": + playClick({ + toneHz: 600, + startFreq: 540, + noise: 0.18, + duration: 0.09, + gain: 0.17, + lowpass: 3000, + }); + setTimeout( + () => + playClick({ + toneHz: 950, + startFreq: 900, + noise: 0.1, + duration: 0.07, + gain: 0.13, + lowpass: 3400, + }), + 50, + ); + break; + } +} + +// map input actions to sfx categories +import type { InputAction } from "../input/actions"; +export function sfxForAction(action: InputAction): SfxType | undefined { + switch (action) { + case "moveLeft": + case "moveRight": + case "moveUp": + case "moveDown": + return "move"; + case "confirm": + return "confirm"; + case "back": + return "back"; + case "delete": + return "delete"; + case "toggleFavorite": + return "favorite"; + default: + return undefined; + } +} diff --git a/frontend/src/console/views/Game.vue b/frontend/src/console/views/Game.vue new file mode 100644 index 000000000..72bad2a23 --- /dev/null +++ b/frontend/src/console/views/Game.vue @@ -0,0 +1,1009 @@ + + + + + + + + Loading… + + + {{ errorMessage }} + + + This platform is not yet supported in the web player + + + + + + + + + + + + + + + + + + + + + + + + + + {{ rom.name }} + + + + + {{ + rom.platform_name || + (rom.platform_slug || "RETRO")?.toString().toUpperCase() + }} + + + {{ releaseYear }} + + + {{ regions[0] }} + + + {{ genres.join(", ") }} + + + + + {{ rom.summary }} + + + + + ▶ + Play + + + Details + + + + + + SAVE STATES + + + + + + STATE + + + + {{ + relativeTime(st.updated_at) + }} + + + + + + + + + + + + + + Screenshots + + + + + + + + mdi-image-outline + + + + + mdi-image-outline + + + + + + + + + + + + + + + + + Description + + + + + {{ rom.summary }} + + + + + + + + + + + Details + + + + + + + + Companies + + + {{ companies.join(", ") }} + + + + + Genres + + + {{ genres.join(", ") }} + + + + + Release Year + + + {{ releaseYear }} + + + + + Regions + + + {{ regions.join(", ") }} + + + + + File Size + + + {{ Math.round(rom.files[0].file_size_bytes / 1024) }} + KB + + + + + File + + + {{ rom.files[0].file_name || "Unknown" }} + + + + + + + + + + + + + + + + diff --git a/frontend/src/console/views/GamesList.vue b/frontend/src/console/views/GamesList.vue new file mode 100644 index 000000000..130976446 --- /dev/null +++ b/frontend/src/console/views/GamesList.vue @@ -0,0 +1,406 @@ + + + + + + + + Loading games… + + + {{ error }} + + + + No games found. + + + + + + + + + + {{ L }} + + + + + + + + diff --git a/frontend/src/console/views/Home.vue b/frontend/src/console/views/Home.vue new file mode 100644 index 000000000..372439e10 --- /dev/null +++ b/frontend/src/console/views/Home.vue @@ -0,0 +1,720 @@ + + + + + + + + + Console + + + + + Loading platforms… + + + {{ error }} + + + + + Platforms + + + + ◀ + + + ▶ + + + + + + + + + + + + Recently Played + + + + ◀ + + + ▶ + + + + + + + + + + + + Collections + + + + ◀ + + + ▶ + + + + + + + + + + + + + ⏻ + + + ⛶ + + + ⚙ + + + + + + + + + + diff --git a/frontend/src/console/views/Play.vue b/frontend/src/console/views/Play.vue new file mode 100644 index 000000000..09776c072 --- /dev/null +++ b/frontend/src/console/views/Play.vue @@ -0,0 +1,819 @@ + + + + + + + + + + + + Loading emulator… + + + Loading emulator (CDN)… + + + Failed to load emulator + + {{ loaderError }} + + + + + + Press Start + Select (or Backspace) to exit + + + + + + + + + Exit Game + + + ✕ + + + + + + + + {{ opt.label }} + + SAVING… + + + + {{ opt.desc }} + + + + {{ savingState && opt.id === "save" ? "SAVING" : "" }} + + + + + + {{ saveError }} + + + + + + + + + + + + diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 0a1e69567..a1b818a3d 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -9,6 +9,7 @@ import storeHeartbeat from "@/stores/heartbeat"; import "@/styles/common.css"; import "@/styles/fonts.css"; import "@/styles/scrollbar.css"; +import "@/console/index.css"; import { createApp } from "vue"; async function initializeData() { diff --git a/frontend/src/plugins/router.ts b/frontend/src/plugins/router.ts index 951ac1ad9..9cbb7fef1 100644 --- a/frontend/src/plugins/router.ts +++ b/frontend/src/plugins/router.ts @@ -34,6 +34,11 @@ export const ROUTES = { ADMINISTRATION: "administration", SERVER_STATS: "server-stats", NOT_FOUND: "404", + CONSOLE_HOME: "console-home", + CONSOLE_PLATFORM: "console-platform", + CONSOLE_COLLECTION: "console-collection", + CONSOLE_ROM: "console-rom", + CONSOLE_PLAY: "console-play", } as const; const routes = [ @@ -224,6 +229,38 @@ const routes = [ }, ], }, + // Console mode (separate UI namespace under /console) + { + path: "/console", + component: () => import("@/console/Layout.vue"), + children: [ + { + path: "", + name: ROUTES.CONSOLE_HOME, + component: () => import("@/console/views/Home.vue"), + }, + { + path: "platform/:id", + name: ROUTES.CONSOLE_PLATFORM, + component: () => import("@/console/views/GamesList.vue"), + }, + { + path: "collection/:id", + name: ROUTES.CONSOLE_COLLECTION, + component: () => import("@/console/views/GamesList.vue"), + }, + { + path: "rom/:rom", + name: ROUTES.CONSOLE_ROM, + component: () => import("@/console/views/Game.vue"), + }, + { + path: "rom/:rom/play", + name: ROUTES.CONSOLE_PLAY, + component: () => import("@/console/views/Play.vue"), + }, + ], + }, ]; interface RoutePermissions { diff --git a/frontend/src/services/api/collection.ts b/frontend/src/services/api/collection.ts index e26e35fe6..abe6b0964 100644 --- a/frontend/src/services/api/collection.ts +++ b/frontend/src/services/api/collection.ts @@ -18,11 +18,10 @@ async function createCollection({ collection: Partial; }): Promise<{ data: Collection }> { const formData = new FormData(); - formData.append("name", collection.name || ""); formData.append("description", collection.description || ""); formData.append("url_cover", collection.url_cover || ""); - formData.append("rom_ids", JSON.stringify(collection.rom_ids)); + formData.append("rom_ids", JSON.stringify(collection.rom_ids || [])); if (collection.artwork) formData.append("artwork", collection.artwork); return api.post(`/collections`, formData, { @@ -98,8 +97,9 @@ async function updateCollection({ formData.append("name", collection.name || ""); formData.append("description", collection.description || ""); formData.append("url_cover", collection.url_cover || ""); - formData.append("rom_ids", JSON.stringify(collection.rom_ids)); + formData.append("rom_ids", JSON.stringify(collection.rom_ids || [])); if (collection.artwork) formData.append("artwork", collection.artwork); + return api.put(`/collections/${collection.id}`, formData, { headers: { "Content-Type": "multipart/form-data", diff --git a/frontend/src/stores/collections.ts b/frontend/src/stores/collections.ts index 68eb73ce1..93a2fe9db 100644 --- a/frontend/src/stores/collections.ts +++ b/frontend/src/stores/collections.ts @@ -18,7 +18,7 @@ export default defineStore("collections", { allCollections: [] as Collection[], virtualCollections: [] as VirtualCollection[], smartCollections: [] as SmartCollection[], - favoriteCollection: {} as Collection | undefined, + favoriteCollection: undefined as Collection | undefined, filterText: "" as string, fetchingCollections: false as boolean, fetchingSmartCollections: false as boolean, @@ -67,6 +67,11 @@ export default defineStore("collections", { .getCollections() .then(({ data: collections }) => { this.allCollections = collections; + + // Set the favorite collection + const fav = collections.find((c) => c.is_favorite); + if (fav) this.favoriteCollection = fav; + resolve(collections); }) .catch((error) => { diff --git a/frontend/src/stores/console.ts b/frontend/src/stores/console.ts new file mode 100644 index 000000000..32fd3c6ef --- /dev/null +++ b/frontend/src/stores/console.ts @@ -0,0 +1,75 @@ +import { ROUTES } from "@/plugins/router"; +import { defineStore } from "pinia"; + +export type NavigationMode = "systems" | "recent" | "collections" | "controls"; + +export default defineStore("console", { + state: () => ({ + platformIndex: 0, + recentIndex: 0, + collectionsIndex: 0, + controlIndex: 0, + navigationMode: "systems" as NavigationMode, + perPlatformGameIndex: {} as Record, + perCollectionGameIndex: {} as Record, + perPlatformScrollTop: {} as Record, + perCollectionScrollTop: {} as Record, + }), + getters: { + consoleMode: (state) => { + // @ts-expect-error PiniaCustomProperties + const { name } = state.$router.currentRoute.value; + return ( + name === ROUTES.CONSOLE_HOME || + name === ROUTES.CONSOLE_PLATFORM || + name === ROUTES.CONSOLE_COLLECTION || + name === ROUTES.CONSOLE_ROM || + name === ROUTES.CONSOLE_PLAY + ); + }, + }, + actions: { + setHomeState(payload: { + platformIndex?: number; + recentIndex?: number; + collectionsIndex?: number; + controlIndex?: number; + navigationMode?: NavigationMode; + }) { + if (payload.platformIndex !== undefined) + this.platformIndex = payload.platformIndex; + if (payload.recentIndex !== undefined) + this.recentIndex = payload.recentIndex; + if (payload.collectionsIndex !== undefined) + this.collectionsIndex = payload.collectionsIndex; + if (payload.controlIndex !== undefined) + this.controlIndex = payload.controlIndex; + if (payload.navigationMode !== undefined) + this.navigationMode = payload.navigationMode; + }, + setPlatformGameIndex(platformId: number, idx: number) { + this.perPlatformGameIndex[platformId] = idx; + }, + getPlatformGameIndex(platformId: number) { + return this.perPlatformGameIndex[platformId] ?? 0; + }, + setCollectionGameIndex(collectionId: number, idx: number) { + this.perCollectionGameIndex[collectionId] = idx; + }, + getCollectionGameIndex(collectionId: number) { + return this.perCollectionGameIndex[collectionId] ?? 0; + }, + setPlatformScroll(platformId: number, top: number) { + this.perPlatformScrollTop[platformId] = top; + }, + getPlatformScroll(platformId: number) { + return this.perPlatformScrollTop[platformId] ?? 0; + }, + setCollectionScroll(collectionId: number, top: number) { + this.perCollectionScrollTop[collectionId] = top; + }, + getCollectionScroll(collectionId: number) { + return this.perCollectionScrollTop[collectionId] ?? 0; + }, + }, +}); diff --git a/frontend/src/stores/consoleTheme.ts b/frontend/src/stores/consoleTheme.ts new file mode 100644 index 000000000..c7eac7040 --- /dev/null +++ b/frontend/src/stores/consoleTheme.ts @@ -0,0 +1,76 @@ +import { defineStore } from "pinia"; +import { ref, computed } from "vue"; +import { resolveAsset, clearAssetCache } from "@/console/utils/assetResolver"; + +export const useConsoleTheme = defineStore("consoleTheme", () => { + const themeName = ref("default"); + const availableThemes = ["default", "neon"]; + + function setTheme(newThemeName: string): void { + clearAssetCache(); + + themeName.value = newThemeName; + localStorage.setItem("console-theme", newThemeName); + + updateThemeCSS(); + updateBackgroundCSS(); + } + + function initializeTheme(): void { + const savedTheme = localStorage.getItem("console-theme") || "default"; + + themeName.value = savedTheme; + updateThemeCSS(); + updateBackgroundCSS(); + } + + function updateThemeCSS(): void { + // remove existing theme styles + const existingThemeLink = document.getElementById( + "console-theme-css", + ) as HTMLLinkElement; + if (existingThemeLink) { + existingThemeLink.remove(); + } + + // add new theme CSS + const link = document.createElement("link"); + link.id = "console-theme-css"; + link.rel = "stylesheet"; + link.href = `/assets/console/${themeName.value}/theme.css`; + document.head.appendChild(link); + } + + function updateBackgroundCSS(): void { + const backgroundPath = resolveAsset( + "backgrounds", + "background", + "svg", + themeName.value, + ); + const backgroundUrl = `url("${backgroundPath}")`; + document.documentElement.style.setProperty( + "--theme-background", + backgroundUrl, + ); + } + + const themeDisplayName = computed(() => { + switch (themeName.value) { + case "default": + return "Default"; + case "light": + return "Light"; + default: + return themeName.value; + } + }); + + return { + themeName, + availableThemes, + themeDisplayName, + setTheme, + initializeTheme, + }; +}); diff --git a/frontend/src/views/Scan.vue b/frontend/src/views/Scan.vue index b462590a1..18ead5f8d 100644 --- a/frontend/src/views/Scan.vue +++ b/frontend/src/views/Scan.vue @@ -11,7 +11,7 @@ import { storeToRefs } from "pinia"; import { computed, ref, watch, type DefineComponent } from "vue"; import { useDisplay } from "vuetify"; import { useI18n } from "vue-i18n"; -import { useAutoScroll } from "@/composables/use-auto-scroll"; +import { useAutoScroll } from "@/composables/useAutoScroll"; const LOCAL_STORAGE_METADATA_SOURCES_KEY = "scan.metadataSources"; diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 8fa902afc..0d5688a7d 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@vue/tsconfig/tsconfig.dom.json", - "include": ["src/**/*.ts", "src/**/*.vue"], + "include": ["src/**/*.ts", "src/**/*.vue", "src/**/*.d.ts"], + "exclude": ["node_modules"], "types": ["node", "lodash", "js-cookie", "vue-router", "vue"], "compilerOptions": { "composite": true, diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 765456e5b..23151d81e 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -7,6 +7,7 @@ import mkcert from "vite-plugin-mkcert"; // Utilities import { URL, fileURLToPath } from "node:url"; import { defineConfig, loadEnv } from "vite"; +import tailwindcss from "@tailwindcss/vite"; // https://vitejs.dev/config/ export default defineConfig(({ mode }) => { @@ -24,6 +25,7 @@ export default defineConfig(({ mode }) => { target: "esnext", }, plugins: [ + tailwindcss(), vue({ template: { transformAssetUrls }, }),
{{ rom.summary }}
+ {{ saveError }} +