From 137f0ed7f328bc24a912c869c101cd51fc6148df Mon Sep 17 00:00:00 2001 From: "Prad Nukala (aider)" Date: Wed, 23 Oct 2024 12:50:38 -0400 Subject: [PATCH] feat: Move Alpine.js script initialization to separate component --- .../marketing/modals/intro_video.templ | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/pkg/nebula/components/marketing/modals/intro_video.templ b/pkg/nebula/components/marketing/modals/intro_video.templ index 787cce686..67b278c55 100644 --- a/pkg/nebula/components/marketing/modals/intro_video.templ +++ b/pkg/nebula/components/marketing/modals/intro_video.templ @@ -116,32 +116,7 @@ seconds: result.substring(6, 8), }; } }" - x-init=" -supportsVideo = document.createElement('video').canPlayType; -if (!supportsVideo) { -alert('This browser does not support the video element'); -} -$refs.player.load(); -// Hide the default player controls -$refs.player.controls = false; -$watch('playing', (value) => { -if (value) { -ended = false; -controlsHideTimeout = setTimeout(() => { -controls = false; -}, autoHideControlsDelay); -} else { -clearTimeout(controlsHideTimeout); -controls = true; -} -}); -if (!document?.fullscreenEnabled) { -$refs.fullscreenButton.style.display = 'none'; -} -document.addEventListener('fullscreenchange', (e) => { -fullscreen = !!document.fullscreenElement; -}); -" + x-init={ IntroVideoScript() } x-ref="videoContainer" @mouseleave="mouseleave=true" @mousemove="mousemoveVideo"