Skip to content

Instantly share code, notes, and snippets.

View jason-s13r's full-sized avatar

Jason Schwarzenberger jason-s13r

View GitHub Profile
@jason-s13r
jason-s13r / colour.golf.js
Last active June 10, 2024 02:45
Adds a colour picker & toolbar to drawing canvas for https://t0.vc/g.
((
$Document,
_str_createElement,
_str_addEventListener,
_str_preventDefault,
_str_input,
_str_drawTools,
_str_strokeStyle,
_str_color,
_str_range,
@jason-s13r
jason-s13r / tetris.golf.html
Last active April 15, 2025 13:44
A Tetris game for t0.vc
Hover mouse over canvas to allow keyboard input.
Use arrow keys to play.
Someone else can add touch controls (see window.Tetris).
<canvas id="tetris" style="border: solid 1px #000; background: #eee" width="200" height="400"></canvas>
<script>
(($Window, $Document, _m_addEventListener, _m_preventDefault, _m_forEach, _prop_$canvas, _prop_score, _prop_board, _prop_piece, _const_COLS, _const_ROWS, _const_SHAPES, _const_COLORS, _const_ROW_SCORE) => {
class Tetris {
static I = {};
constructor(selector) {
if (Tetris.I[selector])