Skip to content

Commit

Permalink
attempting dynamic mp4 size for background
Browse files Browse the repository at this point in the history
  • Loading branch information
aleatorydialogue committed Jun 29, 2024
1 parent 4d8999f commit a2423a9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
</button>
<div class="dropdown-content">
<a href="consulting/index.html" target="_blank">Consulting</a>
<a href="cells.html" target="_blank">Cellular Automata</a>
<div class="submenu-link">
<a target="_blank">Gaussian Splats</a>
<div class="submenu-content">
Expand All @@ -46,10 +47,9 @@
</nav>
</div>
</footer>
<video autoplay muted loop id="bgVideo">
<video autoplay muted loop id="bgVideo" playsinline>
<source src="backgrounds/2.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

</body>
</html>
20 changes: 20 additions & 0 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ body {
padding: 0;
background: none; /* Remove static background image */
background-size: cover;
overflow: hidden; /* Prevent scrolling */
height: 100vh; /* Ensure body takes up full viewport height */
}

#bgVideo {
Expand All @@ -23,6 +25,24 @@ body {
overflow: hidden;
}

@media (max-width: 768px) {
#bgVideo {
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
}
}

@media (max-width: 480px) {
#bgVideo {
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
}
}

header {
background-color: rgba(0, 0, 0, 0.8);
color: white;
Expand Down

0 comments on commit a2423a9

Please sign in to comment.