uranium / why.html
hihihi934's picture
Update why.html
b49cb20 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>why? cause we're playing bendy</title>
<style>
* {
margin: 0;
padding: 0;
overflow: hidden;
}
html, body {
height: 100%;
background: black;
}
video {
position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
transform: translate(-50%, -50%);
object-fit: cover;
}
</style>
</head>
<body>
<video id="myVideo" autoplay playsinline>
<source src="https://i.yourimageshare.com/xdpwPMMmXy.mp4" type="video/mp4">
<!-- add more formats if you want -->
<!-- <source src="yourvideo.webm" type="video/webm"> -->
</video>
<script>
const video = document.getElementById('myVideo');
// when video finishes playing, close the tab
video.addEventListener('ended', () => {
window.close();
});
// optional: make it loop once before closing if you want, but you said close when it finishes
// video.loop = false; // default is already false
// force video to play (some browsers are strict)
video.play().catch(e => {
console.log("autoplay blocked, user needs to interact");
});
</script>
</body>
</html>