-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4f3d804
Showing
6 changed files
with
55 additions
and
0 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,9 @@ | ||
<html> | ||
<button id="play"></button> | ||
<video id="video"> | ||
<source src="media/head.mp4" type="video/mp4"> | ||
</video> | ||
</html> | ||
|
||
<link rel="stylesheet" href="./style.css"> | ||
<script src="./script.js"></script> |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
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,15 @@ | ||
|
||
const button = document.getElementById('play'); | ||
const video = document.getElementById('video'); | ||
|
||
video.addEventListener('ended', function() { | ||
button.style.display = ''; | ||
}); | ||
|
||
button.addEventListener('click', function() { | ||
const videos = ["./media/head.mp4", "./media/tails.mp4"]; | ||
const random = Math.floor(Math.random() * 2); | ||
video.src = videos[random]; | ||
video.play(); | ||
button.style.display = 'none'; | ||
}); |
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,31 @@ | ||
#video { | ||
width: 100%; | ||
height: 100%; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
z-index: 1; | ||
background-color: black; | ||
} | ||
|
||
#play { | ||
position: absolute; | ||
top: 50%; | ||
left: 50%; | ||
transform: translate(-50%, -50%); | ||
z-index: 2; | ||
|
||
cursor: pointer; | ||
height: 100px; | ||
width: 100px; | ||
border-radius: 100px; | ||
background-color: #f7eda8; | ||
border: solid 6px #b3976e; | ||
background-image: url("./media/play-circle-custom.png"); | ||
background-size: 89px 89px; | ||
} | ||
|
||
#play:hover { | ||
transition: 0.3s; | ||
box-shadow: 0px 0px 10px 0px #000000; | ||
} |