From dd2a995f6c11ef8d59be51ff13fc4adf0513c81c Mon Sep 17 00:00:00 2001
From: th
Date: Fri, 10 Apr 2026 06:35:30 +0200
Subject: [PATCH] canvas feature
---
public/css/style.css | 11 +
public/index.php | 47 ++++
public/js/modules/canvas.js | 509 ++++++++++++++++++++++++++++++++++
public/js/modules/editor.js | 32 +++
public/js/modules/markdown.js | 4 +
5 files changed, 603 insertions(+)
create mode 100644 public/js/modules/canvas.js
diff --git a/public/css/style.css b/public/css/style.css
index 5d24de1..1c5b7fc 100644
--- a/public/css/style.css
+++ b/public/css/style.css
@@ -499,6 +499,16 @@ body.detail-image-fs-open { overflow: hidden; }
#editor-gutter > div { padding-right: 2px; box-sizing: border-box; }
.gutter-active { color: var(--t-accent) !important; font-weight: 700; background: var(--t-raised); }
+/* ASCII Canvas */
+#ascii-canvas-overlay { background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
+.ascii-grid { white-space: pre; user-select: none; -webkit-user-select: none; display: inline-block; width: max-content; }
+.ascii-cursor { background: var(--t-accent); color: var(--t-bg); }
+.ascii-char-btn { font-family: var(--t-font-mono, monospace); font-size: 13px; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--t-border); border-radius: 3px; background: var(--t-bg); color: var(--t-text); cursor: pointer; transition: all 0.1s; padding: 0; line-height: 1; }
+.ascii-char-btn:hover { background: var(--t-raised); color: var(--t-bright); }
+.ascii-char-btn.active { background: var(--t-accent); color: var(--t-bg); border-color: var(--t-accent); }
+.ascii-char-group { display: inline-flex; gap: 2px; margin-right: 6px; }
+#ascii-canvas-toolbar .toolbar-btn.active { background: var(--t-accent); color: var(--t-bg); }
+
/* Search */
#search { backdrop-filter: blur(4px); }
#search-input { caret-color: var(--t-accent); }
@@ -553,6 +563,7 @@ body.detail-image-fs-open { overflow: hidden; }
.prose code { background: var(--t-bg); border: 1px solid var(--t-border); padding: 0.15em 0.4em; border-radius: 3px; font-size: 0.88em; }
.prose pre { background: var(--t-bg); border: 1px solid var(--t-border); padding: 0.8em 1em; overflow-x: auto; margin: 0.8em 0; border-radius: 3px; position: relative; }
.prose pre code { background: none; border: none; padding: 0; font-size: 0.85em; }
+.prose pre.ascii-art { line-height: 1.35; letter-spacing: 0; white-space: pre; font-size: 0.85em; }
.prose pre .code-copy {
position: absolute; top: 4px; right: 4px;
background: var(--t-surface); border: 1px solid var(--t-border);
diff --git a/public/index.php b/public/index.php
index eea1016..6b13394 100644
--- a/public/index.php
+++ b/public/index.php
@@ -1826,6 +1826,7 @@ if (str_starts_with($route, '/api/')) {
+
@@ -1842,6 +1843,52 @@ if (str_starts_with($route, '/api/')) {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|