feat: support video for hero section

This commit is contained in:
jinhojang6 2024-06-01 00:29:03 +09:00
parent dd6b9e63e1
commit 5c0b8fcf25
No known key found for this signature in database
GPG Key ID: 1762F21FE8B543F8
3 changed files with 23 additions and 20 deletions

View File

@ -16,34 +16,34 @@ html {
align-items: center; align-items: center;
} }
.mdx-hero > .mdx-hero-asset img { .main-wrapper > .container {
overflow-x: hidden;
}
.mdx-hero > .mdx-hero-asset video {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
margin-top: -40%; margin-top: -40%;
} }
.main-wrapper > .container {
overflow-x: hidden;
}
@media screen and (min-width: 996px) { @media screen and (min-width: 996px) {
.mdx-hero > .mdx-hero-asset img { .mdx-hero > .mdx-hero-asset video {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
margin-right: -160px; margin-right: -280px;
margin-top: -60%; margin-top: -55%;
scale: 0.95; scale: 0.95;
} }
} }
@media screen and (max-width: 996px) { @media screen and (max-width: 996px) {
.mdx-hero > .mdx-hero-asset img { .mdx-hero > .mdx-hero-asset video {
margin-right: -200px; margin-right: -200px;
margin-left: 0; margin-left: 0;
scale: 0.9; scale: 0.9;
margin-top: -30%; margin-top: -36%;
} }
.mdx-hero { .mdx-hero {
@ -53,19 +53,21 @@ html {
@media screen and (max-width: 930px) { @media screen and (max-width: 930px) {
.mdx-hero { .mdx-hero {
margin-bottom: 260px; margin-bottom: 280px;
} }
.mdx-hero > .mdx-hero-asset img { .mdx-hero > .mdx-hero-asset video {
margin-right: 0; margin-right: unset;
scale: 0.8; margin-left: unset;
margin-top: -15%; margin: 0 auto;
width: -webkit-fill-available;
margin-top: -10%;
} }
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
.mdx-hero { .mdx-hero {
margin-bottom: 20px; margin-bottom: 100px;
} }
} }
@ -74,8 +76,7 @@ html {
margin-bottom: -20px; margin-bottom: -20px;
} }
.mdx-hero > .mdx-hero-asset img { .mdx-hero > .mdx-hero-asset video {
scale: 1; margin-top: -5%;
margin-top: -8%;
} }
} }

View File

@ -40,7 +40,9 @@ import Link from '@docusaurus/Link'
</HeroActions> </HeroActions>
</HeroInfo> </HeroInfo>
<HeroAsset> <HeroAsset>
<img src="/hero/hero-image.png" alt="alt" /> <video autoPlay loop muted autoPlay playsInline>
<source src="/hero/hero-video.webm" type="video/webm" />
</video>
</HeroAsset> </HeroAsset>
</Hero> </Hero>

BIN
static/hero/hero-video.webm Normal file

Binary file not shown.