diff --git a/.jshintrc b/.jshintrc index 134e601..7fe438c 100644 --- a/.jshintrc +++ b/.jshintrc @@ -1,33 +1,85 @@ { + "maxerr": 50, "bitwise": true, - "curly": true, - "devel": true, + "camelcase": false, + "curly": false, "eqeqeq": true, - "esversion": 9, "forin": true, "freeze": true, - "jquery": true, + "immed": false, + "latedef": true, + "newcap": true, "noarg": true, "noempty": true, - "strict": true, + "nonbsp": true, + "nonew": false, + "plusplus": false, + "quotmark": true, "undef": true, - "unused": false, + "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, "globals": { - "HIPPIE": false, + "debugOn": true, "hippie": true, "viewHover": true, "basicEase": true, - "debugOn": true, "TimeDisplay": true, "DateDisplay": true, - "checkButtonAndTarget": false, - "getClosestEdgeToElement": false, - "getClosestEdgeToMouse": false, - "centerElementUnderCursor": false, - "setAttributesAccordingToPosition": false, - "randomIntFrom": false, - "replaceLineBreaks": false, + "checkButtonAndTarget": true, + "getClosestEdgeToElement": true, + "getClosestEdgeToMouse": true, + "centerElementUnderCursor": true, + "setAttributesAccordingToPosition": true, "HippieTaskBar": true } } diff --git a/source/code/drag.js b/source/code/drag.js index 7bdd8e9..01a489a 100644 --- a/source/code/drag.js +++ b/source/code/drag.js @@ -113,3 +113,15 @@ 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 f00f364..e5a26b8 100644 --- a/source/code/hippie/app.js +++ b/source/code/hippie/app.js @@ -405,60 +405,6 @@ 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 bff5a87..341df5e 100644 --- a/source/code/intro.js +++ b/source/code/intro.js @@ -272,6 +272,24 @@ 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 7b46674..fe8ef43 100755 --- a/source/screens/demo/examples/ui/drag.liquid +++ b/source/screens/demo/examples/ui/drag.liquid @@ -22,7 +22,6 @@ tags: {% endblock %} {%- block script %} - -{% endblock %} \ No newline at end of file diff --git a/source/style/hippie-style b/source/style/hippie-style index 0623e81..4e4f881 160000 --- a/source/style/hippie-style +++ b/source/style/hippie-style @@ -1 +1 @@ -Subproject commit 0623e818a49176ca7516a88943e07a882ba5262d +Subproject commit 4e4f8814d319c2f2a26a3ae5ab1c812e1aac8483 diff --git a/source/style/modules/ui/_gallery_module.scss b/source/style/modules/ui/_gallery_module.scss index 06803fb..4f8a233 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"; -main.io section > .gallery { +.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 deleted file mode 100644 index 51896f4..0000000 --- a/source/style/modules/ui/_table_module.scss +++ /dev/null @@ -1,17 +0,0 @@ -@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 861adf8..da6ecf7 100644 --- a/source/style/ui.scss +++ b/source/style/ui.scss @@ -10,7 +10,6 @@ @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;