Skip to content

Commit

Permalink
chore: revert outro
Browse files Browse the repository at this point in the history
  • Loading branch information
o-az committed Sep 27, 2024
1 parent eaae32c commit 3c8caed
Showing 1 changed file with 12 additions and 38 deletions.
50 changes: 12 additions & 38 deletions ceremony/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<script lang="ts">
import "../styles/tailwind.css"
import { supabase } from "$lib/supabase/client.ts"
import { createState } from "$lib/state/index.svelte.ts"
import { watch } from "runed"
import { checkAuth } from "$lib/state/session.svelte.ts"
import Terminal from "$lib/components/Terminal/index.svelte"
import { start } from "$lib/client"
import Timer from "$lib/components/Terminal/Timer.svelte"
import "../styles/tailwind.css"
import { onMount } from "svelte"
import { getAverageTimes } from "$lib/supabase"
Expand Down Expand Up @@ -37,28 +38,22 @@ watch(
contributor.setUserId(user.session?.user.id)
}
)
let showBootSequence = $state(true)
let bootSequenceVideoElement = $state<HTMLVideoElement | null>(null)
let enabledVideo = $state<"INTRO" | "MAIN" | "OUTRO">("INTRO")
let introVideoElement = $state<HTMLVideoElement | null>(null)
onMount(() => introVideoElement?.play())
const hideIntroVideo = () => (enabledVideo = "MAIN")
let outroVideoElement = $state<HTMLVideoElement | null>(null)
onMount(() => bootSequenceVideoElement?.play())
let deleteOutroVideo = () => (outroVideoElement = null)
const hideBootSequenceVideo = () => (showBootSequence = false)
</script>

{#if enabledVideo === 'INTRO'}
{#if showBootSequence}
<video
muted
autoplay
playsinline
data-video="intro"
onended={hideIntroVideo}
bind:this={introVideoElement}
data-video="bootsequence"
onended={hideBootSequenceVideo}
bind:this={bootSequenceVideoElement}
oncanplay={function() {
this.autoplay = true
}}
Expand All @@ -71,13 +66,13 @@ let deleteOutroVideo = () => (outroVideoElement = null)
>
<source src="https://pub-32dd1494f0fa423cb1013941269ecce9.r2.dev/glitchboot.webm" type="video/webm" />
</video>
{:else if contributor.clientState !== 'successful'}
{:else}
<video
loop
muted
autoplay
playsinline
data-video="main"
data-video="glitch"
oncanplay={function() {
this.autoplay = true
}}
Expand All @@ -96,27 +91,6 @@ let deleteOutroVideo = () => (outroVideoElement = null)
</Terminal>
<Timer />
</main>
{:else}
{enabledVideo = 'OUTRO'}
<video
muted
autoplay
playsinline
data-video="outro"
onended={deleteOutroVideo}
bind:this={outroVideoElement}
oncanplay={function() {
this.autoplay = true
}}
onloadeddata={function() {
this.autoplay = true
}}
onloadedmetadata={function() {
this.muted = true
}}
>
<source src="https://pub-32dd1494f0fa423cb1013941269ecce9.r2.dev/glitchboot.webm" type="video/webm" />
</video>
{/if}

<style lang="postcss">
Expand Down

0 comments on commit 3c8caed

Please sign in to comment.