Files
blog/sass/_crt.scss
daudix f8efb69e6c feat: Make stuff look good on as many browser versions as possible
Rejoice iPhone users, you'll have pretty CRT now as well!
2024-01-23 09:47:59 +03:00

78 lines
1.4 KiB
SCSS

.crt {
margin: 1rem 0 1rem;
border-radius: var(--rounded-corner);
background: radial-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.85)),
var(--primary-color);
box-shadow: 0 0 0 1px var(--primary-color-alpha),
0 2px 6px 2px var(--primary-color-alpha),
0 4px 24px 4px var(--primary-color-alpha);
pre {
color: var(--primary-color);
padding: 1rem 1rem;
text-shadow: var(--primary-color-alpha) 0 0 4px,
var(--primary-color) 0 0 12px;
// Unset some <pre> stuff
background-color: unset;
box-shadow: unset;
margin: unset;
}
}
.scanlines {
position: relative;
overflow: hidden;
}
.scanlines::after {
animation: scanlines 250ms linear infinite;
background: repeating-linear-gradient(
0deg,
rgba(0, 0, 0, 0.25),
rgba(0, 0, 0, 0.25) 1px,
transparent 3px,
transparent 4px
);
content: "";
display: block;
height: calc(100% + 8px);
left: 0;
pointer-events: none;
position: absolute;
top: 0;
width: 100%;
@keyframes scanlines {
from {
transform: translateY(-8px);
}
to {
transform: translateY(0px);
}
}
@media (prefers-reduced-motion) {
animation: none;
}
}
.cursor {
animation: blicking 1s infinite;
@keyframes blicking {
from {
opacity: 1;
}
50% {
opacity: 0;
}
75% {
opacity: 1;
}
}
@media (prefers-reduced-motion) {
animation: none;
}
}