-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: embed video in video tag (#635)
* fix: embed video in video tag * link to example
- Loading branch information
Showing
3 changed files
with
46 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<script setup> | ||
import DefaultTheme from "vitepress/theme"; | ||
</script> | ||
|
||
<template> | ||
<DefaultTheme.Layout> | ||
<template #home-hero-image> | ||
<a href="./examples/flights-10m.html"> | ||
<video autoplay loop muted src="/demo-dark.mp4" class="video dark" /> | ||
<video autoplay loop muted src="/demo-light.mp4" class="video light" /> | ||
</a> | ||
</template> | ||
</DefaultTheme.Layout> | ||
</template> | ||
|
||
<style scoped> | ||
.video { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform:translate(-50%, -50%); | ||
max-height: 190px; | ||
} | ||
html:not(.dark) .video.dark { | ||
display:none | ||
} | ||
.dark .video.light { | ||
display:none | ||
} | ||
@media (min-width: 640px) { | ||
.video { | ||
max-height: 256px; | ||
} | ||
} | ||
@media (min-width: 960px) { | ||
.video { | ||
max-height: 320px; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters