c.stupid.cat/css/ascii.css

130 lines
2.7 KiB
CSS

/* ============================================================
ascii.css — standalone page that renders /ascii.txt (ANSI art)
in full colour via ansi_up, styled to match main.css's terminal
aesthetic (Catppuccin surfaces, Comic Code, rounded card chrome).
============================================================ */
/* This page scrolls — ascii art can be tall/wide, unlike the locked hub */
html:has(.ascii-wrap),
body:has(.ascii-wrap) {
height: auto;
min-height: 100dvh;
overflow-y: auto;
}
body:has(.ascii-wrap) {
align-items: flex-start;
}
body:has(.ascii-wrap) .ascii-wrap {
max-width: 100%;
}
.ascii-wrap {
position: relative;
z-index: 1;
width: 100%;
max-width: 1100px;
margin: 0 auto;
padding: 2.5rem 1.25rem 4.5rem;
display: flex;
flex-direction: column;
align-items: center;
}
.ascii-wrap .hub-header {
margin-bottom: 1.5rem;
}
/* ---- the "terminal card" wrapping the art ---- */
.ascii-frame {
width: 100%;
max-width: 100%;
background: var(--mantle);
border: 1px solid var(--surface-1);
border-radius: 14px;
box-shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
overflow: hidden;
}
.ascii-frame-bar {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.55rem 0.85rem;
background: var(--surface-0);
border-bottom: 1px solid var(--surface-1);
}
.ascii-dot {
width: 10px;
height: 10px;
border-radius: 50%;
flex-shrink: 0;
opacity: 0.85;
}
.ascii-dot.red {
background: var(--red);
}
.ascii-dot.yellow {
background: var(--yellow);
}
.ascii-dot.green {
background: var(--green);
}
.ascii-frame-title {
margin-left: 0.4rem;
font-size: 0.75rem;
color: var(--subtext-0);
font-family: 'Comic Code', ui-monospace, monospace;
letter-spacing: 0.02em;
}
/* ---- the actual art ---- */
.ascii-art {
margin: 0;
padding: 1rem;
font-family: ui-monospace, 'Cascadia Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
/* tiny + tight so dense ascii fits without forcing horizontal scroll
on smaller screens; scrolls if it still doesn't fit */
font-size: clamp(2.6px, 0.85vw, 7px);
line-height: 1.05;
white-space: pre;
overflow-x: auto;
overflow-y: hidden;
color: var(--text);
background: var(--crust);
text-shadow: 0 0 1px rgba(0, 0, 0, 0.4);
/* default colour before ansi_up's inline styles kick in / if it fails */
}
.ascii-art::-webkit-scrollbar {
height: 10px;
}
.ascii-art::-webkit-scrollbar-thumb {
background: var(--surface-1);
border-radius: 999px;
}
.ascii-art.ascii-error {
font-size: 0.95rem;
white-space: normal;
color: var(--red);
text-align: center;
padding: 2.5rem 1rem;
}
@media (max-width: 640px) {
.ascii-wrap {
padding: 1.5rem 0.75rem 3rem;
}
.ascii-art {
font-size: clamp(2.2px, 1.6vw, 5px);
}
}