diff --git a/.jshintrc b/.jshintrc index 7fe438c..134e601 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,85 +1,33 @@ { - "maxerr": 50, "bitwise": true, - "camelcase": false, - "curly": false, + "curly": true, + "devel": true, "eqeqeq": true, + "esversion": 9, "forin": true, "freeze": true, - "immed": false, - "latedef": true, - "newcap": true, + "jquery": true, "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, + "undef": true, + "unused": 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, "globals": { - "debugOn": true, + "HIPPIE": false, "hippie": true, "viewHover": true, "basicEase": true, + "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 } } 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 e5a26b8..f00f364 100644 --- a/source/code/hippie/app.js +++ b/source/code/hippie/app.js @@ -405,6 +405,60 @@ 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; +} + +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
. + * + * @param {string} text + * @returns {string} + */ +function replaceLineBreaks(text) { + if (text === '' || !text.includes('\n')) { + return 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/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. */ 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 %} + +{% endblock %} \ No newline at end of file diff --git a/source/style/hippie-style b/source/style/hippie-style index 4e4f881..0623e81 160000 --- a/source/style/hippie-style +++ b/source/style/hippie-style @@ -1 +1 @@ -Subproject commit 4e4f8814d319c2f2a26a3ae5ab1c812e1aac8483 +Subproject commit 0623e818a49176ca7516a88943e07a882ba5262d 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; 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;