Skip to content

Commit c27f471

Browse files
authored
Merge pull request #6 from deco-sites/danielfurt/activation-form
fix: render videos as native JSX for mobile autoplay
2 parents 1a99bb6 + a9c2cbd commit c27f471

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

sections/ActivationForm.tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,20 +174,35 @@ export default function ActivationForm({
174174
return (
175175
<div class="relative h-screen overflow-hidden flex flex-col" style="background-color: #1D1B1D;">
176176
<div class="absolute inset-0 z-0" style="background: linear-gradient(180deg, #1D1B1D 0%, #2a2528 50%, #1D1B1D 100%);">
177-
<div id="bg-video-container" class="absolute inset-0 opacity-0" style="transition: opacity 1s ease-out;" dangerouslySetInnerHTML={{ __html: `
178-
<video autoplay muted loop playsinline style="width: 100%; height: 100%; object-fit: cover; opacity: 0.3;">
177+
<div id="bg-video-container" class="absolute inset-0 opacity-0" style="transition: opacity 1s ease-out;">
178+
<video
179+
class="w-full h-full object-cover"
180+
autoplay
181+
muted
182+
loop
183+
playsinline
184+
poster=""
185+
style="opacity: 0.3;"
186+
>
179187
<source src="https://assets.decocache.com/deriva-earth/63f76078-d3d8-46e9-8f55-bafe3c32fa6b/background2_header-(1)-(1).mp4" type="video/mp4" />
180188
</video>
181-
`}} />
189+
</div>
182190
</div>
183191

184192
{/* Loading screen */}
185193
<div id="loading-screen" class="absolute inset-0 z-50 flex items-center justify-center" style="background-color: #1D1B1D;">
186-
<div id="loading-video-container" class="h-40 lg:h-48" dangerouslySetInnerHTML={{ __html: `
187-
<video id="loading-video" autoplay muted playsinline style="height: 100%; width: auto; mix-blend-mode: screen;">
194+
<div class="h-40 lg:h-48" style="mix-blend-mode: screen;">
195+
<video
196+
id="loading-video"
197+
class="h-full w-auto"
198+
autoplay
199+
muted
200+
playsinline
201+
poster=""
202+
>
188203
<source src="https://assets.decocache.com/deriva-earth/d192798e-7bb1-475b-b79d-2622051e839b/animation.mp4" type="video/mp4" />
189204
</video>
190-
`}} />
205+
</div>
191206
</div>
192207

193208
<style dangerouslySetInnerHTML={{ __html: `

0 commit comments

Comments
 (0)