the home site for me: also iteration 3 or 4 of my site

chore: remove crt styles

dunkirk.sh 11c2cbe2 6b289dc7

verified
Changed files
+1 -259
content
sass
static
templates
shortcodes
+1 -3
content/_index.md
···
+++
<div style="display: flex; justify-content: center; margin: 2rem;">
-
<div class="crt scanlines" style="width: 512px; height: 512px; box-shadow: var(--edge-highlight), var(--shadow-glow);">
-
<img src="/pfps/starry.webp" alt="kieran with a white and gray spotted kitten with a grainy background and star dust" width="512" height="512" class="u-photo"/>
-
</div>
</div>
# About me
···
+++
<div style="display: flex; justify-content: center; margin: 2rem;">
+
<img src="/pfps/starry.webp" alt="kieran with a white and gray spotted kitten with a grainy background and star dust" width="512" height="512" class="u-photo"/>
</div>
# About me
-240
sass/css/_crt.scss
···
-
::root {
-
--edge-highlight: inset 0 0.0625rem 0 rgb(255 255 255 / 0.1);
-
--shadow-glow:
-
0 0 0 0.0625rem var(--accent),
-
0 0.125rem 0.375rem 0.125rem var(--accent),
-
0 0.25rem 1.5rem 0.25rem var(--accent);
-
--crt-bg: var(--gradient-average-light);
-
}
-
-
@media (prefers-color-scheme: light) {
-
::root {
-
--crt-bg: var(--gradient-average-light);
-
}
-
}
-
-
[data-theme="light"] {
-
::root {
-
--crt-bg: var(--gradient-average-light);
-
}
-
}
-
-
@media (prefers-color-scheme: dark) {
-
::root {
-
--crt-bg: color-mix(in oklab, var(--nightshade-violet) 65%, black);
-
}
-
}
-
-
[data-theme="dark"] {
-
::root {
-
--crt-bg: color-mix(in oklab, var(--nightshade-violet) 65%, black);
-
}
-
}
-
-
h1,
-
img,
-
video,
-
iframe[src^="https://www.youtube-nocookie.com"],
-
iframe[src^="https://www.youtube.com"]
-
{
-
border: none;
-
box-shadow: var(--edge-highlight), var(--shadow-glow);
-
animation: flicker 4s alternate infinite;
-
-
@keyframes flicker {
-
2% {
-
opacity: 0.95;
-
}
-
-
4% {
-
opacity: 0.85;
-
}
-
-
7% {
-
opacity: 1;
-
}
-
-
to {
-
opacity: 0.9;
-
}
-
}
-
}
-
-
.text-glow {
-
--text-shadow-1: hsl(from var(--accent) h s l / 0.2);
-
--text-shadow-2: hsl(from var(--accent) h calc(s * 1.2) l);
-
text-shadow:
-
var(--text-shadow-1) 0 0 0.25rem,
-
var(--text-shadow-2) 0 0 0.75rem;
-
-
animation: flicker 4s alternate infinite;
-
-
@keyframes flicker {
-
2% {
-
opacity: 0.95;
-
}
-
-
4% {
-
opacity: 0.85;
-
}
-
-
7% {
-
opacity: 1;
-
}
-
-
to {
-
opacity: 0.9;
-
}
-
}
-
}
-
-
.crt {
-
margin: 1rem 0 1rem;
-
box-shadow:
-
var(--edge-highlight),
-
0 0 0 0.03125rem var(--accent),
-
0 0.0625rem 0.1875rem 0.03125rem var(--accent),
-
0 0.125rem 0.75rem 0.0625rem var(--accent);
-
border-radius: 0.2rem;
-
background-image: radial-gradient(
-
color-mix(in oklab, var(--accent) 25%, var(--crt-bg)),
-
color-mix(in srgb, var(--accent) 10%, var(--crt-bg)) 80%,
-
color-mix(in srgb, var(--accent) 5%, var(--crt-bg))
-
);
-
-
pre {
-
--text-shadow-1: hsl(from var(--accent) h s l / 0.2);
-
--text-shadow-2: hsl(from var(--accent) h calc(s * 1.2) l);
-
animation: flicker 0.3s alternate infinite;
-
margin: 0;
-
box-shadow: none;
-
background-color: transparent !important;
-
padding: 1rem 1rem;
-
color: var(--accent) !important;
-
text-shadow:
-
var(--text-shadow-1) 0 0 0.25rem,
-
var(--text-shadow-2) 0 0 0.75rem;
-
-
@keyframes flicker {
-
25% {
-
opacity: 0.93;
-
}
-
-
50% {
-
opacity: 0.89;
-
}
-
-
75% {
-
opacity: 0.95;
-
}
-
-
to {
-
opacity: 0.9;
-
}
-
}
-
}
-
-
> img {
-
border-radius: 0.2rem;
-
margin: 0;
-
max-width: 100%;
-
}
-
}
-
-
.scanlines,
-
h1 {
-
position: relative;
-
overflow: hidden;
-
-
&::before {
-
display: block;
-
position: absolute;
-
z-index: 2;
-
animation: scanlines 0.1s linear infinite;
-
inset: 0;
-
background-image: repeating-linear-gradient(
-
to bottom,
-
rgb(0 0 0 / 0.15),
-
rgb(0 0 0 / 0.15) 0.125rem,
-
transparent 0.125rem,
-
transparent 0.25rem
-
);
-
pointer-events: none;
-
content: "";
-
-
@keyframes scanlines {
-
to {
-
background-position-y: 0.25rem;
-
}
-
}
-
}
-
-
&::after {
-
--scanline-color: rgb(from var(--accent) r g b / 0.03);
-
display: block;
-
position: absolute;
-
z-index: 2;
-
animation: scanline 5s linear infinite;
-
inset: 0;
-
background-image: linear-gradient(
-
to bottom,
-
transparent,
-
var(--scanline-color) 16rem
-
);
-
background-size: auto 16rem;
-
background-repeat: no-repeat;
-
background-position-y: -16rem;
-
pointer-events: none;
-
content: "";
-
-
@keyframes scanline {
-
to {
-
background-position-y: calc(100% + 16rem);
-
}
-
}
-
}
-
}
-
-
.scanlines {
-
&::before {
-
opacity: 0.8;
-
}
-
-
&::after {
-
opacity: 0.5;
-
}
-
}
-
-
@media (prefers-color-scheme: light) {
-
.scanlines {
-
&::before {
-
opacity: 0.35;
-
}
-
-
&::after {
-
opacity: 0.4;
-
}
-
}
-
}
-
-
[data-theme="light"] {
-
.scanlines {
-
&::before {
-
opacity: 0.35;
-
}
-
-
&::after {
-
opacity: 0.4;
-
}
-
}
-
}
-
-
.cursor {
-
animation: cursor-blink 1s infinite;
-
-
@keyframes cursor-blink {
-
50% {
-
opacity: 0;
-
}
-
}
-
}
···
-1
sass/css/main.scss
···
@use "mods";
@use "copy-button";
-
@use "crt";
@use "theme-toggle";
···
@use "mods";
@use "copy-button";
@use "theme-toggle";
-14
static/js/copy-button.js
···
container.classList.add("pre-container", "crt", "scanlines");
container.appendChild(header);
-
const code = block.querySelector("code");
-
const cursor = document.createElement("span");
-
cursor.classList.add("cursor");
-
cursor.setAttribute("style", "display: inline;");
-
cursor.innerHTML = "█";
-
const lastline = code.lastChild;
-
const spans = lastline.getElementsByTagName("span");
-
const lastspan = spans[spans.length - 1];
-
if (lastspan) {
-
lastspan.appendChild(cursor);
-
} else {
-
lastline.appendChild(cursor);
-
}
-
// Move code block into the container
block.parentNode.insertBefore(container, block);
container.appendChild(block);
···
container.classList.add("pre-container", "crt", "scanlines");
container.appendChild(header);
// Move code block into the container
block.parentNode.insertBefore(container, block);
container.appendChild(block);
-1
templates/shortcodes/crt.html
···
-
<div class="crt scanlines" aria-hidden="true">{{ body | markdown | safe }}</div>
···