File tree Expand file tree Collapse file tree 4 files changed +31
-7
lines changed
Expand file tree Collapse file tree 4 files changed +31
-7
lines changed Original file line number Diff line number Diff line change 11---
2- import { Image } from ' astro:assets'
3-
42/**
53 * Hero Component
64 *
75 * @description A component that displays a hero section with a title, description, and image
86 */
97interface Props {
108 /**
11- * The source URL for the image
9+ * Source for the WebM video
10+ */
11+ srcWebm? : string
12+ /**
13+ * Source for the MP4 video
1214 */
13- src ? : string
15+ srcMp4 ? : string
1416}
1517
16- const { src = ' /demo.gif ' }: Props = Astro .props
18+ const { srcWebm = ' /demo.webm ' , srcMp4 = ' /demo.mp4 ' }: Props = Astro .props
1719---
1820
1921<section class =" hero my-24" >
@@ -31,9 +33,31 @@ const { src = '/demo.gif' }: Props = Astro.props
3133 <img src =" /google-play-badge.png" alt =" Get it on Google Play" width =" 200" class =" h-auto" />
3234 </a >
3335 </div >
34- <Image class =" block w-full max-w-xs mt-8 lg:hidden" src ={ src } alt =" " decoding =" async" width ={ 400 } height ={ 300 } loading =" eager" />
36+ <video
37+ class =" block w-full max-w-xs mt-8 lg:hidden"
38+ autoplay
39+ muted
40+ loop
41+ playsinline
42+ width =" 400"
43+ height =" 300"
44+ >
45+ <source src ={ srcWebm } type =" video/webm" />
46+ <source src ={ srcMp4 } type =" video/mp4" />
47+ </video >
3548 </div >
36- <Image class =" hidden lg:block" src ={ src } alt =" " decoding =" async" width ={ 800 } height ={ 600 } loading =" eager" />
49+ <video
50+ class =" hidden lg:block"
51+ autoplay
52+ muted
53+ loop
54+ playsinline
55+ width =" 536"
56+ height =" 687"
57+ >
58+ <source src ={ srcWebm } type =" video/webm" />
59+ <source src ={ srcMp4 } type =" video/mp4" />
60+ </video >
3761 </div >
3862 </div >
3963</section >
You can’t perform that action at this time.
0 commit comments