Skip to content

Commit

Permalink
Add fallback option for video-background
Browse files Browse the repository at this point in the history
  • Loading branch information
El-Jay-Crypto committed Oct 2, 2024
1 parent b45bcd4 commit 9cdc5c5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Binary file added assets/video/smoking-buddhead-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/video/smoking-buddhead.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@
</nav>

<main>
<section class="py-5 text-light overflow-hidden position-relative" id="home">
<section class="py-5 text-light overflow-hidden position-relative fallback-bg-mobile" id="home">
<video class="d-md-none position-absolute object-fit-cover" playsinline autoplay loop muted style="top: 0; left: 0; width: 100%; height: 100%;">
<source src="/assets/video/smoking-buddhead-mobile.mp4" type="video/mp4">
<source src="/assets/video/smoking-buddhead-mobile.webm" type="video/webm">
</video>
<video class="d-none d-md-block position-absolute object-fit-cover" playsinline autoplay loop muted style="top: 0; left: 0; width: 100%; height: 100%;">
<video class="d-none d-md-block position-absolute object-fit-cover fallback-bg" playsinline autoplay loop muted style="top: 0; left: 0; width: 100%; height: 100%;">
<source src="/assets/video/smoking-buddhead.mp4" type="video/mp4">
<source src="/assets/video/smoking-buddhead.webm" type="video/webm">
</video>
Expand Down
10 changes: 10 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ h4, h5 ,h6 {
background: radial-gradient(circle at 90% -50%, #146a42, #212529)
}

/*** Fallback for video background ***/

.fallback-bg {
background-image: url('/assets/video/smoking-buddhead.png')
}

.fallback-bg-mobile {
background-image: url('/assets/video/smoking-buddhead-mobile.png')
}

/*** Divider & borders ***/

.bg-divider {
Expand Down

0 comments on commit 9cdc5c5

Please sign in to comment.