From 148f4e0a21cb6e5576ecafaa3d381ed5021e5855 Mon Sep 17 00:00:00 2001 From: sthag Date: Thu, 12 Feb 2026 18:36:06 +0100 Subject: [PATCH 1/7] chore: Update jshint Remove unused options and environments. --- .jshintrc | 73 ++++++++----------------------------------------------- 1 file changed, 10 insertions(+), 63 deletions(-) diff --git a/.jshintrc b/.jshintrc index 7fe438c..29388b2 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,78 +1,25 @@ { - "maxerr": 50, "bitwise": true, - "camelcase": false, - "curly": false, + "browser": true, + "curly": true, + "devel": true, "eqeqeq": true, + "esversion": 9, "forin": true, "freeze": true, - "immed": false, - "latedef": true, - "newcap": true, + "jquery": true, + "maxerr": 50, "noarg": true, "noempty": true, - "nonbsp": true, - "nonew": false, - "plusplus": false, - "quotmark": true, - "undef": true, - "unused": true, "strict": true, - "maxparams": false, - "maxdepth": false, - "maxstatements": false, - "maxcomplexity": false, - "maxlen": false, - "varstmt": false, - "asi": false, - "boss": false, - "debug": false, - "eqnull": false, - "esversion": 9, - "moz": false, - "evil": false, - "expr": false, - "funcscope": false, - "globalstrict": false, - "iterator": false, - "lastsemic": false, - "laxbreak": false, - "laxcomma": false, - "loopfunc": false, - "multistr": false, - "noyield": false, - "notypeof": false, - "proto": false, - "scripturl": false, - "shadow": false, - "sub": false, - "supernew": false, - "validthis": false, - "browser": true, - "browserify": false, - "couch": false, - "devel": true, - "dojo": false, - "jasmine": false, - "jquery": true, - "mocha": true, - "mootools": false, - "node": false, - "nonstandard": false, - "phantom": false, - "prototypejs": false, - "qunit": false, - "rhino": false, - "shelljs": false, - "typed": false, - "worker": false, - "wsh": false, - "yui": false, + "undef": true, + "unused": false, "globals": { - "debugOn": true, + "HIPPIE": false, "hippie": true, "viewHover": true, "basicEase": true, + "debugOn": true, "TimeDisplay": true, "DateDisplay": true, "checkButtonAndTarget": true, From ddbd406fc875c39db6711fb0aded668216864d8e Mon Sep 17 00:00:00 2001 From: sthag Date: Fri, 13 Feb 2026 11:27:44 +0100 Subject: [PATCH 2/7] feat: Move function to app scope - Move randomIntFrom() to app.js - Add global entry to jshint configuration --- .jshintrc | 2 ++ source/code/hippie/app.js | 18 ++++++++++++++++++ source/code/intro.js | 18 ------------------ 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.jshintrc b/.jshintrc index 29388b2..cd80937 100644 --- a/.jshintrc +++ b/.jshintrc @@ -27,6 +27,8 @@ "getClosestEdgeToMouse": true, "centerElementUnderCursor": true, "setAttributesAccordingToPosition": true, + "randomIntFrom": false, + "replaceLineBreaks": false, "HippieTaskBar": true } } diff --git a/source/code/hippie/app.js b/source/code/hippie/app.js index e5a26b8..9fa1e9d 100644 --- a/source/code/hippie/app.js +++ b/source/code/hippie/app.js @@ -405,6 +405,24 @@ function setAttributesAccordingToPosition(element, position, attributes) { }); } +/** + * Gibt eine Zahl zwischen und aus. + * Die Werte und sind dabei mit eingeschlossen. + * Mit kann der Exponent für eine 10er-Teilung angegeben werden. + * + * @param {number} min + * @param {number} max + * @param {number} pos + * @returns {number} + */ +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) / pos) * pos; +} + // CONCEPTS // NOTE: Benutzt private Zuweisungen diff --git a/source/code/intro.js b/source/code/intro.js index 341df5e..bff5a87 100644 --- a/source/code/intro.js +++ b/source/code/intro.js @@ -272,24 +272,6 @@ function loadCore() { }); } -/** - * Gibt eine Zahl zwischen und aus. - * Die Werte und sind dabei mit eingeschlossen. - * Mit kann der Exponent für eine 10er-Teilung angegeben werden. - * - * @param {number} min - * @param {number} max - * @param {number} pos - * @returns {number} - */ -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) / pos) * pos; -} - /** * Erstellt Kontext für hint-Objekt und ermöglicht das Entfernen des Ereignis. */ From 1b3a320b17dcfca3510681246d01735d58651032 Mon Sep 17 00:00:00 2001 From: sthag Date: Fri, 13 Feb 2026 11:39:52 +0100 Subject: [PATCH 3/7] feat: New table screen for ui - Add table screen to ui examples - Display table with placeholder content - Add global function replaceLineBreaks() --- source/code/hippie/app.js | 14 +++ source/screens/demo/examples/ui/table.liquid | 101 +++++++++++++++++++ source/style/modules/ui/_table_module.scss | 17 ++++ source/style/ui.scss | 1 + 4 files changed, 133 insertions(+) create mode 100755 source/screens/demo/examples/ui/table.liquid create mode 100644 source/style/modules/ui/_table_module.scss diff --git a/source/code/hippie/app.js b/source/code/hippie/app.js index 9fa1e9d..2e69574 100644 --- a/source/code/hippie/app.js +++ b/source/code/hippie/app.js @@ -423,6 +423,20 @@ function randomIntFrom(min, max, pos = 0) { return Math.floor((Math.random() * (max - min + 1) + min) / pos) * pos; } +/** + * Ersetzt \n durch
. + * + * @param {string} text + * @returns {string} + */ +function replaceLineBreaks(text) { + if (text === '' || !text.includes('\n')) { + return text; + } + + return text.split('\n').join('
'); +} + // CONCEPTS // NOTE: Benutzt private Zuweisungen diff --git a/source/screens/demo/examples/ui/table.liquid b/source/screens/demo/examples/ui/table.liquid new file mode 100755 index 0000000..654a865 --- /dev/null +++ b/source/screens/demo/examples/ui/table.liquid @@ -0,0 +1,101 @@ +--- +title: Table +tags: +- ui +--- +{% assign bodyClass = "body_frame" -%} +{% layout "hippie/app.liquid" %} + +{% block body %} +{% render 'hippie/partials/frame-header.liquid' %} +
+
+
+ + +
+ + + + + + + + + + + +
#namerandomdescription
+ {% render 'hippie/partials/frame-status.liquid' %} +
+
+ +{% render 'hippie/partials/frame-mode.liquid' %} +{% endblock %} + +{%- block script %} +{{ block.super -}} + +{% endblock %} \ No newline at end of file diff --git a/source/style/modules/ui/_table_module.scss b/source/style/modules/ui/_table_module.scss new file mode 100644 index 0000000..51896f4 --- /dev/null +++ b/source/style/modules/ui/_table_module.scss @@ -0,0 +1,17 @@ +@use "../../hippie-style/hippie"; + +main.io section > table { + table-layout: auto; + width: 100%; + margin: 0; + background-color: hippie.$color_back_io; + + thead > tr > th:first-child { + width: 1%; + } + + tr > th:first-child { + text-align: center; + } +} + diff --git a/source/style/ui.scss b/source/style/ui.scss index da6ecf7..861adf8 100644 --- a/source/style/ui.scss +++ b/source/style/ui.scss @@ -10,6 +10,7 @@ @use "modules/ui/game_module"; @use "modules/ui/gallery_module"; @use "modules/ui/windows_module"; +@use "modules/ui/table_module"; $color_gui_back: hippie.$color_dark; $space_gui_half: hippie.$space_half; From 57837110804ea49bd7a56b92450e63494f101e2c Mon Sep 17 00:00:00 2001 From: sthag Date: Fri, 13 Feb 2026 11:40:16 +0100 Subject: [PATCH 4/7] chore: Change jshint configuration --- .jshintrc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.jshintrc b/.jshintrc index cd80937..134e601 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,6 +1,5 @@ { "bitwise": true, - "browser": true, "curly": true, "devel": true, "eqeqeq": true, @@ -8,12 +7,12 @@ "forin": true, "freeze": true, "jquery": true, - "maxerr": 50, "noarg": true, "noempty": true, "strict": true, "undef": true, "unused": false, + "browser": true, "globals": { "HIPPIE": false, "hippie": true, @@ -22,11 +21,11 @@ "debugOn": true, "TimeDisplay": true, "DateDisplay": true, - "checkButtonAndTarget": true, - "getClosestEdgeToElement": true, - "getClosestEdgeToMouse": true, - "centerElementUnderCursor": true, - "setAttributesAccordingToPosition": true, + "checkButtonAndTarget": false, + "getClosestEdgeToElement": false, + "getClosestEdgeToMouse": false, + "centerElementUnderCursor": false, + "setAttributesAccordingToPosition": false, "randomIntFrom": false, "replaceLineBreaks": false, "HippieTaskBar": true From 0dfba8e6eecaab1fb4a84a40faadef8a2250d805 Mon Sep 17 00:00:00 2001 From: sthag Date: Fri, 13 Feb 2026 11:41:00 +0100 Subject: [PATCH 5/7] feat: Improve CSS declaration for gallery --- source/style/modules/ui/_gallery_module.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/style/modules/ui/_gallery_module.scss b/source/style/modules/ui/_gallery_module.scss index 4f8a233..06803fb 100644 --- a/source/style/modules/ui/_gallery_module.scss +++ b/source/style/modules/ui/_gallery_module.scss @@ -1,6 +1,6 @@ @use "../../hippie-style/hippie"; -.gallery { +main.io section > .gallery { display: flex; flex-wrap: wrap; justify-content: left; From f83b5aa258520549c07b1956433720158feba065 Mon Sep 17 00:00:00 2001 From: sthag Date: Fri, 13 Feb 2026 17:35:09 +0100 Subject: [PATCH 6/7] feat: Move and add functions - Add global function randomFloatFrom() - Move getRandomColor() to app --- source/code/drag.js | 12 ----------- source/code/hippie/app.js | 22 +++++++++++++++++++++ source/screens/demo/examples/ui/drag.liquid | 1 + 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/source/code/drag.js b/source/code/drag.js index 01a489a..7bdd8e9 100644 --- a/source/code/drag.js +++ b/source/code/drag.js @@ -113,15 +113,3 @@ class NewDiv { space.appendChild(this.element); } } - -// Function to generate a random color -function getRandomColor() { - const letters = '0123456789ABCDEF'; - let color = '#'; - - for (let i = 0; i < 6; i++) { - color += letters[Math.floor(Math.random() * 16)]; - } - - return color; -} diff --git a/source/code/hippie/app.js b/source/code/hippie/app.js index 2e69574..f00f364 100644 --- a/source/code/hippie/app.js +++ b/source/code/hippie/app.js @@ -423,6 +423,12 @@ function randomIntFrom(min, max, pos = 0) { return Math.floor((Math.random() * (max - min + 1) + min) / pos) * pos; } +function randomFloatFrom(min, max, dec = 0) { + dec = Math.pow(10, dec); + + return Math.round((Math.random() * (max - min + 1) + min) * dec) / dec; +} + /** * Ersetzt \n durch
. * @@ -437,6 +443,22 @@ function replaceLineBreaks(text) { return text.split('\n').join('
'); } +/** + * Gibt eine zufällige Farbe als HEX-Wert aus. + * + * @returns {string} + */ +function getRandomColor() { + const letters = '0123456789ABCDEF'; + let color = '#'; + + for (let i = 0; i < 6; i++) { + color += letters[Math.floor(Math.random() * 16)]; + } + + return color; +} + // CONCEPTS // NOTE: Benutzt private Zuweisungen diff --git a/source/screens/demo/examples/ui/drag.liquid b/source/screens/demo/examples/ui/drag.liquid index fe8ef43..7b46674 100755 --- a/source/screens/demo/examples/ui/drag.liquid +++ b/source/screens/demo/examples/ui/drag.liquid @@ -22,6 +22,7 @@ tags: {% endblock %} {%- block script %} +