Files
blog/sass/_crt.scss
2024-08-23 23:18:59 +03:00

105 lines
1.8 KiB
SCSS

.crt {
margin: 1rem 0 1rem;
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);
border-radius: var(--rounded-corner);
background: radial-gradient(rgb(0 0 0 / 0.7), rgb(0 0 0 / 0.85)),
var(--primary-color);
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;
&::before {
display: block;
position: absolute;
z-index: 1;
animation: scanlines 0.1s linear infinite;
inset: 0;
background-image: repeating-linear-gradient(
to bottom,
rgb(0 0 0 / 0.25),
rgb(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;
}
}
}
&::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;
}
}
}