feat(skins): ship protected built-ins and instance defaults
No files matched your search
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: webspeak-skin-development
|
||||
description: Create, refine, package, and verify WebSpeak visual skins while preserving the product's translated content, fixed component geometry, and interactions.
|
||||
---
|
||||
|
||||
# WebSpeak skin development
|
||||
|
||||
Use this skill when editing or authoring a WebSpeak `.wskin` package, the ILLUSIA built-in skin, or skin-facing UI hooks. A skin changes artwork and visual treatment; WebSpeak owns page structure, text, and behavior. The administrator console is deliberately outside the skin scope.
|
||||
|
||||
## Before editing
|
||||
|
||||
- Read [`docs/SKIN_DEVELOPMENT.md`](../../../docs/SKIN_DEVELOPMENT.md) for the current package validator and public hooks.
|
||||
- Use [`docs/examples/illusia-voice/`](../../../docs/examples/illusia-voice/) and [`docs/examples/ILLUSIA-VOICE.md`](../../../docs/examples/ILLUSIA-VOICE.md) as the reference implementation. Do not restore the removed Aurora Voice sample.
|
||||
- Inspect the actual component markup for `data-ws-page`, `data-ws-part`, and `data-ws-state` hooks. Treat Vue classes and incidental DOM structure as private.
|
||||
|
||||
## Preserve the interface
|
||||
|
||||
- Keep WebSpeak's translations and semantic content as the baseline. Add `content.json` only when a text override is an explicit part of the request; never use it to implement visual artwork.
|
||||
- Skin only with supported visual CSS and package-local images/fonts. The upload validator rejects layout, positioning, sizing, spacing, clipping, text-flow, and interaction-geometry changes. Do not work around it with selectors, pseudo-elements, or animation.
|
||||
- Never hide or obstruct critical controls, make a card or player move/resize, change a floating menu into a modal, or make artwork intercept pointer input. Keep `/admin/**` unskinned.
|
||||
- Use the host's reserved artwork hooks for layered character art and the headphone scene. Prefer transparent assets and `background-size: contain` where the reference requires the full character or chibi to remain visible; arrange the artwork around the fixed hook rather than changing its geometry.
|
||||
- Build visual depth with separate background, surface, and foreground artwork already exposed by the hooks. Avoid duplicate static decorations when an animated replacement exists. For motion, keep waveforms/sonar smooth and restrained, honor reduced-motion preferences, and retain readable focus, error, mute, and speaking states.
|
||||
- Keep skin-specific CSS variables under `--skin-*`. Use only package-local assets and confirm their redistribution rights.
|
||||
|
||||
## Verify and package
|
||||
|
||||
1. Compare the implementation with its visual reference at desktop and narrow widths. Check the homepage, voice workspace, empty chat, member list, screen-share player, selectors, and `/demo`; verify no crop, overflow, text collision, or control overlap.
|
||||
2. Check all five interface languages, day/night modes, keyboard focus, and reduced-motion behavior. Confirm the admin console is unchanged.
|
||||
3. Run `npm test` and `npm --prefix web run build`. Fix validator or build failures rather than weakening the layout guardrails.
|
||||
4. Package the contents of the skin directory so `manifest.json` is at the archive root, then import it through `/admin/skins` and retest the installed `.wskin` in a visitor session.
|
||||
|
||||
The three shipped skins—default day, default night, and ILLUSIA—are protected built-ins. Do not change their IDs or introduce upload/update flows that can disable, replace, or remove them.
|
||||
@@ -1,5 +1,42 @@
|
||||
# Changelog
|
||||
|
||||
## [0.2.5-preview] — 2026-09-27(相对 0.2.4)
|
||||
|
||||
### 中文
|
||||
|
||||
- 新增 `.wskin` 视觉皮肤系统:用户可在首页、语音工作区和 `/demo` 选择外观;皮肤可更换背景、美术素材与组件视觉,但页面结构、排版空间、控件位置和交互仍由 WebSpeak 固定提供,管理后台不受皮肤影响。
|
||||
- 管理员可在皮肤库启用/停用自定义皮肤并指定实例默认皮肤;访客手动选择会保留,未手动选择的访客采用实例默认。默认日间、默认夜间和 ILLUSIA 风是受保护内置皮肤,不能删除、停用或替换。
|
||||
- 将完成度不足的 Aurora Voice 示例移除,以 ILLUSIA 风作为完整皮肤开发样例;细化首页装饰、语音区跨层级立绘、耳机场景、聊天空状态和屏幕播放器表现,并修复深色模式控件可读性、组件溢出和皮肤加载闪烁。
|
||||
- 新增官方仓库皮肤开发 Agent Skill,配套更新开发规范与多语言功能说明;访客总数在统计暂不可用时也不会低于当前访客序号。
|
||||
|
||||
### English
|
||||
|
||||
- Added the `.wskin` visual skin system. Visitors can choose appearances on the home page, voice workspace, and `/demo`; skins may customize artwork and component visuals while WebSpeak retains page structure, layout, control placement, and behavior. The administration console remains unskinned.
|
||||
- Administrators can enable/disable custom skins and set an instance default. Deliberate visitor choices are preserved; visitors without an explicit choice receive the instance default. Default Day, Default Night, and ILLUSIA are protected built-ins that cannot be removed, disabled, or replaced.
|
||||
- Removed the unfinished Aurora Voice sample and made ILLUSIA the complete reference skin. Refined homepage artwork, layered voice-room character art and headphone scene, the empty-chat backdrop, and the screen-share player; fixed dark-mode control contrast, overflow, and skin-load flashes.
|
||||
- Added the repository's official skin-development Agent Skill and synchronized the guide and localized feature notes. The displayed visitor total also remains at least as high as the current visitor ordinal when the counter is unavailable.
|
||||
|
||||
### Deutsch
|
||||
|
||||
- Das visuelle `.wskin`-System wurde ergänzt. Besucher können das Design auf der Startseite, im Sprachbereich und unter `/demo` wählen. Skins dürfen Grafiken und die visuelle Darstellung anpassen; Seitenstruktur, Layout, Positionen der Bedienelemente und Verhalten bleiben von WebSpeak vorgegeben. Die Administrationskonsole bleibt ungestaltet.
|
||||
- Administratoren können eigene Skins aktivieren/deaktivieren und ein Standarddesign für die Instanz festlegen. Eine bewusst getroffene Besucherauswahl bleibt erhalten; ohne eigene Auswahl gilt der Instanzstandard. Tagesmodus, Nachtmodus und ILLUSIA sind geschützte integrierte Skins und können weder gelöscht noch deaktiviert oder ersetzt werden.
|
||||
- Das unfertige Aurora-Voice-Beispiel wurde entfernt; ILLUSIA ist nun das vollständige Referenzdesign. Startseitenkunst, Ebenenillustration und Kopfhörerszene im Sprachbereich, leerer Chat-Hintergrund und Bildschirmfreigabe-Player wurden verfeinert. Außerdem wurden dunkle Bedienelemente, Überläufe und Skin-Ladeblitze korrigiert.
|
||||
- Der offizielle Skin-Entwicklungs-Agent-Skill des Repositorys wurde ergänzt; Anleitung und lokalisierte Funktionsübersichten wurden aktualisiert. Die Besucher-Gesamtzahl fällt bei nicht verfügbarem Zähler nicht unter die aktuelle Besuchernummer.
|
||||
|
||||
### Русский
|
||||
|
||||
- Добавлена визуальная система скинов `.wskin`: посетители могут выбирать оформление на главной странице, в голосовом пространстве и в `/demo`. Скины меняют иллюстрации и внешний вид компонентов, а структуру, компоновку, расположение элементов управления и поведение задаёт WebSpeak. Панель администратора не оформляется скинами.
|
||||
- Администраторы могут включать и отключать пользовательские скины и задавать оформление по умолчанию для экземпляра. Явный выбор посетителя сохраняется; без него используется настройка экземпляра. Дневная тема, ночная тема и ILLUSIA — защищённые встроенные скины, которые нельзя удалить, отключить или заменить.
|
||||
- Удалён незавершённый пример Aurora Voice; полной эталонной темой стала ILLUSIA. Улучшены иллюстрации главной страницы, многослойный персонаж и сцена с наушниками в голосовой комнате, фон пустого чата и проигрыватель трансляции экрана. Исправлены контраст элементов в тёмном режиме, переполнение и вспышки при загрузке скина.
|
||||
- В официальный репозиторий добавлен Agent Skill для разработки скинов, обновлены руководство и локализованные описания функций. При недоступности счётчика общее число посетителей не опускается ниже текущего номера посетителя.
|
||||
|
||||
### 日本語
|
||||
|
||||
- `.wskin` ビジュアルスキン機能を追加しました。ホーム、音声ワークスペース、`/demo` で外観を選択できます。背景や素材、コンポーネントの見た目を変更できますが、ページ構造、レイアウト、操作部品の位置と動作は WebSpeak が管理します。管理コンソールには適用されません。
|
||||
- 管理者はカスタムスキンの有効/無効と、インスタンスのデフォルトスキンを設定できます。訪問者が明示的に選んだスキンは維持され、未選択の場合はインスタンスのデフォルトを使用します。昼、夜、ILLUSIA の3種類は保護された内蔵スキンで、削除・無効化・置換できません。
|
||||
- 未完成の Aurora Voice サンプルを削除し、ILLUSIA を完成版のリファレンスにしました。ホームのアート、音声画面の重ね合わせ立ち絵とヘッドホン背景、空のチャット背景、画面共有プレーヤーを調整し、ダークモードの視認性、はみ出し、読み込み時のちらつきを修正しました。
|
||||
- 公式リポジトリにスキン開発 Agent Skill を追加し、ガイドと各言語の機能説明を更新しました。カウンターを取得できない場合も、訪問者総数が現在の訪問者番号を下回らないようにしました。
|
||||
|
||||
## [0.2.4] — 2026-09-22
|
||||
|
||||
### 中文
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
- [Русский](./docs/README.ru.md)
|
||||
- [日本語](./docs/README.ja.md)
|
||||
- [皮肤开发规范](./docs/SKIN_DEVELOPMENT.md)
|
||||
- [WebSpeak 皮肤开发 Agent Skill](./.agents/skills/webspeak-skin-development/SKILL.md)
|
||||
|
||||
## 社区 · Community
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@ Die öffentliche Demo läuft in Hongkong. Netzwerkbedingungen und Auslastung kö
|
||||
| Desktop-Begleitton | Audio eines freigegebenen Fensters oder Browser-Tabs im aktuellen Kanal teilen. |
|
||||
| Identität und Zugriff | Gespeicherte Identität, eigene Ziele und widerrufbare Einladungslinks mit Ablaufzeit. |
|
||||
| Administration | Ziele, Zugriff, WebRTC, Relays, Einladungen, Sitzungen, Protokolle, Diagnosen und Backups verwalten. |
|
||||
| Oberfläche | Chinesische, englische, deutsche, russische und japanische Oberfläche, helle/dunkle Designs sowie responsive Desktop-/Mobilansicht. |
|
||||
| Skins | Geschützte Tages-, Nacht- und ILLUSIA-Skins sowie instanzverwaltete `.wskin`-Designs mit Aktivierungs- und Standardauswahl im Adminbereich. |
|
||||
| Oberfläche | Chinesische, englische, deutsche, russische und japanische Oberfläche sowie responsive Desktop-/Mobilansicht. |
|
||||
| Selbsthosting | Daten bleiben beim Betreiber; Docker-, Windows-x64- und Linux-x64-Bereitstellung sind verfügbar. |
|
||||
|
||||
## 🖼️ Screenshots
|
||||
@@ -153,6 +154,7 @@ Relay deaktivieren und speichern, um die Option von der Willkommensseite zu entf
|
||||
|
||||
| Version | Datum | Zusammenfassung |
|
||||
| --- | --- | --- |
|
||||
| 0.2.5-preview | 2026-09-27 | `.wskin`-Skins, Aktivierungs-/Standardverwaltung und geschützte Tages-, Nacht- und ILLUSIA-Skins ergänzt; unfertiges Aurora-Voice-Beispiel entfernt, Skin-Ladeblitze, dunkle Bedienelemente und Artwork-Ebenen im Sprachbereich korrigiert sowie offiziellen Skin-Entwicklungs-Agent-Skill hinzugefügt. |
|
||||
| [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) | 2026-09-22 | Plattformübergreifendes P2P-Bildschirmteilen zwischen Browsern und nativen TeamSpeak-6-Clients ergänzt; STUN-/externes-TURN-Konfiguration, Live-Player und Zuschauerstatus, Aufnahmeoptionen bis 1080p/60 FPS und WebRTC-Statistiken hinzugefügt; Bildschirmfreigabe-Interaktion verbessert und Besucherzählung ergänzt. |
|
||||
| [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) | 2026-09-19 | Mitgliederplanung und direkte Verschiebung nach Berechtigung ergänzt; Avatar-, Stummschaltstatus- und Identitätsunterstützung hinzugefügt; Screenshots und Dokumentation für alle fünf Sprachen aktualisiert. |
|
||||
| [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) | 2026-09-17 | Browserseitige Mikrofon-Geräuschunterdrückung, russische und japanische Oberfläche sowie sprachabhängige Begrüßungstexte ergänzt; Lautstärkeinteraktion und Fehlertexte/-codes auf Basis von PR #2 verbessert. |
|
||||
|
||||
@@ -25,7 +25,8 @@ The public demo is hosted in Hong Kong and its network conditions and load may b
|
||||
| Desktop accompaniment | Select an audio-enabled window or browser tab and share its sound with the current channel. |
|
||||
| Identity and access | Remembered identity, visitor-defined targets, and revocable expiring invite links. |
|
||||
| Administration | Manage targets, access policy, WebRTC, relays, invites, sessions, logs, diagnostics, and backups. |
|
||||
| User experience | Chinese, English, German, Russian, and Japanese UI, light/dark themes, and responsive desktop/mobile layouts. |
|
||||
| Skins | Protected Day, Night, and ILLUSIA skins, plus instance-managed `.wskin` appearances with administrator enable/default controls. |
|
||||
| User experience | Chinese, English, German, Russian, and Japanese UI with responsive desktop/mobile layouts. |
|
||||
| Self-hosting | Data stays with the operator; Docker, Windows x64, and Linux x64 deployment options are provided. |
|
||||
|
||||
## 🖼️ Screenshots
|
||||
@@ -153,6 +154,7 @@ Disable and save the relay configuration to remove the relay option from the wel
|
||||
|
||||
| Version | Date | Summary |
|
||||
| --- | --- | --- |
|
||||
| 0.2.5-preview | 2026-09-27 | Added `.wskin` skins, administrator enable/default controls, and protected Day/Night/ILLUSIA built-ins; removed the unfinished Aurora Voice sample, fixed skin-load flashes, dark-control contrast, and voice-room artwork layering, and added the official skin-development Agent Skill. |
|
||||
| [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) | 2026-09-22 | Added cross-platform P2P screen sharing between browsers and native TeamSpeak 6 clients; added STUN/external-TURN configuration, live player and viewer state, 1080p/60 FPS capture settings, and WebRTC statistics; refined screen-share interactions and added visitor numbering. |
|
||||
| [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) | 2026-09-19 | Added channel member scheduling and permission-aware direct moves; added avatar, mute-state, and remembered-identity support; refreshed feature screenshots and documentation for all five languages. |
|
||||
| [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) | 2026-09-17 | Added browser-side microphone noise suppression, Russian and Japanese UI, and per-language welcome text; refined volume interaction and error messages/codes on top of PR #2. |
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
| BGM共有 | デスクトップブラウザで音声付きウィンドウやタブの音をチャンネルに共有。 |
|
||||
| ID とアクセス | ID の保存、接続先の指定、期限・回数付き招待リンク。 |
|
||||
| 管理コンソール | 接続先、アクセス、WebRTC、中継、招待、セッション、ログ、診断、バックアップ。 |
|
||||
| インターフェース | 中文、English、Deutsch、Русский、日本語、ライト/ダークテーマ、レスポンシブ表示。 |
|
||||
| スキン | 保護された昼・夜・ILLUSIA スキンに加え、管理者が有効化とデフォルトを管理するインスタンス `.wskin` に対応。 |
|
||||
| インターフェース | 中文、English、Deutsch、Русский、日本語、レスポンシブ表示。 |
|
||||
|
||||
## 🖼️ インターフェースのスクリーンショット
|
||||
|
||||
@@ -134,6 +135,7 @@ npm start
|
||||
|
||||
| バージョン | 内容 |
|
||||
| --- | --- |
|
||||
| 0.2.5-preview | 2026-09-27 | `.wskin` スキン、管理者向けの有効化/デフォルト設定、保護された昼・夜・ILLUSIA 内蔵スキンを追加。未完成の Aurora Voice サンプルを削除し、読み込み時のちらつき、ダークモードの視認性、音声画面のアートレイヤーを修正。公式スキン開発 Agent Skill も追加しました。 |
|
||||
| [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) | ブラウザと TeamSpeak 6 ネイティブクライアント間のクロスプラットフォーム P2P 画面共有を追加しました。STUN/外部 TURN 設定、プレーヤーと視聴者状態、1080p/60 FPS 取得設定、WebRTC 統計に対応し、共有操作と訪問者番号も改善しました。 |
|
||||
| [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) | チャンネルメンバーの移動操作と権限に応じた直接移動を追加し、アバター表示、ミュート状態の同期、保存 ID の復元に対応しました。5 言語のスクリーンショットとドキュメントも更新しました。 |
|
||||
| [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) | ブラウザ側マイクノイズ抑制、ロシア語・日本語 UI、言語別ウェルカム文を追加。音量操作と PR #2 を基にしたエラー表示・エラーコードを改善しました。 |
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
| Фоновая музыка | На компьютере можно поделиться звуком окна или вкладки с текущим каналом. |
|
||||
| Идентичность и доступ | Сохранение идентичности, собственные цели и приглашения с ограничением срока и числа использований. |
|
||||
| Панель администратора | Цели, доступ, WebRTC, ретрансляторы, приглашения, сессии, логи, диагностика и резервные копии. |
|
||||
| Интерфейс | 中文, English, Deutsch, Русский и 日本語, светлая/тёмная тема и адаптивная верстка. |
|
||||
| Скины | Защищённые дневная, ночная и ILLUSIA-темы, а также `.wskin` экземпляра с управлением включением и темой по умолчанию в панели администратора. |
|
||||
| Интерфейс | 中文, English, Deutsch, Русский и 日本語, адаптивная верстка. |
|
||||
|
||||
## 🖼️ Скриншоты интерфейса
|
||||
|
||||
@@ -134,6 +135,7 @@ npm start
|
||||
|
||||
| Версия | Изменения |
|
||||
| --- | --- |
|
||||
| 0.2.5-preview | 2026-09-27 | Добавлены скины `.wskin`, управление включением и темой по умолчанию, а также защищённые темы «День», «Ночь» и ILLUSIA; удалён незавершённый пример Aurora Voice, исправлены мерцание при загрузке скина, контраст элементов в тёмном режиме и слои иллюстраций в голосовом пространстве; добавлен официальный Agent Skill для разработки скинов. |
|
||||
| [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) | Добавлена кроссплатформенная P2P-трансляция экрана между браузерами и нативными клиентами TeamSpeak 6; добавлены настройка STUN/внешнего TURN, проигрыватель и состояние зрителей, захват до 1080p/60 FPS и статистика WebRTC; улучшено управление трансляцией и добавлен номер посетителя. |
|
||||
| [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) | Добавлены управление перемещением участников и прямое перемещение с учётом прав; поддержаны аватары, синхронизация микрофона и восстановление идентичности; обновлены скриншоты и документация для пяти языков. |
|
||||
| [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) | Добавлены браузерное шумоподавление микрофона, русский и японский интерфейсы и отдельные тексты приветствия; улучшены управление громкостью и сообщения/коды ошибок на основе PR #2. |
|
||||
|
||||
@@ -25,7 +25,8 @@ WebSpeak 是一个可自行部署的 TeamSpeak 3 / TeamSpeak 6 网页客户端
|
||||
| 桌面端伴奏 | 在桌面浏览器选择带音频的窗口或标签页,将声音分享给当前频道。 |
|
||||
| 身份与访问 | 支持身份保持、访客自定义目标和可撤销、可过期的邀请链接。 |
|
||||
| 管理控制台 | 管理目标、访问策略、WebRTC、中继、邀请、会话、日志、诊断和备份。 |
|
||||
| 界面体验 | 提供中文、English、Deutsch、Русский、日本語、浅色/深色主题及响应式桌面/移动布局。 |
|
||||
| 皮肤 | 提供日间、夜间和 ILLUSIA 三款受保护皮肤,并支持实例自定义 `.wskin` 外观与管理员默认/启用管理。 |
|
||||
| 界面体验 | 提供中文、English、Deutsch、Русский、日本語及响应式桌面/移动布局。 |
|
||||
| 自托管 | 数据由部署者保存,提供 Docker、Windows x64 和 Linux x64 方案。 |
|
||||
|
||||
## 🖼️ 界面截图
|
||||
@@ -153,6 +154,7 @@ docker run -d --name webspeak-relay --restart unless-stopped --network host \
|
||||
|
||||
| 版本 | 日期 | 摘要 |
|
||||
| --- | --- | --- |
|
||||
| 0.2.5-preview | 2026-09-27 | 新增 `.wskin` 皮肤系统、管理员启用/默认管理和受保护的日间/夜间/ILLUSIA 内置皮肤;移除未完成 Aurora Voice 样例,修复皮肤加载闪烁、暗色控件可读性与语音界面美术层级,并加入官方皮肤开发 Agent Skill。 |
|
||||
| [v0.2.4](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.4) | 2026-09-22 | 新增浏览器与 TeamSpeak 6 原生客户端之间的跨端 P2P 屏幕共享;提供 STUN/外部 TURN 配置、直播播放器、观众状态、1080p/60 FPS 采集设置和 WebRTC 统计;优化屏幕共享交互并新增访客编号。 |
|
||||
| [v0.2.3](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.3) | 2026-09-19 | 新增频道成员调度与按权限直接移动;支持头像、静音状态同步和身份恢复;更新五种语言的功能截图与文档。 |
|
||||
| [v0.2.2](https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak/releases/tag/v0.2.2) | 2026-09-17 | 提供浏览器端麦克风降噪、俄语和日语支持及按语言欢迎词配置;优化音量交互和 PR #2 基础上的错误提示与错误代码。 |
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# WebSpeak 皮肤开发规范
|
||||
|
||||
本文说明如何制作、校验并发布 WebSpeak `.wskin` 皮肤包。皮肤可以彻底重做公开页面的视觉表现:背景图、字体、布局、头像框、滚动条、按钮、设置面板、语音成员、聊天和屏幕共享播放器都可以用 CSS 定制;首页文字和功能介绍也可以按语言替换。
|
||||
本文说明如何制作、校验并发布 WebSpeak `.wskin` 皮肤包。皮肤可为公开页面逐个部件定制二次元美术表现:背景、素材、配色、轮廓、圆角、阴影、头像装饰、按钮质感、滚动条颜色和播放器外观都可以自定义;但组件的位置、尺寸、排列、文字排版空间及交互结构由 WebSpeak 固定提供,皮肤不得重排或覆盖。
|
||||
|
||||
皮肤不注入 HTML 或 JavaScript,也不改变语音、权限、连接、拖动和屏幕共享行为。页面结构和必要控件由应用提供,皮肤通过样式与有限的文案配置改变呈现。**管理后台 `/admin/**` 不属于皮肤范围,始终使用 WebSpeak 自己的固定样式。**
|
||||
页面结构、必要控件和所有基础翻译均由 WebSpeak 提供。皮肤包不必携带文案;如果只包含样式与美术素材,所有界面文字仍由 WebSpeak 按当前语言显示。`content.json` 仅用于可选覆盖,缺少的语言或字段回退到 WebSpeak 的基础内容。皮肤不注入 HTML 或 JavaScript,也不改变语音、权限、连接、拖动和屏幕共享行为。**管理后台 `/admin/**` 不属于皮肤范围,始终使用 WebSpeak 自己的固定样式。**
|
||||
|
||||
可直接查看 [Aurora Voice 示例源码](examples/aurora-voice/),其中包含本地图片资源、多语言首页文案、演示页翻译、头像框、滚动条、播放器和动效的完整用法。
|
||||
可直接查看 [ILLUSIA 风示例源码](examples/illusia-voice/) 与 [示例说明](examples/ILLUSIA-VOICE.md)。它使用本地美术素材和 CSS 完整定制首页、语音房间、成员区、聊天空状态及播放器,同时沿用 WebSpeak 提供的基础翻译;也是管理控制台内置且不可移除的示例皮肤。
|
||||
|
||||
## 使用与发布
|
||||
|
||||
管理员在 `/admin/skins` 上传 `.wskin` 包,可查看预览、替换同 ID 版本或删除皮肤。皮肤发布到当前 WebSpeak 实例后,访客可在连接首页、语音工作区或 `/demo` 的“皮肤”选择器中切换;选择保存在该浏览器。皮肤包会缓存在浏览器本地;页面启动时会查询实例目录,目录可用且版本更新时拉取新包。若网络不可用,已缓存的版本仍可使用。
|
||||
管理员在 `/admin/skins` 查看三款随 WebSpeak 提供的内置皮肤,并可导入、替换、启用/停用或删除实例自定义皮肤;还可指定访客首次访问时使用的默认皮肤。默认日间、默认夜间和 ILLUSIA 风为受保护内置项,不可替换、停用或移除。访客手动选择的皮肤保存在该浏览器,后续实例默认值变更不会覆盖该明确选择;仅自动套用过旧默认值的浏览器会采用最新实例默认值。皮肤包会缓存在浏览器本地;页面启动时会查询实例目录,目录可用且版本更新时拉取新包。若网络不可用,已缓存的版本仍可使用。
|
||||
|
||||
选择器提供“日间”“夜间”和实例发布的皮肤;没有“跟随系统”选项。自定义皮肤同时继承当前日间或夜间的基础令牌,再由自己的 CSS 覆盖。切换为日间或夜间时,会停用当前自定义包。
|
||||
选择器提供默认日间、默认夜间、内置 ILLUSIA 风和已启用的实例皮肤;没有“跟随系统”选项。停用的实例皮肤不向访客展示,也不能从服务端下载;若它是当前默认皮肤,系统会安全回退到默认日间。管理员设置的默认值只影响未手动选择皮肤的访客。自定义皮肤是独立的外观选择,不继承之前的日间或夜间模式;皮肤未覆盖的部件回退到浅色基础外观,避免一套组件混入另一套模式。自定义皮肤可自行声明 `color-scheme` 并定义深色外观;切换为日间或夜间时,会停用当前自定义包。文档级 `data-theme` 仍由 WebSpeak 保留给管理后台使用。
|
||||
|
||||
## 包结构
|
||||
|
||||
@@ -32,23 +32,22 @@ assets/brand.woff2 # 可选:自带字体
|
||||
```json
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "studio.aurora-voice",
|
||||
"name": "Aurora Voice",
|
||||
"version": "1.0.0",
|
||||
"author": "Your name",
|
||||
"license": "CC-BY-4.0",
|
||||
"description": "An aurora-inspired voice workspace.",
|
||||
"id": "community.illusia-voice",
|
||||
"name": "ILLUSIA风",
|
||||
"version": "1.0.25",
|
||||
"author": "WebSpeak Project",
|
||||
"license": "All rights reserved",
|
||||
"description": "A visual-only art skin using the WebSpeak interface translations.",
|
||||
"entry": "skin.css",
|
||||
"content": "content.json",
|
||||
"preview": "assets/preview.jpg",
|
||||
"minAppVersion": "0.2.4"
|
||||
"preview": "assets/background-composite.webp",
|
||||
"minAppVersion": "0.2.5-preview"
|
||||
}
|
||||
```
|
||||
|
||||
| 字段 | 规则 |
|
||||
| --- | --- |
|
||||
| `schemaVersion` | 当前必须为数字 `1`。 |
|
||||
| `id` | 必需,最多 80 个字符;只允许小写字母、数字、点和连字符;不能以 `builtin.` 开头。发布后不要更改。 |
|
||||
| `id` | 必需,最多 80 个字符;只允许小写字母、数字、点和连字符;不能以 `builtin.` 开头,也不能使用受保护 ID `builtin.light`、`builtin.dark` 或 `community.illusia-voice`。发布后不要更改。 |
|
||||
| `name`、`author`、`license` | 必需,各最多 80 个字符。资源授权由作者负责确认。 |
|
||||
| `version`、`minAppVersion` | 必需,使用语义化版本号,例如 `1.2.0`。 |
|
||||
| `entry` | 必需,包内 CSS 文件路径,最多 120 个字符。 |
|
||||
@@ -60,7 +59,7 @@ assets/brand.woff2 # 可选:自带字体
|
||||
|
||||
## 首页内容和文案
|
||||
|
||||
`content.json` 可按 locale 覆盖连接首页内容和公开界面文案;不提供的字段继续使用应用文案,不会显示空白。当前允许 1–20 个 locale,locale 写作 `en`、`zh-CN`、`ja-JP` 等形式。`defaultLocale` 必须指向一个已定义的 locale。示例:
|
||||
`content.json` 完全可选。WebSpeak 自带中文、英语、德语、俄语和日语的基础内容,因此纯美术皮肤无需复制翻译文件。若希望为皮肤定制部分文案,可按 locale 覆盖连接首页内容和公开界面文案;未定义的语言、字段或翻译键会回退到 WebSpeak 内容,不要求皮肤重复提供整套文字。当前允许 1–20 个 locale,locale 写作 `en`、`zh-CN`、`ja-JP` 等形式。`defaultLocale` 必须指向一个已定义的 locale。示例:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -101,9 +100,9 @@ assets/brand.woff2 # 可选:自带字体
|
||||
运行时把 `skin.css` 的每个选择器限定在皮肤自己的公开页面根节点内:
|
||||
|
||||
```css
|
||||
/* 作者只写部件选择器;运行时自动加上皮肤和页面根作用域。 */
|
||||
/* 选择器必须使用公开的页面/部件钩子;运行时再加上皮肤根作用域。 */
|
||||
[data-ws-page="voice"] [data-ws-part="voice.member.avatar"] {
|
||||
outline: 2px solid var(--accent);
|
||||
outline: 2px solid var(--skin-accent);
|
||||
outline-offset: 4px;
|
||||
}
|
||||
```
|
||||
@@ -111,12 +110,12 @@ assets/brand.woff2 # 可选:自带字体
|
||||
实际规则会被限定在类似下面的根节点内,不会匹配 `/admin/**`:
|
||||
|
||||
```css
|
||||
.ws-skin-root[data-ws-skin="studio.aurora-voice"] [data-ws-page="voice"] [data-ws-part="voice.member.avatar"]
|
||||
[data-ws-page="voice"] [data-ws-part="voice.member.avatar"]
|
||||
```
|
||||
|
||||
也可以写 `:root { --accent: ... }` 设置皮肤根令牌;`:root` 会被转换成当前皮肤根。不要写 `:global()`、`html`、`body` 或 Vue 内部 class 作为公开接口。组件 class 可能随版本调整,`data-ws-part` 才是皮肤作者接口。
|
||||
也可以写 `:root { --skin-accent: ... }` 设置皮肤自己的变量;`:root` 会被转换成当前皮肤根。选择器必须包含 `:root`、`[data-ws-page]` 或 `[data-ws-part]`。不要写 `:global()`、`html`、`body` 或 Vue 内部 class 作为公开接口。组件 class 可能随版本调整,`data-ws-part` 才是皮肤作者接口。自定义变量名必须使用 `--skin-` 前缀,不能覆盖 WebSpeak 的内部令牌。
|
||||
|
||||
页面根节点使用 `data-ws-page` 区分 `home`、`voice` 和 `demo`。使用 `data-ws-state` 选择明确状态,如 `active`、`idle`、`current`、`drag-over`、`dragging`、`speaking`、`connected`、`self`、`mine` 或 `other`。语音成员还提供 `data-ws-speaking="true|false"` 和 `data-ws-self="true|false"`。交互元素会带有 `data-ws-critical="true"`;没有专属部件名称的按钮、链接、输入框、滑块和可拖动成员会使用通用部件 `data-ws-part="control"`,并以 `data-ws-control-kind` 标出 `button`、`link`、`input`、`checkbox`、`range`、`select`、`textarea`、`menuitem` 或 `draggable`。
|
||||
页面根节点使用 `data-ws-page` 区分 `home`、`voice` 和 `demo`。使用 `data-ws-state` 选择明确状态,如 `active`、`idle`、`current`、`open`、`closed`、`drag-over`、`dragging`、`speaking`、`connected`、`self`、`mine` 或 `other`。语音成员还提供 `data-ws-speaking="true|false"` 和 `data-ws-self="true|false"`。交互元素会带有 `data-ws-critical="true"`;没有专属部件名称的按钮、链接、输入框、滑块和可拖动成员会使用通用部件 `data-ws-part="control"`,并以 `data-ws-control-kind` 标出 `button`、`link`、`input`、`checkbox`、`range`、`select`、`textarea`、`menuitem` 或 `draggable`。
|
||||
|
||||
### 已发布的部件名称
|
||||
|
||||
@@ -124,33 +123,44 @@ assets/brand.woff2 # 可选:自带字体
|
||||
|
||||
| 页面区域 | `data-ws-part` |
|
||||
| --- | --- |
|
||||
| 通用 | `app`、`app.toast`、`control` |
|
||||
| 首页 | `home`、`home.header`、`home.brand`、`home.header-tools`、`home.gateway-status`、`home.content`、`home.hero`、`home.hero.eyebrow`、`home.hero.title`、`home.hero.description`、`home.features`、`home.feature`、`home.visitors`、`home.join-card`、`home.join-title`、`home.join-description`、`home.notice`、`home.form`、`home.server-target`、`home.field-label`、`home.field`、`home.relay-choice`、`home.relay-choice.copy`、`home.server-history`、`home.server-history.group`、`home.favorite-toggle`、`home.identity`、`home.connect`、`home.security-note`、`home.footer`、`home.community-dialog` |
|
||||
| 语音工作区 | `voice.shell`、`voice.workspace`、`voice.header`、`voice.header-actions`、`voice.breadcrumbs`、`voice.performance`、`voice.performance.panel`、`voice.performance.route`、`voice.performance.metrics`、`voice.performance.status`、`voice.performance.webrtc-stats`、`voice.connection-status`、`voice.audio-status`、`voice.poke`、`voice.scroll`、`voice.content`、`voice.activity`、`voice.activity-heading`、`voice.screen-share-error`、`voice.members`、`voice.members.empty`、`voice.member`、`voice.member.avatar-wrap`、`voice.member.avatar`、`voice.member.name`、`voice.member.status`、`voice.member.live-indicator`、`voice.member.stop-share`、`voice.member.share-actions`、`voice.member-panel`、`voice.member-panel.heading`、`voice.member-panel.search`、`voice.member-panel.channels`、`voice.channel-group`、`voice.channel-group.heading`、`voice.channel-group.members`、`voice.member-row`、`voice.member-row.avatar`、`voice.member-row.copy`、`voice.member-row.flags`、`voice.member-row.volume`、`voice.whisper-strip`、`voice.audio-dock`、`voice.audio-dock.microphone`、`voice.audio-dock.microphone-panel`、`voice.audio-dock.output`、`voice.audio-dock.output-panel`、`voice.audio-settings`、`voice.mobile-more`、`voice.mobile-nav` |
|
||||
| 聊天与菜单 | `voice.chat`、`voice.chat.tabs`、`voice.chat.tab`、`voice.chat.heading`、`voice.chat.messages`、`voice.chat.event`、`voice.chat.message`、`voice.chat.message-avatar`、`voice.chat.message-body`、`voice.chat.empty`、`voice.chat.composer`、`voice.context-menu-backdrop`、`voice.context-menu`、`voice.context-menu.header`、`voice.context-menu.move-submenu` |
|
||||
| 通用 | `app`、`app.toast`、`control`、`skin.trigger`、`skin.menu`、`skin.option`、`language.trigger`、`language.menu`、`language.option` |
|
||||
| 首页 | `home`、`home.header`、`home.brand`、`home.header-tools`、`home.gateway-status`、`home.content`、`home.hero`、`home.hero.eyebrow`、`home.hero.title`、`home.hero.description`、`home.features`、`home.feature`、`home.visitors`、`home.join-card`、`home.join-card.waveform`、`home.join-card.sonar`、`home.join-title`、`home.join-description`、`home.notice`、`home.form`、`home.server-target`、`home.field-label`、`home.field`、`home.relay-choice`、`home.relay-choice.copy`、`home.server-history`、`home.server-history.group`、`home.favorite-toggle`、`home.identity`、`home.connect`、`home.security-note`、`home.footer`、`home.community-dialog` |
|
||||
| 语音工作区 | `voice.shell`、`voice.workspace`、`voice.header`、`voice.header-actions`、`voice.breadcrumbs`、`voice.performance`、`voice.performance.panel`、`voice.performance.route`、`voice.performance.metrics`、`voice.performance.status`、`voice.performance.webrtc-stats`、`voice.connection-status`、`voice.audio-status`、`voice.poke`、`voice.scroll`、`voice.content`、`voice.activity`、`voice.activity.artwork`、`voice.activity-heading`、`voice.screen-share-error`、`voice.members`、`voice.members.empty`、`voice.member`、`voice.member.avatar-wrap`、`voice.member.avatar`、`voice.member.name`、`voice.member.status`、`voice.member.live-indicator`、`voice.member.stop-share`、`voice.member.share-actions`、`voice.member-panel`、`voice.member-panel.heading`、`voice.member-panel.search`、`voice.member-panel.channels`、`voice.channel-group`、`voice.channel-group.heading`、`voice.channel-group.members`、`voice.member-row`、`voice.member-row.avatar`、`voice.member-row.copy`、`voice.member-row.flags`、`voice.member-row.volume`、`voice.whisper-strip`、`voice.audio-dock`、`voice.audio-dock.microphone`、`voice.audio-dock.microphone-panel`、`voice.audio-dock.output`、`voice.audio-dock.output-panel`、`voice.audio-settings`、`voice.mobile-more`、`voice.mobile-nav` |
|
||||
| 聊天与菜单 | `voice.chat`、`voice.chat.tabs`、`voice.chat.tab`、`voice.chat.heading`、`voice.chat.messages`、`voice.chat.event`、`voice.chat.message`、`voice.chat.message-avatar`、`voice.chat.message-body`、`voice.chat.message-bubble`、`voice.chat.empty`、`voice.chat.composer`、`voice.context-menu-backdrop`、`voice.context-menu`、`voice.context-menu.header`、`voice.context-menu.move-submenu` |
|
||||
| 屏幕共享 | `voice.screen-share-settings`、`voice.screen-share-settings.heading`、`voice.screen-share-settings.fields`、`voice.screen-share-settings.note`、`voice.screen-share-settings.actions`、`voice.screen-player`、`voice.screen-player.stage`、`voice.screen-player.video`、`voice.screen-player.placeholder`、`voice.screen-player.exit`、`voice.screen-player.viewers`、`voice.screen-player.viewer-avatar`、`voice.screen-player.live`、`voice.screen-player.source`、`voice.screen-player.controls`、`voice.screen-player.volume`、`voice.screen-player.fullscreen` |
|
||||
| `/demo` 演示页 | `demo.header`、`demo.brand`、`demo.header-tools`、`demo.badge`、`demo.skin-switcher`、`demo.language-switcher`、`demo.home-link`、`demo.reconnect`、`demo.reconnect.restore`、`demo.layout`、`demo.channels`、`demo.channels.heading`、`demo.channel`、`demo.channel.select`、`demo.channel.members`、`demo.main`、`demo.hero`、`demo.live`、`demo.hero.title`、`demo.hero.description`、`demo.hero.online`、`demo.wave`、`demo.voice-heading`、`demo.voice-grid`、`demo.voice-card`、`demo.avatar`、`demo.member-name`、`demo.member-status`、`demo.chat.heading`、`demo.chat.tabs`、`demo.chat.tab`、`demo.chat.messages`、`demo.chat.message`、`demo.chat.empty`、`demo.chat.composer`、`demo.chat.input`、`demo.chat.send`、`demo.actions`、`demo.actions.heading`、`demo.action.speaking`、`demo.action.poke`、`demo.action.reconnect`、`demo.note`、`demo.user`、`demo.poke-notification`、`demo.poke.dismiss` |
|
||||
|
||||
`voice.member.avatar` 是语音活动区头像;`voice.member-row.avatar` 是右侧成员树头像。状态属性还会使用 `current`、`drag-over`、`dragging` 和 `self`。当前根节点以及屏幕共享播放器、弹窗、菜单都属于同一皮肤作用域。
|
||||
`voice.member.avatar` 是语音活动区头像;`voice.member-row.avatar` 是右侧成员树头像。状态属性还会使用 `current`、`drag-over`、`dragging`、`self`、`events-empty` 和 `messages-empty`。当前根节点以及屏幕共享播放器、弹窗、菜单都属于同一皮肤作用域。
|
||||
|
||||
`voice.activity.artwork` 是位于语音活动区内容上方的固定装饰平面。皮肤可以在其上绘制带透明背景的立绘,让角色压住成员卡片或直播画面的边缘;平面本身不占布局空间、不拦截点击,成员和播放器控件仍保持可交互。只通过背景图及背景定位/缩放来适配素材,不改变其定位和层级。
|
||||
|
||||
`voice.member-panel` 的 `::before` 是成员栏耳机/场景插画层,宿主已固定它的尺寸、位置、透视和前后层级;皮肤只需提供透明背景素材并调整背景显示、滤镜或阴影,不能自行定位或改变尺寸。消息空状态的 `::before` / `::after` 预留给气泡等小型装饰,宿主负责形状位置;皮肤可以绘制边框、底色和点状背景,但标题和说明文字仍由 WebSpeak 翻译并保持可见。
|
||||
|
||||
皮肤与语言选择器的触发按钮、菜单和每个选项都提供上述通用部件钩子。`skin.option` 另带有 `data-ws-skin-id`(内置项为 `builtin.light`、`builtin.dark` 和 `community.illusia-voice`,实例皮肤项为其清单 ID);`language.option` 带有 `data-ws-language`。皮肤可以据此只装饰自己的选择项,而不影响其他皮肤、语言选项或选择器交互。例如:
|
||||
|
||||
```css
|
||||
[data-ws-part="skin.option"][data-ws-skin-id="community.illusia-voice"][role="option"] {
|
||||
background-image: linear-gradient(110deg, #efffff, #c8f3f2);
|
||||
}
|
||||
```
|
||||
|
||||
### 令牌、字体、动效和图片
|
||||
|
||||
皮肤可自定义任意作用域内的普通 CSS,不限于改色。推荐先定义自己的变量,再为公开部件编写布局:
|
||||
皮肤只负责“画什么样”,不负责“放在哪里”。可用的视觉规则包括文字/背景颜色、背景图片及其裁切、圆角、轮廓、阴影、滤镜和动画;边框可用不占空间的内阴影绘制。推荐先定义皮肤变量,再为公开部件编写视觉规则:
|
||||
|
||||
```css
|
||||
:root {
|
||||
--page-bg: #091317;
|
||||
--panel: #142329;
|
||||
--text: #edf8f5;
|
||||
--muted: #9db5af;
|
||||
--accent: #47dcc4;
|
||||
--card-radius: 20px;
|
||||
--skin-page-bg: #091317;
|
||||
--skin-panel: #142329;
|
||||
--skin-text: #edf8f5;
|
||||
--skin-muted: #9db5af;
|
||||
--skin-accent: #47dcc4;
|
||||
--skin-card-radius: 20px;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player"] {
|
||||
border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
|
||||
border-radius: var(--card-radius);
|
||||
box-shadow: 0 18px 50px #0008;
|
||||
border-radius: var(--skin-card-radius);
|
||||
box-shadow: 0 18px 50px #0008, inset 0 0 0 1px color-mix(in srgb, var(--skin-accent) 50%, transparent);
|
||||
}
|
||||
```
|
||||
|
||||
@@ -158,15 +168,23 @@ assets/brand.woff2 # 可选:自带字体
|
||||
|
||||
```css
|
||||
@font-face {
|
||||
font-family: "Aurora Sans";
|
||||
src: url("assets/aurora-sans.woff2") format("woff2");
|
||||
font-family: "ILLUSIA Sans";
|
||||
src: url("assets/illusia-sans.woff2") format("woff2");
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
[data-ws-page="voice"] { font-family: "Aurora Sans", sans-serif; }
|
||||
[data-ws-page="voice"] { font-family: "ILLUSIA Sans", sans-serif; }
|
||||
```
|
||||
|
||||
字体必须随包附带并拥有可再分发许可。字体族名和 `@keyframes` / `@layer` 名称会自动隔离,避免与其他皮肤冲突。请支持 `prefers-reduced-motion`,并确保焦点、错误、静音、正在说话等状态仍容易辨认。
|
||||
字体必须随包附带并拥有可再分发许可。自定义字体可能改变不同语言的字宽,因此校验器会给出提示;发布前必须检查中文、英语、德语、俄语和日语下的标题、按钮和长文案是否仍完整可读。字体族名和 `@keyframes` / `@layer` 名称会自动隔离,避免与其他皮肤冲突。请支持 `prefers-reduced-motion`,并确保焦点、错误、静音、正在说话等状态仍容易辨认。
|
||||
|
||||
### 固定布局与交互边界
|
||||
|
||||
皮肤校验器会拒绝改变布局、定位、尺寸、文字流向/换行或交互命中区域的 CSS 声明,包括 `display`、`position`、`inset`、`z-index`、宽高、内外边距、网格/弹性布局、间距、溢出裁切、变换、指针事件、字号、行高、字距、大小写转换和换行方式等。也不能通过 `all` 重置组件或用伪元素生成/替换文字。动画可以用于颜色、阴影、滤镜等装饰效果,但关键帧同样不能动画化布局属性。
|
||||
|
||||
因此,皮肤可以把成员头像绘制成角色徽章、给屏幕播放器加主题边框和背景、换首页美术素材,但不能移动播放器、压缩文字、扩大/缩小成员卡片、把锚定浮层改成模态弹窗,或挪动按钮的点击区域。用 `background-position` / `background-size` 只调整图片在既有区域中的裁切,不改变组件盒子。轮廓或内阴影可作为不参与排版的描边。
|
||||
|
||||
外观可以因窄屏而更换图片裁切或装饰,但 `@media` 规则也受同一限制,不能用来重排组件。上线前仍需预览桌面与窄屏、所有五种语言、日夜基础主题、键盘焦点、减少动效偏好,并确认浮层和必要控件保持在原位、文字未被裁切。
|
||||
|
||||
## 安全边界和限制
|
||||
|
||||
@@ -186,7 +204,7 @@ assets/brand.woff2 # 可选:自带字体
|
||||
|
||||
压缩包路径穿越、重复/冲突路径、符号链接、异常 ZIP 元数据和本地文件头/目录不一致都会被拒绝。仅允许受支持的 CSS at-rule:`@media`、`@supports`、`@container`、具名 `@layer`、`@font-face` 和 keyframes。`@import`、脚本、HTML、外部网络资源会被拒绝;`!important` 可用于皮肤作用域内的样式。字体 `local()` 也会拒绝,避免绕过包内字体来源。
|
||||
|
||||
必要操作控件(加入/退出、麦克风、设置、菜单、屏幕共享退出、音量、全屏等)及其布局容器不能被隐藏或整体重置。校验器会拦截常见的 `display`、`visibility`、`opacity`、`pointer-events`、遮罩、裁切、变换、滤镜和 `all` 隐藏/重置方式。若确实需要移除纯装饰部分,只允许对以下独立元素使用这些写法:
|
||||
必要操作控件(加入/退出、麦克风、设置、菜单、屏幕共享退出、音量、全屏等)及其布局容器不能被隐藏或整体重置。只有下列明确标记为可选的装饰部件,才允许通过不改变排版盒子的透明度效果淡出:
|
||||
|
||||
```css
|
||||
[data-ws-part="home.hero.eyebrow"]
|
||||
@@ -207,25 +225,25 @@ assets/brand.woff2 # 可选:自带字体
|
||||
[data-ws-part="demo.note"]
|
||||
```
|
||||
|
||||
上面必须使用单独的精确属性选择器;不能通过父容器、组合选择器或子元素间接隐藏/重置内容。关键帧只有在其动画仅被这些可隐藏部件引用时,才可使用隐藏写法;若关键帧也被必要控件引用或动画名通过变量指定,则会被拒绝。你仍可自由重排、装饰这些元素,并使用皮肤包自带的图片和字体。校验仅覆盖常见风险写法,不是对任意 CSS 的形式化安全证明;CSS 仍可能造成遮挡、不可读或破坏布局,皮肤作者需在预览中验证每个必要控件。
|
||||
上面必须使用单独的精确属性选择器;不能通过父容器、组合选择器或子元素间接隐藏/重置内容。关键帧只有在其动画仅被这些可选部件引用时,才可使用透明度归零;若关键帧也被必要控件引用或动画名通过变量指定,则会被拒绝。`clip`、`clip-path` 和 `mask` 一律不允许,避免视觉裁切误伤真实控件。校验器是防止布局回归的边界,不是视觉质量证明;自定义字体、复杂背景和高对比特效仍需人工检查文字可读性与控件辨识度。
|
||||
|
||||
皮肤可重新布置甚至重画控制外观,但不得隐藏或阻断加入/退出、麦克风状态、设置、菜单、屏幕共享退出、音量、全屏等必要操作。校验器还会对固定定位或极端层级给出风险警告;校验成功不代表设计质量合格。提交前要逐页实测窄屏和桌面尺寸、深浅色、键盘焦点与减少动效设置。
|
||||
皮肤可以重画控制外观,但不能重新布置或阻断加入/退出、麦克风状态、设置、菜单、屏幕共享退出、音量、全屏等必要操作。校验成功不代表设计质量合格;提交前要逐页实测窄屏和桌面尺寸、所有界面语言、日夜基础主题、键盘焦点与减少动效设置。
|
||||
|
||||
CSS 被限定在 `.ws-skin-root` 内,管理员页面不会继承皮肤。删除实例里的包会停止从服务器提供该包;已经下载过的浏览器副本会保留在本地存储,因此仍可能在该浏览器的选择器中出现。清除该站点的浏览器数据可移除本地副本。
|
||||
|
||||
## 制作与验收
|
||||
|
||||
1. 复制 `docs/examples/aurora-voice/`,先修改 `manifest.json` 的唯一 `id`、名称、作者、版本和授权。
|
||||
1. 复制 `docs/examples/illusia-voice/`,先修改 `manifest.json` 的唯一 `id`、名称、作者、版本和授权。ILLUSIA 是完整的美术参考,不是必须沿用的角色或配色。
|
||||
2. 只使用本目录公开的 `data-ws-part`、`data-ws-page`、状态属性和包内静态资源。不要依赖 Vue 内部 class。
|
||||
3. 使用本地资源编写 `skin.css`;需要改首页文字或公开翻译时补充 `content.json`。
|
||||
4. 在包根目录生成 ZIP,再改扩展名为 `.wskin`。PowerShell 示例:
|
||||
|
||||
```powershell
|
||||
Compress-Archive -Path .\docs\examples\aurora-voice\* -DestinationPath .\aurora-voice.zip -Force
|
||||
Rename-Item .\aurora-voice.zip aurora-voice.wskin
|
||||
Compress-Archive -Path .\docs\examples\illusia-voice\* -DestinationPath .\illusia-voice.zip -Force
|
||||
Rename-Item .\illusia-voice.zip illusia-voice.wskin
|
||||
```
|
||||
|
||||
5. 在管理员后台 `/admin/skins` 上传。用访客浏览器分别检查连接首页、进入语音页和 `/demo`;测试自定义图片、所有交互控件、语音/静音状态、成员列表、聊天、屏幕共享播放器和设置。
|
||||
5. 在管理员后台 `/admin/skins` 上传。用访客浏览器分别检查连接首页、进入语音页和 `/demo`;测试自定义图片、所有交互控件、语音/静音状态、成员列表、聊天、屏幕共享播放器和设置,确认组件位置、尺寸、排列与未启用皮肤时一致。
|
||||
6. 检查至少一个窄屏尺寸和桌面尺寸,并检查焦点可见、对比度、动效偏好;确认没有第三方素材授权问题。
|
||||
|
||||
当前自动化回归涵盖 ZIP/清单验证、资源路径、CSS 隔离与拒绝规则、文案结构和服务端皮肤目录读写。视觉排版、内容遮挡和浏览器间表现仍须人工预览。
|
||||
@@ -0,0 +1,14 @@
|
||||
# ILLUSIA风
|
||||
|
||||
ILLUSIA风 is a visual-only `.wskin` example built from the local artwork in `illusia-voice/assets/`. It styles the WebSpeak home page, voice workspace, screen-share player, and `/demo` with bright glass surfaces and cyan accents. The homepage skin follows the supplied reference art for the translucent navigation, matching glass skin and language selectors, an illustrated animated ILLUSIA skin option, a floating mascot with a visibly pulsing cyan waveform and expanding halo in the join card, a softly animated cyan aurora inspired by the visitor badge, three feature tiles, character visitor badge, mascot-accented join action, and full-width curved footer. The ambient waveform and halo slow down when reduced motion is enabled instead of disappearing. The voice-room skin uses the resting chibi illustration as the message-empty backdrop and places the main character illustration on the dedicated non-interactive artwork layer so it can rest over the edge of member cards or a live screen-share player without moving or blocking their controls.
|
||||
|
||||
This package intentionally omits `content.json`: the existing WebSpeak translations supply every label and message, including the current and total visitor counts. A skin may optionally add localized copy overrides, but missing locales and fields continue to use WebSpeak's base content. Its CSS is visual-only: WebSpeak retains its component positions, dimensions, text flow, and interactions. In the voice room, the main illustration and headset use separate, non-interactive foreground layers with restrained perspective and shadows; the chat's empty state includes a CSS-drawn speech-bubble ornament, while its translated copy remains visible. The footer wave is a pre-rendered transparent asset sampled from the example's original curve, so it decorates the existing footer instead of introducing another layout element.
|
||||
|
||||
The package source is in [`illusia-voice/`](illusia-voice/). To build it from the repository root:
|
||||
|
||||
```powershell
|
||||
Compress-Archive -Path .\docs\examples\illusia-voice\* -DestinationPath .\docs\examples\illusia-voice.zip -Force
|
||||
Rename-Item .\docs\examples\illusia-voice.zip illusia-voice.wskin -Force
|
||||
```
|
||||
|
||||
Use only artwork you have permission to redistribute when publishing a skin to other WebSpeak instances.
|
||||
|
Before Width: | Height: | Size: 55 KiB |
@@ -1,40 +0,0 @@
|
||||
{
|
||||
"defaultLocale": "en",
|
||||
"locales": {
|
||||
"en": {
|
||||
"home": {
|
||||
"eyebrow": "A room of your own",
|
||||
"title": "Talk",
|
||||
"titleAccent": "together",
|
||||
"description": "A small example of custom homepage copy and feature text.",
|
||||
"welcomeTitle": "Join the room",
|
||||
"welcomeDescription": "Choose a name and connect to your TeamSpeak server.",
|
||||
"features": [
|
||||
{ "title": "Clear voice", "description": "Low-latency Opus audio." },
|
||||
{ "title": "Private by design", "description": "Your connection details stay in this session." },
|
||||
{ "title": "In sync", "description": "Channels and members update together." }
|
||||
]
|
||||
},
|
||||
"messages": {
|
||||
"demo.heroLead": "This demo is styled by the same package as the connection and voice pages.",
|
||||
"demo.speakingNow": "On stage",
|
||||
"demo.skinSelector": "Skin"
|
||||
}
|
||||
},
|
||||
"zh-CN": {
|
||||
"home": {
|
||||
"eyebrow": "属于你的语音空间",
|
||||
"title": "自在",
|
||||
"titleAccent": "畅聊",
|
||||
"description": "示例皮肤可以自定义首页文案、卡片、背景和语音面板。",
|
||||
"welcomeTitle": "进入房间",
|
||||
"welcomeDescription": "填写昵称并连接 TeamSpeak 服务器。"
|
||||
},
|
||||
"messages": {
|
||||
"demo.heroLead": "连接页、语音页和演示页都由同一皮肤包定制。",
|
||||
"demo.speakingNow": "舞台成员",
|
||||
"demo.skinSelector": "皮肤"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "community.aurora-voice",
|
||||
"name": "Aurora Voice",
|
||||
"version": "1.0.0",
|
||||
"author": "WebSpeak Project",
|
||||
"license": "AGPL-3.0-only",
|
||||
"description": "A compact example showing local artwork, full-page CSS styling, avatar frames, and localized copy.",
|
||||
"entry": "skin.css",
|
||||
"content": "content.json",
|
||||
"preview": "assets/webspeak-mark.jpg",
|
||||
"minAppVersion": "0.2.4"
|
||||
}
|
||||
@@ -1,101 +0,0 @@
|
||||
/* Every selector is automatically scoped to this package and a public page root. */
|
||||
:root {
|
||||
--page: #07151c;
|
||||
--surface: #10242b;
|
||||
--surface-raised: #17333a;
|
||||
--ink: #effdfa;
|
||||
--ink-muted: #a2c4be;
|
||||
--accent: #42dfc7;
|
||||
--accent-strong: #06a992;
|
||||
--line: rgba(104, 229, 208, .24);
|
||||
--glow: 0 18px 48px rgba(0, 0, 0, .26);
|
||||
--round-card: 22px;
|
||||
}
|
||||
|
||||
[data-ws-part="home"] {
|
||||
color: var(--ink);
|
||||
background: radial-gradient(ellipse at 50% 35%, #173b43, var(--page) 74%);
|
||||
}
|
||||
|
||||
[data-ws-part="home.join-card"],
|
||||
[data-ws-part="voice.member-panel"],
|
||||
[data-ws-part="voice.chat"],
|
||||
[data-ws-part="demo.main"],
|
||||
[data-ws-part="demo.channels"],
|
||||
[data-ws-part="demo.actions"] {
|
||||
color: var(--ink);
|
||||
background: linear-gradient(145deg, var(--surface-raised), var(--surface));
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--round-card);
|
||||
box-shadow: var(--glow);
|
||||
}
|
||||
|
||||
[data-ws-part="home.connect"],
|
||||
[data-ws-part="voice.audio-dock"],
|
||||
[data-ws-part="demo.chat.send"] {
|
||||
color: #041613;
|
||||
background: linear-gradient(110deg, var(--accent), var(--accent-strong));
|
||||
border: 1px solid rgba(162, 255, 235, .55);
|
||||
border-radius: 14px;
|
||||
box-shadow: 0 0 22px rgba(66, 223, 199, .2);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member.avatar"],
|
||||
[data-ws-part="voice.member-row.avatar"],
|
||||
[data-ws-part="demo.avatar"] {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 4px;
|
||||
box-shadow: 0 0 20px rgba(66, 223, 199, .35);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member.live-indicator"],
|
||||
[data-ws-part="demo.live"] {
|
||||
color: var(--ink);
|
||||
background: rgba(6, 169, 146, .25);
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 999px;
|
||||
box-shadow: 0 0 18px rgba(66, 223, 199, .18);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player"] {
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 20px;
|
||||
box-shadow: 0 0 36px rgba(66, 223, 199, .18);
|
||||
}
|
||||
|
||||
[data-ws-part="demo.hero"] {
|
||||
background-color: #103039;
|
||||
background-image: linear-gradient(100deg, rgba(7, 21, 28, .12), rgba(7, 21, 28, .76)), url("assets/webspeak-mark.jpg");
|
||||
background-position: center, right 22px center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover, 92px 92px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: var(--round-card);
|
||||
}
|
||||
|
||||
[data-ws-part="demo.voice-card"][data-ws-state="speaking"] {
|
||||
outline: 1px solid var(--accent);
|
||||
box-shadow: 0 0 24px rgba(66, 223, 199, .22);
|
||||
}
|
||||
|
||||
[data-ws-part="control"][data-ws-control-kind="range"] {
|
||||
accent-color: var(--accent);
|
||||
}
|
||||
|
||||
* {
|
||||
scrollbar-color: var(--accent-strong) transparent;
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
@keyframes aurora-breathe {
|
||||
0%, 100% { filter: brightness(.94); }
|
||||
50% { filter: brightness(1.12); }
|
||||
}
|
||||
|
||||
[data-ws-part="home.visitors"] {
|
||||
animation: aurora-breathe 5s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
[data-ws-part="home.visitors"] { animation: none; }
|
||||
}
|
||||
|
After Width: | Height: | Size: 1014 KiB |
|
After Width: | Height: | Size: 365 KiB |
|
After Width: | Height: | Size: 113 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 358 KiB |
|
After Width: | Height: | Size: 738 KiB |
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 249 KiB |
|
After Width: | Height: | Size: 7.7 KiB |
|
After Width: | Height: | Size: 168 KiB |
|
After Width: | Height: | Size: 217 KiB |
|
After Width: | Height: | Size: 85 KiB |
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "community.illusia-voice",
|
||||
"name": "ILLUSIA风",
|
||||
"version": "1.0.25",
|
||||
"author": "WebSpeak Project",
|
||||
"license": "All rights reserved",
|
||||
"description": "A bright original-character art skin for the home, voice room, and demo pages.",
|
||||
"entry": "skin.css",
|
||||
"preview": "assets/background-composite.webp",
|
||||
"minAppVersion": "0.2.5-preview"
|
||||
}
|
||||
@@ -0,0 +1,977 @@
|
||||
/* ILLUSIA风: bright glass surfaces, cyan accents, and project artwork. */
|
||||
:root {
|
||||
--skin-illusia-ink: #123849;
|
||||
--skin-illusia-muted: #4f6974;
|
||||
--skin-illusia-teal: #087e86;
|
||||
--skin-illusia-aqua: #47c9d4;
|
||||
--skin-illusia-glass: rgba(250, 254, 255, .96);
|
||||
--skin-illusia-line: rgba(115, 205, 218, .38);
|
||||
--skin-illusia-shadow: 0 20px 56px rgba(29, 91, 113, .16);
|
||||
}
|
||||
|
||||
/* Homepage uses the full-resolution original-character composition. */
|
||||
[data-ws-part="home"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
background-color: #eaf7fc;
|
||||
background-image:
|
||||
radial-gradient(ellipse at 14% 78%, rgba(90, 222, 230, .28), transparent 34%),
|
||||
radial-gradient(ellipse at 83% 21%, rgba(94, 190, 255, .24), transparent 30%),
|
||||
radial-gradient(ellipse at 52% 56%, rgba(190, 239, 255, .16), transparent 42%),
|
||||
linear-gradient(90deg, rgba(246, 252, 255, .91) 0%, rgba(246, 252, 255, .82) 33%, rgba(246, 252, 255, .32) 60%, rgba(246, 252, 255, .08) 100%),
|
||||
url("assets/background-composite.webp");
|
||||
background-position: 0% 100%, 100% 0%, 50% 50%, center, center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 132% 130%, 122% 124%, 116% 116%, cover, cover;
|
||||
animation: illusia-home-aura 18s ease-in-out infinite alternate;
|
||||
}
|
||||
|
||||
@keyframes illusia-home-aura {
|
||||
from { background-position: 0% 100%, 100% 0%, 50% 50%, center, center; }
|
||||
to { background-position: 20% 82%, 78% 18%, 55% 45%, center, center; }
|
||||
}
|
||||
|
||||
[data-ws-part="home.header"] {
|
||||
border-color: rgba(255, 255, 255, .85);
|
||||
border-radius: 999px;
|
||||
background: linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .45));
|
||||
box-shadow: 0 26px 80px rgba(78, 150, 173, .17), inset 0 1px 0 rgba(255, 255, 255, .9);
|
||||
backdrop-filter: blur(22px) saturate(1.18);
|
||||
}
|
||||
|
||||
[data-ws-part="home.header"] [data-ws-part="control"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(255, 255, 255, .76);
|
||||
border-radius: 999px;
|
||||
background: rgba(250, 254, 255, .84);
|
||||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .42);
|
||||
}
|
||||
|
||||
[data-ws-part="home.header"] [data-ws-part="control"]:hover {
|
||||
background: rgba(255, 255, 255, .98);
|
||||
}
|
||||
|
||||
/* ARIA selectors raise specificity over component defaults without private classes. */
|
||||
[data-ws-part="skin.trigger"][aria-haspopup="listbox"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(255, 255, 255, .82);
|
||||
border-radius: 999px;
|
||||
background: rgba(250, 254, 255, .86);
|
||||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
|
||||
}
|
||||
|
||||
[data-ws-part="skin.trigger"][aria-haspopup="listbox"]:hover,
|
||||
[data-ws-part="skin.trigger"][aria-haspopup="listbox"]:focus-visible,
|
||||
[data-ws-part="skin.trigger"][aria-haspopup="listbox"][aria-expanded="true"][data-ws-state="open"] {
|
||||
color: var(--skin-illusia-teal);
|
||||
border-color: rgba(71, 201, 212, .52);
|
||||
background: rgba(255, 255, 255, .98);
|
||||
}
|
||||
|
||||
[data-ws-part="skin.menu"][role="listbox"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(104, 196, 211, .58);
|
||||
border-radius: 15px;
|
||||
background: linear-gradient(145deg, rgba(250, 255, 255, .98), rgba(222, 246, 250, .96));
|
||||
box-shadow: 0 18px 42px rgba(29, 115, 139, .22), inset 0 1px 0 rgba(255, 255, 255, .96);
|
||||
backdrop-filter: blur(18px) saturate(1.18);
|
||||
}
|
||||
|
||||
[data-ws-part="skin.option"][role="option"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-radius: 9px;
|
||||
background: rgba(255, 255, 255, .54);
|
||||
transition: color .16s, background .16s, border-color .16s, box-shadow .16s;
|
||||
}
|
||||
|
||||
[data-ws-part="skin.option"][data-ws-skin-id="community.illusia-voice"][role="option"] {
|
||||
color: #075e68;
|
||||
border-color: rgba(82, 195, 204, .46);
|
||||
background-color: rgba(232, 252, 253, .94);
|
||||
background-image:
|
||||
url("assets/visitor-avatar.webp"),
|
||||
linear-gradient(105deg, rgba(245, 255, 255, .96), rgba(196, 244, 246, .82));
|
||||
background-position: right 2px center, center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 42px 42px, 100% 100%;
|
||||
box-shadow: 0 4px 14px rgba(30, 170, 184, .17), inset 0 0 0 1px rgba(255, 255, 255, .86);
|
||||
animation: illusia-option-shimmer 5s ease-in-out infinite alternate;
|
||||
}
|
||||
|
||||
[data-ws-part="skin.option"][data-ws-skin-id="community.illusia-voice"][role="option"] > :first-child {
|
||||
color: #07858a;
|
||||
filter: drop-shadow(0 0 5px rgba(71, 201, 212, .54));
|
||||
}
|
||||
|
||||
[data-ws-part="skin.option"][data-ws-skin-id="community.illusia-voice"][role="option"]:hover,
|
||||
[data-ws-part="skin.option"][data-ws-skin-id="community.illusia-voice"][role="option"]:focus-visible,
|
||||
[data-ws-part="skin.option"][data-ws-skin-id="community.illusia-voice"][role="option"][aria-selected="true"] {
|
||||
color: #056e76;
|
||||
border-color: rgba(44, 186, 197, .7);
|
||||
background-image:
|
||||
url("assets/visitor-avatar.webp"),
|
||||
linear-gradient(105deg, rgba(250, 255, 255, .98), rgba(170, 236, 241, .9));
|
||||
box-shadow: 0 5px 18px rgba(30, 170, 184, .23), inset 0 0 0 1px rgba(255, 255, 255, .94);
|
||||
}
|
||||
|
||||
@keyframes illusia-option-shimmer {
|
||||
from { background-position: right 2px center, center; }
|
||||
to { background-position: right 7px center, center; }
|
||||
}
|
||||
|
||||
[data-ws-part="language.trigger"][aria-haspopup="listbox"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(255, 255, 255, .82);
|
||||
border-radius: 999px;
|
||||
background: rgba(250, 254, 255, .86);
|
||||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
|
||||
}
|
||||
|
||||
[data-ws-part="language.trigger"][aria-haspopup="listbox"]:hover,
|
||||
[data-ws-part="language.trigger"][aria-haspopup="listbox"]:focus-visible,
|
||||
[data-ws-part="language.trigger"][aria-haspopup="listbox"][aria-expanded="true"][data-ws-state="open"] {
|
||||
color: var(--skin-illusia-teal);
|
||||
border-color: rgba(71, 201, 212, .52);
|
||||
background: rgba(255, 255, 255, .98);
|
||||
}
|
||||
|
||||
[data-ws-part="language.menu"][role="listbox"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(104, 196, 211, .58);
|
||||
border-radius: 15px;
|
||||
background: linear-gradient(145deg, rgba(250, 255, 255, .98), rgba(222, 246, 250, .96));
|
||||
box-shadow: 0 18px 42px rgba(29, 115, 139, .22), inset 0 1px 0 rgba(255, 255, 255, .96);
|
||||
backdrop-filter: blur(18px) saturate(1.18);
|
||||
}
|
||||
|
||||
[data-ws-part="language.option"][role="option"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-radius: 9px;
|
||||
background: rgba(255, 255, 255, .54);
|
||||
}
|
||||
|
||||
[data-ws-part="language.option"][role="option"]:hover,
|
||||
[data-ws-part="language.option"][role="option"]:focus-visible,
|
||||
[data-ws-part="language.option"][role="option"][aria-selected="true"] {
|
||||
color: var(--skin-illusia-teal);
|
||||
border-color: rgba(71, 201, 212, .42);
|
||||
background: rgba(211, 245, 248, .92);
|
||||
}
|
||||
|
||||
[data-ws-part="skin.option"][role="option"]:hover,
|
||||
[data-ws-part="skin.option"][role="option"]:focus-visible,
|
||||
[data-ws-part="skin.option"][role="option"][aria-selected="true"] {
|
||||
color: #087e86;
|
||||
border-color: rgba(71, 201, 212, .42);
|
||||
background: rgba(211, 245, 248, .92);
|
||||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .82);
|
||||
}
|
||||
|
||||
[data-ws-part="home.brand"] {
|
||||
color: var(--skin-illusia-teal);
|
||||
}
|
||||
|
||||
[data-ws-part="home.brand"] strong,
|
||||
[data-ws-part="home.hero.title"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="home.brand"] small,
|
||||
[data-ws-part="home.hero.description"],
|
||||
[data-ws-part="home.join-description"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
[data-ws-part="home.hero.title"] em {
|
||||
color: var(--skin-illusia-teal);
|
||||
text-shadow: 0 8px 28px rgba(47, 192, 202, .2);
|
||||
}
|
||||
|
||||
[data-ws-part="home.hero.eyebrow"] {
|
||||
color: #087a76;
|
||||
}
|
||||
|
||||
[data-ws-part="home.feature"] {
|
||||
border-color: rgba(255, 255, 255, .94);
|
||||
border-radius: 18px;
|
||||
background: rgba(255, 255, 255, .79);
|
||||
box-shadow: 0 14px 28px rgba(68, 158, 173, .12), inset 0 0 0 1px rgba(255, 255, 255, .42);
|
||||
backdrop-filter: blur(12px) saturate(1.08);
|
||||
}
|
||||
|
||||
[data-ws-part="home.feature"] > span:first-child {
|
||||
box-shadow: 0 5px 14px rgba(43, 157, 167, .12), inset 0 0 0 1px rgba(255, 255, 255, .56);
|
||||
}
|
||||
|
||||
[data-ws-part="home.feature"] b {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="home.feature"] small {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
[data-ws-part="home.visitors"] {
|
||||
color: #075c67;
|
||||
border-color: var(--skin-illusia-line);
|
||||
background-color: rgba(247, 254, 255, .9);
|
||||
background-image: linear-gradient(105deg, rgba(247, 254, 255, .98), rgba(237, 252, 253, .84));
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
box-shadow: 0 10px 28px rgba(19, 142, 157, .14), inset 0 0 0 1px rgba(255, 255, 255, .72);
|
||||
backdrop-filter: blur(14px) saturate(1.12);
|
||||
}
|
||||
|
||||
[data-ws-part="home.visitors"] > span:nth-child(2) {
|
||||
color: transparent;
|
||||
background-color: transparent;
|
||||
background-image: url("assets/visitor-avatar.webp");
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover;
|
||||
box-shadow: 0 0 0 3px rgba(71, 201, 212, .26), 0 5px 16px rgba(19, 142, 157, .2);
|
||||
}
|
||||
|
||||
[data-ws-part="home.visitors"] > span:nth-child(2) svg {
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
[data-ws-part="home.visitors"] > span:last-child {
|
||||
color: #41bdcc;
|
||||
text-shadow: 0 0 12px rgba(71, 201, 212, .42);
|
||||
}
|
||||
|
||||
[data-ws-part="home.join-card"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(255, 255, 255, .9);
|
||||
border-radius: 26px;
|
||||
background-color: var(--skin-illusia-glass);
|
||||
background-image: url("assets/banner-mascot-blob.webp");
|
||||
background-position: right 18px top 10px;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 96px 68px;
|
||||
box-shadow: var(--skin-illusia-shadow), 0 0 15px rgba(71, 201, 212, .14), inset 0 0 0 1px rgba(255, 255, 255, .84);
|
||||
backdrop-filter: blur(22px);
|
||||
}
|
||||
|
||||
[data-ws-part="home.join-card.waveform"] {
|
||||
color: #47c9d4;
|
||||
}
|
||||
|
||||
[data-ws-part="home.join-card.waveform"] i {
|
||||
box-shadow: 0 0 8px rgba(71, 201, 212, .52);
|
||||
}
|
||||
|
||||
[data-ws-part="home.join-card.sonar"] {
|
||||
color: rgba(71, 201, 212, .72);
|
||||
}
|
||||
|
||||
[data-ws-part="home.join-card.sonar"] i {
|
||||
box-shadow: 0 0 12px rgba(71, 201, 212, .16);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
[data-ws-part="skin.option"][data-ws-skin-id="community.illusia-voice"][role="option"] {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
|
||||
[data-ws-part="home.join-title"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="home.field"] {
|
||||
color: #4f6974;
|
||||
border-color: rgba(134, 190, 200, .42);
|
||||
border-radius: 12px;
|
||||
background: rgba(232, 244, 247, .96);
|
||||
box-shadow: inset 0 0 0 1px rgba(134, 190, 200, .24);
|
||||
}
|
||||
|
||||
[data-ws-part="home.field"] input {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="home.field"] input::placeholder {
|
||||
color: #8ba4aa;
|
||||
}
|
||||
|
||||
[data-ws-part="home.field-label"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="home"] [data-ws-part="home.connect"] {
|
||||
color: #fff;
|
||||
border-radius: 14px;
|
||||
background-color: var(--skin-illusia-teal);
|
||||
background:
|
||||
url("assets/button-mascot.webp") right 4px center / 112px 74px no-repeat,
|
||||
linear-gradient(100deg, #38d6d0 0%, #0c9caf 62%, #08788d 100%) center / cover no-repeat;
|
||||
box-shadow: 0 12px 22px rgba(16, 181, 192, .24), inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 0 0 1px rgba(141, 255, 255, .52);
|
||||
}
|
||||
|
||||
[data-ws-part="home"] [data-ws-part="home.connect"]:hover {
|
||||
background-color: #087078;
|
||||
box-shadow: 0 14px 30px rgba(8, 126, 134, .3);
|
||||
}
|
||||
|
||||
[data-ws-part="home.security-note"],
|
||||
[data-ws-part="home.footer"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
[data-ws-part="home.footer"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
border-color: transparent;
|
||||
background-color: transparent;
|
||||
background-image: url("assets/footer-wave.png");
|
||||
background-position: center top;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 58px;
|
||||
box-shadow: none;
|
||||
backdrop-filter: blur(8px) saturate(1.04);
|
||||
}
|
||||
|
||||
/* Voice room: let the artwork flow through the UI instead of stacking opaque cards. */
|
||||
:root {
|
||||
--skin-room-line: rgba(76, 176, 193, .3);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.shell"] {
|
||||
color-scheme: light;
|
||||
color: var(--skin-illusia-ink);
|
||||
background-color: #dff4f8;
|
||||
background-image:
|
||||
radial-gradient(circle at 1px 1px, rgba(21, 139, 157, .075) 1px, transparent 1.55px),
|
||||
radial-gradient(circle at 100% 0%, transparent 0 188px, rgba(71, 201, 212, .13) 189px 190px, transparent 191px 229px, rgba(71, 201, 212, .09) 230px 231px, transparent 232px),
|
||||
radial-gradient(ellipse at 13% 5%, rgba(107, 226, 232, .2), transparent 36%),
|
||||
linear-gradient(125deg, rgba(229, 248, 251, .19), rgba(239, 251, 253, .06) 48%, rgba(190, 235, 242, .22)),
|
||||
url("assets/bg-room-main.webp");
|
||||
background-position: 0 0, right top, left top, center, center;
|
||||
background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
|
||||
background-size: 24px 24px, 560px 450px, auto, auto, cover;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.workspace"] {
|
||||
background: linear-gradient(145deg, rgba(239, 251, 253, .22), rgba(218, 244, 248, .12) 48%, rgba(245, 253, 254, .2));
|
||||
backdrop-filter: blur(2px);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.activity"] {
|
||||
border-color: rgba(113, 211, 222, .62);
|
||||
border-radius: 24px;
|
||||
background-color: rgba(227, 247, 250, .64);
|
||||
background-image:
|
||||
radial-gradient(ellipse at 82% 48%, rgba(91, 215, 224, .19), rgba(91, 215, 224, .04) 34%, transparent 65%),
|
||||
linear-gradient(90deg, rgba(230, 248, 251, .78), rgba(230, 248, 251, .36) 38%, rgba(230, 248, 251, .08) 72%),
|
||||
url("assets/bg-room-main.webp");
|
||||
background-position: right 5% center, center, center 48%;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 48% 100%, 100% 100%, cover;
|
||||
box-shadow: 0 15px 38px rgba(30, 111, 132, .13), inset 0 0 0 1px rgba(255, 255, 255, .7);
|
||||
backdrop-filter: blur(10px) saturate(1.08);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.activity.artwork"] {
|
||||
background-image: url("assets/banner-character-main.webp");
|
||||
background-position: right 34% center;
|
||||
background-size: auto 320px;
|
||||
filter: drop-shadow(0 18px 22px rgba(30, 113, 134, .2));
|
||||
}
|
||||
|
||||
[data-ws-part="voice.header"] {
|
||||
border-color: rgba(126, 191, 203, .36);
|
||||
background: linear-gradient(105deg, rgba(249, 254, 255, .76), rgba(222, 246, 250, .57) 56%, rgba(247, 253, 254, .72));
|
||||
box-shadow: 0 8px 28px rgba(27, 92, 112, .08), inset 0 1px 0 rgba(255, 255, 255, .62);
|
||||
backdrop-filter: blur(16px);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member-panel"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: var(--skin-room-line);
|
||||
background-color: rgba(221, 245, 249, .66);
|
||||
background-image:
|
||||
radial-gradient(circle at 1px 1px, rgba(25, 145, 161, .065) 1px, transparent 1.5px),
|
||||
radial-gradient(circle at 100% 0%, transparent 0 86px, rgba(71, 201, 212, .16) 87px 88px, transparent 89px 119px, rgba(71, 201, 212, .1) 120px 121px, transparent 122px),
|
||||
radial-gradient(ellipse at 100% 0%, rgba(107, 226, 232, .2), transparent 43%),
|
||||
linear-gradient(155deg, rgba(248, 254, 255, .75), rgba(222, 246, 249, .58) 48%, rgba(213, 241, 246, .7));
|
||||
background-position: 0 0, right top, right top, center;
|
||||
background-repeat: repeat, no-repeat, no-repeat, no-repeat;
|
||||
background-size: 22px 22px, 360px 320px, auto, auto;
|
||||
backdrop-filter: blur(18px);
|
||||
}
|
||||
|
||||
/* Keep the headset as an independent foreground object instead of flattening
|
||||
it into the member rail's background. Its slight perspective and shadow
|
||||
make it sit in front of the room, while the actual controls remain above it. */
|
||||
[data-ws-part="voice.member-panel"]::before {
|
||||
background-image: url("assets/foreground-headphone.webp");
|
||||
background-position: left bottom;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
filter: drop-shadow(16px 18px 17px rgba(36, 105, 119, .24));
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member-panel.search"] {
|
||||
color: #4f7982;
|
||||
border-color: rgba(103, 186, 198, .28);
|
||||
background: linear-gradient(110deg, rgba(232, 249, 251, .86), rgba(216, 242, 247, .68));
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .58);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member-panel.search"] input {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member-panel.search"] input::placeholder {
|
||||
color: #78979d;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.channel-group"] {
|
||||
border-color: rgba(8, 126, 134, .32);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.channel-group"][data-ws-state="current"] {
|
||||
border-color: rgba(8, 126, 134, .48);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.channel-group.heading"] {
|
||||
color: #386b75;
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(100deg, rgba(223, 246, 249, .68), rgba(237, 250, 251, .34));
|
||||
}
|
||||
|
||||
[data-ws-part="voice.channel-group.heading"][data-ws-state="current"] {
|
||||
color: #087e86;
|
||||
background: linear-gradient(100deg, rgba(179, 235, 239, .78), rgba(224, 248, 249, .5));
|
||||
box-shadow: inset 3px 0 0 rgba(37, 175, 188, .74);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member-row"] {
|
||||
border-radius: 11px;
|
||||
transition: background .16s ease, box-shadow .16s ease;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member-row"]:hover,
|
||||
[data-ws-part="voice.member-row"][data-ws-state="speaking"] {
|
||||
background: linear-gradient(100deg, rgba(198, 240, 243, .38), rgba(238, 251, 252, .28));
|
||||
box-shadow: inset 0 0 0 1px rgba(92, 190, 202, .16);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member"] {
|
||||
border-color: rgba(91, 184, 198, .36);
|
||||
border-radius: 20px;
|
||||
background-color: rgba(222, 246, 249, .7);
|
||||
background-image:
|
||||
radial-gradient(ellipse at 100% 0%, rgba(102, 220, 226, .24), transparent 62%),
|
||||
linear-gradient(145deg, rgba(250, 255, 255, .72), rgba(224, 246, 249, .62) 56%, rgba(210, 241, 246, .66));
|
||||
box-shadow: 0 12px 32px rgba(31, 99, 123, .12), inset 0 1px 0 rgba(255, 255, 255, .76);
|
||||
backdrop-filter: blur(12px) saturate(1.08);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member.avatar"] {
|
||||
outline: 2px solid rgba(71, 201, 212, .8);
|
||||
outline-offset: 4px;
|
||||
box-shadow: 0 0 24px rgba(71, 201, 212, .28);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member.live-indicator"] {
|
||||
color: #08706f;
|
||||
border-radius: 999px;
|
||||
background: rgba(237, 255, 251, .96);
|
||||
box-shadow: 0 6px 20px rgba(42, 160, 162, .18), inset 0 0 0 1px rgba(71, 201, 212, .5);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.audio-dock"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
border-color: rgba(116, 194, 205, .42);
|
||||
border-radius: 22px;
|
||||
background-color: rgba(222, 246, 249, .8);
|
||||
background-image:
|
||||
radial-gradient(circle at 0% 100%, transparent 0 35px, rgba(71, 201, 212, .16) 36px 37px, transparent 38px 57px, rgba(71, 201, 212, .1) 58px 59px, transparent 60px),
|
||||
linear-gradient(125deg, rgba(250, 255, 255, .76), rgba(222, 246, 249, .68) 55%, rgba(205, 238, 244, .76));
|
||||
box-shadow: 0 12px 34px rgba(28, 91, 111, .16), inset 0 1px 0 rgba(255, 255, 255, .74);
|
||||
backdrop-filter: blur(18px);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat"] {
|
||||
border-color: rgba(100, 184, 198, .34);
|
||||
border-radius: 20px;
|
||||
background-color: rgba(221, 245, 249, .58);
|
||||
background-image:
|
||||
radial-gradient(circle at 1px 1px, rgba(21, 139, 157, .055) 1px, transparent 1.5px),
|
||||
radial-gradient(ellipse at 0% 100%, rgba(102, 220, 226, .16), transparent 42%),
|
||||
linear-gradient(145deg, rgba(249, 254, 255, .72), rgba(226, 247, 250, .48) 52%, rgba(214, 242, 247, .62));
|
||||
background-position: 0 0, left bottom, center;
|
||||
background-repeat: repeat, no-repeat, no-repeat;
|
||||
background-size: 24px 24px, auto, auto;
|
||||
backdrop-filter: blur(14px) saturate(1.05);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.tab"] {
|
||||
color: #547780;
|
||||
border-color: rgba(95, 180, 193, .24);
|
||||
background: linear-gradient(115deg, rgba(242, 252, 253, .72), rgba(217, 243, 247, .56));
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.tab"]:hover,
|
||||
[data-ws-part="voice.chat.tab"][data-ws-state="active"] {
|
||||
color: #087e86;
|
||||
border-color: rgba(71, 201, 212, .48);
|
||||
background: linear-gradient(115deg, rgba(207, 242, 245, .86), rgba(232, 250, 251, .72));
|
||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.empty"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
background-color: rgba(218, 244, 248, .4);
|
||||
background-image:
|
||||
radial-gradient(circle at 1px 1px, rgba(21, 139, 157, .075) 1px, transparent 1.5px),
|
||||
radial-gradient(circle at 100% 50%, transparent 0 102px, rgba(71, 201, 212, .13) 103px 104px, transparent 105px 137px, rgba(71, 201, 212, .09) 138px 139px, transparent 140px),
|
||||
linear-gradient(100deg, rgba(237, 250, 252, .76), rgba(228, 247, 250, .38) 52%, rgba(205, 240, 245, .26)),
|
||||
url("assets/chat-empty-chibi.webp");
|
||||
background-position: 0 0, right center, center, center 10px;
|
||||
background-repeat: repeat, no-repeat, no-repeat, no-repeat;
|
||||
background-size: 22px 22px, 300px 250px, cover, min(340px, 46vw) auto;
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.empty"][data-ws-state="messages-empty"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
background-color: rgba(218, 244, 248, .4);
|
||||
background-image:
|
||||
radial-gradient(circle at 1px 1px, rgba(21, 139, 157, .075) 1px, transparent 1.5px),
|
||||
radial-gradient(circle at 100% 50%, transparent 0 102px, rgba(71, 201, 212, .13) 103px 104px, transparent 105px 137px, rgba(71, 201, 212, .09) 138px 139px, transparent 140px),
|
||||
linear-gradient(100deg, rgba(237, 250, 252, .68), rgba(228, 247, 250, .34) 50%, rgba(205, 240, 245, .08)),
|
||||
url("assets/chat-empty-chibi.webp");
|
||||
background-position: 0 0, right center, center, center 8px;
|
||||
background-repeat: repeat, no-repeat, no-repeat, no-repeat;
|
||||
background-size: 22px 22px, 300px 250px, cover, min(340px, 46vw) auto;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.empty"][data-ws-state="messages-empty"]::before {
|
||||
color: rgba(71, 126, 148, .9);
|
||||
border-radius: 50%;
|
||||
background-color: rgba(250, 255, 255, .66);
|
||||
background-image:
|
||||
radial-gradient(circle, #527f91 0 1.6px, transparent 1.9px),
|
||||
radial-gradient(circle, #527f91 0 1.6px, transparent 1.9px),
|
||||
radial-gradient(circle, #527f91 0 1.6px, transparent 1.9px);
|
||||
background-position: 12px 16px, 22px 12px, 32px 9px;
|
||||
background-repeat: no-repeat;
|
||||
box-shadow: 0 3px 8px rgba(48, 115, 132, .1);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.empty"][data-ws-state="messages-empty"]::after {
|
||||
color: rgba(71, 126, 148, .9);
|
||||
background: rgba(250, 255, 255, .7);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.empty"][data-ws-state="messages-empty"] > strong,
|
||||
[data-ws-part="voice.chat.empty"][data-ws-state="messages-empty"] > span {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.empty"] strong {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.empty"] span {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.members.empty"] {
|
||||
color: #587a82;
|
||||
border-color: rgba(78, 176, 191, .38);
|
||||
background: linear-gradient(120deg, rgba(223, 247, 249, .68), rgba(235, 250, 251, .42));
|
||||
}
|
||||
|
||||
[data-ws-part="voice.members.empty"] strong {
|
||||
color: #315c66;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.message-bubble"] {
|
||||
color: #315360;
|
||||
background: linear-gradient(135deg, rgba(250, 255, 255, .78), rgba(216, 243, 247, .68));
|
||||
box-shadow: 0 4px 14px rgba(34, 117, 136, .08), inset 0 0 0 1px rgba(255, 255, 255, .54);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.message"][data-ws-state="mine"] [data-ws-part="voice.chat.message-bubble"] {
|
||||
color: #fff;
|
||||
background: linear-gradient(130deg, #0b9da1, #087985);
|
||||
box-shadow: 0 5px 16px rgba(8, 126, 134, .2);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.activity-heading"] h2,
|
||||
[data-ws-part="voice.chat.heading"] h2 {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.activity-heading"] span,
|
||||
[data-ws-part="voice.chat.heading"] span {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member.name"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member.status"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
/* These controls use the active day/night palette by default. Give them the
|
||||
same readable glass treatment as the rest of this intentionally bright skin. */
|
||||
[data-ws-part="voice.performance"] > [data-ws-part="control"] {
|
||||
color: var(--skin-illusia-teal);
|
||||
border-color: rgba(115, 205, 218, .42);
|
||||
background: rgba(249, 253, 255, .9);
|
||||
box-shadow: 0 5px 16px rgba(29, 91, 113, .1), inset 0 1px 0 rgba(255, 255, 255, .9);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.performance"] > [data-ws-part="control"]:hover,
|
||||
[data-ws-part="voice.performance"] > [data-ws-part="control"][aria-expanded="true"] {
|
||||
color: #075f69;
|
||||
border-color: rgba(71, 201, 212, .72);
|
||||
background: rgba(255, 255, 255, .98);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.performance.panel"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(115, 205, 218, .4);
|
||||
background-color: rgba(223, 246, 249, .96);
|
||||
background-image:
|
||||
radial-gradient(circle at 100% 0%, rgba(71, 201, 212, .16), transparent 52%),
|
||||
linear-gradient(145deg, rgba(250, 255, 255, .96), rgba(224, 246, 249, .94));
|
||||
box-shadow: var(--skin-illusia-shadow);
|
||||
backdrop-filter: blur(18px);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.performance.panel"] small,
|
||||
[data-ws-part="voice.performance.status"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.performance.panel"] [data-ws-part="control"] {
|
||||
color: var(--skin-illusia-teal);
|
||||
border-color: rgba(115, 205, 218, .36);
|
||||
background: rgba(232, 247, 248, .9);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.performance.route"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.performance.route"] span,
|
||||
[data-ws-part="voice.performance.metrics"] article,
|
||||
[data-ws-part="voice.performance.webrtc-stats"] [data-ws-part="control"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
border-color: rgba(115, 205, 218, .28);
|
||||
background: linear-gradient(135deg, rgba(232, 248, 250, .88), rgba(212, 241, 245, .72));
|
||||
}
|
||||
|
||||
[data-ws-part="voice.performance.metrics"] strong,
|
||||
[data-ws-part="voice.performance.webrtc-stats"] strong {
|
||||
color: var(--skin-illusia-teal);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.performance.metrics"] small,
|
||||
[data-ws-part="voice.performance.metrics"] span,
|
||||
[data-ws-part="voice.performance.webrtc-stats"] small,
|
||||
[data-ws-part="voice.performance.webrtc-stats"] span {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.audio-dock"] strong {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.audio-dock"] span {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.audio-dock"] button[data-ws-part="control"] {
|
||||
color: var(--skin-illusia-teal);
|
||||
border-color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.audio-dock"] button[data-ws-part="control"]:hover,
|
||||
[data-ws-part="voice.audio-dock"] button[data-ws-part="control"]:focus-visible {
|
||||
color: #075f69;
|
||||
border-color: rgba(71, 201, 212, .4);
|
||||
background: rgba(221, 246, 247, .86);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.audio-dock.microphone-panel"],
|
||||
[data-ws-part="voice.audio-dock.output-panel"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(115, 205, 218, .38);
|
||||
background: linear-gradient(145deg, rgba(250, 255, 255, .98), rgba(221, 246, 249, .96));
|
||||
box-shadow: var(--skin-illusia-shadow);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.audio-dock.microphone-panel"] strong,
|
||||
[data-ws-part="voice.audio-dock.output-panel"] strong {
|
||||
color: var(--skin-illusia-teal);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.composer"] {
|
||||
background: linear-gradient(110deg, rgba(249, 254, 255, .82), rgba(225, 247, 250, .76) 58%, rgba(214, 242, 247, .82));
|
||||
box-shadow: inset 0 0 0 1px rgba(115, 205, 218, .32), 0 5px 18px rgba(36, 130, 148, .07);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.composer"]:focus-within {
|
||||
background: linear-gradient(110deg, rgba(250, 255, 255, .9), rgba(211, 242, 246, .82));
|
||||
box-shadow: inset 0 0 0 1px rgba(71, 201, 212, .55), 0 6px 20px rgba(36, 130, 148, .11);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.composer"] input {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.composer"] input::placeholder {
|
||||
color: #718b92;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.composer"] button[data-ws-part="control"] {
|
||||
color: #fff;
|
||||
border-color: rgba(8, 126, 134, .18);
|
||||
background: linear-gradient(135deg, #0a9291, #087580);
|
||||
box-shadow: 0 5px 13px rgba(8, 126, 134, .2);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member.share-actions"] button[data-ws-part="control"] {
|
||||
color: #086b72;
|
||||
border-color: rgba(71, 201, 212, .45);
|
||||
background: rgba(237, 252, 251, .96);
|
||||
box-shadow: 0 3px 10px rgba(29, 120, 130, .12);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member.share-actions"] button[data-ws-part="control"]:hover,
|
||||
[data-ws-part="voice.member.share-actions"] button[data-ws-part="control"]:focus-visible {
|
||||
color: #064f59;
|
||||
border-color: rgba(8, 126, 134, .58);
|
||||
background: rgba(219, 247, 246, .98);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member.share-actions"] button[data-ws-part="control"][data-ws-state="viewing"] {
|
||||
color: #fff;
|
||||
border-color: #087e86;
|
||||
background: linear-gradient(135deg, #0a9291, #087580);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.member.stop-share"] {
|
||||
color: #a43e48;
|
||||
border-color: rgba(255, 255, 255, .96);
|
||||
background: #fff6f5;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-share-settings"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(115, 205, 218, .42);
|
||||
background: rgba(250, 254, 255, .98);
|
||||
box-shadow: var(--skin-illusia-shadow);
|
||||
backdrop-filter: blur(18px);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-share-settings.heading"] h2 {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-share-settings.heading"] p,
|
||||
[data-ws-part="voice.screen-share-settings.fields"] label,
|
||||
[data-ws-part="voice.screen-share-settings.note"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-share-settings"] select {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(115, 205, 218, .42);
|
||||
background: rgba(235, 247, 248, .94);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-share-settings"] [data-ws-part="control"] {
|
||||
color: var(--skin-illusia-teal);
|
||||
border-color: rgba(115, 205, 218, .38);
|
||||
background: rgba(232, 247, 248, .92);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-share-settings.actions"] [data-ws-part="control"] {
|
||||
color: #fff;
|
||||
border-color: rgba(8, 126, 134, .2);
|
||||
background: linear-gradient(135deg, #0a9291, #087580);
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
[data-ws-part="voice.chat.empty"] {
|
||||
background-position: 0 0, right 8px center, center, center 8px;
|
||||
background-size: 22px 22px, 260px 220px, cover, min(300px, 66vw) auto;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.activity"] {
|
||||
background-position: right 1% center, center, center 48%;
|
||||
background-size: 56% 100%, 100% 100%, cover;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.activity.artwork"] {
|
||||
background-position: right 28% center;
|
||||
background-size: auto 280px;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.chat.empty"][data-ws-state="messages-empty"] {
|
||||
background-position: 0 0, right center, center, center 8px;
|
||||
background-size: 22px 22px, 260px 220px, cover, min(300px, 66vw) auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 740px) {
|
||||
[data-ws-part="voice.activity"] {
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.activity.artwork"] {
|
||||
background-image: none;
|
||||
}
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player"] {
|
||||
border-radius: 24px;
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(115, 205, 218, .58);
|
||||
background: linear-gradient(135deg, rgba(250, 255, 255, .96), rgba(220, 245, 250, .94));
|
||||
box-shadow: 0 22px 60px rgba(10, 68, 88, .3), inset 0 0 0 1px rgba(185, 246, 249, .55);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player.stage"] {
|
||||
border-radius: 22px;
|
||||
background: radial-gradient(ellipse at 50% 38%, rgba(248, 255, 255, .98), rgba(220, 246, 250, .92) 58%, rgba(202, 237, 244, .9));
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player.video"] {
|
||||
background: #e5f4f8;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player.placeholder"] {
|
||||
color: var(--skin-illusia-muted);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player.placeholder"] strong {
|
||||
color: var(--skin-illusia-ink);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player.exit"],
|
||||
[data-ws-part="voice.screen-player.fullscreen"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(115, 205, 218, .62);
|
||||
background: rgba(250, 255, 255, .9);
|
||||
box-shadow: 0 5px 18px rgba(40, 126, 148, .18);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player.viewers"],
|
||||
[data-ws-part="voice.screen-player.volume"],
|
||||
[data-ws-part="voice.screen-player.source"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-color: rgba(115, 205, 218, .58);
|
||||
background: rgba(250, 255, 255, .88);
|
||||
box-shadow: 0 5px 18px rgba(40, 126, 148, .16);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player.viewer-avatar"] {
|
||||
border-color: rgba(250, 255, 255, .96);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player.live"] {
|
||||
border-radius: 999px;
|
||||
color: #075e68;
|
||||
border-color: rgba(82, 195, 204, .56);
|
||||
background: rgba(239, 253, 254, .94);
|
||||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .76), 0 5px 18px rgba(40, 126, 148, .16);
|
||||
text-shadow: none;
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player.viewer-avatar"] {
|
||||
box-shadow: 0 0 0 2px rgba(255, 255, 255, .94), 0 0 0 4px rgba(71, 201, 212, .72);
|
||||
}
|
||||
|
||||
/* The demo keeps its original controls, labels, and interactions. */
|
||||
[data-ws-page="demo"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
background-color: #eaf7fc;
|
||||
background-image: url("assets/foreground-headphone.webp"), linear-gradient(rgba(239, 250, 253, .7), rgba(239, 250, 253, .82)), url("assets/bg-room-main.webp");
|
||||
background-position: left bottom, center, center;
|
||||
background-repeat: no-repeat, no-repeat, no-repeat;
|
||||
background-size: min(34vw, 430px) auto, auto, cover;
|
||||
background-attachment: fixed, scroll, scroll;
|
||||
}
|
||||
|
||||
[data-ws-part="demo.header"] {
|
||||
border-color: rgba(126, 191, 203, .3);
|
||||
background: rgba(250, 254, 255, .72);
|
||||
backdrop-filter: blur(16px);
|
||||
}
|
||||
|
||||
[data-ws-part="demo.channels"],
|
||||
[data-ws-part="demo.actions"],
|
||||
[data-ws-part="demo.main"] {
|
||||
border-color: rgba(255, 255, 255, .8);
|
||||
border-radius: 20px;
|
||||
background: rgba(249, 253, 255, .84);
|
||||
box-shadow: var(--skin-illusia-shadow);
|
||||
backdrop-filter: blur(18px);
|
||||
}
|
||||
|
||||
[data-ws-part="demo.hero"] {
|
||||
color: var(--skin-illusia-ink);
|
||||
border-radius: 22px;
|
||||
background-color: #d7f3f7;
|
||||
background-image: linear-gradient(90deg, rgba(239, 251, 254, .94), rgba(227, 248, 251, .48)), url("assets/banner-character-main.webp"), url("assets/banner-mascot-blob.webp");
|
||||
background-position: center, right 46px bottom, right 16px center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: cover, auto 112%, auto 72%;
|
||||
box-shadow: 0 14px 38px rgba(31, 99, 123, .12), inset 0 0 0 1px rgba(255, 255, 255, .8);
|
||||
}
|
||||
|
||||
[data-ws-part="demo.voice-card"] {
|
||||
border-color: rgba(115, 205, 218, .35);
|
||||
border-radius: 19px;
|
||||
background: rgba(255, 255, 255, .76);
|
||||
box-shadow: 0 10px 28px rgba(31, 99, 123, .1);
|
||||
}
|
||||
|
||||
[data-ws-part="demo.avatar"] {
|
||||
outline: 2px solid rgba(71, 201, 212, .7);
|
||||
outline-offset: 4px;
|
||||
}
|
||||
|
||||
[data-ws-part="demo.chat.send"] {
|
||||
color: #fff;
|
||||
border-radius: 12px;
|
||||
background: linear-gradient(110deg, #0a9291, #087580);
|
||||
}
|
||||
|
||||
@media (max-width: 740px) {
|
||||
[data-ws-page="demo"] {
|
||||
background-size: min(62vw, 300px) auto, auto, cover;
|
||||
background-attachment: scroll, scroll, scroll;
|
||||
}
|
||||
|
||||
[data-ws-part="demo.hero"] {
|
||||
background-position: center, right center;
|
||||
background-size: cover, auto 65%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
[data-ws-part="home"] {
|
||||
animation: none;
|
||||
}
|
||||
|
||||
[data-ws-part="home.connect"],
|
||||
[data-ws-part="voice.member"],
|
||||
[data-ws-part="demo.voice-card"] {
|
||||
transition-duration: .01ms;
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "webspeak-webclient",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5-preview",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "webspeak-webclient",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5-preview",
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"@discordjs/opus": "^0.10.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "webspeak-webclient",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5-preview",
|
||||
"private": true,
|
||||
"license": "AGPL-3.0-only",
|
||||
"type": "module",
|
||||
@@ -11,7 +11,7 @@
|
||||
"scripts": {
|
||||
"dev": "tsx src/index.ts",
|
||||
"build": "tsc",
|
||||
"test": "node --import tsx --test src/admin/skin-registry.test.ts web/src/services/skin-pack.test.ts",
|
||||
"test": "node --import tsx --test src/admin/skin-registry.test.ts src/server/visitor-count.test.ts web/src/services/skin-catalog.test.ts web/src/services/skin-pack.test.ts",
|
||||
"start": "node dist/index.js",
|
||||
"web:dev": "cd web && npx vite --host",
|
||||
"web:build": "cd web && npx vite build",
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
|
||||
$width = 3200
|
||||
$height = 116
|
||||
$outputPath = Join-Path $PSScriptRoot "..\docs\examples\illusia-voice\assets\footer-wave.png"
|
||||
$bitmap = [System.Drawing.Bitmap]::new($width, $height, [System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
|
||||
$graphics = [System.Drawing.Graphics]::FromImage($bitmap)
|
||||
$graphics.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias
|
||||
$graphics.PixelOffsetMode = [System.Drawing.Drawing2D.PixelOffsetMode]::HighQuality
|
||||
$graphics.CompositingQuality = [System.Drawing.Drawing2D.CompositingQuality]::HighQuality
|
||||
$graphics.Clear([System.Drawing.Color]::Transparent)
|
||||
|
||||
$topEdge = [System.Drawing.Drawing2D.GraphicsPath]::new()
|
||||
$topEdge.StartFigure()
|
||||
$topEdge.AddBezier(
|
||||
[System.Drawing.PointF]::new(0, 20),
|
||||
[System.Drawing.PointF]::new(240, 4),
|
||||
[System.Drawing.PointF]::new(460, 0),
|
||||
[System.Drawing.PointF]::new(700, 10)
|
||||
)
|
||||
$topEdge.AddBezier(
|
||||
[System.Drawing.PointF]::new(700, 10),
|
||||
[System.Drawing.PointF]::new(1000, 26),
|
||||
[System.Drawing.PointF]::new(1200, 36),
|
||||
[System.Drawing.PointF]::new(1600, 36)
|
||||
)
|
||||
$topEdge.AddBezier(
|
||||
[System.Drawing.PointF]::new(1600, 36),
|
||||
[System.Drawing.PointF]::new(2000, 36),
|
||||
[System.Drawing.PointF]::new(2200, 26),
|
||||
[System.Drawing.PointF]::new(2500, 10)
|
||||
)
|
||||
$topEdge.AddBezier(
|
||||
[System.Drawing.PointF]::new(2500, 10),
|
||||
[System.Drawing.PointF]::new(2740, 0),
|
||||
[System.Drawing.PointF]::new(2960, 4),
|
||||
[System.Drawing.PointF]::new(3200, 20)
|
||||
)
|
||||
|
||||
$surface = [System.Drawing.Drawing2D.GraphicsPath]::new()
|
||||
$surface.AddPath($topEdge, $false)
|
||||
$surface.AddLine(3200, 20, 3200, $height)
|
||||
$surface.AddLine(3200, $height, 0, $height)
|
||||
$surface.CloseFigure()
|
||||
|
||||
$brush = [System.Drawing.Drawing2D.LinearGradientBrush]::new(
|
||||
[System.Drawing.Rectangle]::new(0, 0, $width, $height),
|
||||
[System.Drawing.Color]::FromArgb(138, 244, 252, 254),
|
||||
[System.Drawing.Color]::FromArgb(245, 252, 255, 255),
|
||||
[System.Drawing.Drawing2D.LinearGradientMode]::Vertical
|
||||
)
|
||||
$blend = [System.Drawing.Drawing2D.ColorBlend]::new(3)
|
||||
$blend.Colors = [System.Drawing.Color[]]@(
|
||||
[System.Drawing.Color]::FromArgb(138, 244, 252, 254),
|
||||
[System.Drawing.Color]::FromArgb(194, 248, 253, 254),
|
||||
[System.Drawing.Color]::FromArgb(245, 252, 255, 255)
|
||||
)
|
||||
$blend.Positions = [single[]]@(0.0, 0.58, 1.0)
|
||||
$brush.InterpolationColors = $blend
|
||||
$pen = [System.Drawing.Pen]::new([System.Drawing.Color]::FromArgb(118, 103, 210, 221), 1.5)
|
||||
$pen.LineJoin = [System.Drawing.Drawing2D.LineJoin]::Round
|
||||
$accentBrush = [System.Drawing.SolidBrush]::new([System.Drawing.Color]::FromArgb(150, 99, 216, 225))
|
||||
$accentPath = [System.Drawing.Drawing2D.GraphicsPath]::new()
|
||||
$leftDiamond = [System.Drawing.PointF[]]@(
|
||||
[System.Drawing.PointF]::new(126, 47),
|
||||
[System.Drawing.PointF]::new(136, 58),
|
||||
[System.Drawing.PointF]::new(126, 69),
|
||||
[System.Drawing.PointF]::new(116, 58)
|
||||
)
|
||||
$rightDiamond = [System.Drawing.PointF[]]@(
|
||||
[System.Drawing.PointF]::new(3074, 47),
|
||||
[System.Drawing.PointF]::new(3084, 58),
|
||||
[System.Drawing.PointF]::new(3074, 69),
|
||||
[System.Drawing.PointF]::new(3064, 58)
|
||||
)
|
||||
$accentPen = [System.Drawing.Pen]::new([System.Drawing.Color]::FromArgb(94, 91, 211, 223), 1.2)
|
||||
$accentPen.StartCap = [System.Drawing.Drawing2D.LineCap]::Round
|
||||
$accentPen.EndCap = [System.Drawing.Drawing2D.LineCap]::Round
|
||||
|
||||
$graphics.FillPath($brush, $surface)
|
||||
$graphics.DrawPath($pen, $topEdge)
|
||||
$graphics.DrawLine($accentPen, 82, 58, 116, 58)
|
||||
$graphics.DrawLine($accentPen, 136, 58, 170, 58)
|
||||
$graphics.DrawLine($accentPen, 3030, 58, 3064, 58)
|
||||
$graphics.DrawLine($accentPen, 3084, 58, 3118, 58)
|
||||
$accentPath.AddPolygon($leftDiamond)
|
||||
$accentPath.AddPolygon($rightDiamond)
|
||||
$graphics.FillPath($accentBrush, $accentPath)
|
||||
[System.IO.Directory]::CreateDirectory((Split-Path -Parent $outputPath)) | Out-Null
|
||||
$bitmap.Save($outputPath, [System.Drawing.Imaging.ImageFormat]::Png)
|
||||
|
||||
$accentPen.Dispose()
|
||||
$accentBrush.Dispose()
|
||||
$accentPath.Dispose()
|
||||
$pen.Dispose()
|
||||
$brush.Dispose()
|
||||
$surface.Dispose()
|
||||
$topEdge.Dispose()
|
||||
$graphics.Dispose()
|
||||
$bitmap.Dispose()
|
||||
@@ -123,7 +123,43 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
|
||||
});
|
||||
|
||||
router.get("/skins", async (_request, response) => {
|
||||
response.json({ skins: await options.skinRegistry?.list() ?? [] });
|
||||
response.json({
|
||||
skins: await options.skinRegistry?.list() ?? [],
|
||||
defaultSkinId: await options.skinRegistry?.getDefaultSkinId() ?? "builtin.light",
|
||||
});
|
||||
});
|
||||
|
||||
router.put("/skins/default", requireSameOrigin, requireCsrf(options.sessions), async (request, response) => {
|
||||
try {
|
||||
if (!options.skinRegistry) throw new SkinRegistryError("Skin storage is unavailable.", "SKIN_STORAGE_UNAVAILABLE");
|
||||
const id = typeof asRecord(request.body).id === "string" ? (asRecord(request.body).id as string).trim() : "";
|
||||
const settings = await options.skinRegistry.setDefaultSkin(id);
|
||||
response.json({ ok: true, defaultSkinId: settings.defaultSkinId });
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof SkinRegistryError) {
|
||||
response.status(error.code === "SKIN_DEFAULT_INVALID" ? 400 : 409).json({ ok: false, code: error.code, message: error.message });
|
||||
return;
|
||||
}
|
||||
sendAdminError(response, error);
|
||||
}
|
||||
});
|
||||
|
||||
router.put("/skins/:id/enabled", requireSameOrigin, requireCsrf(options.sessions), async (request, response) => {
|
||||
try {
|
||||
const id = typeof request.params.id === "string" ? request.params.id : "";
|
||||
const body = asRecord(request.body);
|
||||
if (!options.skinRegistry || typeof body.enabled !== "boolean") throw new SkinRegistryError("A skin and boolean enabled value are required.", "SKIN_ENABLE_INVALID");
|
||||
const skin = await options.skinRegistry.setEnabled(id, body.enabled);
|
||||
options.service.database.addAudit(body.enabled ? "ADMIN_SKIN_ENABLED" : "ADMIN_SKIN_DISABLED", { id });
|
||||
response.json({ ok: true, skin, defaultSkinId: await options.skinRegistry.getDefaultSkinId() });
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof SkinRegistryError) {
|
||||
const status = error.code === "SKIN_NOT_FOUND" ? 404 : error.code === "SKIN_ENABLE_INVALID" ? 400 : 409;
|
||||
response.status(status).json({ ok: false, code: error.code, message: error.message });
|
||||
return;
|
||||
}
|
||||
sendAdminError(response, error);
|
||||
}
|
||||
});
|
||||
|
||||
router.put("/skins/:id", requireSameOriginBinary, requireCsrf(options.sessions), expressRaw({ type: "application/octet-stream", limit: "20mb" }), async (request, response) => {
|
||||
@@ -135,7 +171,7 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
|
||||
response.status(201).json({ ok: true, skin });
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof SkinRegistryError) {
|
||||
const status = error.code === "SKIN_LIMIT" || error.code === "SKIN_STORAGE_LIMIT" ? 409 : 400;
|
||||
const status = error.code === "SKIN_LIMIT" || error.code === "SKIN_STORAGE_LIMIT" || error.code === "SKIN_BUILTIN_PROTECTED" ? 409 : 400;
|
||||
response.status(status).json({ ok: false, code: error.code, message: error.message });
|
||||
return;
|
||||
}
|
||||
@@ -145,12 +181,20 @@ export function createAdminRouter(options: AdminRouterOptions): Router {
|
||||
|
||||
router.delete("/skins/:id", requireSameOrigin, requireCsrf(options.sessions), async (request, response) => {
|
||||
const id = typeof request.params.id === "string" ? request.params.id : "";
|
||||
if (!options.skinRegistry || !await options.skinRegistry.remove(id)) {
|
||||
response.status(404).json({ ok: false, code: "SKIN_NOT_FOUND" });
|
||||
return;
|
||||
try {
|
||||
if (!options.skinRegistry || !await options.skinRegistry.remove(id)) {
|
||||
response.status(404).json({ ok: false, code: "SKIN_NOT_FOUND" });
|
||||
return;
|
||||
}
|
||||
options.service.database.addAudit("ADMIN_SKIN_REMOVED", { id });
|
||||
response.json({ ok: true });
|
||||
} catch (error: unknown) {
|
||||
if (error instanceof SkinRegistryError) {
|
||||
response.status(error.code === "SKIN_BUILTIN_PROTECTED" ? 409 : 400).json({ ok: false, code: error.code, message: error.message });
|
||||
return;
|
||||
}
|
||||
sendAdminError(response, error);
|
||||
}
|
||||
options.service.database.addAudit("ADMIN_SKIN_REMOVED", { id });
|
||||
response.json({ ok: true });
|
||||
});
|
||||
|
||||
router.get("/sessions", (_request, response) => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
||||
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
||||
import os from "node:os";
|
||||
import path from "node:path";
|
||||
import test from "node:test";
|
||||
@@ -37,6 +37,10 @@ test("skin registry validates, lists, replaces, serves, and removes packages", a
|
||||
assert.equal((await registry.list()).length, 1);
|
||||
assert.deepEqual(await registry.readArchive("sample-skin"), firstArchive);
|
||||
assert.deepEqual((await registry.readPreview("sample-skin"))?.bytes, Buffer.from([5, 6, 7, 8]));
|
||||
await registry.setEnabled("sample-skin", false);
|
||||
assert.equal(await registry.readArchive("sample-skin"), null);
|
||||
assert.equal(await registry.readPreview("sample-skin"), null);
|
||||
await registry.setEnabled("sample-skin", true);
|
||||
|
||||
const replacement = { ...manifest, version: "2.0.0", content: undefined, preview: undefined };
|
||||
const secondArchive = createZip([
|
||||
@@ -55,6 +59,34 @@ test("skin registry validates, lists, replaces, serves, and removes packages", a
|
||||
assert.equal(await registry.remove("sample-skin"), false);
|
||||
});
|
||||
|
||||
test("custom skins can be enabled, disabled, and selected as the instance default", async (context) => {
|
||||
const directory = await mkdtemp(path.join(os.tmpdir(), "webspeak-skin-settings-"));
|
||||
context.after(() => rm(directory, { recursive: true, force: true }));
|
||||
const registry = new SkinRegistry(directory);
|
||||
const archive = createZip([
|
||||
["manifest.json", Buffer.from(JSON.stringify({ ...manifest, content: undefined, preview: undefined }))],
|
||||
["skin.css", Buffer.from("[data-ws-part=\"demo.voice-card\"] { color: teal; }")],
|
||||
]);
|
||||
|
||||
const skin = await registry.save(archive, "sample-skin");
|
||||
assert.equal(skin.enabled, true);
|
||||
assert.equal(await registry.getDefaultSkinId(), "builtin.light");
|
||||
await registry.setDefaultSkin("sample-skin");
|
||||
assert.equal(await registry.getDefaultSkinId(), "sample-skin");
|
||||
|
||||
const disabled = await registry.setEnabled("sample-skin", false);
|
||||
assert.equal(disabled.enabled, false);
|
||||
assert.equal(await registry.readArchive("sample-skin"), null);
|
||||
assert.equal(await registry.getDefaultSkinId(), "builtin.light");
|
||||
await assert.rejects(registry.setDefaultSkin("sample-skin"), (error: unknown) => error instanceof SkinRegistryError && error.code === "SKIN_DEFAULT_INVALID");
|
||||
|
||||
await registry.setEnabled("sample-skin", true);
|
||||
assert.deepEqual(await registry.readArchive("sample-skin"), archive);
|
||||
await registry.setDefaultSkin("sample-skin");
|
||||
assert.equal(await registry.remove("sample-skin"), true);
|
||||
assert.equal(await registry.getDefaultSkinId(), "builtin.light");
|
||||
});
|
||||
|
||||
test("skin registry rejects path traversal and mismatched local ZIP headers", async (context) => {
|
||||
const directory = await mkdtemp(path.join(os.tmpdir(), "webspeak-skin-invalid-"));
|
||||
context.after(() => rm(directory, { recursive: true, force: true }));
|
||||
@@ -74,15 +106,15 @@ test("skin registry rejects path traversal and mismatched local ZIP headers", as
|
||||
assert.deepEqual(await registry.list(), []);
|
||||
});
|
||||
|
||||
test("the documented Aurora Voice package passes the server-side upload validator", async (context) => {
|
||||
const directory = await mkdtemp(path.join(os.tmpdir(), "webspeak-skin-example-"));
|
||||
test("the three bundled skins cannot be replaced or removed through the registry", async (context) => {
|
||||
const directory = await mkdtemp(path.join(os.tmpdir(), "webspeak-skin-builtins-"));
|
||||
context.after(() => rm(directory, { recursive: true, force: true }));
|
||||
const registry = new SkinRegistry(directory);
|
||||
const archive = await readFile(new URL("../../docs/examples/aurora-voice.wskin", import.meta.url));
|
||||
const entry = await registry.save(archive, "community.aurora-voice");
|
||||
assert.equal(entry.name, "Aurora Voice");
|
||||
assert.equal(entry.previewUrl, "/api/skins/community.aurora-voice/preview");
|
||||
assert.equal((await registry.list()).length, 1);
|
||||
for (const id of ["builtin.light", "builtin.dark", "community.illusia-voice"]) {
|
||||
await assert.rejects(registry.save(Buffer.alloc(22), id), (error: unknown) => error instanceof SkinRegistryError && error.code === "SKIN_BUILTIN_PROTECTED");
|
||||
await assert.rejects(registry.remove(id), (error: unknown) => error instanceof SkinRegistryError && error.code === "SKIN_BUILTIN_PROTECTED");
|
||||
await assert.rejects(registry.setEnabled(id, false), (error: unknown) => error instanceof SkinRegistryError && error.code === "SKIN_BUILTIN_PROTECTED");
|
||||
}
|
||||
});
|
||||
|
||||
function createZip(files: Array<[string, Buffer]>): Buffer {
|
||||
|
||||
@@ -12,6 +12,8 @@ const MAX_IMAGE_BYTES = 16 * 1024 * 1024;
|
||||
const MAX_FONT_BYTES = 4 * 1024 * 1024;
|
||||
const MAX_SKINS = 50;
|
||||
const MAX_TOTAL_ARCHIVES = 200 * 1024 * 1024;
|
||||
export const BUILTIN_SKIN_IDS = ["builtin.light", "builtin.dark", "community.illusia-voice"] as const;
|
||||
const BUILTIN_SKIN_ID_SET = new Set<string>(BUILTIN_SKIN_IDS);
|
||||
const EOCD_SIGNATURE = 0x06054b50;
|
||||
const CENTRAL_SIGNATURE = 0x02014b50;
|
||||
const LOCAL_SIGNATURE = 0x04034b50;
|
||||
@@ -27,6 +29,11 @@ export interface SkinCatalogEntry {
|
||||
previewUrl?: string;
|
||||
previewMimeType?: string;
|
||||
installedAt: number;
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
export interface SkinRegistrySettings {
|
||||
defaultSkinId: string;
|
||||
}
|
||||
|
||||
interface SkinArchiveEntry {
|
||||
@@ -41,7 +48,7 @@ interface SkinArchiveEntry {
|
||||
unixFileType: number;
|
||||
}
|
||||
|
||||
type ParsedSkinManifest = Omit<SkinCatalogEntry, "installedAt" | "previewUrl" | "previewMimeType"> & {
|
||||
type ParsedSkinManifest = Omit<SkinCatalogEntry, "installedAt" | "previewUrl" | "previewMimeType" | "enabled"> & {
|
||||
entry: string;
|
||||
content?: string;
|
||||
preview?: string;
|
||||
@@ -54,6 +61,10 @@ export class SkinRegistryError extends Error {
|
||||
}
|
||||
}
|
||||
|
||||
export function isBuiltinSkinId(id: string): boolean {
|
||||
return BUILTIN_SKIN_ID_SET.has(id);
|
||||
}
|
||||
|
||||
export class SkinRegistry {
|
||||
constructor(private readonly directory: string) {}
|
||||
|
||||
@@ -67,7 +78,7 @@ export class SkinRegistry {
|
||||
if (!isCatalogEntry(value) || filename !== `${value.id}.json`) continue;
|
||||
const archiveInfo = await stat(path.join(this.directory, `${value.id}.wskin`)).catch(() => null);
|
||||
if (!archiveInfo?.isFile() || archiveInfo.size < 22 || archiveInfo.size > MAX_ARCHIVE_BYTES) continue;
|
||||
entries.push(value);
|
||||
entries.push({ ...value, enabled: value.enabled !== false });
|
||||
} catch {
|
||||
// Ignore incomplete or stale metadata. The archive itself remains untouched.
|
||||
}
|
||||
@@ -76,6 +87,7 @@ export class SkinRegistry {
|
||||
}
|
||||
|
||||
async save(bytes: Buffer, expectedId: string): Promise<SkinCatalogEntry> {
|
||||
if (isBuiltinSkinId(expectedId)) throw new SkinRegistryError("Built-in skins cannot be replaced.", "SKIN_BUILTIN_PROTECTED");
|
||||
if (!isSafeSkinId(expectedId)) throw new SkinRegistryError("Skin ID is invalid.", "SKIN_ID_INVALID");
|
||||
const parsed = validateSkinArchive(bytes, expectedId);
|
||||
await mkdir(this.directory, { recursive: true });
|
||||
@@ -86,10 +98,12 @@ export class SkinRegistry {
|
||||
const totalBytes = archivePaths.reduce((sum, entry) => sum + (entry.id === expectedId ? 0 : entry.size), bytes.byteLength);
|
||||
if (totalBytes > MAX_TOTAL_ARCHIVES) throw new SkinRegistryError("The total skin storage limit is 200 MiB.", "SKIN_STORAGE_LIMIT");
|
||||
|
||||
const installedAt = replacing ? current.find((entry) => entry.id === expectedId)!.installedAt : Date.now();
|
||||
const previous = current.find((entry) => entry.id === expectedId);
|
||||
const installedAt = previous?.installedAt ?? Date.now();
|
||||
const catalog: SkinCatalogEntry = {
|
||||
...parsed.manifest,
|
||||
installedAt,
|
||||
enabled: previous?.enabled ?? true,
|
||||
...(parsed.previewMime ? { previewUrl: `/api/skins/${expectedId}/preview`, previewMimeType: parsed.previewMime } : {}),
|
||||
};
|
||||
const nonce = randomBytes(6).toString("hex");
|
||||
@@ -114,7 +128,7 @@ export class SkinRegistry {
|
||||
|
||||
async readArchive(id: string): Promise<Buffer | null> {
|
||||
if (!isSafeSkinId(id)) return null;
|
||||
if (!(await this.list()).some((entry) => entry.id === id)) return null;
|
||||
if (!(await this.list()).some((entry) => entry.id === id && entry.enabled)) return null;
|
||||
try { return await readFile(path.join(this.directory, `${id}.wskin`)); }
|
||||
catch { return null; }
|
||||
}
|
||||
@@ -122,7 +136,7 @@ export class SkinRegistry {
|
||||
async readPreview(id: string): Promise<{ bytes: Buffer; mimeType: string } | null> {
|
||||
if (!isSafeSkinId(id)) return null;
|
||||
const catalog = (await this.list()).find((entry) => entry.id === id);
|
||||
if (!catalog?.previewUrl) return null;
|
||||
if (!catalog?.enabled || !catalog.previewUrl) return null;
|
||||
const mimeType = catalog.previewMimeType || "application/octet-stream";
|
||||
try {
|
||||
const bytes = await readFile(path.join(this.directory, `${id}.preview`));
|
||||
@@ -131,7 +145,9 @@ export class SkinRegistry {
|
||||
}
|
||||
|
||||
async remove(id: string): Promise<boolean> {
|
||||
if (isBuiltinSkinId(id)) throw new SkinRegistryError("Built-in skins cannot be removed.", "SKIN_BUILTIN_PROTECTED");
|
||||
if (!isSafeSkinId(id)) return false;
|
||||
const wasDefault = await this.getDefaultSkinId() === id;
|
||||
const archive = path.join(this.directory, `${id}.wskin`);
|
||||
const catalog = path.join(this.directory, `${id}.json`);
|
||||
const preview = path.join(this.directory, `${id}.preview`);
|
||||
@@ -140,8 +156,55 @@ export class SkinRegistry {
|
||||
await Promise.all([archive, catalog, preview].map((file) => unlink(file).catch((error: unknown) => {
|
||||
if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) throw error;
|
||||
})));
|
||||
if (wasDefault) await this.setDefaultSkin("builtin.light");
|
||||
return true;
|
||||
}
|
||||
|
||||
async setEnabled(id: string, enabled: boolean): Promise<SkinCatalogEntry> {
|
||||
if (isBuiltinSkinId(id)) throw new SkinRegistryError("Built-in skins cannot be disabled.", "SKIN_BUILTIN_PROTECTED");
|
||||
const entry = (await this.list()).find((item) => item.id === id);
|
||||
if (!entry) throw new SkinRegistryError("The skin was not found.", "SKIN_NOT_FOUND");
|
||||
const wasDefault = await this.getDefaultSkinId() === id;
|
||||
const updated = { ...entry, enabled };
|
||||
await writeAtomicJson(path.join(this.directory, `${id}.json`), updated);
|
||||
if (!enabled && wasDefault) await this.setDefaultSkin("builtin.light");
|
||||
return updated;
|
||||
}
|
||||
|
||||
async getDefaultSkinId(): Promise<string> {
|
||||
try {
|
||||
const value: unknown = JSON.parse(await readFile(path.join(this.directory, "settings.json"), "utf8"));
|
||||
const id = value && typeof value === "object" ? (value as Record<string, unknown>).defaultSkinId : null;
|
||||
if (typeof id !== "string") return "builtin.light";
|
||||
if (isBuiltinSkinId(id)) return id;
|
||||
const entry = (await this.list()).find((skin) => skin.id === id && skin.enabled);
|
||||
return entry ? id : "builtin.light";
|
||||
} catch {
|
||||
return "builtin.light";
|
||||
}
|
||||
}
|
||||
|
||||
async setDefaultSkin(id: string): Promise<SkinRegistrySettings> {
|
||||
if (!isBuiltinSkinId(id)) {
|
||||
const entry = (await this.list()).find((skin) => skin.id === id && skin.enabled);
|
||||
if (!entry) throw new SkinRegistryError("The default skin must be enabled and installed.", "SKIN_DEFAULT_INVALID");
|
||||
}
|
||||
await mkdir(this.directory, { recursive: true });
|
||||
const settings = { defaultSkinId: id };
|
||||
await writeAtomicJson(path.join(this.directory, "settings.json"), settings);
|
||||
return settings;
|
||||
}
|
||||
}
|
||||
|
||||
async function writeAtomicJson(filename: string, value: unknown): Promise<void> {
|
||||
const temporary = `${filename}.${randomBytes(6).toString("hex")}.tmp`;
|
||||
try {
|
||||
await writeFile(temporary, JSON.stringify(value), { flag: "wx", mode: 0o600 });
|
||||
await rename(temporary, filename);
|
||||
} catch (error) {
|
||||
await unlink(temporary).catch(() => undefined);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
function validateSkinArchive(bytes: Buffer, expectedId?: string): { manifest: ParsedSkinManifest; previewBytes?: Buffer; previewMime?: string } {
|
||||
@@ -374,6 +437,7 @@ function isCatalogEntry(value: unknown): value is SkinCatalogEntry {
|
||||
if (!isSafeSkinId(item.id) || !isShortText(item.name, 80) || !isShortText(item.author, 80) || !isShortText(item.license, 80)) return false;
|
||||
if (typeof item.version !== "string" || !semver.test(item.version) || typeof item.minAppVersion !== "string" || !semver.test(item.minAppVersion)) return false;
|
||||
if (!Number.isSafeInteger(item.installedAt) || (item.installedAt as number) < 0) return false;
|
||||
if (item.enabled !== undefined && typeof item.enabled !== "boolean") return false;
|
||||
if (item.description !== undefined && (typeof item.description !== "string" || item.description.length > 400)) return false;
|
||||
const hasPreview = item.previewUrl !== undefined || item.previewMimeType !== undefined;
|
||||
return !hasPreview || (item.previewUrl === `/api/skins/${item.id}/preview` && ["image/png", "image/jpeg", "image/webp", "image/avif", "image/gif"].includes(String(item.previewMimeType)));
|
||||
|
||||
@@ -14,6 +14,7 @@ import { identityFromString } from "@echosixhiya/teamspeak-client";
|
||||
import { JoinRateLimiter } from "./join-rate-limit.js";
|
||||
import type { ConfiguredAccelerationRelay } from "./acceleration-relay.js";
|
||||
import type { SkinRegistry } from "../admin/skin-registry.js";
|
||||
import { resolveVisitorTotal } from "./visitor-count.js";
|
||||
|
||||
export interface WebServerOptions {
|
||||
port: number;
|
||||
@@ -79,11 +80,10 @@ export function createWebServer(options: WebServerOptions): WebServer {
|
||||
logger.warn({ err: error instanceof Error ? error.message : String(error) }, "Visitor number could not be assigned");
|
||||
}
|
||||
}
|
||||
let visitorTotal: number | null = null;
|
||||
let visitorTotal = resolveVisitorTotal(visitorNumber, null);
|
||||
if (options.visitorCount) {
|
||||
try {
|
||||
const count = options.visitorCount();
|
||||
if (Number.isSafeInteger(count) && count >= 0) visitorTotal = count;
|
||||
visitorTotal = resolveVisitorTotal(visitorNumber, options.visitorCount());
|
||||
} catch (error: unknown) {
|
||||
logger.warn({ err: error instanceof Error ? error.message : String(error) }, "Visitor total could not be read");
|
||||
}
|
||||
@@ -101,7 +101,10 @@ export function createWebServer(options: WebServerOptions): WebServer {
|
||||
|
||||
app.get("/api/skins", async (_request, response) => {
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.json({ skins: await options.skinRegistry?.list() ?? [] });
|
||||
response.json({
|
||||
skins: await options.skinRegistry?.list() ?? [],
|
||||
defaultSkinId: await options.skinRegistry?.getDefaultSkinId() ?? "builtin.light",
|
||||
});
|
||||
});
|
||||
|
||||
app.get("/api/skins/:id/package", async (request, response) => {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import { resolveVisitorTotal } from "./visitor-count.js";
|
||||
|
||||
test("visitor total never disappears or falls below the current visitor ordinal", () => {
|
||||
assert.equal(resolveVisitorTotal(3, 0), 3);
|
||||
assert.equal(resolveVisitorTotal(3, 5), 5);
|
||||
assert.equal(resolveVisitorTotal(3, undefined), 3);
|
||||
assert.equal(resolveVisitorTotal(null, 8), 8);
|
||||
assert.equal(resolveVisitorTotal(null, -1), null);
|
||||
assert.equal(resolveVisitorTotal(0, 2), 2);
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
export function resolveVisitorTotal(visitorNumber: number | null, recordedTotal: unknown): number | null {
|
||||
const currentVisitor = Number.isSafeInteger(visitorNumber) && Number(visitorNumber) > 0
|
||||
? Number(visitorNumber)
|
||||
: null;
|
||||
const total = typeof recordedTotal === "number" && Number.isSafeInteger(recordedTotal) && recordedTotal >= 0
|
||||
? recordedTotal
|
||||
: null;
|
||||
|
||||
if (total === null) return currentVisitor;
|
||||
return Math.max(total, currentVisitor ?? 0);
|
||||
}
|
||||
|
After Width: | Height: | Size: 1014 KiB |
@@ -3,9 +3,11 @@
|
||||
<button
|
||||
type="button"
|
||||
class="language-trigger"
|
||||
data-ws-part="language.trigger"
|
||||
:aria-label="menuLabel"
|
||||
aria-haspopup="listbox"
|
||||
:aria-expanded="open"
|
||||
:data-ws-state="open ? 'open' : 'closed'"
|
||||
:aria-controls="menuId"
|
||||
@click.stop="toggle"
|
||||
>
|
||||
@@ -14,12 +16,14 @@
|
||||
<Icon name="chevron-down" :size="13" />
|
||||
</button>
|
||||
|
||||
<div v-if="open" :id="menuId" class="language-dropdown" role="listbox" :aria-label="menuLabel" @click.stop>
|
||||
<div v-if="open" :id="menuId" class="language-dropdown" data-ws-part="language.menu" role="listbox" :aria-label="menuLabel" @click.stop>
|
||||
<button
|
||||
v-for="option in options"
|
||||
:key="option.value"
|
||||
type="button"
|
||||
class="language-option"
|
||||
data-ws-part="language.option"
|
||||
:data-ws-language="option.value"
|
||||
:class="{ selected: modelValue === option.value }"
|
||||
role="option"
|
||||
:aria-selected="modelValue === option.value"
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
<button
|
||||
type="button"
|
||||
class="skin-trigger"
|
||||
data-ws-part="skin.trigger"
|
||||
:aria-label="menuLabel"
|
||||
:title="`${menuLabel}: ${selectedOption.label}`"
|
||||
aria-haspopup="listbox"
|
||||
:aria-expanded="open"
|
||||
:data-ws-state="open ? 'open' : 'closed'"
|
||||
:aria-controls="menuId"
|
||||
@click.stop="toggle"
|
||||
>
|
||||
@@ -15,12 +17,14 @@
|
||||
<Icon name="chevron-down" :size="12" />
|
||||
</button>
|
||||
|
||||
<div v-if="open" :id="menuId" class="skin-dropdown" role="listbox" :aria-label="menuLabel" @click.stop>
|
||||
<div v-if="open" :id="menuId" class="skin-dropdown" data-ws-part="skin.menu" role="listbox" :aria-label="menuLabel" @click.stop>
|
||||
<button
|
||||
v-for="option in options"
|
||||
:key="option.value"
|
||||
type="button"
|
||||
class="skin-option"
|
||||
data-ws-part="skin.option"
|
||||
:data-ws-skin-id="option.value"
|
||||
:class="{ selected: modelValue === option.value }"
|
||||
role="option"
|
||||
:aria-selected="modelValue === option.value"
|
||||
@@ -92,23 +96,25 @@ onUnmounted(() => document.removeEventListener("pointerdown", onDocumentPointerD
|
||||
min-width: 34px;
|
||||
min-height: 32px;
|
||||
padding: 0 8px;
|
||||
color: var(--accent);
|
||||
background: color-mix(in srgb, var(--accent) 8%, var(--surface-1));
|
||||
border: 1px solid var(--border);
|
||||
color: #08766f;
|
||||
background: rgba(250, 254, 255, .94);
|
||||
border: 1px solid #c8e6e1;
|
||||
border-radius: 8px;
|
||||
font: inherit;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
transition: color .16s, background .16s, border-color .16s;
|
||||
box-shadow: 0 4px 12px rgba(8, 126, 134, .08);
|
||||
transition: color .16s, background .16s, border-color .16s, box-shadow .16s;
|
||||
}
|
||||
|
||||
.skin-trigger:hover,
|
||||
.skin-switcher.open .skin-trigger {
|
||||
color: var(--accent);
|
||||
background: color-mix(in srgb, var(--accent) 14%, var(--surface-1));
|
||||
border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
|
||||
color: #056e76;
|
||||
background: #edfafa;
|
||||
border-color: #8fd7d9;
|
||||
box-shadow: 0 6px 16px rgba(30, 170, 184, .14);
|
||||
}
|
||||
|
||||
.skin-trigger > .ui-icon:last-child { margin-left: 1px; }
|
||||
@@ -121,10 +127,12 @@ onUnmounted(() => document.removeEventListener("pointerdown", onDocumentPointerD
|
||||
gap: 3px;
|
||||
min-width: 176px;
|
||||
padding: 6px;
|
||||
background: var(--surface-1);
|
||||
border: 1px solid var(--border);
|
||||
color: #123849;
|
||||
background: linear-gradient(145deg, rgba(250, 255, 255, .99), rgba(232, 249, 250, .98));
|
||||
border: 1px solid rgba(104, 196, 211, .58);
|
||||
border-radius: 11px;
|
||||
box-shadow: 0 14px 32px color-mix(in srgb, var(--text-primary) 16%, transparent);
|
||||
box-shadow: 0 18px 42px rgba(29, 115, 139, .2), inset 0 1px 0 rgba(255, 255, 255, .96);
|
||||
backdrop-filter: blur(18px) saturate(1.12);
|
||||
}
|
||||
|
||||
.skin-option {
|
||||
@@ -133,9 +141,9 @@ onUnmounted(() => document.removeEventListener("pointerdown", onDocumentPointerD
|
||||
gap: 9px;
|
||||
min-height: 36px;
|
||||
padding: 0 9px;
|
||||
color: var(--text-primary);
|
||||
background: transparent;
|
||||
border: 1px solid transparent;
|
||||
color: #123849;
|
||||
background: rgba(255, 255, 255, .62);
|
||||
border: 1px solid rgba(255, 255, 255, .5);
|
||||
border-radius: 7px;
|
||||
font: inherit;
|
||||
font-size: 11px;
|
||||
@@ -143,14 +151,15 @@ onUnmounted(() => document.removeEventListener("pointerdown", onDocumentPointerD
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.skin-option > .ui-icon:first-child { color: var(--text-muted); }
|
||||
.skin-option > .ui-icon:last-child { margin-left: auto; color: var(--accent); }
|
||||
.skin-option > .ui-icon:first-child { color: #64858a; }
|
||||
.skin-option > .ui-icon:last-child { margin-left: auto; color: #087e86; }
|
||||
.skin-option:hover,
|
||||
.skin-option:focus-visible,
|
||||
.skin-option.selected {
|
||||
color: var(--accent);
|
||||
background: color-mix(in srgb, var(--accent) 10%, var(--surface-1));
|
||||
border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
|
||||
color: #087e86;
|
||||
background: rgba(211, 245, 248, .92);
|
||||
border-color: rgba(71, 201, 212, .42);
|
||||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .82);
|
||||
}
|
||||
|
||||
@media (max-width: 520px) {
|
||||
|
||||
@@ -27,7 +27,7 @@ export function useWebClientPublicConfig({
|
||||
const accessMode = ref<"fixed" | "open">("fixed");
|
||||
const initialized = ref(false);
|
||||
const siteName = ref("WebSpeak");
|
||||
const appVersion = ref("0.2.4");
|
||||
const appVersion = ref("0.2.5-preview");
|
||||
const visitorNumber = ref<number | null>(null);
|
||||
const visitorTotal = ref<number | null>(null);
|
||||
const accelerationRelays = ref<RelayOption[]>([]);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/** Reduce built-in theme specificity while a community skin is active.
|
||||
* The community skin is loaded after this stylesheet and should own appearance
|
||||
* without needing !important or private component selectors.
|
||||
*/
|
||||
export function scopeBuiltinThemeForCustomSkin(css: string, theme: "light" | "dark", skinId: string): string {
|
||||
const sourceRoot = `.ws-skin-root[data-ws-skin="builtin.${theme}"]`;
|
||||
const customRoot = `:where(.ws-skin-root[data-ws-skin="${skinId}"])`;
|
||||
return css.replaceAll(sourceRoot, customRoot);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import {
|
||||
BUILTIN_SKIN_CATALOG,
|
||||
getPublicDefaultSkinId,
|
||||
isPublicSkinEnabled,
|
||||
listPublicSkins,
|
||||
} from "./skin-catalog.js";
|
||||
|
||||
test("skin catalog always includes the three protected built-ins and exposes only enabled custom skins", async () => {
|
||||
const originalFetch = globalThis.fetch;
|
||||
globalThis.fetch = async () => new Response(JSON.stringify({
|
||||
defaultSkinId: "sample-skin",
|
||||
skins: [
|
||||
{ id: "sample-skin", name: "Sample", version: "1.0.0", author: "Test", license: "MIT", minAppVersion: "0.2.5-preview", installedAt: 1, enabled: true },
|
||||
{ id: "disabled-skin", name: "Disabled", version: "1.0.0", author: "Test", license: "MIT", minAppVersion: "0.2.5-preview", installedAt: 2, enabled: false },
|
||||
{ id: "community.illusia-voice", name: "Spoofed", version: "9.9.9", author: "Other", license: "MIT", minAppVersion: "0.0.1", installedAt: 3 },
|
||||
],
|
||||
}), { status: 200, headers: { "content-type": "application/json" } });
|
||||
|
||||
try {
|
||||
const skins = await listPublicSkins();
|
||||
assert.deepEqual(skins.map((skin) => skin.id), [
|
||||
"builtin.light",
|
||||
"builtin.dark",
|
||||
"community.illusia-voice",
|
||||
"sample-skin",
|
||||
]);
|
||||
assert.deepEqual(BUILTIN_SKIN_CATALOG.map((skin) => skin.id), skins.slice(0, 3).map((skin) => skin.id));
|
||||
assert.equal(getPublicDefaultSkinId(), "sample-skin");
|
||||
assert.equal(isPublicSkinEnabled("sample-skin"), true);
|
||||
assert.equal(isPublicSkinEnabled("disabled-skin"), false);
|
||||
assert.equal(isPublicSkinEnabled("community.illusia-voice"), true);
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
}
|
||||
});
|
||||
|
||||
test("invalid or disabled instance defaults safely fall back to the protected day skin", async () => {
|
||||
const originalFetch = globalThis.fetch;
|
||||
globalThis.fetch = async () => new Response(JSON.stringify({
|
||||
defaultSkinId: "disabled-skin",
|
||||
skins: [{ id: "disabled-skin", name: "Disabled", version: "1.0.0", author: "Test", license: "MIT", minAppVersion: "0.2.5-preview", installedAt: 2, enabled: false }],
|
||||
}), { status: 200, headers: { "content-type": "application/json" } });
|
||||
|
||||
try {
|
||||
const skins = await listPublicSkins();
|
||||
assert.equal(skins.length, 3);
|
||||
assert.equal(getPublicDefaultSkinId(), "builtin.light");
|
||||
} finally {
|
||||
globalThis.fetch = originalFetch;
|
||||
}
|
||||
});
|
||||
@@ -8,18 +8,84 @@ export interface SkinCatalogEntry {
|
||||
minAppVersion: string;
|
||||
previewUrl?: string;
|
||||
installedAt: number;
|
||||
builtIn?: boolean;
|
||||
enabled?: boolean;
|
||||
previewKind?: "day" | "night" | "illusia";
|
||||
}
|
||||
|
||||
export const BUILTIN_ILLUSIA_SKIN_ID = "community.illusia-voice";
|
||||
|
||||
export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: "builtin.light",
|
||||
name: "Day mode",
|
||||
version: "1.0.0",
|
||||
author: "WebSpeak",
|
||||
license: "AGPL-3.0-only",
|
||||
description: "The default light appearance.",
|
||||
minAppVersion: "0.2.5-preview",
|
||||
installedAt: 0,
|
||||
builtIn: true,
|
||||
previewKind: "day",
|
||||
},
|
||||
{
|
||||
id: "builtin.dark",
|
||||
name: "Night mode",
|
||||
version: "1.0.0",
|
||||
author: "WebSpeak",
|
||||
license: "AGPL-3.0-only",
|
||||
description: "The default dark appearance.",
|
||||
minAppVersion: "0.2.5-preview",
|
||||
installedAt: 0,
|
||||
builtIn: true,
|
||||
previewKind: "night",
|
||||
},
|
||||
{
|
||||
id: BUILTIN_ILLUSIA_SKIN_ID,
|
||||
name: "ILLUSIA风",
|
||||
version: "1.0.25",
|
||||
author: "WebSpeak Project",
|
||||
license: "All rights reserved",
|
||||
description: "A bright original-character art skin for the home, voice room, and demo pages.",
|
||||
minAppVersion: "0.2.5-preview",
|
||||
previewUrl: "/skins/illusia-voice-preview.webp",
|
||||
installedAt: 0,
|
||||
builtIn: true,
|
||||
previewKind: "illusia",
|
||||
},
|
||||
];
|
||||
|
||||
const BUILTIN_ILLUSIA_PACKAGE_URL = "/skins/illusia-voice.wskin";
|
||||
let publicDirectoryLoaded = false;
|
||||
let publicEnabledSkinIds = new Set<string>(BUILTIN_SKIN_CATALOG.map((skin) => skin.id));
|
||||
let publicDefaultSkinId = "builtin.light";
|
||||
|
||||
export function getPublicDefaultSkinId(): string {
|
||||
return isPublicSkinEnabled(publicDefaultSkinId) ? publicDefaultSkinId : "builtin.light";
|
||||
}
|
||||
|
||||
export function isPublicSkinEnabled(id: string): boolean {
|
||||
if (BUILTIN_SKIN_CATALOG.some((skin) => skin.id === id)) return true;
|
||||
return !publicDirectoryLoaded || publicEnabledSkinIds.has(id);
|
||||
}
|
||||
|
||||
export function getBundledSkinPackageUrl(id: string): string | null {
|
||||
return id === BUILTIN_ILLUSIA_SKIN_ID ? BUILTIN_ILLUSIA_PACKAGE_URL : null;
|
||||
}
|
||||
|
||||
export async function listPublicSkins(): Promise<SkinCatalogEntry[]> {
|
||||
publicDirectoryLoaded = false;
|
||||
publicEnabledSkinIds = new Set(BUILTIN_SKIN_CATALOG.map((skin) => skin.id));
|
||||
publicDefaultSkinId = "builtin.light";
|
||||
try {
|
||||
const response = await fetch("/api/skins", { headers: { accept: "application/json" }, cache: "no-cache" });
|
||||
if (!response.ok) return [];
|
||||
if (!response.ok) return BUILTIN_SKIN_CATALOG;
|
||||
const payload: unknown = await response.json();
|
||||
if (!payload || typeof payload !== "object" || !Array.isArray((payload as { skins?: unknown }).skins)) return [];
|
||||
return (payload as { skins: unknown[] }).skins.flatMap((value) => {
|
||||
if (!payload || typeof payload !== "object" || !Array.isArray((payload as { skins?: unknown }).skins)) return BUILTIN_SKIN_CATALOG;
|
||||
const directorySkins = (payload as { skins: unknown[] }).skins.flatMap((value) => {
|
||||
if (!value || typeof value !== "object") return [];
|
||||
const skin = value as Record<string, unknown>;
|
||||
if (typeof skin.id !== "string" || !/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/.test(skin.id) || skin.id.startsWith("builtin.")) return [];
|
||||
if (typeof skin.id !== "string" || !/^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/.test(skin.id) || skin.id.startsWith("builtin.") || skin.id === BUILTIN_ILLUSIA_SKIN_ID) return [];
|
||||
if ([skin.name, skin.version, skin.author, skin.license, skin.minAppVersion].some((field) => typeof field !== "string")) return [];
|
||||
const previewUrl = typeof skin.previewUrl === "string" && skin.previewUrl === `/api/skins/${skin.id}/preview` ? skin.previewUrl : undefined;
|
||||
return [{
|
||||
@@ -32,10 +98,22 @@ export async function listPublicSkins(): Promise<SkinCatalogEntry[]> {
|
||||
...(typeof skin.description === "string" ? { description: skin.description } : {}),
|
||||
...(previewUrl ? { previewUrl } : {}),
|
||||
installedAt: Number.isFinite(skin.installedAt) ? Number(skin.installedAt) : 0,
|
||||
enabled: skin.enabled !== false,
|
||||
}];
|
||||
});
|
||||
publicDirectoryLoaded = true;
|
||||
publicEnabledSkinIds = new Set([
|
||||
...BUILTIN_SKIN_CATALOG.map((skin) => skin.id),
|
||||
...directorySkins.filter((skin) => skin.enabled).map((skin) => skin.id),
|
||||
]);
|
||||
const requestedDefault = (payload as { defaultSkinId?: unknown }).defaultSkinId;
|
||||
publicDefaultSkinId = typeof requestedDefault === "string" && publicEnabledSkinIds.has(requestedDefault) ? requestedDefault : "builtin.light";
|
||||
return [...BUILTIN_SKIN_CATALOG, ...directorySkins.filter((skin) => skin.enabled)];
|
||||
} catch {
|
||||
return [];
|
||||
publicDirectoryLoaded = false;
|
||||
publicEnabledSkinIds = new Set(BUILTIN_SKIN_CATALOG.map((skin) => skin.id));
|
||||
publicDefaultSkinId = "builtin.light";
|
||||
return BUILTIN_SKIN_CATALOG;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import { readFile } from "node:fs/promises";
|
||||
import test from "node:test";
|
||||
import { strToU8, zipSync } from "fflate";
|
||||
import { importSkinPack, resolveSkinCssAssets, SkinPackError } from "./skin-pack.js";
|
||||
import { scopeBuiltinThemeForCustomSkin } from "./skin-cascade.js";
|
||||
|
||||
const manifest = {
|
||||
schemaVersion: 1,
|
||||
@@ -19,68 +20,203 @@ test("skin CSS is scoped, local artwork and fonts work, and global names are iso
|
||||
const skin = await importSkinPack(makeSkin(`
|
||||
@font-face { font-family: "Wave Font"; src: url("assets/wave.woff2") format("woff2"); }
|
||||
@keyframes shimmer { from { opacity: .4; } to { opacity: 1; } }
|
||||
:root { --accent: #00a99d; }
|
||||
.voice-card { font-family: "Wave Font", sans-serif; animation: shimmer 1s ease-in-out; background-image: image-set("assets/backdrop.png" 1x); }
|
||||
:root { --skin-accent: #00a99d; }
|
||||
[data-ws-part="voice.member"] { font-family: "Wave Font", sans-serif; animation: shimmer 1s ease-in-out; background-image: image-set("assets/backdrop.png" 1x); }
|
||||
`));
|
||||
|
||||
assert.match(skin.css, /\.ws-skin-root\[data-ws-skin="ocean-night"\] \{ --accent: #00a99d; \}/);
|
||||
assert.match(skin.css, /\.ws-skin-root\[data-ws-skin="ocean-night"\] \{ --skin-accent: #00a99d; \}/);
|
||||
assert.match(skin.css, /@keyframes ws-ocean-night-shimmer/);
|
||||
assert.match(skin.css, /animation: ws-ocean-night-shimmer/);
|
||||
assert.match(skin.css, /font-family: "ws-ocean-night-Wave-Font"/);
|
||||
assert.match(skin.css, /url\("wskin-asset:assets%2Fwave\.woff2"\)/);
|
||||
assert.match(skin.css, /image-set\("wskin-asset:assets%2Fbackdrop\.png" 1x\)/);
|
||||
assert.ok(skin.warnings.some((warning) => warning.includes("localized text wrapping")));
|
||||
assert.equal(skin.contentData, undefined, "skin content is optional; WebSpeak supplies the base interface translations");
|
||||
|
||||
const resolved = resolveSkinCssAssets(skin.css, skin.assets);
|
||||
assert.match(resolved.css, /blob:/);
|
||||
resolved.objectUrls.forEach((url) => URL.revokeObjectURL(url));
|
||||
});
|
||||
|
||||
test("skin CSS permits hiding explicitly optional decoration while protecting controls and containers", async () => {
|
||||
const skin = await importSkinPack(makeSkin('@keyframes fade-wave { from { opacity: 0; } to { opacity: 1; } } [data-ws-part="demo.wave"] { display: none !important; opacity: var(--decorative-opacity); all: unset; animation: fade-wave 1s; }'));
|
||||
assert.match(skin.css, /display: none !important/);
|
||||
assert.match(skin.css, /opacity: var\(--decorative-opacity\)/);
|
||||
assert.match(skin.css, /all: unset/);
|
||||
test("skin CSS permits visual decoration but prevents layout, text-flow, and control-geometry changes", async () => {
|
||||
const skin = await importSkinPack(makeSkin('@keyframes fade-wave { from { opacity: 0; } to { opacity: 1; } } [data-ws-part="demo.wave"] { opacity: var(--skin-decoration-opacity); animation: fade-wave 1s; box-shadow: 0 0 14px #4ff; }'));
|
||||
assert.match(skin.css, /opacity: var\(--skin-decoration-opacity\)/);
|
||||
assert.match(skin.css, /box-shadow: 0 0 14px #4ff/);
|
||||
assert.match(skin.css, /from \{ opacity: 0; \}/);
|
||||
assert.match(skin.css, /animation: ws-ocean-night-fade-wave 1s/);
|
||||
|
||||
await assert.rejects(importSkinPack(makeSkin(".required { display: none; }")), (error: unknown) => error instanceof Error && error.message.includes("explicitly optional visual parts"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="voice.screen-player.exit"] { display: none; }')), (error: unknown) => error instanceof Error && error.message.includes("must not change layout"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="voice.screen-player.exit"] { position: fixed; inset: 0; z-index: 99999; }')), (error: unknown) => error instanceof Error && error.message.includes("must not change layout"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="voice.member"] { padding: 30px; transform: scale(1.2); }')), (error: unknown) => error instanceof Error && error.message.includes("must not change layout"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="home.hero.title"] { font-size: 3rem; line-height: 1; white-space: nowrap; }')), (error: unknown) => error instanceof Error && error.message.includes("must not change layout"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="home.hero.title"] { text-transform: uppercase; }')), (error: unknown) => error instanceof Error && error.message.includes("must not change layout"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="voice.screen-player.exit"] { opacity: 0; }')), (error: unknown) => error instanceof Error && error.message.includes("explicitly optional visual parts"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="demo.wave"] .child { display: none; }')), (error: unknown) => error instanceof Error && error.message.includes("explicitly optional visual parts"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="voice.screen-player.exit"] { display: var(--hidden); }')), (error: unknown) => error instanceof Error && error.message.includes("indirect values"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="voice.screen-player.exit"] { all: unset; }')), (error: unknown) => error instanceof Error && error.message.includes("explicitly optional visual parts"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="demo.wave"] span { display: none; }')), (error: unknown) => error instanceof Error && error.message.includes("must not change layout"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="voice.screen-player.exit"] { display: var(--skin-hidden); }')), (error: unknown) => error instanceof Error && error.message.includes("must not change layout"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="voice.screen-player.exit"] { all: unset; }')), (error: unknown) => error instanceof Error && error.message.includes("must not change layout"));
|
||||
await assert.rejects(importSkinPack(makeSkin('@keyframes hide-control { to { opacity: 0; } } [data-ws-part="voice.screen-player.exit"] { animation: hide-control 1s infinite; }')), (error: unknown) => error instanceof Error && error.message.includes("explicitly optional visual parts"));
|
||||
await assert.rejects(importSkinPack(makeSkin('@keyframes hide-control { to { opacity: 0; } } [data-ws-part="control"] { animation: var(--custom-animation); }')), (error: unknown) => error instanceof Error && error.message.includes("explicitly optional visual parts"));
|
||||
await assert.rejects(importSkinPack(makeSkin(".art { background-image: image-set(\"https://example.invalid/remote.png\" 1x); }")), (error: unknown) => error instanceof SkinPackError && error.code === "SKIN_EXTERNAL_RESOURCE");
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="home"] { --accent: red; }')), (error: unknown) => error instanceof Error && error.message.includes("--skin- prefix"));
|
||||
await assert.rejects(importSkinPack(makeSkin(".internal-class { color: red; }")), (error: unknown) => error instanceof Error && error.message.includes("must use :root"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="demo.voice-card"].private-component { color: red; }')), (error: unknown) => error instanceof Error && error.message.includes("must use :root"));
|
||||
await assert.rejects(importSkinPack(makeSkin('[data-ws-part="home"] { background-image: image-set("https://example.invalid/remote.png" 1x); }')), (error: unknown) => error instanceof SkinPackError && error.code === "SKIN_EXTERNAL_RESOURCE");
|
||||
});
|
||||
|
||||
test("custom skins can override theme appearance without !important or private class selectors", () => {
|
||||
const css = '.ws-skin-root[data-ws-skin="builtin.dark"] .join-page .join-card { color: white; }';
|
||||
assert.equal(
|
||||
scopeBuiltinThemeForCustomSkin(css, "dark", "community.illusia-voice"),
|
||||
':where(.ws-skin-root[data-ws-skin="community.illusia-voice"]) .join-page .join-card { color: white; }',
|
||||
);
|
||||
});
|
||||
|
||||
test("community skins use a scoped light fallback instead of inheriting the night skin", async () => {
|
||||
const lightCss = await readFile(new URL("../skins/builtin/light/skin.css", import.meta.url), "utf8");
|
||||
const scoped = scopeBuiltinThemeForCustomSkin(lightCss, "light", "community.illusia-voice");
|
||||
assert.match(scoped, /:where\(\.ws-skin-root\[data-ws-skin="community\.illusia-voice"\]\) \{\s*color-scheme: light;/);
|
||||
assert.match(scoped, /:where\(\.ws-skin-root\[data-ws-skin="community\.illusia-voice"\]\) \.settings-content/);
|
||||
});
|
||||
|
||||
test("all public skin parts are documented and the admin console is outside skin scope", async () => {
|
||||
const [webClient, demo, admin, documentation] = await Promise.all([
|
||||
const [webClient, demo, skinSwitcher, languageSwitcher, admin, documentation] = await Promise.all([
|
||||
readFile(new URL("../views/WebClient.vue", import.meta.url), "utf8"),
|
||||
readFile(new URL("../views/DemoView.vue", import.meta.url), "utf8"),
|
||||
readFile(new URL("../components/SkinSwitcher.vue", import.meta.url), "utf8"),
|
||||
readFile(new URL("../components/LanguageSwitcher.vue", import.meta.url), "utf8"),
|
||||
readFile(new URL("../views/AdminView.vue", import.meta.url), "utf8"),
|
||||
readFile(new URL("../../../docs/SKIN_DEVELOPMENT.md", import.meta.url), "utf8"),
|
||||
]);
|
||||
const publicParts = new Set([...`${webClient}\n${demo}`.matchAll(/data-ws-part="([^"]+)"/g)].map((match) => match[1]));
|
||||
const publicParts = new Set([...`${webClient}\n${demo}\n${skinSwitcher}\n${languageSwitcher}`.matchAll(/data-ws-part="([^"]+)"/g)].map((match) => match[1]));
|
||||
for (const part of publicParts) assert.ok(documentation.includes(`\`${part}\``), `Undocumented skin part: ${part}`);
|
||||
assert.match(skinSwitcher, /data-ws-skin-id/);
|
||||
assert.match(skinSwitcher, /data-ws-state/);
|
||||
assert.match(languageSwitcher, /data-ws-language/);
|
||||
assert.doesNotMatch(admin, /ws-skin-root|data-ws-page=/);
|
||||
assert.doesNotMatch(demo, /:global\(:root\[data-theme="dark"\]\)/);
|
||||
assert.match(demo, /\.demo-page\[data-ws-skin="builtin\.dark"\]/);
|
||||
});
|
||||
|
||||
test("public skin and language selectors keep readable light surfaces in dark mode", async () => {
|
||||
const [skinSwitcher, languageSwitcher, darkSkin] = await Promise.all([
|
||||
readFile(new URL("../components/SkinSwitcher.vue", import.meta.url), "utf8"),
|
||||
readFile(new URL("../components/LanguageSwitcher.vue", import.meta.url), "utf8"),
|
||||
readFile(new URL("../skins/builtin/dark/skin.css", import.meta.url), "utf8"),
|
||||
]);
|
||||
|
||||
assert.match(skinSwitcher, /\.skin-trigger\s*\{[^}]*background:\s*rgba\(250,\s*254,\s*255/i);
|
||||
assert.match(skinSwitcher, /\.skin-dropdown\s*\{[^}]*background:\s*linear-gradient/i);
|
||||
assert.match(skinSwitcher, /\.skin-option\s*\{[^}]*color:\s*#123849/i);
|
||||
assert.match(languageSwitcher, /\.language-dropdown\s*\{[^}]*background:\s*#fff/i);
|
||||
assert.doesNotMatch(darkSkin, /\.language-switcher\s+\.language-(?:trigger|dropdown|option)/);
|
||||
});
|
||||
|
||||
test("skin content supports localized interface message overrides and includes the preview as an asset", async () => {
|
||||
const content = { defaultLocale: "en", locales: { en: { home: { title: "Welcome" }, messages: { speakingNow: "Live now" } } } };
|
||||
const skin = await importSkinPack(makeSkin(".voice-card { background: url(assets/preview.png); }", content));
|
||||
const skin = await importSkinPack(makeSkin('[data-ws-part="demo.voice-card"] { background: url(assets/preview.png); }', content));
|
||||
assert.equal(skin.contentData?.locales.en?.messages?.speakingNow, "Live now");
|
||||
assert.equal(skin.previewBlob?.type, "image/png");
|
||||
assert.ok(skin.assets["assets/preview.png"]);
|
||||
});
|
||||
|
||||
test("the documented Aurora Voice example package imports with its artwork and localized copy", async () => {
|
||||
const bytes = await readFile(new URL("../../../docs/examples/aurora-voice.wskin", import.meta.url));
|
||||
const skin = await importSkinPack(new File([bytes], "aurora-voice.wskin", { type: "application/octet-stream" }));
|
||||
assert.equal(skin.id, "community.aurora-voice");
|
||||
assert.equal(skin.contentData?.locales["zh-CN"]?.home?.title, "自在");
|
||||
assert.equal(skin.contentData?.locales.en?.messages?.["demo.heroLead"], "This demo is styled by the same package as the connection and voice pages.");
|
||||
assert.equal(skin.previewBlob?.type, "image/jpeg");
|
||||
assert.match(skin.css, /\.ws-skin-root\[data-ws-skin="community\.aurora-voice"\]/);
|
||||
test("the ILLUSIA visual-only example imports without replacing WebSpeak's base translations", async () => {
|
||||
const bytes = await readFile(new URL("../../../docs/examples/illusia-voice.wskin", import.meta.url));
|
||||
const skin = await importSkinPack(new File([bytes], "illusia-voice.wskin", { type: "application/octet-stream" }));
|
||||
assert.equal(skin.id, "community.illusia-voice");
|
||||
assert.equal(skin.name, "ILLUSIA风");
|
||||
assert.equal(skin.version, "1.0.25");
|
||||
assert.equal(skin.contentData, undefined);
|
||||
assert.equal(skin.previewBlob?.type, "image/webp");
|
||||
assert.ok(skin.assets["assets/background-composite.webp"]);
|
||||
assert.ok(skin.assets["assets/bg-room-main.webp"]);
|
||||
assert.ok(skin.assets["assets/banner-character-main.webp"]);
|
||||
assert.ok(skin.assets["assets/foreground-headphone.webp"]);
|
||||
assert.ok(skin.assets["assets/chat-empty-chibi.webp"]);
|
||||
assert.ok(skin.assets["assets/visitor-avatar.webp"]);
|
||||
assert.ok(skin.assets["assets/button-mascot.webp"]);
|
||||
assert.ok(skin.assets["assets/footer-wave.png"]);
|
||||
assert.match(skin.css, /\.ws-skin-root\[data-ws-skin="community\.illusia-voice"\]/);
|
||||
assert.match(skin.css, /home\.visitors.*?nth-child\(2\)/s);
|
||||
assert.match(skin.css, /skin\.menu/);
|
||||
assert.match(skin.css, /skin\.menu[^{}]*\[role="listbox"\]/);
|
||||
assert.match(skin.css, /skin\.option/);
|
||||
assert.match(skin.css, /language\.trigger/);
|
||||
assert.match(skin.css, /language\.menu[^{}]*\[role="listbox"\]/);
|
||||
assert.match(skin.css, /language\.option/);
|
||||
assert.match(skin.css, /data-ws-skin-id="community\.illusia-voice"/);
|
||||
assert.match(skin.css, /data-ws-part="home\.join-card\.waveform"/);
|
||||
assert.match(skin.css, /data-ws-part="home\.join-card\.sonar"/);
|
||||
assert.match(skin.css, /data-ws-part="home\.join-card"\]\s*\{[^}]*background-image:\s*url\("wskin-asset:assets%2Fbanner-mascot-blob\.webp"\)/s);
|
||||
assert.doesNotMatch(skin.css, /data-ws-part="home\.join-card"\]\s*\{[^}]*radial-gradient/s);
|
||||
assert.match(skin.css, /data-ws-part="voice\.member-panel"\]\s*\{[^}]*background-position:\s*0 0, right top, right top, center/s);
|
||||
assert.match(skin.css, /data-ws-part="voice\.member-panel"\]\s*::before\s*\{[^}]*background-image:\s*url\("wskin-asset:assets%2Fforeground-headphone\.webp"\)[^}]*filter:\s*drop-shadow/s);
|
||||
assert.doesNotMatch(skin.css, /illusia-card-signal|illusia-card-glow/);
|
||||
assert.match(skin.css, /illusia-home-aura/);
|
||||
assert.match(skin.css, /voice\.activity[\s\S]*?wskin-asset:assets%2Fbanner-character-main\.webp/);
|
||||
assert.match(skin.css, /voice\.activity\.artwork[\s\S]*?wskin-asset:assets%2Fbanner-character-main\.webp/);
|
||||
assert.match(skin.css, /data-ws-part="voice\.activity"\]\s*\{[^}]*border-color:\s*rgba\(113, 211, 222, \.62\);[^}]*border-radius:\s*24px;[^}]*background-image:[\s\S]*?bg-room-main\.webp[^}]*backdrop-filter:\s*blur\(10px\)/);
|
||||
assert.match(skin.css, /voice\.activity\.artwork[^{}]*\{[^}]*background-position:\s*right 34% center;[^}]*background-size:\s*auto 320px;[^}]*filter:\s*drop-shadow\(0 18px 22px/);
|
||||
assert.doesNotMatch(skin.css, /voice\.chat\.empty[^{}]*data-ws-state="messages-empty"\]\s*> :first-child/);
|
||||
assert.match(skin.css, /data-ws-part="voice\.channel-group"\]\s*\{[^}]*border-color:\s*rgba\(8, 126, 134, \.32\)/);
|
||||
assert.match(skin.css, /data-ws-part="voice\.channel-group"\]\[data-ws-state="current"\]\s*\{[^}]*border-color:\s*rgba\(8, 126, 134, \.48\)/);
|
||||
assert.match(skin.css, /voice\.chat\.empty[^{}]*data-ws-state="messages-empty"[\s\S]*?wskin-asset:assets%2Fchat-empty-chibi\.webp/);
|
||||
assert.match(skin.css, /voice\.chat\.empty[^{}]*\{[^}]*background-size:\s*22px 22px, 300px 250px, cover, min\(340px, 46vw\) auto/s);
|
||||
assert.match(skin.css, /voice\.chat\.empty[^{}]*data-ws-state="messages-empty"[^{}]*\{[^}]*background-position:\s*0 0, right center, center, center 8px;[^}]*background-size:\s*22px 22px, 300px 250px, cover, min\(340px, 46vw\) auto/s);
|
||||
assert.match(skin.css, /data-ws-state="messages-empty"\]::before\s*\{[^}]*color:\s*rgba\(71, 126, 148, \.9\);[^}]*radial-gradient\(circle, #527f91 0 1\.6px/s);
|
||||
assert.match(skin.css, /data-ws-state="messages-empty"\]::after\s*\{[^}]*color:\s*rgba\(71, 126, 148, \.9\)/s);
|
||||
assert.match(skin.css, /@media \(max-width: 1100px\)[\s\S]*?voice\.chat\.empty[^{}]*\{[^}]*background-position:\s*0 0, right 8px center, center, center 8px;[^}]*background-size:\s*22px 22px, 260px 220px, cover, min\(300px, 66vw\) auto/s);
|
||||
assert.match(skin.css, /@media \(max-width: 1100px\)[\s\S]*?voice\.chat\.empty[^{}]*data-ws-state="messages-empty"[^{}]*\{[^}]*background-position:\s*0 0, right center, center, center 8px;[^}]*background-size:\s*22px 22px, 260px 220px, cover, min\(300px, 66vw\) auto/s);
|
||||
assert.doesNotMatch(skin.css, /data-ws-state="messages-empty"[^{}]*\{[^}]*color: transparent/s);
|
||||
assert.doesNotMatch(skin.css, /(?:^|[;{\s])(?:position|inset|top|right|bottom|left|width|height|min-height|padding|z-index|transform)\s*:/);
|
||||
assert.doesNotMatch(skin.css, /\[data-ws-part="home\.join-card"\]\s*\{[^}]*animation:/);
|
||||
assert.doesNotMatch(skin.css, /\[data-ws-part="home\.join-card"\]\s*\{\s*animation: none;/);
|
||||
assert.match(skin.css, /home\.footer[\s\S]*?footer-wave\.png/);
|
||||
assert.match(skin.css, /\[data-ws-part="home"\] \[data-ws-part="home\.connect"\]/);
|
||||
assert.doesNotMatch(skin.css, /\[data-ws-page="home"\] \[data-ws-part="home\.connect"\]/);
|
||||
assert.match(skin.css, /home\.connect[\s\S]*?wskin-asset:assets%2Fbutton-mascot\.webp/);
|
||||
assert.match(skin.css, /data-ws-page="demo"[^{}]*\{[^}]*wskin-asset:assets%2Fforeground-headphone\.webp[^}]*background-position:\s*left bottom, center, center;[^}]*background-size:\s*min\(34vw, 430px\) auto, auto, cover/s);
|
||||
assert.match(skin.css, /voice\.screen-player[\s\S]*?background: linear-gradient\(135deg, rgba\(250, 255, 255, \.96\), rgba\(220, 245, 250, \.94\)\)/);
|
||||
assert.doesNotMatch(skin.css, /voice\.screen-player[^{}]*\{[^}]*background: rgba\(10, 34, 45, \.96\)/);
|
||||
});
|
||||
|
||||
test("the activity artwork layer floats above room content without intercepting controls", async () => {
|
||||
const css = await readFile(new URL("../styles/web-client.css", import.meta.url), "utf8");
|
||||
assert.match(css, /\.app-shell \.workspace-content\s*\{\s*position: relative;\s*isolation: isolate;/);
|
||||
assert.match(css, /\.voice-activity-artwork\s*\{\s*position: absolute;\s*z-index: 2;\s*inset: -26px 0 -48px;[^}]*pointer-events: none;/);
|
||||
assert.match(css, /\.voice-activity-artwork\s*\{[^}]*transform: perspective\(1100px\) rotateY\(-2\.5deg\) translateZ\(22px\)/);
|
||||
assert.match(css, /\.app-shell \.member-panel::before\s*\{\s*content: "";\s*position: absolute;\s*z-index: 1;\s*left: -28px;\s*bottom: 18px;\s*width: min\(430px, calc\(100vw - 24px\)\);\s*aspect-ratio: 3 \/ 2;[^}]*perspective\(1100px\) rotateY\(-8deg\)/);
|
||||
assert.match(css, /\.app-shell \.chat-empty\[data-ws-state="messages-empty"\]\s*\{[^}]*min-height: 210px;\s*padding: 126px 12px 10px;/);
|
||||
assert.match(css, /\.app-shell \.chat-panel \.section-heading,[\s\S]*?\.app-shell \.chat-panel \.message-composer\s*\{\s*position: relative;\s*z-index: 3;/);
|
||||
assert.match(css, /\.screen-share-player\s*\{[^}]*background: var\(--surface-1\)/);
|
||||
assert.match(css, /\.screen-share-player-exit\s*\{[^}]*z-index: 3;/);
|
||||
assert.match(css, /\.screen-share-player-stage\s*\{[^}]*var\(--accent\)[^}]*var\(--surface-2\)/);
|
||||
assert.match(css, /\.screen-share-player-video\s*\{[^}]*background: var\(--surface-2\)/);
|
||||
assert.match(css, /@media \(min-width: 741px\)\s*\{\s*\/\* Keep header menus above the independently stacked screen-share stage\. \*\/\s*\.app-shell \.workspace-header\s*\{\s*position: relative;\s*z-index: 40;/);
|
||||
});
|
||||
|
||||
test("channel empty state removes its bubble ornament and keeps the text-channel label", async () => {
|
||||
const [view, chat] = await Promise.all([
|
||||
readFile(new URL("../views/WebClient.vue", import.meta.url), "utf8"),
|
||||
readFile(new URL("../composables/useWebClientChat.ts", import.meta.url), "utf8"),
|
||||
]);
|
||||
assert.doesNotMatch(view, /data-ws-state="messages-empty"><div class="chat-empty-icon"/);
|
||||
assert.match(view, /class="section-kicker">\{\{ chatTabLabel \}\}/);
|
||||
assert.match(chat, /tab\.value === "channel" \? t\("textChannel"\)/);
|
||||
});
|
||||
|
||||
test("homepage motion and room content spacing preserve the ILLUSIA layout", async () => {
|
||||
const css = await readFile(new URL("../styles/web-client.css", import.meta.url), "utf8");
|
||||
assert.ok(css.includes('.join-page *:not([data-ws-part="home.join-card"])'));
|
||||
assert.ok(css.includes("animation: none !important"));
|
||||
assert.doesNotMatch(css, /\.join-page \*, \.join-page \*::before, \.join-page \*::after\s*\{\s*animation: none !important/);
|
||||
assert.ok(css.includes("padding: 0 clamp(12px, 1.4vw, 22px);"), "homepage header contents keep an inset from their container edge");
|
||||
assert.ok(css.includes(".chat-panel { margin-top: 34px; padding: 0 clamp(14px, 1.8vw, 24px) 20px;"), "chat children keep horizontal and bottom breathing room");
|
||||
assert.match(css, /\.app-shell \.voice-section \{\s*position: relative;\s*padding: clamp\(14px, 1\.8vw, 24px\);/);
|
||||
assert.match(css, /@media \(max-width: 740px\) \{\s*\.app-shell \.voice-section \{\s*padding: 14px 10px 16px;/);
|
||||
assert.match(css, /\.promise-list \{\s*display: grid;\s*width: 100%;\s*grid-template-columns: repeat\(3, minmax\(0, 1fr\)\);/);
|
||||
assert.match(css, /\.promise-item \{\s*min-width: 0;\s*min-height: 58px;[\s\S]*?padding: 9px 11px;/);
|
||||
assert.match(css, /@media \(max-width: 420px\) \{\s*\.promise-list \{\s*grid-template-columns: minmax\(0, 1fr\);/);
|
||||
assert.match(css, /\.join-card-waveform i \{[^}]*animation: screen-share-wave 1\.1s ease-in-out infinite alternate;/);
|
||||
assert.match(css, /@keyframes join-card-sonar-ring[\s\S]*?transform: scale\(\.6\); opacity: \.62;[\s\S]*?transform: scale\(1\); opacity: 0;/);
|
||||
});
|
||||
|
||||
function makeSkin(css: string, content?: unknown): File {
|
||||
|
||||
@@ -11,12 +11,30 @@ const MAX_CONTENT_BYTES = 256 * 1024;
|
||||
const MAX_IMAGE_BYTES = 16 * 1024 * 1024;
|
||||
const MAX_FONT_BYTES = 4 * 1024 * 1024;
|
||||
const ALLOWED_AT_RULES = new Set(["media", "supports", "container", "layer", "font-face", "keyframes", "-webkit-keyframes"]);
|
||||
const LAYOUT_AFFECTING_PROPERTIES = new Set([
|
||||
"all", "display", "position", "top", "right", "bottom", "left", "inset", "inset-block", "inset-inline",
|
||||
"width", "height", "min-width", "min-height", "max-width", "max-height", "inline-size", "block-size",
|
||||
"min-inline-size", "min-block-size", "max-inline-size", "max-block-size", "aspect-ratio", "box-sizing",
|
||||
"gap", "row-gap", "column-gap", "grid", "flex", "order", "float", "clear", "overflow", "overflow-x",
|
||||
"overflow-y", "overflow-block", "overflow-inline", "overscroll-behavior", "z-index", "visibility",
|
||||
"pointer-events", "clip", "clip-path", "mask", "mask-image", "transform", "transform-origin", "transform-style", "translate", "scale", "rotate",
|
||||
"perspective", "perspective-origin", "contain", "content-visibility", "container", "container-name",
|
||||
"container-type", "contain-intrinsic-size", "resize", "columns", "column-count", "column-width", "scrollbar-width", "font",
|
||||
"font-size", "line-height", "letter-spacing", "word-spacing", "white-space", "word-break", "overflow-wrap", "word-wrap",
|
||||
"text-wrap", "text-overflow", "text-indent", "text-transform", "text-combine-upright", "text-autospace", "text-spacing-trim",
|
||||
"line-clamp", "tab-size", "hyphens", "line-break", "text-size-adjust", "initial-letter", "shape-outside", "baseline-shift",
|
||||
"box-orient", "box-direction", "box-lines", "ruby-position", "caption-side", "table-layout", "border-collapse", "border-spacing",
|
||||
"writing-mode", "direction", "unicode-bidi", "vertical-align", "appearance", "zoom", "scrollbar-gutter", "touch-action", "user-select", "cursor", "content",
|
||||
"position-anchor", "position-area", "position-try-fallbacks", "position-try-order", "anchor-name", "anchor-scope",
|
||||
]);
|
||||
const OPTIONAL_VISUAL_PARTS = new Set([
|
||||
"home.hero.eyebrow",
|
||||
"home.gateway-status",
|
||||
"home.features",
|
||||
"home.feature",
|
||||
"home.visitors",
|
||||
"home.join-card.waveform",
|
||||
"home.join-card.sonar",
|
||||
"voice.activity-heading",
|
||||
"voice.member.avatar",
|
||||
"voice.member.live-indicator",
|
||||
@@ -440,6 +458,7 @@ function compileSkinCss(source: string, id: string, assets: Record<string, Blob>
|
||||
root.walkRules((rule: Rule) => {
|
||||
if (hasKeyframesAncestor(rule)) return;
|
||||
if (rule.parent?.type === "rule") throw rule.error("Nested style rules are not supported; use flat selectors.");
|
||||
if (!selectorUsesPublicHook(rule.selector)) throw rule.error("Skin selectors must use :root, [data-ws-page], or [data-ws-part] so they stay attached to WebSpeak's stable visual interface.");
|
||||
if (targetsOnlyOptionalVisualParts(rule.selector)) hideableRules.add(rule);
|
||||
try {
|
||||
rule.selector = selectorParser((selectors) => {
|
||||
@@ -493,6 +512,13 @@ function compileSkinCss(source: string, id: string, assets: Record<string, Blob>
|
||||
const canHideTarget = owningRule
|
||||
? hideableRules.has(owningRule) || Boolean(keyframesRule && optionalOnlyKeyframes.has(keyframesRule.params.trim()))
|
||||
: false;
|
||||
if (property.startsWith("--") && !/^--skin-[a-z0-9_-]+$/i.test(property)) {
|
||||
throw declaration.error("Custom skin variables must use the --skin- prefix so they cannot replace WebSpeak's structural tokens.");
|
||||
}
|
||||
if (isLayoutAffectingProperty(property)) {
|
||||
throw declaration.error("Skin CSS may change component artwork and appearance, but must not change layout, positioning, sizing, text flow, or interaction geometry.");
|
||||
}
|
||||
if (property === "font-family") warnings.add("Custom fonts can change localized text wrapping; verify every WebSpeak language before publishing.");
|
||||
if (["behavior", "-moz-binding"].includes(property) || /expression\s*\(|javascript\s*:|vbscript\s*:/i.test(value)) {
|
||||
throw declaration.error("Executable CSS values are not allowed.");
|
||||
}
|
||||
@@ -543,6 +569,33 @@ function targetsOnlyOptionalVisualParts(selector: string): boolean {
|
||||
}
|
||||
}
|
||||
|
||||
function selectorUsesPublicHook(selector: string): boolean {
|
||||
try {
|
||||
const parsed = selectorParser().astSync(selector);
|
||||
return parsed.nodes.length > 0 && parsed.nodes.every((item) => {
|
||||
let scoped = false;
|
||||
let usesPrivateName = false;
|
||||
item.walk((node) => {
|
||||
if (node.type === "attribute" && ["data-ws-part", "data-ws-page"].includes(node.attribute.toLowerCase())) scoped = true;
|
||||
if (node.type === "pseudo" && node.value.toLowerCase() === ":root") scoped = true;
|
||||
if (node.type === "class" || node.type === "id") usesPrivateName = true;
|
||||
});
|
||||
return scoped && !usesPrivateName;
|
||||
});
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isLayoutAffectingProperty(property: string): boolean {
|
||||
const unprefixed = property.replace(/^-(?:webkit|moz|ms|o)-/, "");
|
||||
if (LAYOUT_AFFECTING_PROPERTIES.has(unprefixed)) return true;
|
||||
if (/^(?:margin|padding)(?:-|$)/.test(unprefixed)) return true;
|
||||
if (/^border(?:-|$)/.test(unprefixed) && !/^border-(?:color(?:-|$)|radius(?:-|$))/.test(unprefixed)) return true;
|
||||
if (/^(?:grid|flex|align-(?:content|items|self)|justify-(?:content|items|self)|place-(?:content|items|self)|offset|transform|overscroll|overflow|column)(?:-|$)/.test(unprefixed)) return true;
|
||||
return /^font-(?!family$|weight$|style$|synthesis$|palette$)/.test(unprefixed);
|
||||
}
|
||||
|
||||
function findOwningRule(node: Node): Rule | null {
|
||||
let parent = node.parent;
|
||||
while (parent && parent.type !== "root") {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { getInstalledSkin, saveInstalledSkin } from "./local-persistence.js";
|
||||
import type { InstalledSkin } from "./skin-pack.js";
|
||||
import { applyTheme, getBuiltinSkinCss, getStoredTheme, isDarkTheme, type ThemeMode } from "./theme.js";
|
||||
import { applyTheme, getBuiltinSkinCss, getStoredTheme, isDarkTheme } from "./theme.js";
|
||||
import { scopeBuiltinThemeForCustomSkin } from "./skin-cascade.js";
|
||||
import { getBundledSkinPackageUrl, isPublicSkinEnabled } from "./skin-catalog.js";
|
||||
|
||||
export const ACTIVE_SKIN_KEY = "webspeak:active-skin";
|
||||
export const BUILTIN_LIGHT_SKIN = "builtin.light";
|
||||
export const BUILTIN_DARK_SKIN = "builtin.dark";
|
||||
const CUSTOM_STYLE_ID = "webspeak-active-custom-skin";
|
||||
const BUILTIN_STYLE_ID = "webspeak-active-built-in-skin";
|
||||
const CUSTOM_BASE_STYLE_ID = "webspeak-active-custom-skin-base";
|
||||
|
||||
let activeAssetUrls: string[] = [];
|
||||
let criticalControlObserver: MutationObserver | null = null;
|
||||
@@ -27,7 +29,7 @@ export async function activateStoredSkin(): Promise<InstalledSkin | null> {
|
||||
return activateSkin(selectedId);
|
||||
}
|
||||
|
||||
export async function activateSkin(id: string, expectedVersion?: string, appVersion = "0.2.4"): Promise<InstalledSkin | null> {
|
||||
export async function activateSkin(id: string, expectedVersion?: string, appVersion = "0.2.5-preview"): Promise<InstalledSkin | null> {
|
||||
if (id === BUILTIN_LIGHT_SKIN || id === BUILTIN_DARK_SKIN) {
|
||||
clearCustomSkinStyle();
|
||||
applyTheme(id === BUILTIN_DARK_SKIN ? "dark" : "light");
|
||||
@@ -35,11 +37,16 @@ export async function activateSkin(id: string, expectedVersion?: string, appVers
|
||||
storeSkinId(id);
|
||||
return null;
|
||||
}
|
||||
if (!isPublicSkinEnabled(id)) {
|
||||
if (typeof localStorage !== "undefined") localStorage.removeItem("webspeak:skin-choice");
|
||||
return fallBackToBuiltin();
|
||||
}
|
||||
|
||||
let skin = await getInstalledSkin(id);
|
||||
if (!skin || (expectedVersion && skin.version !== expectedVersion)) {
|
||||
try {
|
||||
const response = await fetch(`/api/skins/${encodeURIComponent(id)}/package`, { cache: "no-cache" });
|
||||
const packageUrl = getBundledSkinPackageUrl(id) ?? `/api/skins/${encodeURIComponent(id)}/package`;
|
||||
const response = await fetch(packageUrl, { cache: "no-cache" });
|
||||
if (!response.ok) throw new Error("Skin package is no longer available.");
|
||||
const archive = await response.blob();
|
||||
const file = new File([archive], `${id}.wskin`, { type: "application/octet-stream" });
|
||||
@@ -59,13 +66,19 @@ export async function activateSkin(id: string, expectedVersion?: string, appVers
|
||||
try {
|
||||
const { resolveSkinCssAssets } = await import("./skin-pack.js");
|
||||
const compiled = resolveSkinCssAssets(skin.css, skin.assets);
|
||||
const baseTheme: Exclude<ThemeMode, "system"> = isDarkTheme(getStoredTheme()) ? "dark" : "light";
|
||||
applyTheme(baseTheme);
|
||||
const root = document.getElementById(BUILTIN_STYLE_ID) as HTMLStyleElement | null;
|
||||
if (root) {
|
||||
root.dataset.skinPackage = skin.id;
|
||||
root.textContent = getBuiltinSkinCss(baseTheme).replaceAll(`data-ws-skin="builtin.${baseTheme}"`, `data-ws-skin="${skin.id}"`);
|
||||
// A community skin is a complete appearance choice, not an overlay on the
|
||||
// previously selected day/night skin. Keep the document theme (used by the
|
||||
// independent admin appearance) but give unstyled public parts a light,
|
||||
// neutral fallback. A custom skin can opt into dark colors itself.
|
||||
applyTheme(getStoredTheme());
|
||||
let baseStyle = document.getElementById(CUSTOM_BASE_STYLE_ID) as HTMLStyleElement | null;
|
||||
if (!baseStyle) {
|
||||
baseStyle = document.createElement("style");
|
||||
baseStyle.id = CUSTOM_BASE_STYLE_ID;
|
||||
document.head.append(baseStyle);
|
||||
}
|
||||
baseStyle.dataset.skinPackage = skin.id;
|
||||
baseStyle.textContent = scopeBuiltinThemeForCustomSkin(getBuiltinSkinCss("light"), "light", skin.id);
|
||||
document.querySelectorAll<HTMLElement>(".ws-skin-root").forEach((clientRoot) => {
|
||||
clientRoot.dataset.wsSkin = skin!.id;
|
||||
});
|
||||
@@ -99,6 +112,7 @@ function fallBackToBuiltin(): null {
|
||||
|
||||
export function clearCustomSkinStyle(): void {
|
||||
document.getElementById(CUSTOM_STYLE_ID)?.remove();
|
||||
document.getElementById(CUSTOM_BASE_STYLE_ID)?.remove();
|
||||
activeAssetUrls.forEach((url) => URL.revokeObjectURL(url));
|
||||
activeAssetUrls = [];
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export function getStoredTheme(): ThemeMode {
|
||||
return value === "light" || value === "dark" || value === "system" ? value : "system";
|
||||
}
|
||||
|
||||
export function applyTheme(theme: ThemeMode): void {
|
||||
export function applyTheme(theme: ThemeMode, options: { preserveCustomSkins?: boolean } = {}): void {
|
||||
if (typeof document === "undefined") return;
|
||||
activeThemeMode = theme;
|
||||
const root = document.documentElement;
|
||||
@@ -33,6 +33,9 @@ export function applyTheme(theme: ThemeMode): void {
|
||||
// Built-in skin CSS is scoped to public roots and can never restyle /admin.
|
||||
root.dataset.theme = theme;
|
||||
document.querySelectorAll<HTMLElement>(".ws-skin-root").forEach((clientRoot) => {
|
||||
const currentSkin = clientRoot.dataset.wsSkin;
|
||||
const isCustomSkin = currentSkin !== builtinSkins.light.manifest.id && currentSkin !== builtinSkins.dark.manifest.id;
|
||||
if (options.preserveCustomSkins && currentSkin && isCustomSkin) return;
|
||||
clientRoot.dataset.wsSkin = activeSkin.manifest.id;
|
||||
});
|
||||
|
||||
@@ -69,7 +72,7 @@ applyTheme(getStoredTheme());
|
||||
if (typeof window !== "undefined" && typeof window.matchMedia === "function") {
|
||||
const systemColorScheme = window.matchMedia("(prefers-color-scheme: dark)");
|
||||
const updateSystemSkin = () => {
|
||||
if (activeThemeMode === "system") applyTheme("system");
|
||||
if (activeThemeMode === "system") applyTheme("system", { preserveCustomSkins: true });
|
||||
};
|
||||
if (systemColorScheme.addEventListener) systemColorScheme.addEventListener("change", updateSystemSkin);
|
||||
else systemColorScheme.addListener?.(updateSystemSkin);
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
"license": "AGPL-3.0-only",
|
||||
"description": "The built-in dark appearance for public WebSpeak pages.",
|
||||
"entry": "skin.css",
|
||||
"minAppVersion": "0.2.4"
|
||||
"minAppVersion": "0.2.5-preview"
|
||||
}
|
||||
@@ -276,31 +276,6 @@
|
||||
}
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] *::-webkit-scrollbar-thumb:hover { background: #69c7bc; }
|
||||
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] .language-switcher .language-trigger {
|
||||
color: #a9d9d1;
|
||||
background: #203531;
|
||||
border-color: #38564f;
|
||||
}
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] .language-switcher .language-trigger:hover,
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] .language-switcher.open .language-trigger {
|
||||
color: #10201d;
|
||||
background: #69d2c7;
|
||||
border-color: #69d2c7;
|
||||
}
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] .language-switcher .language-dropdown {
|
||||
background: #172321;
|
||||
border-color: #30413d;
|
||||
box-shadow: 0 16px 36px rgba(0, 0, 0, .32);
|
||||
}
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] .language-switcher .language-option { color: #d7e7e3; }
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] .language-switcher .language-option:hover,
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] .language-switcher .language-option:focus-visible,
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] .language-switcher .language-option.selected {
|
||||
color: #69d2c7;
|
||||
background: #203531;
|
||||
border-color: #38564f;
|
||||
}
|
||||
|
||||
@keyframes join-accent-breathe-dark {
|
||||
0%, 100% { transform: translateY(0); text-shadow: 0 0 8px rgba(125, 255, 174, .28), 0 0 18px rgba(105, 210, 199, .14); }
|
||||
50% { transform: translateY(-2px); text-shadow: 0 0 13px rgba(125, 255, 174, .5), 0 0 26px rgba(105, 210, 199, .22); }
|
||||
|
||||
@@ -7,5 +7,5 @@
|
||||
"license": "AGPL-3.0-only",
|
||||
"description": "The built-in light appearance for public WebSpeak pages.",
|
||||
"entry": "skin.css",
|
||||
"minAppVersion": "0.2.4"
|
||||
"minAppVersion": "0.2.5-preview"
|
||||
}
|
||||
@@ -4,20 +4,23 @@
|
||||
:global(button) { border: 0; }
|
||||
|
||||
.web-client { min-height: 100dvh; outline: none; background: var(--surface-0); color: var(--text-primary); }
|
||||
.web-client.skin-initializing { visibility: hidden; }
|
||||
.join-page { min-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: var(--surface-0); color: var(--text-primary); }
|
||||
.join-header, .join-content, .join-footer { width: min(1240px, calc(100% - 64px)); margin: 0 auto; }
|
||||
.join-header, .join-content, .join-footer { position: relative; z-index: 1; }
|
||||
.join-header { z-index: 10; }
|
||||
.join-header .language-switcher { z-index: 50; }
|
||||
.join-footer { z-index: 2; }
|
||||
.join-header { min-height: 84px; display: flex; align-items: center; justify-content: space-between; }
|
||||
.join-header { width: min(1680px, calc(100% - 32px)); }
|
||||
.join-footer { width: 100%; padding-inline: max(20px, calc((100% - 1240px) / 2)); }
|
||||
.join-header { min-height: 84px; display: flex; flex-wrap: wrap; align-content: center; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 0 clamp(12px, 1.4vw, 22px); box-sizing: border-box; }
|
||||
.brand-lockup { display: flex; align-items: center; gap: 12px; }
|
||||
.brand-mark, .rail-logo { display: grid; place-items: center; color: #fff; background: #006a64; box-shadow: 0 8px 18px rgba(0, 106, 100, .15); }
|
||||
.brand-mark { display: block; width: 40px; height: 40px; border-radius: 12px; object-fit: cover; }
|
||||
.brand-lockup strong { display: block; color: #006a64; font-size: 18px; letter-spacing: -.04em; }
|
||||
.brand-lockup strong span { color: #24312f; font-weight: 500; }
|
||||
.brand-lockup small { display: block; margin-top: 2px; color: #7b8885; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
|
||||
.header-tools { display: flex; align-items: center; gap: 17px; }
|
||||
.header-tools { display: flex; min-width: 0; max-width: 100%; flex: 1 1 640px; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: clamp(6px, 1vw, 14px); row-gap: 6px; }
|
||||
.github-button { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 13px; color: #fff; background: #1f2d2b; border: 1px solid #1f2d2b; border-radius: 9px; box-shadow: 0 5px 12px rgba(31,45,43,.16); font-size: 12px; font-weight: 800; text-decoration: none; transition: .18s; }
|
||||
.github-button:hover { color: #fff; background: #006a64; border-color: #006a64; box-shadow: 0 7px 16px rgba(0,106,100,.2); transform: translateY(-1px); }
|
||||
.github-button .ui-icon { flex: 0 0 auto; }
|
||||
@@ -110,8 +113,8 @@
|
||||
.workspace { display: flex; min-width: 0; flex-direction: column; background: #fff; }.workspace-header { display: flex; align-items: center; justify-content: space-between; min-height: 73px; padding: 0 29px; border-bottom: 1px solid #eef2f0; }.breadcrumbs { display: flex; align-items: center; gap: 9px; min-width: 0; color: #52605b; font-size: 12px; }.breadcrumbs strong { overflow: hidden; color: #26332f; text-overflow: ellipsis; white-space: nowrap; }.crumb-muted { color: #98a39f; }.mobile-brand { display: none; color: #006a64; font-size: 17px; font-weight: 800; letter-spacing: -.06em; }.mobile-brand em { color: #293632; font-style: normal; font-weight: 500; }.workspace-actions, .dock-actions { display: flex; align-items: center; gap: 8px; }.header-action, .dock-icon { display: grid; place-items: center; color: #75847f; background: transparent; border-radius: 8px; cursor: pointer; transition: .16s; }.header-action { width: 32px; height: 32px; }.header-action:hover, .dock-icon:hover { color: #006a64; background: #edf5f2; }.disconnect-button { display: inline-flex; align-items: center; gap: 6px; min-height: 33px; margin-left: 8px; padding: 0 13px; color: #a94d48; background: #fff2f1; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; }.disconnect-button:hover { color: #fff; background: #c95a54; }
|
||||
.workspace { display: flex; min-width: 0; flex-direction: column; background: #fff; }.workspace-header { display: flex; align-items: center; justify-content: space-between; min-height: 73px; padding: 0 29px; border-bottom: 1px solid #eef2f0; }.breadcrumbs { display: flex; align-items: center; gap: 9px; min-width: 0; color: #52605b; font-size: 12px; }.breadcrumbs strong { overflow: hidden; color: #26332f; text-overflow: ellipsis; white-space: nowrap; }.crumb-muted { color: #98a39f; }.mobile-brand { display: none; color: #006a64; font-size: 17px; font-weight: 800; letter-spacing: -.06em; }.mobile-brand em { color: #293632; font-style: normal; font-weight: 500; }.workspace-actions, .dock-actions { display: flex; align-items: center; gap: 8px; }.header-action, .dock-icon { display: grid; place-items: center; color: #75847f; background: transparent; border-radius: 8px; cursor: pointer; transition: .16s; }.header-action { width: 32px; height: 32px; }.header-action:hover, .dock-icon:hover { color: #006a64; background: #edf5f2; }.workspace-language { margin-left: 3px; }.disconnect-button { display: inline-flex; align-items: center; gap: 6px; min-height: 33px; margin-left: 8px; padding: 0 13px; color: #a94d48; background: #fff2f1; border-radius: 8px; font-size: 11px; font-weight: 700; cursor: pointer; }.disconnect-button:hover { color: #fff; background: #c95a54; }
|
||||
.workspace-scroll { flex: 1; overflow-y: auto; }.workspace-content { width: min(950px, calc(100% - 64px)); margin: 0 auto; padding: 31px 0 27px; }.room-hero { position: relative; min-height: 190px; overflow: hidden; padding: 30px 34px; border-radius: 16px; background: linear-gradient(110deg, #e3f4f1, #f8fbfa 68%, #fff); }.room-hero-content { position: relative; z-index: 1; }.room-eyebrow { color: #4d817a; font-size: 10px; }.live-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; color: #2d7540; background: #d6f5d9; border-radius: 999px; font-size: 9px; letter-spacing: .08em; }.live-pill i { width: 5px; height: 5px; border-radius: 50%; background: #56cf69; }.room-hero h1 { display: flex; align-items: center; gap: 8px; margin: 16px 0 7px; color: #18302c; font-size: 26px; letter-spacing: -.05em; }.room-hero h1 .ui-icon { color: #006a64; }.room-hero p { max-width: 470px; margin: 0; color: #64817a; font-size: 12px; line-height: 1.6; }.room-stats { display: flex; align-items: center; gap: 11px; margin-top: 19px; color: #52716b; font-size: 10px; }.room-stats span { display: inline-flex; align-items: center; gap: 5px; }.stat-divider { width: 1px; height: 13px; background: #b8d9d4; }.hero-decoration { position: absolute; border: 1px solid rgba(0,106,100,.12); border-radius: 50%; }.hero-decoration.one { width: 250px; height: 250px; right: 48px; top: -116px; }.hero-decoration.two { width: 355px; height: 355px; right: -20px; top: -168px; }.hero-visual { position: absolute; right: 85px; bottom: 20px; width: 160px; height: 120px; opacity: .75; }.orbit { position: absolute; inset: 16px 4px; border: 1px solid rgba(0,106,100,.19); border-radius: 50%; transform: rotate(28deg); }.orbit-b { inset: 0 26px; transform: rotate(-49deg); }.hero-wave { position: absolute; right: 29px; bottom: 45px; display: flex; align-items: center; gap: 4px; height: 53px; }.hero-wave i { display: block; width: 3px; min-height: 8px; border-radius: 4px; background: #63c7bf; animation: wave 2.2s ease-in-out infinite alternate; }.hero-wave i:nth-child(3n) { background: #90f691; animation-delay: -.8s; }.hero-wave i:nth-child(4n) { animation-delay: -.4s; }
|
||||
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }.voice-section { margin-top: 34px; }.section-heading h2 { display: flex; align-items: center; gap: 7px; margin: 6px 0 0; color: #1d2926; font-size: 20px; letter-spacing: -.04em; }.section-counter { color: #87928e; font-size: 10px; }.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 12px; margin-top: 17px; }.voice-card { min-height: 152px; padding: 17px 11px 13px; border: 1px solid #edf1ef; border-radius: 13px; background: #fff; box-shadow: 0 7px 18px rgba(20,58,51,.04); text-align: center; transition: .18s; }.voice-card:hover { transform: translateY(-2px); box-shadow: 0 11px 24px rgba(20,58,51,.08); }.voice-card.speaking { border-color: #90f691; box-shadow: 0 0 14px rgba(144,246,145,.35); }.voice-avatar-wrap { position: relative; width: 68px; margin: 0 auto 11px; }.voice-avatar { display: grid; place-items: center; width: 68px; height: 68px; color: #fff; border-radius: 50%; font-size: 20px; font-weight: 700; }.voice-status { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 24px; height: 24px; color: #78908b; background: #fff; border: 1px solid #e0eae6; border-radius: 50%; }.voice-status.speaking { color: #278c3b; border-color: #90f691; }.voice-card > strong, .voice-card > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.voice-card > strong { color: #2c3935; font-size: 12px; }.voice-card > span { margin-top: 5px; color: #91a09a; font-size: 10px; }.voice-card.speaking > span { color: #278c3b; }.more-card { display: grid; place-items: center; align-content: center; }.more-count { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 11px; color: #006a64; background: #e0f2ef; border-radius: 50%; font-size: 14px; font-weight: 700; }.voice-empty { display: flex; align-items: center; gap: 11px; margin-top: 17px; padding: 18px; color: #83908c; border: 1px dashed #dce6e2; border-radius: 12px; font-size: 11px; }.voice-empty .empty-icon { margin: 0; width: 34px; height: 34px; }.voice-empty strong { color: #4c5e58; }.voice-empty span:last-child { margin-left: auto; }
|
||||
.chat-panel { margin-top: 34px; padding: 0 0 16px; border-top: 1px solid #eef2f0; }.chat-heading { padding-top: 25px; }.chat-heading h2 .ui-icon { color: #006a64; }.message-list { display: flex; flex-direction: column; gap: 18px; min-height: 170px; max-height: 360px; overflow-y: auto; padding: 22px 8px 10px 3px; }.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 145px; color: #9aa6a2; text-align: center; }.chat-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 11px; color: #6fa8a2; background: #e5f3f1; border-radius: 14px; }.chat-empty strong { color: #556761; font-size: 12px; }.chat-empty span { margin-top: 5px; font-size: 10px; }.message-row { display: flex; align-items: flex-start; gap: 11px; max-width: 78%; }.message-row.mine { align-self: flex-end; flex-direction: row-reverse; }.message-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; }.message-body { min-width: 0; }.message-meta { display: flex; align-items: baseline; gap: 8px; margin: 1px 0 6px; }.message-row.mine .message-meta { justify-content: flex-end; }.message-meta strong { color: #384843; font-size: 11px; }.message-meta time { color: #a1ada9; font-size: 9px; }.message-bubble { padding: 10px 13px; color: #43534e; background: #f1f5f3; border-radius: 4px 13px 13px 13px; font-size: 12px; line-height: 1.55; }.message-row.mine .message-bubble { color: #fff; background: #006a64; border-radius: 13px 4px 13px 13px; }.message-composer { display: flex; align-items: center; gap: 7px; min-height: 48px; padding: 6px 8px 6px 12px; background: #f3f6f5; border-radius: 11px; }.message-composer input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: #3a4944; font-size: 12px; }.message-composer input::placeholder { color: #9aa6a2; }.composer-tool { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; color: #94a19d; background: transparent; border-radius: 7px; }.composer-tool:not(:disabled) { cursor: pointer; }.composer-tool:disabled { opacity: .6; }.send-button { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; color: #fff; background: #006a64; border-radius: 9px; cursor: pointer; }.send-button:disabled { cursor: not-allowed; opacity: .35; }
|
||||
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }.voice-section { margin-top: 34px; }.section-heading h2 { display: flex; align-items: center; gap: 7px; margin: 6px 0 0; color: #1d2926; font-size: 20px; letter-spacing: -.04em; }.section-counter { color: #87928e; font-size: 10px; }.voice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 12px; margin-top: 17px; }.voice-card { position: relative; min-height: 152px; padding: 17px 11px 13px; border: 1px solid #edf1ef; border-radius: 13px; background: #fff; box-shadow: 0 7px 18px rgba(20,58,51,.04); text-align: center; transition: .18s; }.voice-card:hover { z-index: 3; transform: translateY(-2px); box-shadow: 0 11px 24px rgba(20,58,51,.08); }.voice-card.speaking { border-color: #90f691; box-shadow: 0 0 14px rgba(144,246,145,.35); }.voice-avatar-wrap { position: relative; z-index: 3; width: 68px; margin: 0 auto 11px; }.voice-avatar { display: grid; place-items: center; width: 68px; height: 68px; color: #fff; border-radius: 50%; font-size: 20px; font-weight: 700; }.voice-status { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 24px; height: 24px; color: #78908b; background: #fff; border: 1px solid #e0eae6; border-radius: 50%; }.voice-status.speaking { color: #278c3b; border-color: #90f691; }.voice-card > strong, .voice-card > span { position: relative; z-index: 3; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.voice-card > strong { color: #2c3935; font-size: 12px; }.voice-card > span { margin-top: 5px; color: #91a09a; font-size: 10px; }.voice-card.speaking > span { color: #278c3b; }.more-card { display: grid; place-items: center; align-content: center; }.more-count { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 11px; color: #006a64; background: #e0f2ef; border-radius: 50%; font-size: 14px; font-weight: 700; }.voice-empty { display: flex; align-items: center; gap: 11px; margin-top: 17px; padding: 18px; color: #83908c; border: 1px dashed #dce6e2; border-radius: 12px; font-size: 11px; }.voice-empty .empty-icon { margin: 0; width: 34px; height: 34px; }.voice-empty strong { color: #4c5e58; }.voice-empty span:last-child { margin-left: auto; }
|
||||
.chat-panel { margin-top: 34px; padding: 0 clamp(14px, 1.8vw, 24px) 20px; border-top: 1px solid #eef2f0; }.chat-heading { padding-top: 25px; }.chat-heading h2 .ui-icon { color: #006a64; }.message-list { display: flex; flex-direction: column; gap: 18px; min-height: 170px; max-height: 360px; overflow-y: auto; padding: 22px 8px 10px 3px; }.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 145px; color: #9aa6a2; text-align: center; }.chat-empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 11px; color: #6fa8a2; background: #e5f3f1; border-radius: 14px; }.chat-empty strong { color: #556761; font-size: 12px; }.chat-empty span { margin-top: 5px; font-size: 10px; }.message-row { display: flex; align-items: flex-start; gap: 11px; max-width: 78%; }.message-row.mine { align-self: flex-end; flex-direction: row-reverse; }.message-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; }.message-body { min-width: 0; }.message-meta { display: flex; align-items: baseline; gap: 8px; margin: 1px 0 6px; }.message-row.mine .message-meta { justify-content: flex-end; }.message-meta strong { color: #384843; font-size: 11px; }.message-meta time { color: #a1ada9; font-size: 9px; }.message-bubble { padding: 10px 13px; color: #43534e; background: #f1f5f3; border-radius: 4px 13px 13px 13px; font-size: 12px; line-height: 1.55; }.message-row.mine .message-bubble { color: #fff; background: #006a64; border-radius: 13px 4px 13px 13px; }.message-composer { display: flex; align-items: center; gap: 7px; min-height: 48px; padding: 6px 8px 6px 12px; background: #f3f6f5; border-radius: 11px; }.message-composer input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: #3a4944; font-size: 12px; }.message-composer input::placeholder { color: #9aa6a2; }.composer-tool { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; color: #94a19d; background: transparent; border-radius: 7px; }.composer-tool:not(:disabled) { cursor: pointer; }.composer-tool:disabled { opacity: .6; }.send-button { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto; color: #fff; background: #006a64; border-radius: 9px; cursor: pointer; }.send-button:disabled { cursor: not-allowed; opacity: .35; }
|
||||
.control-dock { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 74px; padding: 10px 29px; border-top: 1px solid #e9efec; background: rgba(255,255,255,.94); box-shadow: 0 -5px 18px rgba(23,52,47,.03); }.dock-user { display: flex; align-items: center; gap: 9px; min-width: 140px; }.dock-avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 11px; }.dock-user strong, .dock-user span { display: block; }.dock-user strong { max-width: 125px; overflow: hidden; color: #33423d; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }.dock-user span { display: flex; align-items: center; gap: 5px; margin-top: 4px; color: #7e8d87; font-size: 9px; }.dock-user span i { width: 5px; height: 5px; border-radius: 50%; background: #65d879; }.dock-center { display: flex; align-items: center; gap: 14px; }.mic-mode-switch { display: flex; padding: 3px; background: #eef3f1; border-radius: 8px; }.mic-mode-switch button { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; color: #8b9894; background: transparent; border-radius: 6px; font-size: 10px; cursor: pointer; }.mic-mode-switch button.active { color: #006a64; background: #fff; box-shadow: 0 2px 5px rgba(21,54,48,.08); font-weight: 700; }.ptt-indicator { display: inline-flex; align-items: center; gap: 7px; color: #7c8b86; font-size: 10px; }.ptt-indicator span { width: 7px; height: 7px; border-radius: 50%; background: #b2bfbb; }.ptt-indicator.active { color: #278c3b; }.ptt-indicator.active span { background: #65d879; box-shadow: 0 0 0 4px rgba(101,216,121,.15); }.dock-actions { min-width: 140px; justify-content: flex-end; }.dock-icon { width: 34px; height: 34px; }.dock-end { display: grid; place-items: center; width: 37px; height: 37px; color: #fff; background: #c95a54; border-radius: 10px; cursor: pointer; }.dock-end:hover { background: #b84c47; }
|
||||
|
||||
.member-panel { min-width: 0; padding: 26px 16px; color: #2c3935; background: #fbfcfc; border-left: 1px solid #eef2f0; }.member-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; }.member-panel-heading h2 { margin: 5px 0 0; color: #25322e; font-size: 19px; letter-spacing: -.04em; }.member-search { margin-top: 18px; padding: 0 10px; min-height: 33px; }.member-group { margin-top: 24px; }.member-group-title { display: flex; align-items: center; gap: 8px; color: #85928e; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }.group-line { height: 1px; flex: 1; background: #e6edeb; }.member-list { display: flex; flex-direction: column; gap: 17px; margin-top: 17px; }.member-row { display: flex; align-items: center; gap: 8px; min-width: 0; }.member-avatar { position: relative; display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 auto; color: #fff; border-radius: 10px; font-size: 10px; font-weight: 700; }.member-avatar.speaking { box-shadow: 0 0 0 2px #90f691, 0 0 10px rgba(144,246,145,.35); }.member-presence { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border: 2px solid #fbfcfc; border-radius: 50%; background: #65d879; }.member-copy { min-width: 0; flex: 1; }.member-copy strong, .member-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.member-copy strong { color: #34423d; font-size: 10px; }.member-copy span { margin-top: 4px; color: #96a29e; font-size: 9px; }.member-volume { display: flex; align-items: center; gap: 5px; color: #a1afaa; width: 64px; }.member-volume input { width: 45px; height: 4px; appearance: none; border-radius: 99px; outline: none; cursor: pointer; }.member-volume input::-webkit-slider-thumb, .settings-range::-webkit-slider-thumb { width: 14px; height: 14px; appearance: none; border: 2px solid #81d8d0; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.12); cursor: pointer; }.member-volume input::-moz-range-thumb, .settings-range::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid #81d8d0; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.12); cursor: pointer; }.member-empty { margin-top: 22px; color: #98a49f; font-size: 10px; text-align: center; }.member-panel-tip { display: flex; gap: 8px; margin-top: 36px; padding: 12px; color: #72827c; background: #eef5f2; border-radius: 9px; font-size: 9px; line-height: 1.5; }.member-panel-tip .ui-icon { color: #5e9e96; }
|
||||
@@ -140,7 +143,7 @@
|
||||
|
||||
@keyframes join-fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
|
||||
@keyframes join-title-in { from { opacity: 0; letter-spacing: -.02em; transform: translateY(18px) scale(.98); } to { opacity: 1; letter-spacing: -.075em; transform: translateY(0) scale(1); } }
|
||||
@keyframes join-accent-breathe { 0%, 100% { transform: translateY(0); text-shadow: 0 0 0 rgba(0, 106, 100, 0); } 50% { transform: translateY(-2px); text-shadow: 0 5px 18px rgba(0, 106, 100, .16); } }
|
||||
@keyframes join-accent-breathe { 0%, 100% { text-shadow: 0 0 0 rgba(0, 106, 100, 0); } 50% { text-shadow: 0 5px 18px rgba(0, 106, 100, .16); } }
|
||||
@keyframes join-dot-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(144, 246, 145, .28); } 50% { transform: scale(1.18); box-shadow: 0 0 0 6px rgba(144, 246, 145, 0); } }
|
||||
@keyframes visitor-shimmer { 0%, 42% { left: -45%; } 72%, 100% { left: 130%; } }
|
||||
@keyframes visitor-spark { 0%, 100% { opacity: .58; transform: scale(.88) rotate(0deg); } 50% { opacity: 1; transform: scale(1.14) rotate(12deg); } }
|
||||
@@ -156,11 +159,13 @@
|
||||
.join-page .promise-item:nth-child(3) { animation: join-fade-up .58s .68s cubic-bezier(.22, 1, .36, 1) both; }
|
||||
.join-page .visitor-count { animation: join-fade-up .58s .76s cubic-bezier(.22, 1, .36, 1) both; }
|
||||
.join-page .eyebrow-dot { animation: join-dot-pulse 2.8s .8s ease-in-out infinite; }
|
||||
.join-page .join-card { animation: join-fade-up .68s .24s cubic-bezier(.22, 1, .36, 1) both; }
|
||||
.join-page .join-footer { animation: join-fade-up .55s .72s cubic-bezier(.22, 1, .36, 1) both; }
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.join-page *, .join-page *::before, .join-page *::after { animation: none !important; transition-duration: .01ms !important; }
|
||||
.join-page *:not([data-ws-part="home.join-card"]),
|
||||
.join-page *:not([data-ws-part="home.join-card"])::before,
|
||||
.join-page *:not([data-ws-part="home.join-card"])::after { animation: none !important; }
|
||||
.join-page * { transition-duration: .01ms !important; }
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) { .app-shell { grid-template-columns: 72px 255px minmax(0, 1fr) 218px; }.workspace-content { width: min(900px, calc(100% - 42px)); }.control-dock { padding-inline: 18px; }.dock-center { gap: 8px; }.mic-mode-switch button { padding-inline: 7px; }.member-panel { padding-inline: 12px; }.member-volume { display: none; } }
|
||||
@@ -168,6 +173,26 @@
|
||||
@media (max-width: 740px) { .join-header, .join-content, .join-footer { width: min(100% - 32px, 560px); }.join-header { min-height: 70px; }.header-note { display: none; }.join-content { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 35px; padding: 36px 0 48px; }.join-copy h1 { margin-top: 15px; font-size: 45px; }.join-description { font-size: 14px; }.promise-list { gap: 13px; margin-top: 27px; }.promise-item { min-width: 0; flex: 1 1 30%; }.promise-item small { display: none; }.visitor-count { margin-top: 24px; }.join-card { padding: 24px 20px; }.join-footer { min-height: 53px; }.join-footer .footer-spacer { display: none; }.join-footer span:last-child { margin-left: auto; }.field-grid { grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }.app-shell { display: block; height: 100dvh; }.nav-rail, .channel-sidebar, .member-panel { display: none; }.workspace { height: 100%; }.workspace-header { min-height: 61px; padding: 0 15px; }.mobile-brand { display: inline; }.crumb-muted, .breadcrumbs > .ui-icon, .breadcrumbs > strong { display: none; }.workspace-actions { gap: 3px; }.disconnect-button { margin-left: 2px; padding-inline: 9px; }.disconnect-button .ui-icon { display: none; }.workspace-content { width: calc(100% - 30px); padding-top: 18px; }.room-hero { min-height: 182px; padding: 23px 21px; }.room-hero h1 { font-size: 22px; }.room-hero p { max-width: 74%; font-size: 11px; }.hero-visual { right: -15px; bottom: 4px; transform: scale(.75); transform-origin: right bottom; }.voice-section, .chat-panel { margin-top: 25px; }.voice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.voice-card { min-height: 143px; }.message-row { max-width: 92%; }.control-dock { min-height: 66px; padding: 8px 15px; }.dock-user { min-width: 0; }.dock-user > div:last-child { display: none; }.dock-center { flex: 1; justify-content: center; }.mic-mode-switch button { padding: 6px 7px; font-size: 9px; }.ptt-indicator { display: none; }.dock-actions { min-width: 75px; }.settings-modal { max-height: calc(100dvh - 28px); }.settings-nav { display: none; }.settings-content { padding: 24px 20px; }.settings-header { min-height: 62px; padding-inline: 20px; }.settings-header h2 { font-size: 19px; }.settings-footer { min-height: 61px; padding-inline: 20px; } }
|
||||
@media (max-width: 420px) { .join-copy h1 { font-size: 38px; }.promise-list { display: grid; grid-template-columns: 1fr; }.promise-item small { display: block; }.join-card { border-radius: 15px; }.voice-grid { gap: 8px; }.voice-card { padding-inline: 6px; }.section-counter { display: none; }.workspace-actions .header-action:first-child { display: none; }.dock-icon { display: none; }.dock-actions { min-width: 37px; }.room-stats { gap: 6px; }.room-stats span:last-child, .stat-divider { display: none; } }
|
||||
|
||||
@media (max-width: 740px) {
|
||||
.join-footer { width: 100%; padding-inline: 16px; }
|
||||
}
|
||||
|
||||
/* Use the wide desktop workspace without stretching voice tiles indefinitely. */
|
||||
@media (min-width: 1201px) {
|
||||
.app-shell .workspace-content { width: min(1360px, calc(100% - 64px)); }
|
||||
}
|
||||
|
||||
@media (min-width: 741px) {
|
||||
.app-shell .voice-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
|
||||
}
|
||||
|
||||
.screen-share-card-button { min-height: 28px; font-size: 10px; }
|
||||
.screen-share-settings-button { width: 28px; min-width: 28px; min-height: 28px; }
|
||||
|
||||
@media (max-width: 740px) {
|
||||
.screen-share-card-button { font-size: 9px; }
|
||||
}
|
||||
|
||||
/* The connected view keeps only controls that have a working action. The
|
||||
channel tree lives with the member list so every channel remains visible
|
||||
even when the current user is elsewhere. */
|
||||
@@ -313,6 +338,8 @@
|
||||
}
|
||||
|
||||
@media (max-width: 740px) {
|
||||
.join-header { flex-wrap: nowrap; gap: 6px; }
|
||||
.header-tools { min-width: 0; flex: 0 1 auto; flex-wrap: nowrap; gap: 7px; }
|
||||
.app-shell { grid-template-rows: minmax(0, 1fr) 220px; }
|
||||
}
|
||||
|
||||
@@ -395,6 +422,25 @@
|
||||
|
||||
/* Shared interaction/layout rules; appearance is supplied by a built-in skin package. */
|
||||
.join-page .join-card { position: relative; }
|
||||
.join-page .join-card { isolation: isolate; }
|
||||
.join-card-effects { position: absolute; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
|
||||
.join-card > :not(.join-card-effects) { position: relative; z-index: 1; }
|
||||
.join-card-waveform { position: absolute; top: 18px; right: 115px; display: flex; align-items: center; justify-content: center; gap: 3px; width: 52px; height: 46px; color: var(--accent); }
|
||||
.join-card-waveform i { display: block; width: 3px; height: 20px; flex: 0 0 3px; border-radius: 99px; background: currentColor; transform-origin: center; animation: screen-share-wave 1.1s ease-in-out infinite alternate; }
|
||||
.join-card-waveform i:nth-child(2n) { animation-delay: -.18s; }
|
||||
.join-card-waveform i:nth-child(3n) { animation-delay: -.42s; }
|
||||
.join-card-waveform i:nth-child(4n) { animation-delay: -.66s; }
|
||||
.join-card-waveform i:nth-child(1), .join-card-waveform i:nth-child(9) { height: 12px; }
|
||||
.join-card-waveform i:nth-child(2), .join-card-waveform i:nth-child(8) { height: 21px; }
|
||||
.join-card-waveform i:nth-child(3), .join-card-waveform i:nth-child(7) { height: 30px; }
|
||||
.join-card-waveform i:nth-child(4), .join-card-waveform i:nth-child(6) { height: 17px; }
|
||||
.join-card-waveform i:nth-child(5) { height: 26px; }
|
||||
.join-card-sonar { position: absolute; top: -29px; right: -5px; width: 148px; height: 148px; color: var(--accent); }
|
||||
.join-card-sonar i { position: absolute; inset: 0; border: 1px solid color-mix(in srgb, currentColor 32%, transparent); border-radius: 50%; opacity: 0; animation: join-card-sonar-ring 3.15s ease-out infinite; }
|
||||
.join-card-sonar i:nth-child(2) { animation-delay: 1.05s; }
|
||||
.join-card-sonar i:nth-child(3) { animation-delay: 2.1s; }
|
||||
@keyframes join-card-sonar-ring { 0% { transform: scale(.6); opacity: .62; } 68% { opacity: .15; } 100% { transform: scale(1); opacity: 0; } }
|
||||
.join-card-waveform i, .join-card-sonar i { backface-visibility: hidden; }
|
||||
.web-client button:focus-visible, .web-client a:focus-visible, .web-client input:focus-visible, .web-client select:focus-visible, .web-client textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
|
||||
.message-composer { position: sticky; bottom: env(safe-area-inset-bottom, 0px); z-index: 3; }
|
||||
@media (max-width: 740px) { .workspace-scroll { overscroll-behavior: contain; }.workspace-content { width: min(100% - 24px, 650px); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }.message-composer { margin-bottom: 8px; } }
|
||||
@@ -882,7 +928,7 @@
|
||||
.screen-share-stop-button { position: absolute; bottom: -4px; left: -5px; z-index: 3; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; color: var(--danger); border: 2px solid var(--surface-1); border-radius: 7px; background: var(--surface-2); box-shadow: 0 3px 9px color-mix(in srgb, var(--text-primary) 18%, transparent); cursor: pointer; }
|
||||
.screen-share-stop-button:hover { color: #fff; border-color: var(--danger); background: var(--danger); }
|
||||
.screen-share-stop-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--danger) 42%, transparent); outline-offset: 2px; }
|
||||
.screen-share-card-actions { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; min-width: 0; margin-top: 9px; flex-wrap: wrap; }
|
||||
.screen-share-card-actions { position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; min-width: 0; margin-top: 9px; flex-wrap: wrap; }
|
||||
.screen-share-start-actions { display: inline-flex; align-items: stretch; justify-content: center; gap: 4px; width: 100%; min-width: 0; }
|
||||
.screen-share-card-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 25px; max-width: 100%; padding: 4px 7px; overflow: hidden; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); border-radius: 999px; background: color-mix(in srgb, var(--accent) 8%, var(--surface-1)); font-size: 9px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
|
||||
.screen-share-card-button:hover { background: color-mix(in srgb, var(--accent) 15%, var(--surface-1)); }
|
||||
@@ -905,29 +951,29 @@
|
||||
.screen-share-settings-note { margin: 15px 0 0; color: var(--text-muted); font-size: 9px; line-height: 1.45; }
|
||||
.screen-share-settings-footer { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--border); }
|
||||
.screen-share-settings-start { min-height: 35px; padding: 0 12px; font-size: 10px; }
|
||||
.screen-share-player { position: relative; margin-top: 17px; overflow: hidden; border: 1px solid #263b37; border-radius: 18px; background: #070d0d; box-shadow: 0 12px 30px color-mix(in srgb, var(--text-primary) 18%, transparent); }
|
||||
.screen-share-player-stage { position: relative; display: grid; width: 100%; min-height: 245px; aspect-ratio: 16 / 9; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 40%, #1d3934, #091010 68%); }
|
||||
.screen-share-player-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #030606; }
|
||||
.screen-share-player-placeholder { display: flex; align-items: center; flex-direction: column; gap: 10px; max-width: 360px; padding: 30px; color: #b1c2bd; text-align: center; }
|
||||
.screen-share-player-placeholder-icon { display: grid; place-items: center; width: 58px; height: 58px; color: #69d2c7; border: 1px solid rgba(105,210,199,.36); border-radius: 18px; background: rgba(105,210,199,.12); }
|
||||
.screen-share-player-placeholder strong { color: #f0f8f5; font-size: 15px; }
|
||||
.screen-share-player-placeholder > span:last-child { color: #8ea39d; font-size: 10px; line-height: 1.5; }
|
||||
.screen-share-player-exit, .screen-share-player-controls button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; color: #edf7f4; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; background: rgba(8,14,14,.7); box-shadow: 0 5px 16px rgba(0,0,0,.22); backdrop-filter: blur(8px); cursor: pointer; }
|
||||
.screen-share-player { position: relative; margin-top: 17px; overflow: hidden; color: var(--text-primary); border: 1px solid var(--border); border-radius: 18px; background: var(--surface-1); box-shadow: 0 12px 30px color-mix(in srgb, var(--text-primary) 18%, transparent); }
|
||||
.screen-share-player-stage { position: relative; display: grid; width: 100%; min-height: 245px; aspect-ratio: 16 / 9; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 12%, var(--surface-1)), var(--surface-2) 74%); }
|
||||
.screen-share-player-video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--surface-2); }
|
||||
.screen-share-player-placeholder { display: flex; align-items: center; flex-direction: column; gap: 10px; max-width: 360px; padding: 30px; color: var(--text-muted); text-align: center; }
|
||||
.screen-share-player-placeholder-icon { display: grid; place-items: center; width: 58px; height: 58px; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent); border-radius: 18px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
|
||||
.screen-share-player-placeholder strong { color: var(--text-primary); font-size: 15px; }
|
||||
.screen-share-player-placeholder > span:last-child { color: var(--text-muted); font-size: 10px; line-height: 1.5; }
|
||||
.screen-share-player-exit, .screen-share-player-controls button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; color: var(--text-primary); border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 50%; background: color-mix(in srgb, var(--surface-1) 88%, transparent); box-shadow: 0 5px 16px color-mix(in srgb, var(--text-primary) 14%, transparent); backdrop-filter: blur(8px); cursor: pointer; }
|
||||
.screen-share-player-exit { position: absolute; top: 15px; left: 15px; z-index: 3; }
|
||||
.screen-share-player-exit:hover, .screen-share-player-controls button:hover { color: #fff; border-color: rgba(105,210,199,.75); background: rgba(0,106,100,.85); }
|
||||
.screen-share-player-viewers { position: absolute; top: 15px; right: 15px; z-index: 3; display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 5px 8px 5px 11px; color: #f3faf8; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(8,14,14,.74); box-shadow: 0 5px 16px rgba(0,0,0,.22); backdrop-filter: blur(8px); }
|
||||
.screen-share-player-viewer-label { display: inline-flex; align-items: center; gap: 5px; color: #d2e2de; font-size: 10px; font-weight: 700; white-space: nowrap; }
|
||||
.screen-share-player-exit:hover, .screen-share-player-controls button:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); background: color-mix(in srgb, var(--accent) 12%, var(--surface-1)); }
|
||||
.screen-share-player-viewers { position: absolute; top: 15px; right: 15px; z-index: 3; display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 5px 8px 5px 11px; color: var(--text-primary); border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--surface-1) 88%, transparent); box-shadow: 0 5px 16px color-mix(in srgb, var(--text-primary) 14%, transparent); backdrop-filter: blur(8px); }
|
||||
.screen-share-player-viewer-label { display: inline-flex; align-items: center; gap: 5px; color: inherit; font-size: 10px; font-weight: 700; white-space: nowrap; }
|
||||
.screen-share-player-viewer-avatars { display: inline-flex; align-items: center; padding-left: 4px; }
|
||||
.screen-share-player-viewer-avatar { display: grid; place-items: center; width: 25px; height: 25px; margin-left: -4px; color: #fff; border: 2px solid #15211f; border-radius: 50%; font-size: 9px; font-weight: 800; box-shadow: 0 2px 7px rgba(0,0,0,.25); }
|
||||
.screen-share-player-live { position: absolute; top: 22px; left: 64px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; color: #a7fff0; font-size: 11px; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.55); }
|
||||
.screen-share-player-viewer-avatar { display: grid; place-items: center; width: 25px; height: 25px; margin-left: -4px; color: #fff; border: 2px solid var(--surface-1); border-radius: 50%; font-size: 9px; font-weight: 800; box-shadow: 0 2px 7px color-mix(in srgb, var(--text-primary) 22%, transparent); }
|
||||
.screen-share-player-live { position: absolute; top: 22px; left: 64px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; color: var(--text-primary); border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--surface-1) 88%, transparent); box-shadow: 0 5px 16px color-mix(in srgb, var(--text-primary) 14%, transparent); backdrop-filter: blur(8px); font-size: 11px; font-weight: 800; }
|
||||
.screen-share-player-live i { width: 7px; height: 7px; border-radius: 50%; background: #65e48b; box-shadow: 0 0 0 4px rgba(101,228,139,.18); animation: screen-share-live-dot 1.2s ease-in-out infinite; }
|
||||
.screen-share-player-source { position: absolute; bottom: 18px; left: 18px; z-index: 3; max-width: 45%; overflow: hidden; color: #f5fbf8; font-size: 12px; font-weight: 800; text-overflow: ellipsis; text-shadow: 0 2px 8px rgba(0,0,0,.7); white-space: nowrap; }
|
||||
.screen-share-player-source { position: absolute; bottom: 18px; left: 18px; z-index: 3; max-width: 45%; overflow: hidden; padding: 7px 10px; color: var(--text-primary); border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--surface-1) 88%, transparent); box-shadow: 0 5px 16px color-mix(in srgb, var(--text-primary) 14%, transparent); backdrop-filter: blur(8px); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.screen-share-player-controls { position: absolute; right: 15px; bottom: 15px; z-index: 3; display: flex; align-items: center; gap: 9px; }
|
||||
.screen-share-player-controls label { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 11px; color: #edf7f4; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; background: rgba(8,14,14,.7); box-shadow: 0 5px 16px rgba(0,0,0,.22); backdrop-filter: blur(8px); }
|
||||
.screen-share-player-controls label { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 11px; color: var(--text-primary); border: 1px solid color-mix(in srgb, var(--border) 78%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--surface-1) 88%, transparent); box-shadow: 0 5px 16px color-mix(in srgb, var(--text-primary) 14%, transparent); backdrop-filter: blur(8px); }
|
||||
.screen-share-player-controls input { width: 102px; height: 4px; accent-color: #69d2c7; cursor: pointer; }
|
||||
.screen-share-player:fullscreen { width: 100vw; height: 100vh; border: 0; border-radius: 0; background: #030606; }
|
||||
.screen-share-player:fullscreen { width: 100vw; height: 100vh; border: 0; border-radius: 0; background: var(--surface-0); }
|
||||
.screen-share-player:fullscreen .screen-share-player-stage { height: 100%; max-height: none; aspect-ratio: auto; }
|
||||
.screen-share-player::backdrop { background: #030606; }
|
||||
.screen-share-player::backdrop { background: var(--surface-0); }
|
||||
@keyframes screen-share-wave { 0% { transform: scaleY(.45); opacity: .5; } 100% { transform: scaleY(1); opacity: 1; } }
|
||||
@keyframes screen-share-live-dot { 0%, 100% { opacity: .55; transform: scale(.86); } 50% { opacity: 1; transform: scale(1); } }
|
||||
@media (max-width: 740px) {
|
||||
@@ -943,3 +989,237 @@
|
||||
.screen-share-player-controls input { width: 70px; }
|
||||
.screen-share-player-exit { top: 10px; left: 10px; }
|
||||
}
|
||||
|
||||
/* The footer artwork belongs to the viewport, while its copy stays aligned
|
||||
with the homepage content column. */
|
||||
.join-footer { width: 100%; padding-inline: max(20px, calc((100% - 1240px) / 2)); }
|
||||
@media (max-width: 740px) {
|
||||
.join-footer { width: 100%; padding-inline: 16px; }
|
||||
}
|
||||
|
||||
/* Keep the performance popover out of the activity area on tablet layouts. */
|
||||
@media (min-width: 741px) and (max-width: 1200px) {
|
||||
.app-shell .performance-panel {
|
||||
position: fixed;
|
||||
top: 82px;
|
||||
right: 16px;
|
||||
width: min(330px, calc(100vw - 32px));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 981px) and (max-width: 1200px) {
|
||||
.app-shell[data-performance-open="true"] .voice-section .section-heading {
|
||||
padding-right: 390px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 741px) and (max-width: 980px) {
|
||||
.app-shell[data-performance-open="true"] .voice-section {
|
||||
margin-top: 248px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Keep voice activity content inset from the artwork container edges. */
|
||||
.app-shell .voice-section {
|
||||
position: relative;
|
||||
padding: clamp(14px, 1.8vw, 24px);
|
||||
border: 1px solid transparent;
|
||||
border-radius: 24px;
|
||||
}
|
||||
|
||||
.app-shell .workspace-content {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
}
|
||||
|
||||
/* Stacking order inside voice activity: room surfaces (auto), artwork (2),
|
||||
and readable labels / actionable overlays (3). */
|
||||
.app-shell .voice-section .section-heading {
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.voice-activity-artwork {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
inset: -26px 0 -48px;
|
||||
background-repeat: no-repeat;
|
||||
transform: perspective(1100px) rotateY(-2.5deg) translateZ(22px);
|
||||
transform-origin: right center;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Public artwork hooks have host-defined geometry. Skins can supply the art
|
||||
and its appearance without taking over the member rail's layout. */
|
||||
.app-shell .member-panel {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.app-shell .member-panel::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
left: -28px;
|
||||
bottom: 18px;
|
||||
width: min(430px, calc(100vw - 24px));
|
||||
aspect-ratio: 3 / 2;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left bottom;
|
||||
background-size: contain;
|
||||
transform: perspective(1100px) rotateY(-8deg) rotateX(2deg) translateZ(20px);
|
||||
transform-origin: 15% 100%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.app-shell .member-panel-heading,
|
||||
.app-shell .member-search,
|
||||
.app-shell .member-tree,
|
||||
.app-shell .member-empty {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.app-shell .chat-empty[data-ws-state="messages-empty"] {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
min-height: 210px;
|
||||
padding: 126px 12px 10px;
|
||||
}
|
||||
|
||||
.app-shell .chat-empty[data-ws-state="messages-empty"]::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 12px;
|
||||
left: calc(50% - 142px);
|
||||
width: 48px;
|
||||
height: 34px;
|
||||
color: transparent;
|
||||
border: 1.5px solid currentColor;
|
||||
border-radius: 50%;
|
||||
background-repeat: no-repeat;
|
||||
transform: rotate(-12deg);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.app-shell .chat-empty[data-ws-state="messages-empty"]::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
top: 39px;
|
||||
left: calc(50% - 116px);
|
||||
width: 9px;
|
||||
height: 9px;
|
||||
color: transparent;
|
||||
border: 1.5px solid transparent;
|
||||
border-color: transparent currentColor currentColor transparent;
|
||||
background: transparent;
|
||||
transform: rotate(28deg);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.app-shell .chat-empty[data-ws-state="messages-empty"] > strong,
|
||||
.app-shell .chat-empty[data-ws-state="messages-empty"] > span {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.app-shell .chat-panel .section-heading,
|
||||
.app-shell .chat-panel .message-list,
|
||||
.app-shell .chat-panel .message-composer {
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
@media (max-width: 740px) {
|
||||
.app-shell .voice-section {
|
||||
padding: 14px 10px 16px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.app-shell .chat-empty[data-ws-state="messages-empty"] {
|
||||
min-height: 190px;
|
||||
padding-top: 112px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 980px) {
|
||||
.app-shell .member-panel::before {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 740px) {
|
||||
.app-shell .chat-empty[data-ws-state="messages-empty"] {
|
||||
min-height: 170px;
|
||||
padding: 100px 10px 8px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Homepage feature tiles use a shared grid and consistent internal spacing. */
|
||||
.promise-list {
|
||||
display: grid;
|
||||
width: 100%;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.promise-item {
|
||||
min-width: 0;
|
||||
min-height: 58px;
|
||||
gap: 9px;
|
||||
padding: 9px 11px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 14px;
|
||||
background: color-mix(in srgb, var(--surface-1) 78%, transparent);
|
||||
box-shadow: 0 8px 20px color-mix(in srgb, var(--text-primary) 7%, transparent);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.promise-item > span:last-child {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.promise-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
flex: 0 0 36px;
|
||||
}
|
||||
|
||||
@media (min-width: 741px) {
|
||||
/* Keep header menus above the independently stacked screen-share stage. */
|
||||
.app-shell .workspace-header {
|
||||
position: relative;
|
||||
z-index: 40;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 740px) {
|
||||
.promise-list {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.promise-item {
|
||||
min-height: 54px;
|
||||
gap: 7px;
|
||||
padding: 8px 9px;
|
||||
}
|
||||
|
||||
.promise-icon {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
flex-basis: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 420px) {
|
||||
.promise-list {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.promise-item {
|
||||
padding: 10px 12px;
|
||||
}
|
||||
}
|
||||
@@ -106,13 +106,14 @@
|
||||
<div class="page-heading"><div><h2>{{ tr('skinLibrary') }}</h2><p>{{ tr('skinLibraryLead') }}</p></div><button class="primary-button" type="button" :disabled="skinUploading" @click="skinFileInput?.click()"><span v-if="skinUploading" class="spinner small"></span><Icon v-else name="share" :size="16" />{{ skinUploading ? tr('skinUploading') : tr('skinUpload') }}</button></div>
|
||||
<input ref="skinFileInput" class="skin-file-input" type="file" accept=".wskin,application/zip" @change="onSkinFileChanged" />
|
||||
<div class="alert info skin-library-scope"><Icon name="info" :size="16" /><span>{{ tr('skinLibraryScope') }}</span></div>
|
||||
<section class="skin-default-control"><div><strong>{{ tr('skinDefault') }}</strong><p>{{ tr('skinDefaultLead') }}</p></div><select v-model="skinDefaultId" :disabled="skinLoading || skinDefaultSaving" :aria-label="tr('skinDefault')" @change="saveSkinDefault"><option v-for="skin in enabledSkinEntries" :key="skin.id" :value="skin.id">{{ skinName(skin) }}</option></select></section>
|
||||
<div v-if="skinManagerError" class="alert error" role="alert">{{ skinManagerError }}</div>
|
||||
<div v-if="skinManagerNotice" class="alert success" role="status">{{ skinManagerNotice }}</div>
|
||||
<div v-if="skinLoading" class="skin-library-loading"><span class="spinner"></span>{{ tr('loading') }}</div>
|
||||
<div v-else-if="skinEntries.length" class="skin-library-grid">
|
||||
<article v-for="skin in skinEntries" :key="skin.id" class="skin-library-card">
|
||||
<div class="skin-preview"><img v-if="skin.previewUrl" :src="skin.previewUrl" :alt="skin.name" /><span v-else><Icon name="compass" :size="28" /></span><small>v{{ skin.version }}</small></div>
|
||||
<div class="skin-library-copy"><div class="skin-library-title"><h3>{{ skin.name }}</h3><span>{{ skin.id }}</span></div><p v-if="skin.description">{{ skin.description }}</p><dl><div><dt>{{ tr('skinAuthor') }}</dt><dd>{{ skin.author }}</dd></div><div><dt>{{ tr('skinLicense') }}</dt><dd>{{ skin.license }}</dd></div><div><dt>{{ tr('skinMinVersion') }}</dt><dd>{{ skin.minAppVersion }}</dd></div></dl><div class="skin-library-actions"><a v-if="skin.previewUrl" :href="skin.previewUrl" target="_blank" rel="noreferrer" class="text-link">{{ tr('skinPreview') }}</a><button class="text-danger" type="button" :disabled="removingSkinId === skin.id" @click="removeSkin(skin)">{{ removingSkinId === skin.id ? tr('skinRemoving') : tr('skinRemove') }}</button></div></div>
|
||||
<div class="skin-preview" :class="`skin-preview--${skin.previewKind || 'custom'}`"><img v-if="skin.previewUrl" :src="skin.previewUrl" :alt="skinName(skin)" /><span v-else><Icon :name="skin.previewKind === 'night' ? 'moon' : 'sun'" :size="28" /></span><small>v{{ skin.version }}</small><b v-if="skin.builtIn" class="skin-builtin-badge">{{ tr('skinBuiltin') }}</b></div>
|
||||
<div class="skin-library-copy"><div class="skin-library-title"><h3>{{ skinName(skin) }}</h3><span>{{ skin.id }}</span></div><p v-if="skinDescription(skin)">{{ skinDescription(skin) }}</p><dl><div><dt>{{ tr('skinAuthor') }}</dt><dd>{{ skin.author }}</dd></div><div><dt>{{ tr('skinLicense') }}</dt><dd>{{ skin.license }}</dd></div><div><dt>{{ tr('skinMinVersion') }}</dt><dd>{{ skin.minAppVersion }}</dd></div></dl><div class="skin-library-actions"><a v-if="skin.previewUrl" :href="skin.previewUrl" target="_blank" rel="noreferrer" class="text-link">{{ tr('skinPreview') }}</a><label v-if="!skin.builtIn" class="skin-enabled-control"><span>{{ skin.enabled === false ? tr('skinDisabled') : tr('skinEnabled') }}</span><input type="checkbox" :checked="skin.enabled !== false" :disabled="updatingSkinId === skin.id" @change="toggleSkinEnabled(skin)" /></label><span v-else class="skin-protected-label">{{ tr('skinProtected') }}</span><button v-if="!skin.builtIn" class="text-danger" type="button" :disabled="removingSkinId === skin.id" @click="removeSkin(skin)">{{ removingSkinId === skin.id ? tr('skinRemoving') : tr('skinRemove') }}</button></div></div>
|
||||
</article>
|
||||
</div>
|
||||
<div v-else class="skin-library-empty"><span><Icon name="compass" :size="24" /></span><strong>{{ tr('skinEmpty') }}</strong><p>{{ tr('skinEmptyLead') }}</p></div>
|
||||
@@ -136,7 +137,7 @@ import { RouterLink, useRoute, useRouter } from "vue-router";
|
||||
import Icon from "../components/Icon.vue";
|
||||
import LanguageSwitcher from "../components/LanguageSwitcher.vue";
|
||||
import { combineTeamSpeakTarget, splitTeamSpeakTarget } from "../services/teamspeak-target.js";
|
||||
import { deleteSkinPackage, uploadSkinPackage, type SkinCatalogEntry } from "../services/skin-catalog.js";
|
||||
import { BUILTIN_SKIN_CATALOG, deleteSkinPackage, uploadSkinPackage, type SkinCatalogEntry } from "../services/skin-catalog.js";
|
||||
import { applyTheme, getStoredTheme, isDarkTheme, nextTheme, saveTheme, type ThemeMode } from "../services/theme.js";
|
||||
|
||||
type Language = "zh" | "en" | "de" | "ru" | "ja";
|
||||
@@ -189,6 +190,10 @@ const skinEntries = ref<SkinCatalogEntry[]>([]);
|
||||
const skinLoading = ref(false);
|
||||
const skinUploading = ref(false);
|
||||
const removingSkinId = ref("");
|
||||
const updatingSkinId = ref("");
|
||||
const skinDefaultId = ref("builtin.light");
|
||||
const skinDefaultSaving = ref(false);
|
||||
const enabledSkinEntries = computed(() => skinEntries.value.filter((skin) => skin.builtIn || skin.enabled !== false));
|
||||
const skinManagerError = ref("");
|
||||
const skinManagerNotice = ref("");
|
||||
const inviteForm = reactive({ channel: "", expiresInHours: 24, maxUses: 0 });
|
||||
@@ -225,7 +230,22 @@ const copy = {
|
||||
server: "服务器",
|
||||
operations: "运维",
|
||||
skinLibrary: "皮肤",
|
||||
skinLibraryLead: "上传并管理此实例访客可选择的自定义皮肤。",
|
||||
skinLibraryLead: "查看访客可选的默认皮肤和实例自定义皮肤;支持导入皮肤包。",
|
||||
skinDay: "默认日间模式",
|
||||
skinNight: "默认夜间模式",
|
||||
skinIllusia: "ILLUSIA风",
|
||||
skinBuiltin: "内置",
|
||||
skinProtected: "内置皮肤,不可移除",
|
||||
skinDefault: "默认皮肤",
|
||||
skinDefaultLead: "访客首次访问时使用;访客已有选择时保留其偏好。",
|
||||
skinEnabled: "已启用",
|
||||
skinDisabled: "已停用",
|
||||
skinDefaultSaved: "默认皮肤已更新。",
|
||||
skinEnabledNotice: "皮肤已启用并向访客开放。",
|
||||
skinDisabledNotice: "皮肤已停用,不再向访客提供。",
|
||||
skinDayDescription: "WebSpeak 默认的明亮日间外观。",
|
||||
skinNightDescription: "WebSpeak 默认的深色夜间外观。",
|
||||
skinIllusiaDescription: "覆盖首页、语音房间和演示页的 ILLUSIA 美术皮肤。",
|
||||
skinLibraryScope: "皮肤会作为可选项提供给访客;每位访客可在前台自行选择。管理后台始终保持原样式。",
|
||||
skinUpload: "导入皮肤包",
|
||||
skinUploading: "正在校验并导入…",
|
||||
@@ -449,7 +469,22 @@ const copy = {
|
||||
server: "Server",
|
||||
operations: "Operations",
|
||||
skinLibrary: "Skins",
|
||||
skinLibraryLead: "Upload and manage custom skins available to visitors of this instance.",
|
||||
skinLibraryLead: "View the default and custom skins available to visitors; import instance-wide skin packages.",
|
||||
skinDay: "Default day mode",
|
||||
skinNight: "Default night mode",
|
||||
skinIllusia: "ILLUSIA style",
|
||||
skinBuiltin: "Built in",
|
||||
skinProtected: "Built-in skin · cannot be removed",
|
||||
skinDefault: "Default skin",
|
||||
skinDefaultLead: "Used for first-time visitors; existing visitor choices are preserved.",
|
||||
skinEnabled: "Enabled",
|
||||
skinDisabled: "Disabled",
|
||||
skinDefaultSaved: "Default skin updated.",
|
||||
skinEnabledNotice: "Skin enabled and available to visitors.",
|
||||
skinDisabledNotice: "Skin disabled and hidden from visitors.",
|
||||
skinDayDescription: "WebSpeak's default light appearance.",
|
||||
skinNightDescription: "WebSpeak's default dark appearance.",
|
||||
skinIllusiaDescription: "ILLUSIA artwork for the home, voice room, and demo pages.",
|
||||
skinLibraryScope: "Skins are offered as visitor-selectable options. Each visitor chooses a skin on the public page; the admin console always keeps its own appearance.",
|
||||
skinUpload: "Import skin package",
|
||||
skinUploading: "Validating and importing…",
|
||||
@@ -671,7 +706,22 @@ const germanCopy = {
|
||||
server: "Server",
|
||||
operations: "Betrieb",
|
||||
skinLibrary: "Skins",
|
||||
skinLibraryLead: "Benutzerdefinierte Skins für Besucher dieser Instanz hochladen und verwalten.",
|
||||
skinLibraryLead: "Standard- und benutzerdefinierte Skins für Besucher anzeigen und instanzweite Skin-Pakete importieren.",
|
||||
skinDay: "Standard-Tagesmodus",
|
||||
skinNight: "Standard-Nachtmodus",
|
||||
skinIllusia: "ILLUSIA-Stil",
|
||||
skinBuiltin: "Integriert",
|
||||
skinProtected: "Integrierter Skin · nicht entfernbar",
|
||||
skinDefault: "Standard-Skin",
|
||||
skinDefaultLead: "Wird bei neuen Besuchern verwendet; bestehende Auswahl bleibt erhalten.",
|
||||
skinEnabled: "Aktiviert",
|
||||
skinDisabled: "Deaktiviert",
|
||||
skinDefaultSaved: "Standardskin aktualisiert.",
|
||||
skinEnabledNotice: "Skin aktiviert und für Besucher verfügbar.",
|
||||
skinDisabledNotice: "Skin deaktiviert und für Besucher ausgeblendet.",
|
||||
skinDayDescription: "Das standardmäßige helle WebSpeak-Design.",
|
||||
skinNightDescription: "Das standardmäßige dunkle WebSpeak-Design.",
|
||||
skinIllusiaDescription: "ILLUSIA-Grafiken für Startseite, Sprachraum und Demo.",
|
||||
skinLibraryScope: "Skins werden Besuchern zur Auswahl angeboten. Jeder Besucher wählt das Design auf der öffentlichen Seite; die Administrationsoberfläche bleibt unverändert.",
|
||||
skinUpload: "Skin-Paket importieren",
|
||||
skinUploading: "Wird geprüft und importiert…",
|
||||
@@ -845,7 +895,22 @@ const russianCopy = {
|
||||
server: "Сервер",
|
||||
operations: "Операции",
|
||||
skinLibrary: "Оформление",
|
||||
skinLibraryLead: "Загружайте и управляйте оформлением, доступным посетителям этого экземпляра.",
|
||||
skinLibraryLead: "Просматривайте стандартное и пользовательское оформление и импортируйте пакеты для всего экземпляра.",
|
||||
skinDay: "Стандартная дневная тема",
|
||||
skinNight: "Стандартная ночная тема",
|
||||
skinIllusia: "Стиль ILLUSIA",
|
||||
skinBuiltin: "Встроено",
|
||||
skinProtected: "Встроенная тема · нельзя удалить",
|
||||
skinDefault: "Тема по умолчанию",
|
||||
skinDefaultLead: "Используется при первом посещении; сохранённый выбор пользователя не меняется.",
|
||||
skinEnabled: "Включена",
|
||||
skinDisabled: "Отключена",
|
||||
skinDefaultSaved: "Тема по умолчанию обновлена.",
|
||||
skinEnabledNotice: "Тема включена и доступна посетителям.",
|
||||
skinDisabledNotice: "Тема отключена и скрыта от посетителей.",
|
||||
skinDayDescription: "Стандартное светлое оформление WebSpeak.",
|
||||
skinNightDescription: "Стандартное тёмное оформление WebSpeak.",
|
||||
skinIllusiaDescription: "Иллюстрации ILLUSIA для главной страницы, голосовой комнаты и демо.",
|
||||
skinLibraryScope: "Оформление предлагается посетителям на выбор; каждый выбирает его на публичной странице. Панель администратора сохраняет собственный стиль.",
|
||||
skinUpload: "Импортировать пакет оформления",
|
||||
skinUploading: "Проверка и импорт…",
|
||||
@@ -984,7 +1049,22 @@ const japaneseCopy = {
|
||||
server: "サーバー",
|
||||
operations: "運用",
|
||||
skinLibrary: "スキン",
|
||||
skinLibraryLead: "このインスタンスの訪問者が選択できるカスタムスキンを管理します。",
|
||||
skinLibraryLead: "訪問者向けの標準スキンとカスタムスキンを表示し、インスタンス共通のパッケージを読み込みます。",
|
||||
skinDay: "標準の昼モード",
|
||||
skinNight: "標準の夜モード",
|
||||
skinIllusia: "ILLUSIA スタイル",
|
||||
skinBuiltin: "組み込み",
|
||||
skinProtected: "組み込みスキン · 削除不可",
|
||||
skinDefault: "デフォルトスキン",
|
||||
skinDefaultLead: "初回訪問時に適用します。訪問者が選択済みの場合はその設定を維持します。",
|
||||
skinEnabled: "有効",
|
||||
skinDisabled: "無効",
|
||||
skinDefaultSaved: "デフォルトスキンを更新しました。",
|
||||
skinEnabledNotice: "スキンを有効にし、訪問者に公開しました。",
|
||||
skinDisabledNotice: "スキンを無効にし、訪問者の選択肢から隠しました。",
|
||||
skinDayDescription: "WebSpeak の標準ライト外観です。",
|
||||
skinNightDescription: "WebSpeak の標準ダーク外観です。",
|
||||
skinIllusiaDescription: "ホーム、ボイスルーム、デモ用の ILLUSIA アートです。",
|
||||
skinLibraryScope: "スキンは訪問者向けの選択肢として公開され、各訪問者が公開ページで選択します。管理画面の外観は変更されません。",
|
||||
skinUpload: "スキンパッケージを読み込む",
|
||||
skinUploading: "検証・読み込み中…",
|
||||
@@ -1184,13 +1264,60 @@ async function loadSkinCatalog() {
|
||||
skinManagerError.value = "";
|
||||
try {
|
||||
const value = await getJson("/api/admin/skins");
|
||||
skinEntries.value = Array.isArray(value.skins) ? value.skins : [];
|
||||
const uploaded = Array.isArray(value.skins) ? value.skins as SkinCatalogEntry[] : [];
|
||||
const protectedIds = new Set(BUILTIN_SKIN_CATALOG.map((skin) => skin.id));
|
||||
skinEntries.value = [...BUILTIN_SKIN_CATALOG, ...uploaded.filter((skin) => !protectedIds.has(skin.id))];
|
||||
skinDefaultId.value = typeof value.defaultSkinId === "string" ? value.defaultSkinId : "builtin.light";
|
||||
} catch {
|
||||
skinManagerError.value = tr("requestFailed");
|
||||
} finally {
|
||||
skinLoading.value = false;
|
||||
}
|
||||
}
|
||||
function skinName(skin: SkinCatalogEntry): string {
|
||||
if (skin.id === "builtin.light") return tr("skinDay");
|
||||
if (skin.id === "builtin.dark") return tr("skinNight");
|
||||
if (skin.id === "community.illusia-voice") return tr("skinIllusia");
|
||||
return skin.name;
|
||||
}
|
||||
function skinDescription(skin: SkinCatalogEntry): string {
|
||||
if (skin.id === "builtin.light") return tr("skinDayDescription");
|
||||
if (skin.id === "builtin.dark") return tr("skinNightDescription");
|
||||
if (skin.id === "community.illusia-voice") return tr("skinIllusiaDescription");
|
||||
return skin.description || "";
|
||||
}
|
||||
async function saveSkinDefault() {
|
||||
skinDefaultSaving.value = true;
|
||||
skinManagerError.value = "";
|
||||
skinManagerNotice.value = "";
|
||||
try {
|
||||
const result = await sendJson("/api/admin/skins/default", "PUT", { id: skinDefaultId.value });
|
||||
skinDefaultId.value = typeof result.defaultSkinId === "string" ? result.defaultSkinId : "builtin.light";
|
||||
skinManagerNotice.value = tr("skinDefaultSaved");
|
||||
} catch {
|
||||
skinManagerError.value = tr("operationFailed");
|
||||
await loadSkinCatalog();
|
||||
} finally {
|
||||
skinDefaultSaving.value = false;
|
||||
}
|
||||
}
|
||||
async function toggleSkinEnabled(skin: SkinCatalogEntry) {
|
||||
updatingSkinId.value = skin.id;
|
||||
skinManagerError.value = "";
|
||||
skinManagerNotice.value = "";
|
||||
try {
|
||||
const result = await sendJson(`/api/admin/skins/${encodeURIComponent(skin.id)}/enabled`, "PUT", { enabled: skin.enabled === false });
|
||||
const updated = result.skin as SkinCatalogEntry | undefined;
|
||||
if (updated) Object.assign(skin, updated);
|
||||
if (typeof result.defaultSkinId === "string") skinDefaultId.value = result.defaultSkinId;
|
||||
skinManagerNotice.value = tr(skin.enabled === false ? "skinDisabledNotice" : "skinEnabledNotice");
|
||||
} catch {
|
||||
skinManagerError.value = tr("operationFailed");
|
||||
await loadSkinCatalog();
|
||||
} finally {
|
||||
updatingSkinId.value = "";
|
||||
}
|
||||
}
|
||||
async function onSkinFileChanged(event: Event) {
|
||||
const input = event.target as HTMLInputElement;
|
||||
const file = input.files?.[0];
|
||||
@@ -1695,12 +1822,20 @@ async function parseResponse(response: Response) { const value = await response.
|
||||
.skin-library-page{display:grid;align-content:start;gap:16px}
|
||||
.skin-library-page>.page-heading,.skin-library-page>.skin-library-scope{margin:0}
|
||||
.skin-library-scope{display:flex;align-items:center;gap:9px}
|
||||
.skin-default-control{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:15px 17px;background:var(--admin-surface,#fff);border:1px solid var(--admin-border,#dce7e3);border-radius:12px}
|
||||
.skin-default-control strong{color:var(--admin-text,#20312d);font-size:13px}
|
||||
.skin-default-control p{margin:4px 0 0;color:var(--admin-muted,#687a74);font-size:11px}
|
||||
.skin-default-control select{min-width:min(100%,270px);padding:10px 12px;color:var(--admin-text,#20312d);background:var(--admin-input,#fff);border:1px solid var(--admin-border,#dce7e3);border-radius:9px;font:inherit}
|
||||
.skin-library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,360px),1fr));gap:14px;align-content:start}
|
||||
.skin-library-card{display:grid;grid-template-columns:minmax(140px,.78fr) minmax(0,1.22fr);min-width:0;overflow:hidden;background:var(--admin-surface,#fff);border:1px solid var(--admin-border,#dce7e3);border-radius:14px;box-shadow:0 6px 20px rgba(20,60,53,.04)}
|
||||
.skin-preview{position:relative;display:grid;place-items:center;min-height:180px;overflow:hidden;color:#5f9f97;background:linear-gradient(145deg,#e5f5f1,#f5f8f7)}
|
||||
.skin-preview--day{color:#087e86;background:linear-gradient(145deg,#e8fbfb 0%,#c7f0ed 52%,#fff 100%)}
|
||||
.skin-preview--night{color:#b5e8df;background:linear-gradient(145deg,#122320 0%,#223a37 55%,#0b1514 100%)}
|
||||
.skin-preview img{width:100%;height:100%;position:absolute;inset:0;object-fit:cover}
|
||||
.skin-preview>span{display:grid;place-items:center;width:54px;height:54px;border:1px solid #cde8e2;border-radius:16px;background:rgba(255,255,255,.68)}
|
||||
.skin-preview--night>span{border-color:rgba(181,232,223,.32);background:rgba(225,255,249,.1)}
|
||||
.skin-preview small{position:absolute;right:9px;bottom:9px;padding:4px 7px;color:#f7fffd;background:rgba(17,40,37,.72);border-radius:6px;font-size:10px}
|
||||
.skin-builtin-badge{position:absolute;top:9px;left:9px;padding:4px 7px;color:#075f5d;background:rgba(240,255,252,.92);border:1px solid rgba(255,255,255,.72);border-radius:6px;font-size:10px}
|
||||
.skin-library-copy{display:flex;min-width:0;flex-direction:column;padding:14px}
|
||||
.skin-library-title{display:grid;gap:3px;min-width:0}
|
||||
.skin-library-title h3{margin:0;color:var(--admin-text,#20312d);font-size:15px}
|
||||
@@ -1712,12 +1847,15 @@ async function parseResponse(response: Response) { const value = await response.
|
||||
.skin-library-copy dd{margin:0;color:var(--admin-text,#30423d);text-align:right;overflow-wrap:anywhere}
|
||||
.skin-library-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:auto;padding-top:13px}
|
||||
.skin-library-actions button,.skin-library-actions a{font-size:11px}
|
||||
.skin-protected-label{color:var(--admin-muted,#687a74);font-size:10px}
|
||||
.skin-enabled-control{display:inline-flex;align-items:center;gap:6px;color:var(--admin-muted,#687a74);font-size:10px;white-space:nowrap}
|
||||
.skin-enabled-control input{width:16px;height:16px;margin:0;accent-color:#07877e}
|
||||
.skin-library-empty,.skin-library-loading{display:grid;justify-items:center;gap:9px;padding:48px 18px;color:var(--admin-muted,#7d8d88);text-align:center;background:var(--admin-surface,#fff);border:1px dashed var(--admin-border,#dce7e3);border-radius:14px}
|
||||
.skin-library-empty>span{display:grid;place-items:center;width:46px;height:46px;color:#0b8075;background:#e5f5f1;border-radius:14px}
|
||||
.skin-library-empty strong{color:var(--admin-text,#263a35);font-size:14px}
|
||||
.skin-library-empty p{margin:0;font-size:11px}
|
||||
.skin-library-loading{display:flex;justify-content:center}
|
||||
@media(max-width:620px){.skin-library-card{grid-template-columns:minmax(0,1fr)}.skin-preview{min-height:190px;aspect-ratio:16/9}.skin-library-page>.page-heading{align-items:flex-start}.skin-library-page>.page-heading .primary-button{white-space:nowrap}}
|
||||
@media(max-width:620px){.skin-library-card{grid-template-columns:minmax(0,1fr)}.skin-preview{min-height:190px;aspect-ratio:16/9}.skin-library-page>.page-heading{align-items:flex-start}.skin-library-page>.page-heading .primary-button{white-space:nowrap}.skin-default-control{align-items:flex-start;flex-direction:column}.skin-default-control select{width:100%}}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="demo-page ws-skin-root" data-ws-part="app" data-ws-page="demo">
|
||||
<div :class="['demo-page', 'ws-skin-root', { 'skin-initializing': !skinReady }]" data-ws-part="app" data-ws-page="demo">
|
||||
<header class="demo-header" data-ws-part="demo.header">
|
||||
<div class="demo-brand" data-ws-part="demo.brand"><span><Icon name="waveform" :size="21" /></span><div><strong>WebSpeak</strong><small>{{ copy.browserClient }}</small></div></div>
|
||||
<div class="demo-tools" data-ws-part="demo.header-tools"><span class="demo-badge" data-ws-part="demo.badge">{{ copy.demoBadge }}</span><SkinSwitcher v-model="activeSkinId" data-ws-part="demo.skin-switcher" :menu-label="copy.skinSelector" :options="skinOptions" @change="onSkinChange" /><LanguageSwitcher v-model="language" data-ws-part="demo.language-switcher" :menu-label="copy.languageMenu" @change="persistLanguage" /><a href="/" data-ws-part="demo.home-link">{{ copy.back }}</a></div>
|
||||
@@ -37,7 +37,7 @@ import Icon from "../components/Icon.vue";
|
||||
import LanguageSwitcher from "../components/LanguageSwitcher.vue";
|
||||
import SkinSwitcher, { type SkinOption } from "../components/SkinSwitcher.vue";
|
||||
import { listInstalledSkins, loadLocalPreferences, saveLocalPreferences } from "../services/local-persistence.js";
|
||||
import { listPublicSkins, type SkinCatalogEntry } from "../services/skin-catalog.js";
|
||||
import { getPublicDefaultSkinId, isPublicSkinEnabled, listPublicSkins, type SkinCatalogEntry } from "../services/skin-catalog.js";
|
||||
import { activateSkin, BUILTIN_DARK_SKIN, BUILTIN_LIGHT_SKIN, getStoredSkinId } from "../services/skin-runtime.js";
|
||||
import type { InstalledSkin } from "../services/skin-pack.js";
|
||||
import { getStoredTheme, isDarkTheme } from "../services/theme.js";
|
||||
@@ -49,14 +49,18 @@ const storedLanguage = localStorage.getItem("webspeak:language");
|
||||
const language = ref<Language>(storedLanguage === "en" || storedLanguage === "de" || storedLanguage === "ru" || storedLanguage === "ja" ? storedLanguage : "zh");
|
||||
const baseCopy = computed(() => language.value === "zh" ? zh : language.value === "de" ? de : language.value === "ru" ? ru : language.value === "ja" ? ja : en);
|
||||
const activeSkin = shallowRef<InstalledSkin | null>(null);
|
||||
const activeSkinId = ref(getStoredSkinId() ?? (isDarkTheme(getStoredTheme()) ? BUILTIN_DARK_SKIN : BUILTIN_LIGHT_SKIN));
|
||||
const storedSkinId = getStoredSkinId();
|
||||
const activeSkinId = ref(storedSkinId ?? (isDarkTheme(getStoredTheme()) ? BUILTIN_DARK_SKIN : BUILTIN_LIGHT_SKIN));
|
||||
const skinReady = ref(storedSkinId === BUILTIN_LIGHT_SKIN || storedSkinId === BUILTIN_DARK_SKIN);
|
||||
const installedSkins = ref<InstalledSkin[]>([]);
|
||||
const catalogSkins = ref<SkinCatalogEntry[]>([]);
|
||||
const skinOptions = computed<SkinOption[]>(() => [
|
||||
{ value: BUILTIN_LIGHT_SKIN, label: copy.value.skinDay, icon: "sun" },
|
||||
{ value: BUILTIN_DARK_SKIN, label: copy.value.skinNight, icon: "moon" },
|
||||
...catalogSkins.value.map((skin) => ({ value: skin.id, label: skin.name, icon: "compass" })),
|
||||
...installedSkins.value.filter((skin) => !catalogSkins.value.some((item) => item.id === skin.id)).map((skin) => ({ value: skin.id, label: skin.name, icon: "compass" })),
|
||||
...catalogSkins.value.map((skin) => ({
|
||||
value: skin.id,
|
||||
label: skin.id === BUILTIN_LIGHT_SKIN ? copy.value.skinDay : skin.id === BUILTIN_DARK_SKIN ? copy.value.skinNight : skin.name,
|
||||
icon: skin.id === BUILTIN_LIGHT_SKIN ? "sun" : skin.id === BUILTIN_DARK_SKIN ? "moon" : "compass",
|
||||
})),
|
||||
...installedSkins.value.filter((skin) => !catalogSkins.value.some((item) => item.id === skin.id) && isPublicSkinEnabled(skin.id)).map((skin) => ({ value: skin.id, label: skin.name, icon: "compass" })),
|
||||
]);
|
||||
const copy = computed(() => {
|
||||
const result = { ...baseCopy.value };
|
||||
@@ -67,7 +71,7 @@ const copy = computed(() => {
|
||||
for (const [key, value] of Object.entries(content.locales[locale]?.messages ?? {})) {
|
||||
if (!key.startsWith("demo.")) continue;
|
||||
const copyKey = key.slice("demo.".length) as keyof typeof result;
|
||||
if (Object.prototype.hasOwnProperty.call(result, copyKey)) result[copyKey] = value;
|
||||
if (Object.prototype.hasOwnProperty.call(result, copyKey) && value.trim()) result[copyKey] = value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -99,20 +103,44 @@ const visibleMessages = computed(() => activeTab.value === "channel" ? messages.
|
||||
|
||||
function persistLanguage() { localStorage.setItem("webspeak:language", language.value); void saveLocalPreferences({ schemaVersion: 1, language: language.value }); }
|
||||
async function onSkinChange(skinId: string) {
|
||||
localStorage.setItem("webspeak:skin-choice", skinId);
|
||||
const catalogSkin = catalogSkins.value.find((skin) => skin.id === skinId);
|
||||
activeSkin.value = await activateSkin(skinId, catalogSkin?.version);
|
||||
activeSkinId.value = getStoredSkinId() ?? skinId;
|
||||
void saveLocalPreferences({ schemaVersion: 1, skinId: activeSkinId.value });
|
||||
}
|
||||
onMounted(async () => {
|
||||
const [preferences, installed, available] = await Promise.all([loadLocalPreferences(), listInstalledSkins(), listPublicSkins()]);
|
||||
installedSkins.value = installed;
|
||||
catalogSkins.value = available;
|
||||
const selectedId = getStoredSkinId() ?? preferences.skinId ?? activeSkinId.value;
|
||||
activeSkinId.value = selectedId;
|
||||
const catalogSkin = available.find((skin) => skin.id === selectedId);
|
||||
activeSkin.value = await activateSkin(selectedId, catalogSkin?.version);
|
||||
activeSkinId.value = getStoredSkinId() ?? selectedId;
|
||||
const catalogPromise = listPublicSkins().catch(() => []);
|
||||
try {
|
||||
const [preferences, installed, available] = await Promise.all([loadLocalPreferences(), listInstalledSkins(), catalogPromise]);
|
||||
installedSkins.value = installed;
|
||||
catalogSkins.value = available;
|
||||
// Only a deliberate choice should override the instance default. The active
|
||||
// skin and local preference also contain automatically applied defaults.
|
||||
const savedSkinId = localStorage.getItem("webspeak:skin-choice");
|
||||
const selectedId = savedSkinId && isPublicSkinEnabled(savedSkinId) ? savedSkinId : getPublicDefaultSkinId();
|
||||
const selectedSkin = available.find((skin) => skin.id === selectedId);
|
||||
activeSkinId.value = selectedId;
|
||||
activeSkin.value = await activateSkin(selectedId, selectedSkin?.version);
|
||||
activeSkinId.value = getStoredSkinId() ?? selectedId;
|
||||
} catch {
|
||||
activeSkin.value = null;
|
||||
activeSkinId.value = isDarkTheme(getStoredTheme()) ? BUILTIN_DARK_SKIN : BUILTIN_LIGHT_SKIN;
|
||||
await activateSkin(activeSkinId.value).catch(() => undefined);
|
||||
} finally {
|
||||
skinReady.value = true;
|
||||
}
|
||||
|
||||
void catalogPromise.then(async (available) => {
|
||||
catalogSkins.value = available;
|
||||
const selected = available.find((skin) => skin.id === activeSkinId.value);
|
||||
const installed = installedSkins.value.find((skin) => skin.id === activeSkinId.value);
|
||||
if (!selected || !installed || installed.version === selected.version) return;
|
||||
activeSkin.value = await activateSkin(selected.id, selected.version);
|
||||
if (getStoredSkinId() !== selected.id) return;
|
||||
activeSkinId.value = getStoredSkinId() ?? selected.id;
|
||||
installedSkins.value = await listInstalledSkins();
|
||||
}).catch(() => undefined);
|
||||
});
|
||||
function selectChannel(id: string) { selectedChannelId.value = id; activeTab.value = "channel"; }
|
||||
function toggleSpeaking() { speakingId.value = speakingId.value ? "" : selectedChannel.value.members[0]?.id ?? ""; }
|
||||
@@ -123,6 +151,7 @@ function avatarStyle(name: string) { let hash = 0; for (const char of name) hash
|
||||
|
||||
<style scoped>
|
||||
.demo-page, .demo-page * { box-sizing: border-box; }
|
||||
.demo-page.skin-initializing { visibility: hidden; }
|
||||
.demo-page { min-height: 100dvh; padding: 0 28px 38px; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: radial-gradient(circle at 72% 12%, rgba(126, 213, 205, .18), transparent 26rem), #f7f9f8; color: #1c2b28; }
|
||||
.demo-page button, .demo-page input { font: inherit; }
|
||||
.demo-header { display: flex; align-items: center; justify-content: space-between; width: min(1380px, 100%); min-height: 82px; margin: 0 auto; }
|
||||
@@ -138,12 +167,11 @@ function avatarStyle(name: string) { let hash = 0; for (const char of name) hash
|
||||
divide the fixed poke banner offsets back to CSS pixels so it stays at the
|
||||
intended 82px/25px margin instead of drifting by the zoom factor. */
|
||||
@media (min-width: 851px) { .demo-poke { top: calc(82px / var(--ui-scale)); right: calc(25px / var(--ui-scale)); } }
|
||||
:global(:root[data-theme="dark"]) .demo-page { color: #e8f3f0; background: #101918; }
|
||||
:global(:root[data-theme="dark"]) .demo-channel-panel, :global(:root[data-theme="dark"]) .demo-actions-panel, :global(:root[data-theme="dark"]) .demo-main, :global(:root[data-theme="dark"]) .demo-voice-card { background: #172321; border-color: #30413d; }
|
||||
:global(:root[data-theme="dark"]) .demo-panel-title strong, :global(:root[data-theme="dark"]) .demo-hero h1, :global(:root[data-theme="dark"]) .demo-section-heading strong, :global(:root[data-theme="dark"]) .demo-chat-head strong, :global(:root[data-theme="dark"]) .demo-voice-card strong, :global(:root[data-theme="dark"]) .demo-user strong { color: #e8f3f0; }
|
||||
:global(:root[data-theme="dark"]) .demo-hero { background: linear-gradient(112deg, #173e3a, #172321); }
|
||||
:global(:root[data-theme="dark"]) .demo-message p, :global(:root[data-theme="dark"]) .demo-composer, :global(:root[data-theme="dark"]) .demo-actions-panel > button { background: #202f2c; color: #d7e7e3; }
|
||||
:global(:root[data-theme="dark"]) .demo-chat-head, :global(:root[data-theme="dark"]) .demo-user { border-color: #30413d; }
|
||||
@media (prefers-color-scheme: dark) { :global(:root[data-theme="system"]) .demo-page .demo-channel-panel, :global(:root[data-theme="system"]) .demo-page .demo-actions-panel, :global(:root[data-theme="system"]) .demo-page .demo-main, :global(:root[data-theme="system"]) .demo-page .demo-voice-card { background: #172321; border-color: #30413d; } }
|
||||
.demo-page[data-ws-skin="builtin.dark"] { color: #e8f3f0; background: #101918; }
|
||||
.demo-page[data-ws-skin="builtin.dark"] .demo-channel-panel, .demo-page[data-ws-skin="builtin.dark"] .demo-actions-panel, .demo-page[data-ws-skin="builtin.dark"] .demo-main, .demo-page[data-ws-skin="builtin.dark"] .demo-voice-card { background: #172321; border-color: #30413d; }
|
||||
.demo-page[data-ws-skin="builtin.dark"] .demo-panel-title strong, .demo-page[data-ws-skin="builtin.dark"] .demo-hero h1, .demo-page[data-ws-skin="builtin.dark"] .demo-section-heading strong, .demo-page[data-ws-skin="builtin.dark"] .demo-chat-head strong, .demo-page[data-ws-skin="builtin.dark"] .demo-voice-card strong, .demo-page[data-ws-skin="builtin.dark"] .demo-user strong { color: #e8f3f0; }
|
||||
.demo-page[data-ws-skin="builtin.dark"] .demo-hero { background: linear-gradient(112deg, #173e3a, #172321); }
|
||||
.demo-page[data-ws-skin="builtin.dark"] .demo-message p, .demo-page[data-ws-skin="builtin.dark"] .demo-composer, .demo-page[data-ws-skin="builtin.dark"] .demo-actions-panel > button { background: #202f2c; color: #d7e7e3; }
|
||||
.demo-page[data-ws-skin="builtin.dark"] .demo-chat-head, .demo-page[data-ws-skin="builtin.dark"] .demo-user { border-color: #30413d; }
|
||||
.demo-page :where(button, a, input, select):focus-visible { outline: 3px solid #69d2c7; outline-offset: 2px; }
|
||||
</style>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div :class="['web-client', 'ws-skin-root', `language-${language}`]" data-ws-part="app" :data-ws-page="voiceState.connected || voiceState.reconnecting || voiceState.reconnectFailed ? 'voice' : 'home'">
|
||||
<div :class="['web-client', 'ws-skin-root', `language-${language}`, { 'skin-initializing': !skinReady }]" data-ws-part="app" :data-ws-page="voiceState.connected || voiceState.reconnecting || voiceState.reconnectFailed ? 'voice' : 'home'">
|
||||
<!-- Connection / welcome screen -->
|
||||
<section v-if="!voiceState.connected && !voiceState.reconnecting && !voiceState.reconnectFailed" class="join-page" data-ws-part="home">
|
||||
<header class="join-header" data-ws-part="home.header">
|
||||
@@ -32,6 +32,10 @@
|
||||
</div>
|
||||
|
||||
<div class="join-card" data-ws-part="home.join-card">
|
||||
<div class="join-card-effects" aria-hidden="true">
|
||||
<span class="join-card-waveform" data-ws-part="home.join-card.waveform"><i v-for="bar in 9" :key="bar"></i></span>
|
||||
<span class="join-card-sonar" data-ws-part="home.join-card.sonar"><i v-for="ring in 3" :key="ring"></i></span>
|
||||
</div>
|
||||
<h2 data-ws-part="home.join-title">{{ skinHomeCopy.welcomeTitle || t('welcomeBack') }}</h2>
|
||||
<p class="card-lead" data-ws-part="home.join-description">{{ skinHomeCopy.welcomeDescription || t('joinLead') }}</p>
|
||||
|
||||
@@ -99,7 +103,7 @@
|
||||
</section>
|
||||
|
||||
<!-- Connected application shell -->
|
||||
<div v-else :class="['app-shell', `mobile-view-${mobileSection}`]" data-ws-part="voice.shell" @click="memberMenu = null">
|
||||
<div v-else :class="['app-shell', `mobile-view-${mobileSection}`]" :data-performance-open="performancePanelOpen ? 'true' : 'false'" data-ws-part="voice.shell" @click="memberMenu = null">
|
||||
<main class="workspace" data-ws-part="voice.workspace">
|
||||
<header class="workspace-header" data-ws-part="voice.header">
|
||||
<div class="breadcrumbs" data-ws-part="voice.breadcrumbs"><span class="mobile-brand">TeamSpeak <em>Web</em></span><span class="crumb-muted">{{ t('serverBreadcrumb') }}</span><Icon name="chevron-right" :size="14" /><strong>{{ currentChannelName }}</strong></div>
|
||||
@@ -154,6 +158,7 @@
|
||||
<div class="workspace-scroll" data-ws-part="voice.scroll">
|
||||
<div class="workspace-content" data-ws-part="voice.content">
|
||||
<section :class="['voice-section', { 'mobile-section-hidden': mobileSection !== 'voice' }]" data-ws-part="voice.activity">
|
||||
<div class="voice-activity-artwork" data-ws-part="voice.activity.artwork" aria-hidden="true"></div>
|
||||
<div class="section-heading" data-ws-part="voice.activity-heading"><div><span class="section-kicker">{{ t('voiceActivity') }}</span><h2>{{ t('speakingNow') }}</h2></div><span class="section-counter">{{ t('onlineShort', { count: currentMembers.length }) }}</span></div>
|
||||
<div v-if="screenShareError" class="screen-share-inline-error" data-ws-part="voice.screen-share-error" role="status"><Icon name="info" :size="15" /> <span>{{ screenShareErrorText }}</span></div>
|
||||
<section v-if="screenShareViewing" ref="screenSharePlayerEl" class="screen-share-player" data-ws-part="voice.screen-player" role="region" :aria-label="t('screenShare')">
|
||||
@@ -189,7 +194,7 @@
|
||||
<button type="button" class="screen-share-settings-button" :aria-label="t('screenShareSettings')" :aria-expanded="screenShareSettingsOpen" :title="t('screenShareSettings')" @click.stop="screenShareSettingsOpen = !screenShareSettingsOpen"><Icon name="settings" :size="13" /></button>
|
||||
</div>
|
||||
</template>
|
||||
<button v-else-if="!member.isSelf" type="button" :class="['screen-share-card-button', { viewing: screenShareViewingStreamId === screenShareStreamForMember(member)?.streamId }]" @click.stop="toggleScreenShareForMember(member)"><Icon name="monitor" :size="13" /> {{ screenShareViewingStreamId === screenShareStreamForMember(member)?.streamId ? t('watching') : t('watchScreenShare') }}</button>
|
||||
<button v-else-if="!member.isSelf" type="button" :class="['screen-share-card-button', { viewing: screenShareViewingStreamId === screenShareStreamForMember(member)?.streamId }]" :data-ws-state="screenShareViewingStreamId === screenShareStreamForMember(member)?.streamId ? 'viewing' : 'idle'" @click.stop="toggleScreenShareForMember(member)"><Icon name="monitor" :size="13" /> {{ screenShareViewingStreamId === screenShareStreamForMember(member)?.streamId ? t('watching') : t('watchScreenShare') }}</button>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
@@ -216,13 +221,13 @@
|
||||
<div ref="chatListEl" class="message-list" data-ws-part="voice.chat.messages">
|
||||
<div v-if="chatTab === 'events'">
|
||||
<article v-for="event in serverEvents" :key="event.id" class="event-row" data-ws-part="voice.chat.event"><time>{{ formatTime(event.timestamp) }}</time><span>{{ event.message }}</span></article>
|
||||
<div v-if="!serverEvents.length" class="chat-empty" data-ws-part="voice.chat.empty"><div class="chat-empty-icon"><Icon name="bell" :size="24" /></div><strong>{{ t('noEvents') }}</strong><span>{{ t('noEventsLead') }}</span></div>
|
||||
<div v-if="!serverEvents.length" class="chat-empty" data-ws-part="voice.chat.empty" data-ws-state="events-empty"><div class="chat-empty-icon"><Icon name="bell" :size="24" /></div><strong>{{ t('noEvents') }}</strong><span>{{ t('noEventsLead') }}</span></div>
|
||||
</div>
|
||||
<div v-else-if="!visibleChatMessages.length" class="chat-empty" data-ws-part="voice.chat.empty"><div class="chat-empty-icon"><Icon name="message" :size="24" /></div><strong>{{ chatTab === 'private' ? t('privateChatStart') : t('chatStart') }}</strong><span>{{ chatTab === 'private' ? t('privateChatStartLead') : t('chatStartLead') }}</span></div>
|
||||
<div v-else-if="!visibleChatMessages.length" class="chat-empty" data-ws-part="voice.chat.empty" data-ws-state="messages-empty"><strong>{{ chatTab === 'private' ? t('privateChatStart') : t('chatStart') }}</strong><span>{{ chatTab === 'private' ? t('privateChatStartLead') : t('chatStartLead') }}</span></div>
|
||||
<template v-for="message in visibleChatMessages" :key="message.id">
|
||||
<article v-if="chatTab !== 'events'" :class="['message-row', { mine: message.isSelf }]" data-ws-part="voice.chat.message" :data-ws-state="message.isSelf ? 'mine' : 'other'">
|
||||
<div class="message-avatar" data-ws-part="voice.chat.message-avatar" :style="avatarStyle(message.invokerName, message.isSelf, messageAvatar(message))">{{ messageAvatar(message) ? '' : avatarInitial(message.invokerName) }}</div>
|
||||
<div class="message-body" data-ws-part="voice.chat.message-body"><div class="message-meta"><strong>{{ message.isSelf ? t('you') : message.invokerName }}</strong><time>{{ formatTime(message.timestamp) }}</time></div><div class="message-bubble">{{ message.message }}</div></div>
|
||||
<div class="message-body" data-ws-part="voice.chat.message-body"><div class="message-meta"><strong>{{ message.isSelf ? t('you') : message.invokerName }}</strong><time>{{ formatTime(message.timestamp) }}</time></div><div class="message-bubble" data-ws-part="voice.chat.message-bubble">{{ message.message }}</div></div>
|
||||
</article>
|
||||
</template>
|
||||
</div>
|
||||
@@ -386,7 +391,7 @@ import { useWebClientServerHistory } from "../composables/useWebClientServerHist
|
||||
import { getInitialLanguage, type Language } from "../i18n/web-client.js";
|
||||
import { clearLocalData as clearStoredLocalData, isLocalPersistenceAvailable, listInstalledSkins, loadLocalPreferences, loadStoredIdentity, removeStoredIdentity, saveLocalPreferences, saveStoredIdentity } from "../services/local-persistence.js";
|
||||
import type { InstalledSkin, SkinHomeCopy } from "../services/skin-pack.js";
|
||||
import { listPublicSkins, type SkinCatalogEntry } from "../services/skin-catalog.js";
|
||||
import { getPublicDefaultSkinId, isPublicSkinEnabled, listPublicSkins, type SkinCatalogEntry } from "../services/skin-catalog.js";
|
||||
import { activateSkin, BUILTIN_DARK_SKIN, BUILTIN_LIGHT_SKIN, clearCustomSkinStyle, getStoredSkinId } from "../services/skin-runtime.js";
|
||||
import { applyTheme, getStoredTheme, isDarkTheme, saveTheme, type ThemeMode } from "../services/theme.js";
|
||||
import { DEFAULT_TEAM_SPEAK_PORT, splitTeamSpeakTarget } from "../services/teamspeak-target.js";
|
||||
@@ -509,7 +514,9 @@ const skinMessageOverrides = computed(() => resolveSkinMessages(activeSkin.value
|
||||
const { t: translate, localizedMessage, localizedAudioNotice, visibleErrorCode } = useWebClientI18n(language);
|
||||
function t(key: string, variables: Record<string, string | number> = {}) {
|
||||
const template = skinMessageOverrides.value[key];
|
||||
if (template === undefined) return translate(key, variables);
|
||||
// WebSpeak's own locale dictionaries are the complete baseline; a skin only
|
||||
// replaces non-empty strings it explicitly provides.
|
||||
if (template === undefined || !template.trim()) return translate(key, variables);
|
||||
return Object.entries(variables).reduce((value, [name, replacement]) => value.replaceAll(`{{${name}}}`, String(replacement)), template);
|
||||
}
|
||||
const {
|
||||
@@ -543,14 +550,18 @@ function resolveSkinMode(theme: ThemeMode): SkinMode {
|
||||
const themeMode = ref<SkinMode>(resolveSkinMode(getStoredTheme()));
|
||||
applyTheme(themeMode.value);
|
||||
if (localStorage.getItem("webspeak:theme") === "system") saveTheme(themeMode.value);
|
||||
const activeSkinId = ref(getStoredSkinId() ?? (themeMode.value === "dark" ? BUILTIN_DARK_SKIN : BUILTIN_LIGHT_SKIN));
|
||||
const storedSkinId = getStoredSkinId();
|
||||
const activeSkinId = ref(storedSkinId ?? (themeMode.value === "dark" ? BUILTIN_DARK_SKIN : BUILTIN_LIGHT_SKIN));
|
||||
const skinReady = ref(storedSkinId === BUILTIN_LIGHT_SKIN || storedSkinId === BUILTIN_DARK_SKIN);
|
||||
const installedSkins = ref<InstalledSkin[]>([]);
|
||||
const catalogSkins = ref<SkinCatalogEntry[]>([]);
|
||||
const skinOptions = computed<SkinOption[]>(() => [
|
||||
{ value: BUILTIN_LIGHT_SKIN, label: t("skinDay"), icon: "sun" },
|
||||
{ value: BUILTIN_DARK_SKIN, label: t("skinNight"), icon: "moon" },
|
||||
...catalogSkins.value.map((skin) => ({ value: skin.id, label: skin.name, icon: "compass" })),
|
||||
...installedSkins.value.filter((skin) => !catalogSkins.value.some((item) => item.id === skin.id)).map((skin) => ({ value: skin.id, label: skin.name, icon: "compass" })),
|
||||
...catalogSkins.value.map((skin) => ({
|
||||
value: skin.id,
|
||||
label: skin.id === BUILTIN_LIGHT_SKIN ? t("skinDay") : skin.id === BUILTIN_DARK_SKIN ? t("skinNight") : skin.name,
|
||||
icon: skin.id === BUILTIN_LIGHT_SKIN ? "sun" : skin.id === BUILTIN_DARK_SKIN ? "moon" : "compass",
|
||||
})),
|
||||
...installedSkins.value.filter((skin) => !catalogSkins.value.some((item) => item.id === skin.id) && isPublicSkinEnabled(skin.id)).map((skin) => ({ value: skin.id, label: skin.name, icon: "compass" })),
|
||||
]);
|
||||
const skinHomeCopy = computed<SkinHomeCopy>(() => resolveSkinHomeCopy(activeSkin.value, language.value));
|
||||
const skinHomeFeatures = computed(() => {
|
||||
@@ -559,11 +570,23 @@ const skinHomeFeatures = computed(() => {
|
||||
{ id: "secure", title: t("secureJoin"), description: t("inviteProtected"), icon: "shield", tone: "mint" },
|
||||
{ id: "realtime", title: t("realtime"), description: t("membersSync"), icon: "users", tone: "sand" },
|
||||
];
|
||||
const custom = skinHomeCopy.value.features;
|
||||
if (!custom) return defaults;
|
||||
const features = [...defaults];
|
||||
const custom = skinHomeCopy.value.features ?? [];
|
||||
const icons = ["waveform", "shield", "users"];
|
||||
const tones = ["", "mint", "sand"];
|
||||
return custom.map((feature, index) => ({ id: `custom-${index}`, ...feature, icon: icons[index % icons.length], tone: tones[index % tones.length] }));
|
||||
custom.forEach((feature, index) => {
|
||||
const base = defaults[index];
|
||||
const replacement = {
|
||||
id: base?.id ?? `custom-${index}`,
|
||||
title: feature.title.trim() || base?.title || "",
|
||||
description: feature.description.trim() || base?.description || "",
|
||||
icon: base?.icon ?? icons[index % icons.length],
|
||||
tone: base?.tone ?? tones[index % tones.length],
|
||||
};
|
||||
if (base) features[index] = replacement;
|
||||
else if (replacement.title && replacement.description) features.push(replacement);
|
||||
});
|
||||
return features;
|
||||
});
|
||||
const {
|
||||
settingsError: audioSettingsError,
|
||||
@@ -628,6 +651,7 @@ function persistLanguage() {
|
||||
}
|
||||
|
||||
async function onSkinChange(skinId: string) {
|
||||
localStorage.setItem("webspeak:skin-choice", skinId);
|
||||
activeSkinId.value = skinId;
|
||||
const catalogSkin = catalogSkins.value.find((skin) => skin.id === skinId);
|
||||
activeSkin.value = await activateSkin(skinId, catalogSkin?.version, appVersion.value);
|
||||
@@ -639,24 +663,60 @@ async function onSkinChange(skinId: string) {
|
||||
}
|
||||
|
||||
async function initializeSkin(): Promise<void> {
|
||||
const [preferences, skins, availableSkins] = await Promise.all([loadLocalPreferences(), listInstalledSkins(), listPublicSkins()]);
|
||||
installedSkins.value = skins;
|
||||
catalogSkins.value = availableSkins;
|
||||
if (!localStorage.getItem("webspeak:theme")) {
|
||||
if (preferences.theme === "system" || preferences.theme === "light" || preferences.theme === "dark") {
|
||||
themeMode.value = resolveSkinMode(preferences.theme);
|
||||
const catalogPromise = listPublicSkins().catch(() => []);
|
||||
try {
|
||||
const [preferences, skins, availableSkins] = await Promise.all([loadLocalPreferences(), listInstalledSkins(), catalogPromise]);
|
||||
installedSkins.value = skins;
|
||||
catalogSkins.value = availableSkins;
|
||||
if (!localStorage.getItem("webspeak:theme")) {
|
||||
if (preferences.theme === "system" || preferences.theme === "light" || preferences.theme === "dark") {
|
||||
themeMode.value = resolveSkinMode(preferences.theme);
|
||||
}
|
||||
saveTheme(themeMode.value);
|
||||
}
|
||||
saveTheme(themeMode.value);
|
||||
// Only a deliberate choice should override the instance default. The active
|
||||
// skin and local preference also contain automatically applied defaults.
|
||||
const savedSkinId = localStorage.getItem("webspeak:skin-choice");
|
||||
const preferredSkinId = savedSkinId && isPublicSkinEnabled(savedSkinId)
|
||||
? savedSkinId
|
||||
: getPublicDefaultSkinId();
|
||||
const preferredSkin = availableSkins.find((skin) => skin.id === preferredSkinId);
|
||||
activeSkinId.value = preferredSkinId;
|
||||
// Apply the locally cached package (or fetch it if absent) before revealing
|
||||
// the page. The network catalog/version check must not block the first paint.
|
||||
activeSkin.value = await activateSkin(preferredSkinId, preferredSkin?.version, appVersion.value);
|
||||
activeSkinId.value = getStoredSkinId() ?? preferredSkinId;
|
||||
if (activeSkinId.value === BUILTIN_LIGHT_SKIN) themeMode.value = "light";
|
||||
else if (activeSkinId.value === BUILTIN_DARK_SKIN) themeMode.value = "dark";
|
||||
else themeMode.value = resolveSkinMode(getStoredTheme());
|
||||
void saveLocalPreferences({ schemaVersion: 1, theme: themeMode.value, skinId: activeSkinId.value });
|
||||
} catch {
|
||||
// Storage or package loading can fail on restricted browsers. Do not leave
|
||||
// the application hidden, and restore a usable built-in palette instead.
|
||||
activeSkin.value = null;
|
||||
activeSkinId.value = themeMode.value === "dark" ? BUILTIN_DARK_SKIN : BUILTIN_LIGHT_SKIN;
|
||||
try {
|
||||
await activateSkin(activeSkinId.value, undefined, appVersion.value);
|
||||
} catch {
|
||||
applyTheme(themeMode.value);
|
||||
}
|
||||
} finally {
|
||||
// The active skin's CSS and asset URLs are installed before this becomes
|
||||
// visible, so the built-in day/night palette is never shown in between.
|
||||
skinReady.value = true;
|
||||
}
|
||||
const preferredSkinId = getStoredSkinId() || preferences.skinId || (themeMode.value === "dark" ? BUILTIN_DARK_SKIN : BUILTIN_LIGHT_SKIN);
|
||||
activeSkinId.value = preferredSkinId;
|
||||
const catalogSkin = availableSkins.find((skin) => skin.id === preferredSkinId);
|
||||
activeSkin.value = await activateSkin(preferredSkinId, catalogSkin?.version, appVersion.value);
|
||||
activeSkinId.value = getStoredSkinId() ?? preferredSkinId;
|
||||
if (activeSkinId.value === BUILTIN_LIGHT_SKIN) themeMode.value = "light";
|
||||
else if (activeSkinId.value === BUILTIN_DARK_SKIN) themeMode.value = "dark";
|
||||
else themeMode.value = resolveSkinMode(getStoredTheme());
|
||||
void saveLocalPreferences({ schemaVersion: 1, theme: themeMode.value, skinId: activeSkinId.value });
|
||||
|
||||
void catalogPromise.then(async (availableSkins) => {
|
||||
catalogSkins.value = availableSkins;
|
||||
const selectedSkin = availableSkins.find((skin) => skin.id === activeSkinId.value);
|
||||
const installedSkin = installedSkins.value.find((skin) => skin.id === activeSkinId.value);
|
||||
if (!selectedSkin || !installedSkin || installedSkin.version === selectedSkin.version) return;
|
||||
const updatedSkin = await activateSkin(selectedSkin.id, selectedSkin.version, appVersion.value);
|
||||
if (getStoredSkinId() !== selectedSkin.id) return;
|
||||
activeSkin.value = updatedSkin;
|
||||
activeSkinId.value = getStoredSkinId() ?? selectedSkin.id;
|
||||
installedSkins.value = await listInstalledSkins();
|
||||
}).catch(() => undefined);
|
||||
}
|
||||
|
||||
const screenShareIndicatorBars = [5, 10, 7, 12, 8, 10];
|
||||
@@ -930,7 +990,7 @@ function doShare() {
|
||||
async function clearBrowserData(): Promise<void> {
|
||||
if (!window.confirm(t("clearLocalDataConfirm"))) return;
|
||||
await clearStoredLocalData();
|
||||
for (const key of ["webspeak:nickname", "webspeak:language", "webspeak:theme", "webspeak:active-skin", "webspeak:input-device", "webspeak:output-device", "webspeak:remember-identity"]) localStorage.removeItem(key);
|
||||
for (const key of ["webspeak:nickname", "webspeak:language", "webspeak:theme", "webspeak:active-skin", "webspeak:skin-choice", "webspeak:input-device", "webspeak:output-device", "webspeak:remember-identity"]) localStorage.removeItem(key);
|
||||
clearCustomSkinStyle();
|
||||
activeSkin.value = null;
|
||||
installedSkins.value = [];
|
||||
|
||||