From 780eb6a8066d32abf8cb8dd0bb9ccdeb9b38662c Mon Sep 17 00:00:00 2001 From: sthag Date: Sat, 28 Mar 2026 19:10:45 +0100 Subject: [PATCH 1/5] feat: Add matrix screen --- source/screens/demo/examples/matrix.liquid | 242 +++++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 source/screens/demo/examples/matrix.liquid diff --git a/source/screens/demo/examples/matrix.liquid b/source/screens/demo/examples/matrix.liquid new file mode 100644 index 0000000..1e2c266 --- /dev/null +++ b/source/screens/demo/examples/matrix.liquid @@ -0,0 +1,242 @@ +--- +title: Matrix +tags: +- demoExample +--- +{% layout 'hippie/simple.liquid' %} + +{% block style %} + +{% endblock %} + +{% block body %} + +
Canvas element not supported.
+
+
+ A +
+{% endblock %} + +{% block script %} + +{% endblock %} \ No newline at end of file From 8fe884aad6d7150fa3a7db4ebd7d2c3a8e1aaa75 Mon Sep 17 00:00:00 2001 From: sthag Date: Sat, 28 Mar 2026 19:21:59 +0100 Subject: [PATCH 2/5] feat: Change matrix Add change function and test in console. --- source/screens/demo/examples/matrix.liquid | 41 +++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/source/screens/demo/examples/matrix.liquid b/source/screens/demo/examples/matrix.liquid index 1e2c266..5685600 100644 --- a/source/screens/demo/examples/matrix.liquid +++ b/source/screens/demo/examples/matrix.liquid @@ -56,16 +56,19 @@ tags: const cEl = document.getElementById('container'); let createId = undefined; + let changeId = undefined; let holdId = undefined; let cleanId = undefined; let createInterval = 300; - let holdInterval = 5000; + let changeInterval = 300; + let holdInterval = 1000; let cleanInterval = 1000; let bodyHeight = Math.max(document.body.offsetHeight, document.body.clientHeight, 0); let glyphY = parseInt(window.getComputedStyle(glyphEl).top); let glyphW = glyphEl.offsetWidth; let glyphH = glyphEl.offsetHeight; let maxHeight = bodyHeight - glyphY - 2 * 16; + let index = 0; cEl.style.display = 'none'; @@ -226,17 +229,47 @@ tags: } // containerTrail(0, cEl); - window.addEventListener("load", canvasTrail); + // window.addEventListener("load", canvasTrail); + + /** + * Change glyph + */ + console.log("init", changeInterval); + changeId = setInterval(change, changeInterval); + + function change() { + clearInterval(holdId); + let char = characters.charAt(Math.floor(Math.random() * characters.length)); + console.log(index, char); + + index++; + + if (index > 10) { + clearInterval(changeId); + index = 0; + changeInterval = randomIntFrom(100, 1000, 2); + console.clear(); + console.log("hold", holdInterval); + + holdId = setTimeout(() => { + holdInterval = randomIntFrom(1000, 10000, 3); + + console.log("change", changeInterval); + changeId = setInterval(change, changeInterval); + }, holdInterval); + } + } function randomBetween(min, max) { return (Math.random() * (max - min) + min).toFixed(2); } - function randomIntFrom(min, max) { + function randomIntFrom(min, max, pos = 0) { + pos = Math.pow(10, pos); min = Math.ceil(min); max = Math.floor(max); - return Math.floor(Math.random() * (max - min + 1) + min); + return Math.floor((Math.random() * (max - min + 1) + min) / pos) * pos; } {% endblock %} \ No newline at end of file From c1633e0bc9ae8a70e8b7661446d294426e07a9d3 Mon Sep 17 00:00:00 2001 From: sthag Date: Sat, 28 Mar 2026 19:44:07 +0100 Subject: [PATCH 3/5] feat: Change matrix - Use blocks for now - Hold and clean for line - Only one line for now --- source/screens/demo/examples/matrix.liquid | 294 ++++++--------------- 1 file changed, 83 insertions(+), 211 deletions(-) diff --git a/source/screens/demo/examples/matrix.liquid b/source/screens/demo/examples/matrix.liquid index 5685600..8306978 100644 --- a/source/screens/demo/examples/matrix.liquid +++ b/source/screens/demo/examples/matrix.liquid @@ -7,255 +7,127 @@ tags: {% block style %} {% endblock %} {% block body %} - -
Canvas element not supported.
-
-
- A -
+ {% endblock %} {% block script %}