Fake Broken Page CSS
Attempt at fake broken page using CSS tricks.
by MegaScience
HTML
<div id="container">
<div class="tablerow">
<h1>Here is my test page!</h1>
</div>
<div class="tablerow">
<div id="player" class="tablecell">
<progress id="progressbar" value="0" max="100"></progress>
<span id="under"></span>
</div>
</div>
<div class="tablerow">
<p>Apologies for any lag. It's a lot of code.</p>
</div>
</div>
CSS
/* Normal styling */
html, body {
height: 100%;
}
body {
background-color: yellow;
text-align:center;
}
h1 {
margin-top: 0;
}
#container {
display: table;
padding: 10px;
text-align: center;
margin: auto 0;
max-width: 900px;
min-width: 700px;
margin:0px auto;
border: 4px solid white;
background-color: black;
color: green;
text-shadow: -1px -1px 0 white, 1px -1px 0 white, -1px 1px 0 white, 1px 1px 0 white;
font-size: 30px;
font-family: Arial;
font-weight: bolder;
text-align: center;
box-sizing: border-box;
}
.tablerow {
display: table-row;
}
.tablecell {
display: table-cell;
text-align: center;
vertical-align: middle;
}
#player {
border: 2px solid white;
width: 640px;
height: 480px;
background-color: rgba(255, 255, 255, 0.1);
}
#progressbar {
font-size: large;
}
#under {
visibility: hidden;
}
/* Fake page crash */
#progressbar[value="79"] + #under:before/*, :root:before, body > :first-child:after*/ {
background-color: rgba(255, 255, 255, 0.8);
content:" ";
left: 0;
top: 0;
position: fixed;
width: 100%;
height: 100vh;
cursor: wait;
visibility: hidden;
-moz-animation: popin 1s ease 2.5s forwards;
-webkit-animation: popin 1s ease 2.5s forwards;
-o-animation: popin 1s ease 2.5s forwards;
-ms-animation: popin 1s ease 2.5s forwards;
animation: popin 1s ease 2.5s forwards;
}/*
body {
overflow: hidden;
}*/
@-moz-keyframes popin {
from {
visibility: hidden;
/*
overflow: visible;*/
}
to {
visibility: visible;
/*
overflow: hidden;*/
}
}
@-webkit-keyframes popin {
from {
visibility: hidden;
/*
overflow: visible;*/
}
to {
visibility: visible;
/*
overflow: hidden;*/
}
}
@-o-keyframes popin {
from {
visibility: hidden;
/*
overflow: visible;*/
}
to {
visibility:...
JavaScript
const progressbar = document.getElementById('progressbar')
const pInterval = setInterval(() => { if(++progressbar.value > 78) clearInterval(pInterval) }, 75)
/*const pInterval = (() => {
let progress = 0
return setInterval(() => {
if(++progressbar.value > 78) clearInterval(pInterval)
}, 75)
})()*/
/*let progress = 0
const pInterval = setInterval(() => {
progressbar.value = ++progress
if(progress > 78) clearInterval(pInterval)
}, 50)*/