From 56eec8912c91968c54f03bec5520e6df5b202a29 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Fri, 27 Dec 2024 01:58:17 +0800 Subject: [PATCH] feat(presenter): use screen capture mirroring, resolve #1987 --- .vscode/settings.json | 3 +- packages/client/composables/useClicks.ts | 2 +- packages/client/composables/useTimer.ts | 2 +- packages/client/internals/Badge.vue | 48 ++++++++++++++ packages/client/internals/FocusIndicator.vue | 9 --- packages/client/internals/RecordingDialog.vue | 14 +---- .../client/internals/ScreenCaptureMirror.vue | 45 ++++++++++++++ packages/client/internals/SegmentControl.vue | 29 +++++++++ packages/client/internals/SyncControls.vue | 4 +- packages/client/logic/color.ts | 62 +++++++++++++++++++ packages/client/pages/export.vue | 20 +++--- packages/client/pages/presenter.vue | 57 +++++++++++------ packages/client/styles/index.css | 14 +++-- 13 files changed, 245 insertions(+), 64 deletions(-) create mode 100644 packages/client/internals/Badge.vue delete mode 100644 packages/client/internals/FocusIndicator.vue create mode 100644 packages/client/internals/ScreenCaptureMirror.vue create mode 100644 packages/client/internals/SegmentControl.vue create mode 100644 packages/client/logic/color.ts diff --git a/.vscode/settings.json b/.vscode/settings.json index 79309d59d9..7ab9ad261c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -50,5 +50,6 @@ "slidev.include": [ "**/slides.md", "packages/vscode/syntax/slidev.example.md" - ] + ], + "vue.server.hybridMode": "typeScriptPluginOnly" } diff --git a/packages/client/composables/useClicks.ts b/packages/client/composables/useClicks.ts index 3636ec64ad..2e36b20a26 100644 --- a/packages/client/composables/useClicks.ts +++ b/packages/client/composables/useClicks.ts @@ -165,7 +165,7 @@ export function createFixedClicks( ): ClicksContext { const clicksStart = route?.meta.slide?.frontmatter.clicksStart ?? 0 return createClicksContextBase( - computed(() => Math.max(toValue(currentInit), clicksStart)), + ref(Math.max(toValue(currentInit), clicksStart)), clicksStart, route?.meta?.clicks, ) diff --git a/packages/client/composables/useTimer.ts b/packages/client/composables/useTimer.ts index 1d04c89ad5..18f6645964 100644 --- a/packages/client/composables/useTimer.ts +++ b/packages/client/composables/useTimer.ts @@ -13,7 +13,7 @@ export function useTimer() { return { timer, - isTimerAvctive: isActive, + isTimerActive: isActive, resetTimer: reset, toggleTimer: () => (isActive.value ? pause() : resume()), } diff --git a/packages/client/internals/Badge.vue b/packages/client/internals/Badge.vue new file mode 100644 index 0000000000..f2de54bc2e --- /dev/null +++ b/packages/client/internals/Badge.vue @@ -0,0 +1,48 @@ + + + diff --git a/packages/client/internals/FocusIndicator.vue b/packages/client/internals/FocusIndicator.vue deleted file mode 100644 index 527002260c..0000000000 --- a/packages/client/internals/FocusIndicator.vue +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/packages/client/internals/RecordingDialog.vue b/packages/client/internals/RecordingDialog.vue index c8b8da1518..7c0671b88c 100644 --- a/packages/client/internals/RecordingDialog.vue +++ b/packages/client/internals/RecordingDialog.vue @@ -75,11 +75,11 @@ async function start() {
-
-
@@ -111,15 +111,5 @@ async function start() { input[type='text'] { @apply border border-main rounded px-2 py-1; } - - button { - @apply bg-orange-400 text-white px-4 py-1 rounded border-b-2 border-orange-600; - @apply hover:(bg-orange-500 border-orange-700); - } - - button.cancel { - @apply bg-gray-400 bg-opacity-50 text-white px-4 py-1 rounded border-b-2 border-main; - @apply hover:(bg-opacity-75 border-opacity-75); - } } diff --git a/packages/client/internals/ScreenCaptureMirror.vue b/packages/client/internals/ScreenCaptureMirror.vue new file mode 100644 index 0000000000..f80836cbc7 --- /dev/null +++ b/packages/client/internals/ScreenCaptureMirror.vue @@ -0,0 +1,45 @@ + + + diff --git a/packages/client/internals/SegmentControl.vue b/packages/client/internals/SegmentControl.vue new file mode 100644 index 0000000000..3690e71a9d --- /dev/null +++ b/packages/client/internals/SegmentControl.vue @@ -0,0 +1,29 @@ + + + diff --git a/packages/client/internals/SyncControls.vue b/packages/client/internals/SyncControls.vue index 87181adf1c..c552f4d031 100644 --- a/packages/client/internals/SyncControls.vue +++ b/packages/client/internals/SyncControls.vue @@ -47,9 +47,9 @@ const shouldSend = computed({