retro-terminaljs
Version:
Create retro terminals feeding live data.
125 lines (115 loc) • 2.2 kB
CSS
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #000;
}
.terminal {
position: relative;
width: 300px;
height: 300px;
overflow: hidden;
}
.terminal:before {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 0%;
height: 120px;
background: #000;
z-index: 2;
}
.terminal:after,
h3::after {
content: '';
position: absolute;
right: 0;
width: 400%;
height: 100%;
background: linear-gradient(to right, transparent, #000, #000);
z-index: 3;
animation: Roll 8s linear forwards;
}
@keyframes Roll {
0% {
right: 0;
}
50% {
right: -400%;
}
100% {
right: 0;
}
}
.terminal span {
position: absolute;
top: 0;
width: 20px;
height: 100%;
background: #fff;
}
.terminal span:nth-child(1) {
background: #fffff1;
left: 0;
}
.terminal span:nth-child(2) {
background: #fffff1;
right: 0;
}
.terminal span:nth-child(3) {
background: #fffff1;
left: 50%;
transform: rotate(90deg);
top: -47%;
z-index: 1;
}
.terminal span:nth-child(4) {
background: #fffff1;
left: 50%;
transform: rotate(90deg);
top: 47%;
z-index: 1;
}
.terminal span:nth-child(5) {
background: #fff;
z-index: 3;
top: 60%;
left: 20%;
transform-origin: top left;
transform: skewX(45deg);
height: 10%;
}
.terminal span:nth-child(6) {
background: #fff;
z-index: 3;
top: 70%;
left: 20%;
transform-origin: bottom left;
transform: skewX(-45deg);
height: 10%;
}
.terminal span:nth-child(7) {
background: #fff;
z-index: 3;
top: 75%;
left: 45%;
transform: rotate(90deg);
height: 16%;
width: 4%;
}
h3 {
position: relative;
margin: 0;
padding: 0;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
color: #fff;
font-size: 30px;
text-transform: uppercase;
letter-spacing: 10px;
overflow: hidden;
}