Skip to content

Instantly share code, notes, and snippets.

@flordefuego
Created May 28, 2026 19:00
Show Gist options
  • Select an option

  • Save flordefuego/bd489c8eaca11d5f5fb7495cede35e08 to your computer and use it in GitHub Desktop.

Select an option

Save flordefuego/bd489c8eaca11d5f5fb7495cede35e08 to your computer and use it in GitHub Desktop.
await loadScript("https://cdn.jsdelivr.net/npm/textmode.js@latest/dist/textmode.umd.js")
// Initialize textmodifier
const canvas = document.getElementById('hydra-canvas')
// Initialize textmodifier
const tm = textmode.create({
canvas: canvas,
overlay: true
});
tm.setup(() => {
// Configure overlay settings
tm.fontSize(32);
tm.overlay
.characters(" .:-=+*KUOKO") // Character set for brightness mapping
.cellColorMode("fixed") // Use fixed cell color
.cellColor(0, 0, 0) // Black cell background
.charColorMode("sampled") // Sample character color from image
.background(0, 0, 0, 255); // Black background for transparent pixels
});
tm.draw(() => {
tm.background(0);
tm.image(tm.overlay, tm.grid.cols, tm.grid.rows);
});
osc(10, 0.1, 0.5)
.color(1, 0, 1)
.rotate()
.diff(osc(5, 0.1, 0.5))
.modulate(osc(10)
.rotate(() => Math.PI / 2))
.invert()
.layer(src(o0).mask(shape(4,[0,1].smooth()).repeat(4,4)))
.out(o0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment