diff --git a/.agents/skills/webspeak-skin-development/SKILL.md b/.agents/skills/webspeak-skin-development/SKILL.md new file mode 100644 index 0000000..4272077 --- /dev/null +++ b/.agents/skills/webspeak-skin-development/SKILL.md @@ -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. diff --git a/CHANGELOG.md b/CHANGELOG.md index 95b0de3..a42c28d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ### 中文 diff --git a/README.md b/README.md index 8977332..4ba1c8b 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/docs/README.de.md b/docs/README.de.md index b895356..bee61d5 100644 --- a/docs/README.de.md +++ b/docs/README.de.md @@ -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. | diff --git a/docs/README.en.md b/docs/README.en.md index 27da841..1bb145d 100644 --- a/docs/README.en.md +++ b/docs/README.en.md @@ -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. | diff --git a/docs/README.ja.md b/docs/README.ja.md index c5cf354..c196330 100644 --- a/docs/README.ja.md +++ b/docs/README.ja.md @@ -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 を基にしたエラー表示・エラーコードを改善しました。 | diff --git a/docs/README.ru.md b/docs/README.ru.md index 6460344..f26230e 100644 --- a/docs/README.ru.md +++ b/docs/README.ru.md @@ -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. | diff --git a/docs/README.zh-CN.md b/docs/README.zh-CN.md index 2616519..3359563 100644 --- a/docs/README.zh-CN.md +++ b/docs/README.zh-CN.md @@ -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 基础上的错误提示与错误代码。 | diff --git a/docs/SKIN_DEVELOPMENT.md b/docs/SKIN_DEVELOPMENT.md index 8cc206f..3d26427 100644 --- a/docs/SKIN_DEVELOPMENT.md +++ b/docs/SKIN_DEVELOPMENT.md @@ -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 隔离与拒绝规则、文案结构和服务端皮肤目录读写。视觉排版、内容遮挡和浏览器间表现仍须人工预览。 diff --git a/docs/examples/ILLUSIA-VOICE.md b/docs/examples/ILLUSIA-VOICE.md new file mode 100644 index 0000000..78f99a4 --- /dev/null +++ b/docs/examples/ILLUSIA-VOICE.md @@ -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. diff --git a/docs/examples/aurora-voice.wskin b/docs/examples/aurora-voice.wskin deleted file mode 100644 index 118ba5c..0000000 Binary files a/docs/examples/aurora-voice.wskin and /dev/null differ diff --git a/docs/examples/aurora-voice/assets/webspeak-mark.jpg b/docs/examples/aurora-voice/assets/webspeak-mark.jpg deleted file mode 100644 index 19cf590..0000000 Binary files a/docs/examples/aurora-voice/assets/webspeak-mark.jpg and /dev/null differ diff --git a/docs/examples/aurora-voice/content.json b/docs/examples/aurora-voice/content.json deleted file mode 100644 index 0c623a4..0000000 --- a/docs/examples/aurora-voice/content.json +++ /dev/null @@ -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": "皮肤" - } - } - } -} diff --git a/docs/examples/aurora-voice/manifest.json b/docs/examples/aurora-voice/manifest.json deleted file mode 100644 index 5812f54..0000000 --- a/docs/examples/aurora-voice/manifest.json +++ /dev/null @@ -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" -} diff --git a/docs/examples/aurora-voice/skin.css b/docs/examples/aurora-voice/skin.css deleted file mode 100644 index 50b1390..0000000 --- a/docs/examples/aurora-voice/skin.css +++ /dev/null @@ -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; } -} diff --git a/docs/examples/illusia-voice.wskin b/docs/examples/illusia-voice.wskin new file mode 100644 index 0000000..c07bf3f Binary files /dev/null and b/docs/examples/illusia-voice.wskin differ diff --git a/docs/examples/illusia-voice/assets/background-composite.webp b/docs/examples/illusia-voice/assets/background-composite.webp new file mode 100644 index 0000000..34d483b Binary files /dev/null and b/docs/examples/illusia-voice/assets/background-composite.webp differ diff --git a/docs/examples/illusia-voice/assets/banner-character-main.webp b/docs/examples/illusia-voice/assets/banner-character-main.webp new file mode 100644 index 0000000..193d729 Binary files /dev/null and b/docs/examples/illusia-voice/assets/banner-character-main.webp differ diff --git a/docs/examples/illusia-voice/assets/banner-mascot-blob.webp b/docs/examples/illusia-voice/assets/banner-mascot-blob.webp new file mode 100644 index 0000000..3ec292e Binary files /dev/null and b/docs/examples/illusia-voice/assets/banner-mascot-blob.webp differ diff --git a/docs/examples/illusia-voice/assets/banner-petals.webp b/docs/examples/illusia-voice/assets/banner-petals.webp new file mode 100644 index 0000000..2a7c976 Binary files /dev/null and b/docs/examples/illusia-voice/assets/banner-petals.webp differ diff --git a/docs/examples/illusia-voice/assets/bg-foreground-blur.webp b/docs/examples/illusia-voice/assets/bg-foreground-blur.webp new file mode 100644 index 0000000..c976c13 Binary files /dev/null and b/docs/examples/illusia-voice/assets/bg-foreground-blur.webp differ diff --git a/docs/examples/illusia-voice/assets/bg-room-main.webp b/docs/examples/illusia-voice/assets/bg-room-main.webp new file mode 100644 index 0000000..e39632b Binary files /dev/null and b/docs/examples/illusia-voice/assets/bg-room-main.webp differ diff --git a/docs/examples/illusia-voice/assets/button-mascot.webp b/docs/examples/illusia-voice/assets/button-mascot.webp new file mode 100644 index 0000000..1d19ea3 Binary files /dev/null and b/docs/examples/illusia-voice/assets/button-mascot.webp differ diff --git a/docs/examples/illusia-voice/assets/chat-empty-chibi.webp b/docs/examples/illusia-voice/assets/chat-empty-chibi.webp new file mode 100644 index 0000000..231794c Binary files /dev/null and b/docs/examples/illusia-voice/assets/chat-empty-chibi.webp differ diff --git a/docs/examples/illusia-voice/assets/footer-wave.png b/docs/examples/illusia-voice/assets/footer-wave.png new file mode 100644 index 0000000..8cd6371 Binary files /dev/null and b/docs/examples/illusia-voice/assets/footer-wave.png differ diff --git a/docs/examples/illusia-voice/assets/foreground-books-right.webp b/docs/examples/illusia-voice/assets/foreground-books-right.webp new file mode 100644 index 0000000..ec99835 Binary files /dev/null and b/docs/examples/illusia-voice/assets/foreground-books-right.webp differ diff --git a/docs/examples/illusia-voice/assets/foreground-headphone.webp b/docs/examples/illusia-voice/assets/foreground-headphone.webp new file mode 100644 index 0000000..e9d4ec7 Binary files /dev/null and b/docs/examples/illusia-voice/assets/foreground-headphone.webp differ diff --git a/docs/examples/illusia-voice/assets/visitor-avatar.webp b/docs/examples/illusia-voice/assets/visitor-avatar.webp new file mode 100644 index 0000000..c0ed84c Binary files /dev/null and b/docs/examples/illusia-voice/assets/visitor-avatar.webp differ diff --git a/docs/examples/illusia-voice/manifest.json b/docs/examples/illusia-voice/manifest.json new file mode 100644 index 0000000..fb9c5ff --- /dev/null +++ b/docs/examples/illusia-voice/manifest.json @@ -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" +} diff --git a/docs/examples/illusia-voice/skin.css b/docs/examples/illusia-voice/skin.css new file mode 100644 index 0000000..e1b6cdd --- /dev/null +++ b/docs/examples/illusia-voice/skin.css @@ -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; + } +} diff --git a/package-lock.json b/package-lock.json index f7b361b..aaf4bb4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 424dbef..6cc13dd 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/generate-illusia-footer-wave.ps1 b/scripts/generate-illusia-footer-wave.ps1 new file mode 100644 index 0000000..c11b1bc --- /dev/null +++ b/scripts/generate-illusia-footer-wave.ps1 @@ -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() diff --git a/src/admin/admin-router.ts b/src/admin/admin-router.ts index 01d0946..7961dab 100644 --- a/src/admin/admin-router.ts +++ b/src/admin/admin-router.ts @@ -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) => { diff --git a/src/admin/skin-registry.test.ts b/src/admin/skin-registry.test.ts index 4ebe4ec..9e7862e 100644 --- a/src/admin/skin-registry.test.ts +++ b/src/admin/skin-registry.test.ts @@ -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 { diff --git a/src/admin/skin-registry.ts b/src/admin/skin-registry.ts index ebb8b25..6e89f18 100644 --- a/src/admin/skin-registry.ts +++ b/src/admin/skin-registry.ts @@ -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(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 & { +type ParsedSkinManifest = Omit & { 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 { + 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 { 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 { + 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 { + 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 { + try { + const value: unknown = JSON.parse(await readFile(path.join(this.directory, "settings.json"), "utf8")); + const id = value && typeof value === "object" ? (value as Record).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 { + 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 { + 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))); diff --git a/src/server/server.ts b/src/server/server.ts index 0da2eae..c61afb4 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -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) => { diff --git a/src/server/visitor-count.test.ts b/src/server/visitor-count.test.ts new file mode 100644 index 0000000..67345fd --- /dev/null +++ b/src/server/visitor-count.test.ts @@ -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); +}); diff --git a/src/server/visitor-count.ts b/src/server/visitor-count.ts new file mode 100644 index 0000000..d7ad0af --- /dev/null +++ b/src/server/visitor-count.ts @@ -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); +} diff --git a/web/public/skins/illusia-voice-preview.webp b/web/public/skins/illusia-voice-preview.webp new file mode 100644 index 0000000..34d483b Binary files /dev/null and b/web/public/skins/illusia-voice-preview.webp differ diff --git a/web/public/skins/illusia-voice.wskin b/web/public/skins/illusia-voice.wskin new file mode 100644 index 0000000..c07bf3f Binary files /dev/null and b/web/public/skins/illusia-voice.wskin differ diff --git a/web/src/components/LanguageSwitcher.vue b/web/src/components/LanguageSwitcher.vue index 646fe74..c2151a5 100644 --- a/web/src/components/LanguageSwitcher.vue +++ b/web/src/components/LanguageSwitcher.vue @@ -3,9 +3,11 @@ -
+
-
+
{{ tr('skinLibraryScope') }}
+
{{ tr('skinDefault') }}

{{ tr('skinDefaultLead') }}

{{ skinManagerNotice }}
{{ tr('loading') }}
-
v{{ skin.version }}
-

{{ skin.name }}

{{ skin.id }}

{{ skin.description }}

{{ tr('skinAuthor') }}
{{ skin.author }}
{{ tr('skinLicense') }}
{{ skin.license }}
{{ tr('skinMinVersion') }}
{{ skin.minAppVersion }}
{{ tr('skinPreview') }}
+
v{{ skin.version }}{{ tr('skinBuiltin') }}
+

{{ skinName(skin) }}

{{ skin.id }}

{{ skinDescription(skin) }}

{{ tr('skinAuthor') }}
{{ skin.author }}
{{ tr('skinLicense') }}
{{ skin.license }}
{{ tr('skinMinVersion') }}
{{ skin.minAppVersion }}
{{ tr('skinPreview') }}{{ tr('skinProtected') }}
{{ tr('skinEmpty') }}

{{ tr('skinEmptyLead') }}

@@ -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([]); 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%}} diff --git a/web/src/views/WebClient.vue b/web/src/views/WebClient.vue index 3ab3027..e20c8b3 100644 --- a/web/src/views/WebClient.vue +++ b/web/src/views/WebClient.vue @@ -1,5 +1,5 @@ - +
@@ -216,13 +221,13 @@
{{ event.message }}
-
{{ t('noEvents') }}{{ t('noEventsLead') }}
+
{{ t('noEvents') }}{{ t('noEventsLead') }}
-
{{ chatTab === 'private' ? t('privateChatStart') : t('chatStart') }}{{ chatTab === 'private' ? t('privateChatStartLead') : t('chatStartLead') }}
+
{{ chatTab === 'private' ? t('privateChatStart') : t('chatStart') }}{{ chatTab === 'private' ? t('privateChatStartLead') : t('chatStartLead') }}
@@ -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 = {}) { 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(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([]); const catalogSkins = ref([]); const skinOptions = computed(() => [ - { 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(() => 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 { - 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 { 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 = [];