Something went wrong. Try again.
A warm, tech-dystopian color scheme inspired by corrupted hardware and failing systems. digitalrust.katsuricata.com
theme color-scheme color-theme warm color
Something went wrong. Try again.
6.4 kB · 253 lines
Svelte
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254<script lang="ts"> import { color } from '#lib/palette.js';
interface TokenExample { text: string; className: string; }
interface TokenCategory { title: string; colorId: string; description: string; examples: TokenExample[]; }
const categories: TokenCategory[] = [ { title: 'Keywords & Storage', colorId: 'fatal-error', description: 'Control flow, modifiers, `try/catch`, storage types.', examples: [ { text: 'class', className: 'keyword' }, { text: 'return', className: 'keyword' }, { text: 'await', className: 'keyword' } ] }, { title: 'Functions & Macros', colorId: 'stack-overglow', description: 'User functions, built macros, shell commands.', examples: [ { text: 'renderTheme()', className: 'function' }, { text: 'println!', className: 'function' }, { text: 'COUNT', className: 'function' } ] }, { title: 'Classes & Types', colorId: 'dead-thread', description: 'Types, interfaces, trait names, lifetimes.', examples: [ { text: 'SystemState', className: 'class-name' }, { text: 'bool', className: 'type' }, { text: "'static", className: 'decorator' } ] }, { title: 'Strings & Regex', colorId: 'memory-leek', description: 'Literal text, heredocs, regex bodies & groups.', examples: [ { text: '"corrupted"', className: 'string' }, { text: '/kernel.+panic/', className: 'string' } ] }, { title: 'Numbers & Units', colorId: 'thermal-throttle', description: 'Integers, floats, hex, CSS units, rgb values.', examples: [ { text: '0xDEADBEEF', className: 'number' }, { text: '42', className: 'number' }, { text: '85.5°C', className: 'number' } ] }, { title: 'Constants & Specials', colorId: 'bright-stack-overglow', description: 'Booleans, null-like, enum values, magic names.', examples: [ { text: 'true', className: 'literal' }, { text: 'None', className: 'literal' }, { text: 'Status::OK', className: 'constant' } ] }, { title: 'Comments & Docs', colorId: 'dim-thermal-throttle', description: 'Inline comments, docstrings, shebangs (italic).', examples: [ { text: '// note', className: 'comment' }, { text: '#!/bin/bash', className: 'comment' } ] }, { title: 'Decorators & Attributes', colorId: 'dead-thread', description: 'Python decorators, Rust attributes, JSX props.', examples: [ { text: '@dataclass', className: 'decorator' }, { text: '#[cfg(test)]', className: 'decorator' } ] }, { title: 'Support & Built-ins', colorId: 'dim-stack-overglow', description: 'Standard library functions, DOM globals, HTML attributes.', examples: [ { text: 'console', className: 'support' }, { text: 'print', className: 'support' }, { text: 'class', className: 'support' } ] }, { title: 'Variables & Identifiers', colorId: 'ghost-pixel', description: 'Parameters, locals, properties, fallback text.', examples: [ { text: 'entropyLevel', className: 'variable' }, { text: 'error', className: 'parameter' }, { text: '$PATH', className: 'variable' } ] }, { title: 'Operators & Punctuation', colorId: 'copper-trace', description: 'Brackets, sigils, punctuation, interpolation braces.', examples: [ { text: '===', className: 'operator' }, { text: '{ }', className: 'punctuation' }, { text: '::', className: 'operator' } ] }, { title: 'Diagnostics & Errors', colorId: 'amber-alert', description: 'Wavy underline + icon ensures non-color cues.', examples: [ { text: 'panic()', className: 'error-inline' }, { text: 'deprecated()', className: 'warning-inline' } ] } ];</script>
<section aria-labelledby="token-map" class="token-map"> <h2 id="token-map" class="section-title">Token Classification Map</h2> <p class="section-copy"> Each card renders the canonical color, name, and example scopes. Sigils inherit their parent token color per spec. </p> <div class="token-grid"> {#each categories as category (category.title)} {@const swatch = color(category.colorId)} <article class="token-card"> <header> <span>{category.title}</span> <span class="token-swatch" style:--swatch="var(--{swatch.id})"> {swatch.name} · {swatch.hex} </span> </header> <p>{category.description}</p> <div class="token-examples"> {#each category.examples as example (example.text)} <span class={example.className}>{example.text}</span> {/each} </div> </article> {/each} </div></section>
<style> .token-map { margin-top: var(--dr-space-2xl); }
.token-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--dr-space-md); }
.token-card { background: var(--dr-surface-elevated); border: var(--dr-border); border-radius: var(--dr-radius); padding: var(--dr-space-md); display: flex; flex-direction: column; gap: var(--dr-space-sm); box-shadow: var(--dr-shadow-offset-sm), var(--dr-shadow-inner-highlight); transition: transform var(--dr-transition-fast), box-shadow var(--dr-transition-fast); }
.token-card:hover { transform: translate(-2px, -2px); box-shadow: var(--dr-shadow-hover-md); }
.token-card:active { transform: translate(2px, 2px); box-shadow: var(--dr-shadow-active); }
.token-card header { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: var(--dr-text-xs); color: var(--dr-text-quiet); gap: var(--dr-space-sm); border: none; margin: 0; padding: 0; }
.token-card header > span:first-child { text-transform: uppercase; letter-spacing: 0.05em; }
.token-swatch { background: var(--dr-surface-base); border: var(--dr-border-subtle); border-radius: var(--dr-radius-sm); padding: 0.2rem 0.4rem; font-size: var(--dr-text-xs); color: var(--dr-text-primary); position: relative; }
.token-swatch::before { content: ''; position: absolute; inset: 2px; border-radius: var(--dr-radius-sm); background: var(--swatch); opacity: 0.35; z-index: -1; }
.token-card p { color: var(--dr-text-secondary); font-size: var(--dr-text-sm); }
.token-examples { display: flex; flex-wrap: wrap; gap: 0.4rem; font-size: var(--dr-text-sm); }
@media (max-width: 480px) { .token-grid { grid-template-columns: 1fr; } }</style>