diff --git a/docs/assets/guide/app-modes.en.dark.png b/docs/assets/guide/app-modes.en.dark.png index e76b4db69..fc7ae8e22 100644 Binary files a/docs/assets/guide/app-modes.en.dark.png and b/docs/assets/guide/app-modes.en.dark.png differ diff --git a/docs/assets/guide/app-modes.en.png b/docs/assets/guide/app-modes.en.png index c49dd36c9..3591f955d 100644 Binary files a/docs/assets/guide/app-modes.en.png and b/docs/assets/guide/app-modes.en.png differ diff --git a/docs/assets/guide/app-modes.zh-CN.dark.png b/docs/assets/guide/app-modes.zh-CN.dark.png index 9d49533fe..97f0f5ea7 100644 Binary files a/docs/assets/guide/app-modes.zh-CN.dark.png and b/docs/assets/guide/app-modes.zh-CN.dark.png differ diff --git a/docs/assets/guide/app-modes.zh-CN.png b/docs/assets/guide/app-modes.zh-CN.png index 5cad2498b..7a90f6806 100644 Binary files a/docs/assets/guide/app-modes.zh-CN.png and b/docs/assets/guide/app-modes.zh-CN.png differ diff --git a/docs/assets/guide/invite-copy.en.dark.png b/docs/assets/guide/invite-copy.en.dark.png new file mode 100644 index 000000000..37a8c0953 Binary files /dev/null and b/docs/assets/guide/invite-copy.en.dark.png differ diff --git a/docs/assets/guide/invite-copy.en.png b/docs/assets/guide/invite-copy.en.png index fdb9ee742..df6e4edf7 100644 Binary files a/docs/assets/guide/invite-copy.en.png and b/docs/assets/guide/invite-copy.en.png differ diff --git a/docs/assets/guide/invite-copy.zh-CN.dark.png b/docs/assets/guide/invite-copy.zh-CN.dark.png new file mode 100644 index 000000000..46b614c44 Binary files /dev/null and b/docs/assets/guide/invite-copy.zh-CN.dark.png differ diff --git a/docs/assets/guide/invite-copy.zh-CN.png b/docs/assets/guide/invite-copy.zh-CN.png index 6d93d592f..3325f7a59 100644 Binary files a/docs/assets/guide/invite-copy.zh-CN.png and b/docs/assets/guide/invite-copy.zh-CN.png differ diff --git a/docs/assets/guide/invite-qr.en.dark.png b/docs/assets/guide/invite-qr.en.dark.png new file mode 100644 index 000000000..7de634b26 Binary files /dev/null and b/docs/assets/guide/invite-qr.en.dark.png differ diff --git a/docs/assets/guide/invite-qr.en.png b/docs/assets/guide/invite-qr.en.png index cfe2e4891..64d4ffa67 100644 Binary files a/docs/assets/guide/invite-qr.en.png and b/docs/assets/guide/invite-qr.en.png differ diff --git a/docs/assets/guide/invite-qr.zh-CN.dark.png b/docs/assets/guide/invite-qr.zh-CN.dark.png new file mode 100644 index 000000000..1880fc24c Binary files /dev/null and b/docs/assets/guide/invite-qr.zh-CN.dark.png differ diff --git a/docs/assets/guide/invite-qr.zh-CN.png b/docs/assets/guide/invite-qr.zh-CN.png index 721eedaa1..e6f90d49f 100644 Binary files a/docs/assets/guide/invite-qr.zh-CN.png and b/docs/assets/guide/invite-qr.zh-CN.png differ diff --git a/docs/assets/guide/join-code.en.dark.png b/docs/assets/guide/join-code.en.dark.png new file mode 100644 index 000000000..62e17b3a5 Binary files /dev/null and b/docs/assets/guide/join-code.en.dark.png differ diff --git a/docs/assets/guide/join-code.en.png b/docs/assets/guide/join-code.en.png index 3289ecea7..c5341e47a 100644 Binary files a/docs/assets/guide/join-code.en.png and b/docs/assets/guide/join-code.en.png differ diff --git a/docs/assets/guide/join-code.zh-CN.dark.png b/docs/assets/guide/join-code.zh-CN.dark.png new file mode 100644 index 000000000..ce33a6d14 Binary files /dev/null and b/docs/assets/guide/join-code.zh-CN.dark.png differ diff --git a/docs/assets/guide/join-code.zh-CN.png b/docs/assets/guide/join-code.zh-CN.png index 1a952ecf5..b98cb81f7 100644 Binary files a/docs/assets/guide/join-code.zh-CN.png and b/docs/assets/guide/join-code.zh-CN.png differ diff --git a/docs/assets/guide/join-password.en.dark.png b/docs/assets/guide/join-password.en.dark.png new file mode 100644 index 000000000..78bc2230b Binary files /dev/null and b/docs/assets/guide/join-password.en.dark.png differ diff --git a/docs/assets/guide/join-password.en.png b/docs/assets/guide/join-password.en.png index 7b884b3e1..a8da6ac5d 100644 Binary files a/docs/assets/guide/join-password.en.png and b/docs/assets/guide/join-password.en.png differ diff --git a/docs/assets/guide/join-password.zh-CN.dark.png b/docs/assets/guide/join-password.zh-CN.dark.png new file mode 100644 index 000000000..ba4dca6f3 Binary files /dev/null and b/docs/assets/guide/join-password.zh-CN.dark.png differ diff --git a/docs/assets/guide/join-password.zh-CN.png b/docs/assets/guide/join-password.zh-CN.png index 7353bc159..66d367fb8 100644 Binary files a/docs/assets/guide/join-password.zh-CN.png and b/docs/assets/guide/join-password.zh-CN.png differ diff --git a/docs/assets/guide/room-voice.en.dark.png b/docs/assets/guide/room-voice.en.dark.png index b06028c16..aad73f2e1 100644 Binary files a/docs/assets/guide/room-voice.en.dark.png and b/docs/assets/guide/room-voice.en.dark.png differ diff --git a/docs/assets/guide/room-voice.en.png b/docs/assets/guide/room-voice.en.png index 669967d99..5005ee793 100644 Binary files a/docs/assets/guide/room-voice.en.png and b/docs/assets/guide/room-voice.en.png differ diff --git a/docs/assets/guide/room-voice.zh-CN.dark.png b/docs/assets/guide/room-voice.zh-CN.dark.png index fc3e1d9f9..9cad23581 100644 Binary files a/docs/assets/guide/room-voice.zh-CN.dark.png and b/docs/assets/guide/room-voice.zh-CN.dark.png differ diff --git a/docs/assets/guide/room-voice.zh-CN.png b/docs/assets/guide/room-voice.zh-CN.png index 82b31df2a..5d41ef1ca 100644 Binary files a/docs/assets/guide/room-voice.zh-CN.png and b/docs/assets/guide/room-voice.zh-CN.png differ diff --git a/docs/assets/guide/share-failure.en.dark.png b/docs/assets/guide/share-failure.en.dark.png index 7c640c2d9..483282046 100644 Binary files a/docs/assets/guide/share-failure.en.dark.png and b/docs/assets/guide/share-failure.en.dark.png differ diff --git a/docs/assets/guide/share-failure.en.png b/docs/assets/guide/share-failure.en.png index 77318fb0a..8b0e9b132 100644 Binary files a/docs/assets/guide/share-failure.en.png and b/docs/assets/guide/share-failure.en.png differ diff --git a/docs/assets/guide/share-failure.zh-CN.dark.png b/docs/assets/guide/share-failure.zh-CN.dark.png index ccff4ac4a..0b39dfc53 100644 Binary files a/docs/assets/guide/share-failure.zh-CN.dark.png and b/docs/assets/guide/share-failure.zh-CN.dark.png differ diff --git a/docs/assets/guide/share-failure.zh-CN.png b/docs/assets/guide/share-failure.zh-CN.png index 9e87d7b6b..964ce8e4a 100644 Binary files a/docs/assets/guide/share-failure.zh-CN.png and b/docs/assets/guide/share-failure.zh-CN.png differ diff --git a/docs/assets/guide/share-source-confirm.en.dark.png b/docs/assets/guide/share-source-confirm.en.dark.png index 0897af307..d9d8eb26f 100644 Binary files a/docs/assets/guide/share-source-confirm.en.dark.png and b/docs/assets/guide/share-source-confirm.en.dark.png differ diff --git a/docs/assets/guide/share-source-confirm.en.png b/docs/assets/guide/share-source-confirm.en.png index e8d26e4f1..9bf0ade5a 100644 Binary files a/docs/assets/guide/share-source-confirm.en.png and b/docs/assets/guide/share-source-confirm.en.png differ diff --git a/docs/assets/guide/share-source-confirm.zh-CN.dark.png b/docs/assets/guide/share-source-confirm.zh-CN.dark.png index a8e63f53c..963b2cfef 100644 Binary files a/docs/assets/guide/share-source-confirm.zh-CN.dark.png and b/docs/assets/guide/share-source-confirm.zh-CN.dark.png differ diff --git a/docs/assets/guide/share-source-confirm.zh-CN.png b/docs/assets/guide/share-source-confirm.zh-CN.png index 59cc06746..c9b5e622c 100644 Binary files a/docs/assets/guide/share-source-confirm.zh-CN.png and b/docs/assets/guide/share-source-confirm.zh-CN.png differ diff --git a/docs/assets/guide/share-source.en.dark.png b/docs/assets/guide/share-source.en.dark.png index 33672df0f..999182899 100644 Binary files a/docs/assets/guide/share-source.en.dark.png and b/docs/assets/guide/share-source.en.dark.png differ diff --git a/docs/assets/guide/share-source.en.png b/docs/assets/guide/share-source.en.png index 5d94a0c3b..9b5098935 100644 Binary files a/docs/assets/guide/share-source.en.png and b/docs/assets/guide/share-source.en.png differ diff --git a/docs/assets/guide/share-source.zh-CN.dark.png b/docs/assets/guide/share-source.zh-CN.dark.png index d237a67f5..18050c0a9 100644 Binary files a/docs/assets/guide/share-source.zh-CN.dark.png and b/docs/assets/guide/share-source.zh-CN.dark.png differ diff --git a/docs/assets/guide/share-source.zh-CN.png b/docs/assets/guide/share-source.zh-CN.png index 7e7daca41..aba3fac7e 100644 Binary files a/docs/assets/guide/share-source.zh-CN.png and b/docs/assets/guide/share-source.zh-CN.png differ diff --git a/docs/assets/guide/sharing-settings.en.dark.png b/docs/assets/guide/sharing-settings.en.dark.png index 419d8a38e..5a28cdedf 100644 Binary files a/docs/assets/guide/sharing-settings.en.dark.png and b/docs/assets/guide/sharing-settings.en.dark.png differ diff --git a/docs/assets/guide/sharing-settings.en.png b/docs/assets/guide/sharing-settings.en.png index e6ee51db7..beef6540b 100644 Binary files a/docs/assets/guide/sharing-settings.en.png and b/docs/assets/guide/sharing-settings.en.png differ diff --git a/docs/assets/guide/sharing-settings.zh-CN.dark.png b/docs/assets/guide/sharing-settings.zh-CN.dark.png index 17e14ec55..a205b16f0 100644 Binary files a/docs/assets/guide/sharing-settings.zh-CN.dark.png and b/docs/assets/guide/sharing-settings.zh-CN.dark.png differ diff --git a/docs/assets/guide/sharing-settings.zh-CN.png b/docs/assets/guide/sharing-settings.zh-CN.png index 334b1c2c2..7f858a2d5 100644 Binary files a/docs/assets/guide/sharing-settings.zh-CN.png and b/docs/assets/guide/sharing-settings.zh-CN.png differ diff --git a/docs/assets/guide/touch-joystick.en.dark.png b/docs/assets/guide/touch-joystick.en.dark.png new file mode 100644 index 000000000..213d63725 Binary files /dev/null and b/docs/assets/guide/touch-joystick.en.dark.png differ diff --git a/docs/assets/guide/touch-joystick.en.png b/docs/assets/guide/touch-joystick.en.png index c1ed8fa51..084127391 100644 Binary files a/docs/assets/guide/touch-joystick.en.png and b/docs/assets/guide/touch-joystick.en.png differ diff --git a/docs/assets/guide/touch-joystick.png b/docs/assets/guide/touch-joystick.png deleted file mode 100644 index 4534e1ae3..000000000 Binary files a/docs/assets/guide/touch-joystick.png and /dev/null differ diff --git a/docs/assets/guide/touch-joystick.zh-CN.dark.png b/docs/assets/guide/touch-joystick.zh-CN.dark.png new file mode 100644 index 000000000..213d63725 Binary files /dev/null and b/docs/assets/guide/touch-joystick.zh-CN.dark.png differ diff --git a/docs/assets/guide/touch-joystick.zh-CN.png b/docs/assets/guide/touch-joystick.zh-CN.png new file mode 100644 index 000000000..084127391 Binary files /dev/null and b/docs/assets/guide/touch-joystick.zh-CN.png differ diff --git a/docs/assets/guide/viewer-route-failure.en.dark.png b/docs/assets/guide/viewer-route-failure.en.dark.png index 1160097a9..066628145 100644 Binary files a/docs/assets/guide/viewer-route-failure.en.dark.png and b/docs/assets/guide/viewer-route-failure.en.dark.png differ diff --git a/docs/assets/guide/viewer-route-failure.en.png b/docs/assets/guide/viewer-route-failure.en.png index 61ee76263..1b3b43a5d 100644 Binary files a/docs/assets/guide/viewer-route-failure.en.png and b/docs/assets/guide/viewer-route-failure.en.png differ diff --git a/docs/assets/guide/viewer-route-failure.zh-CN.dark.png b/docs/assets/guide/viewer-route-failure.zh-CN.dark.png index 4e8be377e..6365f166d 100644 Binary files a/docs/assets/guide/viewer-route-failure.zh-CN.dark.png and b/docs/assets/guide/viewer-route-failure.zh-CN.dark.png differ diff --git a/docs/assets/guide/viewer-route-failure.zh-CN.png b/docs/assets/guide/viewer-route-failure.zh-CN.png index 2b4894d80..550e20f80 100644 Binary files a/docs/assets/guide/viewer-route-failure.zh-CN.png and b/docs/assets/guide/viewer-route-failure.zh-CN.png differ diff --git a/docs/assets/guide/virtual-lan-address.en.dark.png b/docs/assets/guide/virtual-lan-address.en.dark.png index 8488b58dd..0922eb9c2 100644 Binary files a/docs/assets/guide/virtual-lan-address.en.dark.png and b/docs/assets/guide/virtual-lan-address.en.dark.png differ diff --git a/docs/assets/guide/virtual-lan-address.en.png b/docs/assets/guide/virtual-lan-address.en.png index 2b401a7a3..c684f98e2 100644 Binary files a/docs/assets/guide/virtual-lan-address.en.png and b/docs/assets/guide/virtual-lan-address.en.png differ diff --git a/docs/assets/guide/virtual-lan-address.zh-CN.dark.png b/docs/assets/guide/virtual-lan-address.zh-CN.dark.png index f4ad46bf6..8169b9b06 100644 Binary files a/docs/assets/guide/virtual-lan-address.zh-CN.dark.png and b/docs/assets/guide/virtual-lan-address.zh-CN.dark.png differ diff --git a/docs/assets/guide/virtual-lan-address.zh-CN.png b/docs/assets/guide/virtual-lan-address.zh-CN.png index 90981c5a6..d5dd0056c 100644 Binary files a/docs/assets/guide/virtual-lan-address.zh-CN.png and b/docs/assets/guide/virtual-lan-address.zh-CN.png differ diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index 326267085..47d36b2cb 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -13,9 +13,11 @@ English · [简体中文](./getting-started.zh-CN.md) · [Documentation](./READM If you received only a four-digit room code, ask your friend for their Piik site address. Open that address, enter the **Site passphrase** if prompted, then select **Join a room**. Enter the four digits and select the arrow to join. -![Four room-code boxes and the arrow that submits the code.](../assets/guide/join-code.en.png) +![Four room-code boxes and the arrow that submits the code.](../assets/guide/join-code.en.png#gh-light-mode-only) +![Four room-code boxes and the arrow that submits the code.](../assets/guide/join-code.en.dark.png#gh-dark-mode-only) -![The Enter room password control opens a password field and a Join button.](../assets/guide/join-password.en.png) +![The Enter room password control opens a password field and a Join button.](../assets/guide/join-password.en.png#gh-light-mode-only) +![The Enter room password control opens a password field and a Join button.](../assets/guide/join-password.en.dark.png#gh-dark-mode-only) [Get help joining or watching](./troubleshooting.md#common-problems). @@ -25,14 +27,16 @@ If you received only a four-digit room code, ask your friend for their Piik site 1. Open [demo.piik.tv](https://demo.piik.tv) in your browser. You can share without an account or download. 2. Select **Start sharing**. Choose **Browser** to share a screen, window, or tab, or **Camera** to share your camera. Pick what you want viewers to see and enable audio if the picker offers it. -3. When your picture appears in the preview, select **Copy** beside the invitation link and send the invitation to your friends. You can also show the room’s **QR code** for them to scan. +3. When your picture appears, select **Copy** under **Admission** and send the invitation to your friends. If a friend is nearby, open the **QR code** beside the link for them to scan. 4. Keep the sharing tab open while friends watch. Select **Stop sharing** when you’re done. For iPhone or iPad, see [screen sharing in Safari](./sharing.md#iphone-and-ipad-screen-sharing). If you can’t start sharing, see [sharing troubleshooting](./troubleshooting.md#starting-a-share). -![The invitation link has Copy and QR code buttons. The link shown is an example.](../assets/guide/invite-copy.en.png) +![Copy appears above the sample invitation, its QR code button and the Skip passwords switch.](../assets/guide/invite-copy.en.png#gh-light-mode-only) +![Copy appears above the sample invitation, its QR code button and the Skip passwords switch.](../assets/guide/invite-copy.en.dark.png#gh-dark-mode-only) -![The invitation QR code opens in a small panel. Ask your friend to scan the code from your own room.](../assets/guide/invite-qr.en.png) +![The invitation QR code opens in a small panel. Ask your friend to scan the code from your own room.](../assets/guide/invite-qr.en.png#gh-light-mode-only) +![The invitation QR code opens in a small panel. Ask your friend to scan the code from your own room.](../assets/guide/invite-qr.en.dark.png#gh-dark-mode-only) ## Share with Piik App diff --git a/docs/guide/getting-started.zh-CN.md b/docs/guide/getting-started.zh-CN.md index 77a8c4f3d..c66d02a32 100644 --- a/docs/guide/getting-started.zh-CN.md +++ b/docs/guide/getting-started.zh-CN.md @@ -13,9 +13,11 @@ 如果朋友只发了四位房间号,先问对方要 Piik 站点地址。打开该地址,按提示输入 **站点口令**,再点击 **加入房间**,填入四位房间号并点击箭头。 -![四格房间号输入框及提交房间号的箭头。](../assets/guide/join-code.zh-CN.png) +![四格房间号输入框及提交房间号的箭头。](../assets/guide/join-code.zh-CN.png#gh-light-mode-only) +![四格房间号输入框及提交房间号的箭头。](../assets/guide/join-code.zh-CN.dark.png#gh-dark-mode-only) -![展开「输入房间密码」后显示密码框和「加入」按钮。](../assets/guide/join-password.zh-CN.png) +![展开「输入房间密码」后显示密码框和「加入」按钮。](../assets/guide/join-password.zh-CN.png#gh-light-mode-only) +![展开「输入房间密码」后显示密码框和「加入」按钮。](../assets/guide/join-password.zh-CN.dark.png#gh-dark-mode-only) [加入或观看遇到问题](./troubleshooting.zh-CN.md#常见问题)。 @@ -25,14 +27,16 @@ 1. 用浏览器打开 [demo.piik.tv](https://demo.piik.tv)。无需注册或下载就能分享。 2. 点击 **开始分享**。选择 **浏览器** 可以分享屏幕、窗口或标签页,选择 **摄像头** 可以分享镜头画面。选好要分享的画面,如果选择器提供音频选项,可按需开启。 -3. 预览出现画面后,点击邀请链接旁的 **复制**,把邀请链接发给朋友。也可以展开房间的 **二维码** 让朋友扫码。 +3. 预览出现画面后,在 **准入方式** 里点 **复制**,把邀请链接发给朋友。朋友在旁边时,可以点链接旁的 **二维码** 让对方扫码。 4. 朋友观看时,保持分享标签页打开。结束时点击 **停止分享**。 使用 iPhone 或 iPad 时,请查看 [Safari 屏幕分享说明](./sharing.zh-CN.md#iphone-与-ipad-屏幕分享)。如果无法开始分享,请查看[分享问题排查](./troubleshooting.zh-CN.md#开始分享)。 -![邀请链接旁的「复制」和「二维码」按钮,图中为示例链接。](../assets/guide/invite-copy.zh-CN.png) +![上方是「复制」,下方显示示例邀请链接、二维码按钮和「免密邀请」开关。](../assets/guide/invite-copy.zh-CN.png#gh-light-mode-only) +![上方是「复制」,下方显示示例邀请链接、二维码按钮和「免密邀请」开关。](../assets/guide/invite-copy.zh-CN.dark.png#gh-dark-mode-only) -![「邀请二维码」会在小面板里打开。请朋友扫描你的房间里显示的二维码。](../assets/guide/invite-qr.zh-CN.png) +![「邀请二维码」会在小面板里打开。请朋友扫描你的房间里显示的二维码。](../assets/guide/invite-qr.zh-CN.png#gh-light-mode-only) +![「邀请二维码」会在小面板里打开。请朋友扫描你的房间里显示的二维码。](../assets/guide/invite-qr.zh-CN.dark.png#gh-dark-mode-only) ## 用 Piik App 分享 diff --git a/docs/guide/no-media-route.zh-CN.md b/docs/guide/no-media-route.zh-CN.md index d38982b9f..d85c365a7 100644 --- a/docs/guide/no-media-route.zh-CN.md +++ b/docs/guide/no-media-route.zh-CN.md @@ -20,7 +20,7 @@ - **房主预览正常,朋友都看不到。** 大家可以[加入同一个虚拟局域网](./network.zh-CN.md#可选虚拟局域网)。房主在组网工具里查看自己这台设备的 IPv4 地址,再打开 Piik App 的 **本地房间 → 局域网邀请地址**,在列表里选中同一个地址。开始分享后,把新生成的完整邀请链接发给朋友。 - **有支持服务器转发的站点。** 请管理员确认站点已启用媒体转发(SFU)。房主在该站点关闭 **隐私模式** 后开播,发送该站点生成的新邀请。Piik 会在直连失败时尝试服务器转发。[用 App 在已有站点分享](./getting-started.zh-CN.md#通过已有站点使用-app) -![观众端提示「没有可用的媒体线路」,截图中的旧版入口叫「问题排查」,新版叫「疑难解答」。](../assets/guide/viewer-route-failure.zh-CN.png#gh-light-mode-only) -![观众端提示「没有可用的媒体线路」,截图中的旧版入口叫「问题排查」,新版叫「疑难解答」。](../assets/guide/viewer-route-failure.zh-CN.dark.png#gh-dark-mode-only) +![观众端提示「没有可用的媒体线路」,点击「疑难解答」查看连接办法。](../assets/guide/viewer-route-failure.zh-CN.png#gh-light-mode-only) +![观众端提示「没有可用的媒体线路」,点击「疑难解答」查看连接办法。](../assets/guide/viewer-route-failure.zh-CN.dark.png#gh-dark-mode-only) 如果连房间网页都打不开,见[邀请打不开](./troubleshooting.zh-CN.md#进不去朋友的房间)。如果画面能动、只有声音听不到,见[声音排查](./sound-help.zh-CN.md)。 diff --git a/docs/guide/remote-control.md b/docs/guide/remote-control.md index 12a88b2fe..96a1315d6 100644 --- a/docs/guide/remote-control.md +++ b/docs/guide/remote-control.md @@ -94,13 +94,12 @@ remain available without the gamepad driver. On a touchscreen, tap **Request control** in the playback bar. If the host approves requests individually, wait for them to select **Allow**. Once you have control, **L** and **R** appear on the playing picture. Touchscreen laptops work too. -**L** and **R** start collapsed. Tap either button to open or close that stick. When gamepad input is available, **Gamepad ⇄** sends native left and right stick input. In **Keys + mouse ⇄**, **L** holds **W**, **A**, **S**, or **D** and **R** moves the mouse. If a physical gamepad is active on your device, you can still use touch in **Keys + mouse** mode. +Tap **L** or **R** to open that stick. Lift your finger to center it while continuing to hold the other. Each stick slips to the edge after two seconds of inactivity. Tap its visible edge once to bring it back as you left it. -The mode switch applies to both sticks. With only **R** open, use the switch beside **R**. With both open, it appears beside **L**. Lift your finger to center a stick and release its input. Closing a stick, losing focus, or disconnecting also releases its input. After reconnecting, select **Request control** again. +Open **Remote keyboard → Stick mode** to set both sticks. In **Keys + mouse**, the left stick holds W, A, S or D and the right stick moves the mouse. When the Host supports gamepad input and the Viewer has no physical gamepad connected, choose **Gamepad** to send left and right stick input. Closing a stick, leaving the page or disconnecting releases the affected inputs. After reconnecting, select **Request control** again. -![The Viewer’s L and R sticks are both open, with the Gamepad mode switch next to L.](../assets/guide/touch-joystick.en.png) - -Tap the mode switch beside **L** to switch both sticks between gamepad and keyboard-and-mouse input. +![The Viewer has opened both touch sticks over the shared picture.](../assets/guide/touch-joystick.en.png#gh-light-mode-only) +![The Viewer has opened both touch sticks over the shared picture.](../assets/guide/touch-joystick.en.dark.png#gh-dark-mode-only) ## End control diff --git a/docs/guide/remote-control.zh-CN.md b/docs/guide/remote-control.zh-CN.md index 9c2c9c66f..65678478c 100644 --- a/docs/guide/remote-control.zh-CN.md +++ b/docs/guide/remote-control.zh-CN.md @@ -73,13 +73,12 @@ Piik 不指定游戏中的玩家编号,请使用游戏自己的加入和分配 在触摸屏上观看可远控的画面时,点播放栏里的 **请求控制**。如果房主设置了每次询问,等房主点 **允许控制**。取得控制权后,正在播放的画面下方会出现 **L** 和 **R**。带触摸屏的电脑也可以使用。 -两根摇杆默认收起,点 **L** 或 **R** 就能分别展开。支持手柄输入时,**手柄 ⇄** 模式对应游戏手柄的左、右摇杆。**键鼠 ⇄** 模式下,左杆按住 **W、A、S、D**,右杆移动鼠标。正在使用实体手柄时,仍可用触屏发送键鼠输入。 +点 **L** 或 **R** 展开对应的摇杆。松开手指后,这根摇杆会回中;另一根仍可继续按住。闲置两秒后摇杆会贴到画面边缘。点一下露出的边沿,就会恢复贴边前的状态。 -一个模式开关同时控制两根摇杆,只展开右杆也能切换。松开哪根,哪根就回中;另一根可以继续按住。收起摇杆会释放它的输入,切出页面会释放两根。远控连接断开后,待画面恢复,再点 **请求控制**。 +打开 **远程键盘 → 摇杆模式** 可同时设置两根摇杆。**键鼠** 模式用左杆控制 W、A、S、D,右杆移动鼠标。房主支持手柄输入且观众没有连接实体手柄时,可以选 **手柄**,直接发送左右摇杆输入。收起摇杆、切出页面或连接中断都会释放相应输入。重新连接后,请再次点击 **请求控制**。 -![观众端同时展开 L、R 两根摇杆,手柄模式切换按钮在 L 旁边。](../assets/guide/touch-joystick.png) - -点 **L** 旁边的模式按钮,可同时切换两根摇杆的输入方式。 +![观众在画面上同时展开左、右摇杆。](../assets/guide/touch-joystick.zh-CN.png#gh-light-mode-only) +![观众在画面上同时展开左、右摇杆。](../assets/guide/touch-joystick.zh-CN.dark.png#gh-dark-mode-only) ## 结束控制 diff --git a/docs/operations/website.md b/docs/operations/website.md index e3a0b9bb6..b2fd0d2a3 100644 --- a/docs/operations/website.md +++ b/docs/operations/website.md @@ -197,11 +197,7 @@ node scripts/update-guide-images.mjs http://127.0.0.1:8787 npm run build:website ``` -The script regenerates the audio and network diagrams from shared icons and -palette, then captures `/__tooltip-preview` production components using sample data, -both languages, light/dark themes and reduced motion. It closes its own session. -Captures cover the mode selector, source picker, sharing settings, voice panel -and sample sharing-failure dialog. Place each beside the task it explains. Markdown uses GitHub's +The script opens the guide scenes at `/__guide-preview` and captures the production controls with sample room data. For a changed control, update its scene to show the action readers take, then rerun the command above. Each scene produces English and Simplified Chinese PNGs in light and dark themes. Markdown uses GitHub's `#gh-light-mode-only` / `#gh-dark-mode-only` image hints, which the documentation theme also follows when its appearance control changes. Do not invert or tint screenshots: capture the actual theme. SVG explanations inherit the page's diff --git a/scripts/check-docs.mjs b/scripts/check-docs.mjs index da31e08a1..011e5cdfa 100644 --- a/scripts/check-docs.mjs +++ b/scripts/check-docs.mjs @@ -18,6 +18,8 @@ const markdownFiles = repositoryFiles.filter((file) => file.endsWith(".md")); const failures = []; const warnings = []; const anchorCache = new Map(); +const guideReferences = new Set(); +const guideDirectory = resolve(root, "docs/assets/guide"); const contextBudgetRemediation = "Move directory-specific rules to nested or path-scoped context, move " + @@ -103,6 +105,15 @@ checkTopLevelContextBudgets(); if (warnings.length > 0) { process.stderr.write(`${warnings.map((warning) => `warning: ${warning}`).join("\n")}\n`); } +const generated = new Set(execFileSync(process.execPath, [resolve(root, "scripts/update-guide-images.mjs"), "--list"], + { encoding: "utf8" }).trim().split(/\r?\n/u).filter(Boolean)); +for (const path of guideReferences) { + if (!generated.has(path)) failures.push(`Guide screenshot missing from generator: ${relative(root, path)}`); +} +for (const path of generated) { + if (!guideReferences.has(path)) failures.push(`Generated screenshot missing from guides: ${relative(root, path)}`); +} + if (failures.length > 0) { process.stderr.write(`${failures.join("\n")}\n`); process.exit(1); @@ -203,6 +214,9 @@ function checkLink(file, sourcePath, raw) { ? resolve(root, `.${pathText}`) : resolve(dirname(sourcePath), pathText) : sourcePath; + if (file.startsWith("docs/guide/") && dirname(targetPath) === guideDirectory && extname(targetPath) === ".png") { + guideReferences.add(targetPath); + } const repoRelative = relative(root, targetPath); if (repoRelative === ".." || repoRelative.startsWith(`..${sep}`)) { failures.push(`${file}: link leaves repository: ${target}`); diff --git a/scripts/update-guide-images.mjs b/scripts/update-guide-images.mjs index 81f985280..10343d911 100644 --- a/scripts/update-guide-images.mjs +++ b/scripts/update-guide-images.mjs @@ -1,135 +1,99 @@ -import { execFile } from 'node:child_process'; +import { execFile, spawn } from 'node:child_process'; import { mkdir } from 'node:fs/promises'; import { join } from 'node:path'; import { fileURLToPath } from 'node:url'; import { promisify } from 'node:util'; -// Capture the real controls with the catalogue's sample data, never a live room. // Pass the product dev URL, and optionally a built website URL for README captures. -const preview = new URL('/__tooltip-preview', process.argv[2] || 'http://127.0.0.1:8787'); -// The README fixture is bundled by build:website; it is separate from the dev catalogue. +const list = process.argv[2] === '--list'; +const preview = new URL('/__guide-preview', !list && process.argv[2] || 'http://127.0.0.1:8787'); const readmePreview = process.argv[3] ? new URL('/film/ui/index.html', process.argv[3]) : null; const output = fileURLToPath(new URL('../docs/assets/guide/', import.meta.url)); const browser = process.env.AGENT_BROWSER_PATH || (process.platform === 'win32' ? join(process.env.APPDATA, 'npm/node_modules/agent-browser/bin/agent-browser-win32-x64.exe') : 'agent-browser'); +const session = 'piik-guide-images-' + process.pid; const execute = promisify(execFile); -const session = `piik-guide-images-${process.pid}`; -await execute(process.execPath, [fileURLToPath(import.meta.resolve('tsx/cli')), '--tsconfig', +const root = '[data-guide-capture][data-guide-ready]'; +const sceneControls = { + 'app-modes': ['.lr-client-modes'], + 'virtual-lan-address': ['details:has(.lr-client-lan)', 'details:has(.lr-client-lan) > summary'], + 'invite-copy': ['.cp-guide-invite'], + 'invite-qr': ['.lr-invite-qr:popover-open', '.lr-invite-field [popovertarget]'], + 'join-code': [root], + 'join-password': [root], + 'share-source': ['.lr-source-picker-panel'], + 'share-source-confirm': ['.lr-source-picker-panel', '.lr-source-option'], + 'sharing-settings': ['.lr-sharing-panel'], + 'room-voice': ['.lr-interaction-panel', '.lr-scene button[popovertarget]', '.lr-interaction-panel [role="tab"][id$="-voice-tab"]'], + 'touch-joystick': ['.lr-tv:has([data-side=left] > button[aria-expanded=true]):has([data-side=right] > button[aria-expanded=true])', '.lr-remote-direction[data-side=left] > button:first-child', '.lr-remote-direction[data-side=right] > button:first-child'], + 'share-failure': ['dialog.lr-share-help[open]', 'button.lr-status-indicator'], + 'viewer-route-failure': ['.lr-tv-screen'], +}; + +function batch(commands) { + return new Promise((resolve, reject) => { + const child = spawn(browser, ['--session', session, 'batch', '--bail'], { + stdio: ['pipe', 'inherit', 'inherit'], + windowsHide: true, + }); + child.once('error', reject); + child.once('close', code => { + if (code === 0) resolve(); + else reject(new Error('Screenshot batch failed with exit code ' + code)); + }); + child.stdin.once('error', reject); + child.stdin.end(JSON.stringify(commands)); + }); +} + +function capture(url, selector, directory, filename, actions = []) { + const prepare = `(async () => { + const target = document.querySelector(${JSON.stringify(selector)}); + await document.fonts.ready; + await Promise.all(Array.from(target.querySelectorAll('img'), image => image.decode())); + await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve))); + })()`; + return [ + ['open', url.href], + ['wait', actions.length ? root : selector], + ...actions.map(action => ['click', action]), + ['wait', selector], + ['mouse', 'move', '1', '1'], + ['eval', '-b', Buffer.from(prepare).toString('base64')], + ['screenshot', selector, join(directory, filename + '.png')], + ]; +} + +if (!list) await execute(process.execPath, [fileURLToPath(import.meta.resolve('tsx/cli')), '--tsconfig', fileURLToPath(new URL('./tsconfig.json', import.meta.url)), fileURLToPath(new URL('./update-guide-diagrams.tsx', import.meta.url))]); -const run = async (...args) => { - const { stdout } = await execute(browser, ['--session', session, ...args], { timeout: 30000 }); - return stdout; -}; -const evaluate = script => run('eval', '-b', Buffer.from(script).toString('base64')); - -async function openSection(section, lang, theme, path = '/__tooltip-preview') { - await run('open', new URL(path, preview).href); - await run('wait', `#${section}`); - await run('click', `.lr-top button[aria-label="${lang === 'en' ? 'English' : '简体中文'}"]`); - await evaluate(`localStorage.setItem('piik:ui-theme', ${JSON.stringify(theme)})`); - await run('reload'); - await run('wait', `#${section}`); - await evaluate(`(async () => { - const style = document.createElement('style'); - style.textContent = ${JSON.stringify(` - .lr-top, .lr-tooltip-preview > :not(#${section}):not(:has(#${section})), - #control-preview > :not(#${section}), - #${section} > header, #${section} > .cp-tools { display: none !important; } - `)}; - document.head.append(style); - await document.fonts.ready; - scrollTo(0, 0); - })()`); -} - -async function capture(selector, name, directory = output) { - await run('wait', selector); - await run('mouse', 'move', '1', '1'); - await evaluate(`(async () => { - const target = document.querySelector(${JSON.stringify(selector)}); - await Promise.all(Array.from(target.querySelectorAll('img')).map(img => img.decode())); - // Fixed top-layer panels need a settled viewport origin for element captures. - scrollTo(0, 0); - await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve))); - })()`); - await run('screenshot', selector, join(directory, `${name}.png`)); - console.log(`${name}.png`); -} - -await mkdir(output, { recursive: true }); +if (!list) await mkdir(output, { recursive: true }); try { - await run('set', 'viewport', '1280', '900'); for (const theme of ['light', 'dark']) { - await run('set', 'media', theme, 'reduced-motion'); + const commands = [['set', 'viewport', '1280', '900'], ['set', 'media', theme, 'reduced-motion']]; for (const [lang, locale] of [['en', 'en'], ['zh', 'zh-CN']]) { - const suffix = `${locale}${theme === 'dark' ? '.dark' : ''}`; - await openSection('launcher-preview', lang, theme); - await capture('.lr-client-modes', `app-modes.${suffix}`); - await run('set', 'viewport', '440', '900'); - await run('click', '#launcher-preview .lr-client-modes > :last-child [role="radio"]'); - const lan = '#launcher-preview .lr-client-access-options:has(.lr-client-lan)'; - await run('click', `${lan} summary`); - await run('select', `${lan} select`, '192.0.2.30'); - await capture(lan, `virtual-lan-address.${suffix}`); - await run('set', 'viewport', '1280', '900'); - - await openSection('source-preview', lang, theme); - await run('click', '#source-preview .cp-stage-action button'); - await run('wait', '.lr-source-picker-list img'); - await evaluate(`document.querySelector('#source-preview .lr-tv-screen').style.minHeight = '650px'`); - await capture('#source-preview .lr-source-picker-panel', `share-source.${suffix}`); - - await openSection('sharing-preview', lang, theme); - await run('wait', '#sharing-preview button[aria-controls="preview-sharing-settings"]'); - await run('click', '#sharing-preview button[aria-controls="preview-sharing-settings"]'); - await capture('.lr-sharing-panel', `sharing-settings.${suffix}`); - - await run('set', 'viewport', '1280', '420'); - await openSection('interaction-preview', lang, theme); - await run('click', `#interaction-preview button[aria-label="${lang === 'en' ? 'Interact' : '互动'}"]`); - await run('wait', '.lr-interaction-panel'); - await run('click', '.lr-interaction-panel [role="tab"][id$="-voice-tab"]'); - await capture('.lr-interaction-panel', `room-voice.${suffix}`); - await run('set', 'viewport', '1280', '900'); - - await openSection('sharing-troubleshooting', lang, theme, '/__status-preview'); - await run('click', '#sharing-troubleshooting article:first-child button'); - await capture('dialog.lr-share-help[open]', `share-failure.${suffix}`); - - await openSection('viewer-stage-preview', lang, theme, '/__status-preview'); - await run('click', '.sp-scenarios button[data-scenario=initial-route-failed]'); - await run('wait', '#viewer-stage-preview .lr-tv-route-help'); - await evaluate(`(() => { - const stage = document.getElementById('viewer-stage-preview'); - stage.style.position = 'fixed'; - stage.style.inset = '0 auto auto 0'; - stage.style.width = '480px'; - stage.style.background = 'var(--wall)'; - stage.style.zIndex = '1'; - stage.style.padding = '12px'; - stage.querySelectorAll(':scope > :not(.sp-stage-toolbar):not(.lr-tv)').forEach(element => { - element.style.display = 'none'; - }); - })()`); - await capture('#viewer-stage-preview', `viewer-route-failure.${suffix}`); + const suffix = locale + (theme === 'dark' ? '.dark' : ''); + for (const [scene, [selector, ...actions]] of Object.entries(sceneControls)) { + const url = new URL(preview); + url.search = new URLSearchParams({ scene, lang, theme }); + commands.push(...capture(url, selector, output, scene + '.' + suffix, actions)); + } } - } - if (readmePreview) { - await run('set', 'viewport', '1160', '1040'); - for (const theme of ['light', 'dark']) { - await run('set', 'media', theme, 'reduced-motion'); + if (readmePreview) { + commands.push(['set', 'viewport', '1160', '1040']); for (const lang of ['en', 'zh']) { const url = new URL(readmePreview); url.search = new URLSearchParams({ still: 'viewer', lang, theme }); - await run('open', url.href); - await run('wait', '.is-still .lr-app'); - await evaluate('document.fonts.ready'); - await capture('.is-still .lr-app', 'room-' + lang + '-' + theme, join(output, '..')); + commands.push(...capture(url, '.is-still .lr-app', join(output, '..'), 'room-' + lang + '-' + theme)); } } + if (list) { + for (const [action, , path] of commands) if (action === 'screenshot') console.log(path); + } else await batch(commands); } } finally { - await run('close'); + if (!list) await execute(browser, ['--session', session, 'close'], { timeout: 5000 }).catch(error => { + console.warn('Could not close the screenshot browser:', error.message); + }); } diff --git a/site/docs/.vitepress/theme/article.css b/site/docs/.vitepress/theme/article.css index 000c1fffc..d79a5704d 100644 --- a/site/docs/.vitepress/theme/article.css +++ b/site/docs/.vitepress/theme/article.css @@ -21,7 +21,16 @@ .VPDoc .vp-doc details > summary { padding: 14px 0; line-height: 1.5; } .VPDoc .vp-doc details[open] { padding-bottom: 16px; } .VPDoc .vp-doc details[open] > summary { border-bottom: 1px solid var(--line); } -.VPDoc .vp-doc img { object-fit: contain; max-height: min(70vh, 560px); } +.VPDoc .vp-doc img { max-width: 100%; height: auto; } +.VPDoc .vp-doc p:has(> img) { margin-block: 24px; } +.VPDoc .vp-doc p > img { + display: block; + width: auto; + margin-inline: auto; +} +.VPDoc .vp-doc img:is([src$="#gh-light-mode-only"], [src$="#gh-dark-mode-only"]) { + border-radius: 12px; +} .VPDoc :is(a, summary):focus-visible { outline: 2px solid var(--action-text); outline-offset: 3px; } @media (max-width: 767px) { .VPDoc .article-home { margin-bottom: 6px; } diff --git a/site/docs/.vitepress/theme/style.css b/site/docs/.vitepress/theme/style.css index 75018db26..e42d17715 100644 --- a/site/docs/.vitepress/theme/style.css +++ b/site/docs/.vitepress/theme/style.css @@ -34,12 +34,6 @@ html:not(.dark) .vp-doc img[src$="#gh-dark-mode-only"], html.dark .vp-doc img[src$="#gh-light-mode-only"] { display: none; } html { color-scheme: light; } html.dark { color-scheme: dark; } -.vp-doc img { - max-width: 100%; height: auto; margin-inline: auto; border-radius: 12px; -} -.vp-doc img[src*="sharing-settings."] { max-width: min(100%, 620px); } -.vp-doc img[src*="room-voice."] { max-width: min(100%, 480px); } -.vp-doc img[src*="share-failure."] { max-width: min(100%, 480px); } .vp-doc details { margin-block: 20px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; } .vp-doc details > :last-child { margin-bottom: 0; } .docs-license { margin-top: 24px; color: var(--vp-c-text-2); font-size: 12px; } diff --git a/site/index.html b/site/index.html index 473e57f1c..a6aaac8bb 100644 --- a/site/index.html +++ b/site/index.html @@ -626,15 +626,11 @@ diff --git a/site/styles.css b/site/styles.css index 1f3cae3f5..c49055b40 100644 --- a/site/styles.css +++ b/site/styles.css @@ -176,21 +176,13 @@ details p { max-width: 610px; padding: 0 24px 23px 0; color: var(--muted); font- .faq-heading { display: flex; align-items: center; gap: 14px; } .faq-intro h2 { margin: 0; font-size: clamp(30px, 3vw, 42px); line-height: 1.15; } .faq-tv { flex: none; width: 38px; height: 38px; color: var(--action-text); transform: rotate(-7deg); } -.faq-support { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } -.faq-support a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-decoration: none; } -.faq-support strong { font-size: 16px; color: var(--action-text); } -.faq-support small { grid-column: 1 / -1; color: var(--muted); font-size: 13px; line-height: 1.55; } -.faq-link-arrow { color: var(--action-text); } +.faq-support { display: flex; flex-wrap: wrap; gap: 12px; } .questions details { border-bottom: 1px solid var(--line); } .questions details:first-child { border-top: 1px solid var(--line); } .questions summary { min-height: 58px; padding-block: 17px; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.5; } -.questions summary:focus-visible { outline-offset: 2px; } +.questions summary:is(:hover, :focus-visible) { color: var(--action-text); } .questions p { max-width: 68ch; padding: 0 24px 20px 0; font-size: 15px; line-height: 1.75; } .questions a { color: var(--action-text); } -@media (hover: hover) { - .questions summary:hover, .faq-support a:hover strong { color: var(--action-text); text-decoration: underline; } - .faq-support a:hover { border-color: var(--action-text); } -} .project-note { display: flex; align-items: flex-start; gap: 30px; padding: 32px 36px; background: var(--soft-orange); border: 1px solid color-mix(in srgb, var(--orange) 30%, var(--line)); border-radius: 18px; } .project-tv { width: 62px; height: 62px; flex: none; color: var(--action-text); } .project-content { flex: 1; min-width: 0; } @@ -286,7 +278,6 @@ html[lang="zh-CN"] .eyebrow { letter-spacing: .13em; } .modes div + div { margin-top: 0; } .faq-intro { grid-template-columns: 1fr; gap: 16px; margin-bottom: 20px; } .faq-heading { justify-content: space-between; } - .faq-support a { padding: 10px 12px; gap: 3px 6px; } .faq-tv { width: 34px; height: 34px; } summary { font-size: 14px; padding-block: 20px; } details p { padding-right: 9px; } @@ -300,7 +291,6 @@ html[lang="zh-CN"] .eyebrow { letter-spacing: .13em; } .footer-note { margin-top: 0; } } @media (max-width: 380px) { - .faq-support { grid-template-columns: 1fr; } .wrap { width: calc(100% - 32px); } h1, html[lang="zh-CN"] h1 { font-size: clamp(34px, 11.5vw, 43px); } .hero-actions .button { gap: 18px; padding-inline: 18px; } diff --git a/src/client/App.tsx b/src/client/App.tsx index 6e36039c5..e4097f5f6 100644 --- a/src/client/App.tsx +++ b/src/client/App.tsx @@ -35,6 +35,10 @@ import { consoleLanguage } from "./locales"; import { initTheme } from "./ui/theme"; import { debugError, installBrowserDebug, withBrowserDebug } from "./lib/debug"; +const GuidePreviewPage = import.meta.env.DEV + ? lazy(() => import("./pages/GuidePreviewPage").then(module => ({ default: module.GuidePreviewPage }))) + : null; + const TooltipPreviewPage = import.meta.env.DEV ? lazy(() => import("./pages/TooltipPreviewPage").then((module) => ({ default: module.TooltipPreviewPage }))) : null; @@ -160,6 +164,9 @@ function AppRoute() { if (PlaybackPreviewPage && window.location.pathname === "/__playback-preview") { return ; } + if (GuidePreviewPage && window.location.pathname === "/__guide-preview") { + return ; + } if (StatusPreviewPage && window.location.pathname === "/__status-preview") { return ; } diff --git a/src/client/components/living/JoinRoomForms.tsx b/src/client/components/living/JoinRoomForms.tsx new file mode 100644 index 000000000..7e375560e --- /dev/null +++ b/src/client/components/living/JoinRoomForms.tsx @@ -0,0 +1,70 @@ +import type { FormEventHandler, ReactNode } from "react"; +import { MAX_VIEWER_PASSWORD_LENGTH } from "../../../shared/protocol"; +import { useCopy, type CopyKey } from "../../ui/copy"; +import { Glyph } from "../../ui/icons"; +import { RoomCodeInput, RoomCodeError } from "./RoomCodeInput"; +import { Tooltip } from "./Tooltip"; +import { Btn, Pill } from "./primitives"; + +interface JoinRoomFormProps { + value: string; + onChange: (value: string) => void; + onSubmit: FormEventHandler; +} + +export function JoinCodeForm({ + value, + onChange, + onSubmit, + rejectedAttempt = 0, + children, +}: JoinRoomFormProps & { rejectedAttempt?: number; children?: ReactNode }) { + const { t, vis } = useCopy(); + return ( +
+ {children} + + + + + + {vis ? null : {t("join.submit")}} + + ); +} + +export function JoinPasswordForm({ + value, + onChange, + onSubmit, + error, +}: JoinRoomFormProps & { error?: CopyKey | null }) { + const { t } = useCopy(); + return ( +
+ + + onChange(event.target.value)} + /> + + {error && ( + + )} + + + ); +} diff --git a/src/client/components/living/RoomInviteControls.tsx b/src/client/components/living/RoomInviteControls.tsx new file mode 100644 index 000000000..c57d7d963 --- /dev/null +++ b/src/client/components/living/RoomInviteControls.tsx @@ -0,0 +1,60 @@ +import { InviteQrCode } from "./InviteQrCode"; +import { Btn, SwitchItem } from "./primitives"; +import { Tooltip } from "./Tooltip"; +import { Glyph } from "../../ui/icons"; +import { useCopy } from "../../ui/copy"; + +type InviteState = { + roomLink: string | null | undefined; + roomLinkBlocked: boolean; + roomMutating: boolean; + includeInviteCredential: boolean; +}; + +export function CopyRoomInvite({ roomLink, roomLinkBlocked, roomMutating, + includeInviteCredential, copied, onCopy }: InviteState & { copied: boolean; onCopy: () => void }) { + return ( + + ); +} + +export function RoomInviteField({ roomLink, roomLinkBlocked, roomMutating, + includeInviteCredential, onCredentialChange }: InviteState & { onCredentialChange: (checked: boolean) => void }) { + const { t } = useCopy(); + return ( +
+ + {roomLink ? ( + + event.currentTarget.select()} + /> + + ) : null} + + + + +
+ ); +} diff --git a/src/client/pages/ControlsPreview.tsx b/src/client/pages/ControlsPreview.tsx index 07fb1404b..7ce8487a3 100644 --- a/src/client/pages/ControlsPreview.tsx +++ b/src/client/pages/ControlsPreview.tsx @@ -11,7 +11,7 @@ import { RoomInteractions } from "../components/living/RoomInteractions"; import { RoomChatOverlay, RoomChatOverlaySettings, RoomChatToggle } from "../components/living/RoomChatOverlay"; import { REACTION_IDS, type ReactionId } from "../../shared/room-interactions"; import { PlaybackControls } from "../components/living/PlaybackControls"; -import { InviteQrCode } from "../components/living/InviteQrCode"; +import { RoomInviteField } from "../components/living/RoomInviteControls"; import { BrandMark } from "../components/living/BrandMark"; import { SharingSettings } from "../components/living/SharingSettings"; import { ShareMicrophoneSettings } from "../components/living/ShareMicrophoneSettings"; @@ -37,8 +37,8 @@ import { useRoomVoicePreview } from "./RoomVoicePreview"; import { usePreviewInteractions } from "./use-preview-interactions"; import "./controls-preview.css"; -const POSTER = `data:image/svg+xml,${encodeURIComponent('')}`; -const SOURCES = { kind: "ready", processAudio: true, systemAudio: true, processAudioExclusion: true, captureBorderControl: true, sources: [ +export const POSTER = `data:image/svg+xml,${encodeURIComponent('')}`; +export const SOURCES = { kind: "ready", processAudio: true, systemAudio: true, processAudioExclusion: true, captureBorderControl: true, sources: [ { kind: "window", sourceId: "101", pid: 1, creationTime: "1", title: "Sketchbook" }, { kind: "window", sourceId: "102", pid: 2, creationTime: "2", title: "A short film" }, { kind: "window", sourceId: "104", pid: 3, creationTime: "3", title: "Voice call" }, @@ -49,7 +49,7 @@ const CAMERA_PREVIEWS = [ { id: "usb", label: "USB Camera", preview: `data:image/svg+xml,${encodeURIComponent('')}` }, ]; const previewCameras: typeof loadCameraPreviews = async (_signal, publish) => publish(CAMERA_PREVIEWS); -const previewSource = async (source: NativeCaptureTarget) => source.sourceId === "101" ? CAMERA_PREVIEWS[1].preview +export const previewSource = async (source: NativeCaptureTarget) => source.sourceId === "101" ? CAMERA_PREVIEWS[1].preview : source.sourceId === "102" ? CAMERA_PREVIEWS[0].preview : POSTER; const previewApplications = async () => SOURCES.sources; @@ -248,17 +248,9 @@ export function ControlsPreview() { - {inviteAvailable &&
- - - - - - - -
} + {inviteAvailable && } {inviteAvailable && !includeCredential && policy === "private" && !roomPassword ? : null}

{en ? "The website's architecture picker uses the same sliding style with native radio buttons. Arrow keys change the choice." diff --git a/src/client/pages/GuideJoinControls.tsx b/src/client/pages/GuideJoinControls.tsx new file mode 100644 index 000000000..b6fc0377b --- /dev/null +++ b/src/client/pages/GuideJoinControls.tsx @@ -0,0 +1,19 @@ +import { useState, type FormEvent } from "react"; +import { JoinCodeForm, JoinPasswordForm } from "../components/living/JoinRoomForms"; + +export function GuideJoinControls({ password }: { password: boolean }) { + const [code, setCode] = useState("9527"); + const [passwordDraft, setPasswordDraft] = useState(""); + + function submit(event: FormEvent) { + event.preventDefault(); + } + + return ( +

+ {password + ? + : } +
+ ); +} diff --git a/src/client/pages/GuidePreviewPage.tsx b/src/client/pages/GuidePreviewPage.tsx new file mode 100644 index 000000000..538e87569 --- /dev/null +++ b/src/client/pages/GuidePreviewPage.tsx @@ -0,0 +1,90 @@ +import { useEffect, useState } from "react"; +import { POSTER, SOURCES, previewSource } from "./ControlsPreview"; +import { RemoteControlsPreview } from "./RemoteControlsPreview"; +import { GuideJoinControls } from "./GuideJoinControls"; +import { GuideViewerRouteFailure, GuideShareFailure, GuideRoomVoice } from "./GuideRoomScenes"; +import { CaptureSourcePicker } from "../components/living/CaptureSourcePicker"; +import { LauncherForm, type AppMode } from "../components/living/LauncherForm"; +import { CopyRoomInvite, RoomInviteField } from "../components/living/RoomInviteControls"; +import { SharingSettings } from "../components/living/SharingSettings"; +import { QualityPresets, PictureSettingsSummary } from "../components/living/QualityPresets"; +import { QUALITY_PROFILES } from "../media/quality"; +import { StageTv } from "../components/living/Stage"; +import { Row, RowGroup } from "../components/living/primitives"; +import { setCopy, useCopy } from "../ui/copy"; +import { applyTheme } from "../ui/theme"; + +const noop = () => {}; + +function Launcher({ lan }: { lan: boolean }) { + const [mode, setMode] = useState(lan ? "local" : "link"); + const [address, setAddress] = useState("192.0.2.30"); + return
event.preventDefault()} + onSubmit={event => event.preventDefault()} lan={{ selected: address, onChange: setAddress, addresses: [ + { address: "192.0.2.10", name: "Wi-Fi" }, + { address: "192.0.2.30", name: "Virtual LAN" }, + ] }} />
; +} + +function Invite() { + const { t } = useCopy(); + const [includeInviteCredential, setIncludeInviteCredential] = useState(true); + const roomLink = "https://piik.example/r/9527" + (includeInviteCredential ? "#v=preview" : ""); + const state = { roomLink, includeInviteCredential, roomLinkBlocked: false, roomMutating: false }; + return
+ + void navigator.clipboard.writeText(roomLink).catch(noop)} /> + + +
; +} + +function Sources() { + return ; +} + +function Settings() { + const [preset, setPreset] = useState("1080p30"); + return } + pictureSummary={} picture={null} audio={null} />; +} + +function GuideScene({ scene }: { scene: string | null }) { + switch (scene) { + case "app-modes": return ; + case "virtual-lan-address": return ; + case "invite-copy": + case "invite-qr": return ; + case "share-source": + case "share-source-confirm": return ; + case "sharing-settings": return ; + case "room-voice": return ; + case "touch-joystick": return ; + case "share-failure": return ; + case "viewer-route-failure": return ; + case "join-code": + case "join-password": return ; + default: return null; + } +} + +export function GuidePreviewPage() { + const parameters = new URLSearchParams(location.search); + const [ready, setReady] = useState(false); + useEffect(() => { + setCopy({ lang: parameters.get("lang") === "zh" ? "zh" : "en", vis: false }); + applyTheme(parameters.get("theme") === "dark" ? "dark" : "light"); + setReady(true); + }, []); + if (!ready) return null; + const scene = parameters.get("scene"); + return
+ +
; +} diff --git a/src/client/pages/GuideRoomScenes.tsx b/src/client/pages/GuideRoomScenes.tsx new file mode 100644 index 000000000..98933717f --- /dev/null +++ b/src/client/pages/GuideRoomScenes.tsx @@ -0,0 +1,41 @@ +import { RoomInteractions } from "../components/living/RoomInteractions"; +import { ShareFailureHelp } from "../components/living/ShareFailureHelp"; +import { StageOverlay } from "../components/living/Stage"; +import { deriveViewerPresentation } from "../media/viewer-presentation"; +import { useCopy } from "../ui/copy"; +import { deriveParticipantStatus, deriveViewerStatus } from "../ui/media-status"; +import { hostFailureChecks } from "./host-page-notices"; +import { useRoomVoicePreview } from "./RoomVoicePreview"; +import { STATUS_SCENARIOS } from "./status-preview-scenarios"; +import { usePreviewInteractions } from "./use-preview-interactions"; + +export function GuideViewerRouteFailure() { + const { t } = useCopy(); + const { state } = STATUS_SCENARIOS.find(item => item.id === "initial-route-failed")!; + const presentation = deriveViewerPresentation(state); + const { overlay } = deriveViewerStatus(presentation, state.signal, + state.route?.kind === "none" ? null : state.route?.kind); + if (!overlay) return null; + return
+ +
; +} + +export function GuideShareFailure() { + const { t } = useCopy(); + const code = "app/start-share/rejected"; + const labelKey = "native.fail.captureStart"; + return ; +} + +export function GuideRoomVoice() { + const { session } = usePreviewInteractions(false); + const voice = useRoomVoicePreview(false); + return
+
; +} diff --git a/src/client/pages/HostPage.tsx b/src/client/pages/HostPage.tsx index df30a3c24..6499f174f 100644 --- a/src/client/pages/HostPage.tsx +++ b/src/client/pages/HostPage.tsx @@ -31,7 +31,7 @@ import { LiveAudioExclusion } from "../components/living/AudioExclusionSelect"; import { RoomInteractions } from "../components/living/RoomInteractions"; import { RoomChatOverlay, RoomChatOverlaySettings, RoomChatToggle } from "../components/living/RoomChatOverlay"; import { PlaybackControls } from "../components/living/PlaybackControls"; -import { InviteQrCode } from "../components/living/InviteQrCode"; +import { CopyRoomInvite, RoomInviteField } from "../components/living/RoomInviteControls"; import { useTheaterMode } from "../components/living/use-theater-mode"; import { useHostPreviewPlayback } from "../components/living/use-host-preview-playback"; import { readRoomPreferences, saveRoomPreferences } from "../lib/room-preferences"; @@ -4573,17 +4573,8 @@ export function HostPage({ {room ? ( - void copyRoomLink()} - /> + void copyRoomLink()} /> void changeViewerGrant("revoke")} /> -
- - {roomLink ? ( - - event.currentTarget.select()} - /> - - ) : null} - - - { - copyRoomLinkRequestRef.current = null; - setCopiedRoomLink(null); - setIncludeInviteCredential(checked); - }} /> - -
+ { + copyRoomLinkRequestRef.current = null; + setCopiedRoomLink(null); + setIncludeInviteCredential(checked); + }} /> {roomLinkBlocked ? : null}