-
Notifications
You must be signed in to change notification settings - Fork 0
/
crt.html
108 lines (103 loc) · 3.13 KB
/
crt.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!doctype html>
<html lang=en xmlns=http://www.w3.org/1999/xhtml>
<head>
<meta charset=UTF-8>
<meta content="width=device-width,initial-scale=1" name=viewport>
<title>CRT Demo</title>
<style>
:root {
--primary-color: #ffa348;
--primary-color-alpha: #ffa34833;
--contrast-color: #000c
}
html, body {
height: 100%;
margin: 0;
padding: 0;
}
.crt {
height: 100%; /* Full viewport height */
width: 100%;
box-shadow: var(--edge-highlight), 0 0 0 0.0625rem var(--primary-color-alpha), 0 0.125rem 0.375rem 0.125rem var(--primary-color-alpha), 0 0.25rem 1.5rem 0.25rem var(--primary-color-alpha);
background: radial-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.85)), var(--primary-color);
}
.crt pre {
animation: flicker 0.25s alternate infinite;
margin: 0;
box-shadow: none;
background-color: transparent !important;
padding: 1rem 1rem;
color: var(--primary-color) !important;
text-shadow: var(--primary-color-alpha) 0 0 0.25rem, var(--primary-color) 0 0 0.75rem;
}
@keyframes flicker {
25% {
opacity: 0.95;
}
50% {
opacity: 0.85;
}
75% {
opacity: 1;
}
to {
opacity: 0.9;
}
}
.scanlines {
position: relative;
overflow: hidden;
}
.scanlines::before {
display: block;
position: absolute;
z-index: 1;
animation: scanlines 0.1s linear infinite;
inset: 0;
background-image: repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25) 0.125rem, transparent 0.125rem, transparent 0.25rem);
pointer-events: none;
content: "";
}
@keyframes scanlines {
to {
background-position-y: 0.25rem;
}
}
.scanlines::after {
display: block;
position: absolute;
animation: scanline 5s linear infinite;
inset: 0;
background-image: linear-gradient(to bottom, transparent, var(--primary-color-alpha) 7rem, transparent 8rem);
background-size: auto 8rem;
background-repeat: no-repeat;
background-position-y: -8rem;
pointer-events: none;
content: "";
}
@keyframes scanline {
50%, to {
background-position-y: calc(100% + 8rem);
}
}
.cursor {
animation: cursor-blink 1s infinite;
}
@keyframes cursor-blink {
50% {
opacity: 0;
}
}
</style>
</head>
<body>
<div class="crt scanlines">
<pre>
<span>\ /\ _ _ ____ ____ ____ __ </span>
<span> ) ( ') / )( \( __)( _ \/ ___) / \ </span>
<span>( / ) \ \/ / ) _) ) /\___ \( O )</span>
<span> \(__)| \__/ (____)(__\_)(____/ \__/ </span>
</pre>
</div>
</body>
</html>