-
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
Showing
1 changed file
with
108 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,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> |