summaryrefslogtreecommitdiff
path: root/templates/canvas.html
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2026-06-20 09:40:07 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2026-06-20 09:40:07 -0700
commitfb653292612eddca5b088ed88466c546d1597107 (patch)
tree900ed32e066812688858ed3bb15128c41bb78054 /templates/canvas.html
downloadpenguins.lan-fb653292612eddca5b088ed88466c546d1597107.tar.gz
penguins.lan-fb653292612eddca5b088ed88466c546d1597107.zip
Initial commit
Diffstat (limited to 'templates/canvas.html')
-rw-r--r--templates/canvas.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/templates/canvas.html b/templates/canvas.html
new file mode 100644
index 0000000..84e964d
--- /dev/null
+++ b/templates/canvas.html
@@ -0,0 +1,22 @@
+{{ define "content" }}
+<h2>~place</h2>
+<p>{{ .Canvas.Rows }}×{{ .Canvas.Cols }}, one pixel at a time. pick a color, click a cell. be nice to your fellow waddlers &lt;3</p>
+
+<div id="palette" class="palette"></div>
+
+<div class="canvas-wrap">
+ <canvas id="canvas" width="{{ .Canvas.Cols }}" height="{{ .Canvas.Rows }}"></canvas>
+</div>
+<p id="cooldown" class="muted"></p>
+
+<script>
+window.CANVAS = {
+ rows: {{ .Canvas.Rows }},
+ cols: {{ .Canvas.Cols }},
+ scale: {{ .Canvas.Scale }},
+ cooldownMs: {{ .Canvas.CooldownMs }},
+ palette: [{{ range $i, $c := .Canvas.Palette }}{{ if $i }}, {{ end }}"{{ $c }}"{{ end }}]
+};
+</script>
+<script src="/static/js/canvas.js"></script>
+{{ end }}