Skip to content

Commit daa7baf

Browse files
committed
wip: live overlay
1 parent 6cfc443 commit daa7baf

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

pages/live/[id].vue

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,34 @@
55
<NuxtLink to="/atelier">Return</NuxtLink>
66
</div>
77
<div
8+
@click="nextSlides()"
89
@keydown.enter.space.right="nextSlides()"
910
@keydown.left="prevSlides()"
11+
@mousemove="onCursorMoved"
1012
tabindex="0"
1113
class="live"
1214
>
1315
<AtelierRender />
16+
<div
17+
:class="{
18+
'opacity-0': !cursorMoved,
19+
}"
20+
class="overlay"
21+
>
22+
<p>Page {{ currentSlidesIndex + 1 }} / {{ slides.length }}</p>
23+
</div>
1424
</div>
1525
</template>
1626

1727
<style scoped lang="postcss">
1828
.live {
1929
@apply h-screen select-none;
2030
@apply flex justify-center items-center;
31+
32+
.overlay {
33+
@apply fixed bottom-18 bg-dark-900 p-3 rounded-6 text-3;
34+
@apply transition-opacity duration-300;
35+
}
2136
}
2237
</style>
2338

@@ -27,6 +42,19 @@ import { RealtimeChannel } from "@supabase/supabase-js";
2742
const client = useSupabaseClient<Database>();
2843
2944
const { fetchDeck, fetchAllSlides, nextSlides, prevSlides } = useDeckStore();
45+
const { slides, currentSlidesIndex } = storeToRefs(useDeckStore());
46+
47+
const cursorMoved = ref(false);
48+
49+
function onCursorMoved() {
50+
if (cursorMoved.value) return;
51+
52+
cursorMoved.value = true;
53+
54+
setTimeout(() => {
55+
cursorMoved.value = false;
56+
}, 5000);
57+
}
3058
3159
let deckRC: RealtimeChannel, slidesRC: RealtimeChannel;
3260

0 commit comments

Comments
 (0)