text stringlengths 0 1.19k |
|---|
font-size: 22px; |
letter-spacing: 4px; |
color: var(--phosphor-bright); |
text-shadow: 0 0 10px var(--phosphor); |
} |
.overlay p { |
margin: 4px 0 18px; |
font-size: 12px; |
color: var(--phosphor-dim); |
letter-spacing: 1px; |
max-width: 320px; |
line-height: 1.6; |
} |
.key { |
display: inline-block; |
border: 1px solid var(--phosphor-dim); |
padding: 2px 7px; |
border-radius: 3px; |
color: var(--phosphor); |
margin: 0 2px; |
} |
button#start { |
font-family: inherit; |
background: transparent; |
border: 1px solid var(--phosphor); |
color: var(--phosphor-bright); |
padding: 10px 22px; |
letter-spacing: 3px; |
font-size: 12px; |
cursor: pointer; |
text-shadow: 0 0 6px var(--phosphor); |
transition: background 0.15s, color 0.15s; |
} |
button#start:hover { |
background: var(--phosphor); |
color: var(--bg-deep); |
} |
@keyframes blink { |
0%, 100% { opacity: 1; } |
50% { opacity: 0.3; } |
} |
.blink { animation: blink 1.4s infinite; } |
</style> |
</head> |
<body> |
<div class="crt"> |
<header> |
<div class="title">SIGNAL<small>continuous transmission // len n</small></div> |
<div class="stat">SCORE<b id="score">0</b></div> |
</header> |
<div style="position: relative;"> |
<canvas id="board" width="400" height="400"></canvas> |
<div class="overlay show" id="overlay"> |
<h1 id="overlayTitle">SIGNAL</h1> |
<p id="overlayText">Guide the transmission. Eat data to extend the signal.<br>Don't cross yourself. Don't hit the void.</p> |
<button id="start">BEGIN ▸</button> |
<p style="margin-top:16px; font-size:10px;"> |
<span class="key">↑</span><span class="key">↓</span><span class="key">←</span><span class="key">→</span> |
or <span class="key">W</span><span class="key">A</span><span class="key">S</span><span class="key">D</span> to steer |
</p> |
</div> |
</div> |
<div class="footer"> |
<span id="hint">SPACE to pause</span> |
<span id="best">BEST — 0</span> |
</div> |
</div> |
<script> |
(function () { |
const canvas = document.getElementById('board'); |
const ctx = canvas.getContext('2d'); |
const GRID = 20; |
const CELL = canvas.width / GRID; |
const scoreEl = document.getElementById('score'); |
const bestEl = document.getElementById('best'); |
const overlay = document.getElementById('overlay'); |
const overlayTitle = document.getElementById('overlayTitle'); |
const overlayText = document.getElementById('overlayText'); |
const startBtn = document.getElementById('start'); |
const hint = document.getElementById('hint'); |
let best = 0; |
try { best = parseInt(localStorage.getItem('signal-best') || '0', 10); } catch (e) { best = 0; } |
bestEl.textContent = 'BEST — ' + best; |
let snake, dir, nextDir, food, score, alive, paused, tickMs, timer, pulse; |
function reset() { |
snake = [{x: 10, y: 10}, {x: 9, y: 10}, {x: 8, y: 10}]; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.