diff --git a/.eleventy.js b/.eleventy.js index 522c4dd..0e51f7d 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -31,7 +31,8 @@ export default async function (eleventyConfig) { return (data) => `${data.page.filePathStem}.${data.page.outputFileExtension}`; }); - const demoPath = await hasFiles('source/screens') ? '/demo/' : '/'; + // TODO: Demo entfernen + const permalinkPath = await hasFiles('source/screens') ? '/demo/' : '/'; eleventyConfig.addGlobalData('hippie', { brand: 'hippie', @@ -44,7 +45,7 @@ export default async function (eleventyConfig) { mail: 'name@domain.tld', domain: 'https://domain.tld' }, - demoPath: demoPath, + permalink: permalinkPath, debugMode: true, legacyMode: false }); diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c9dd37..4e82455 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,52 +1,52 @@ -| Commit | Version | Description | -| :--- | :----: | :--- | -| 6095870ce33fd3775718a1de3d33f604fd0630ab | 0.4.2 | Javascript again | -| 50a1a6d9257b272e076c2e3b5bac39c7d17b2793 | 0.5.0 | Changes to content | -| e2bbe9273a292a3806de1599f752258a2721d067 | 0.5.1 | | -| 3d4eef5eb0a1632b43e1e3372e38a70cd4b58914 | 0.5.2 | | -| 371cb450f81cd0d692c9005952af35ec066e01e1 | 0.6.0 | New es6 coding standard | -| 175816c3595d783e7d8b48f5336fbdd54dae145b | 0.6.1 | | -| 67e3cc1eca359bc2b927b8e971ccd7ba71f4c5a2 | 0.6.2 | | -| abeb843718988fab978de7c75d6d45806f5d35a7 | 0.6.3 | | -| 4401761a6bec9db19293353942479aea7bb8ead1 | 0.6.4 | | -| 83464a1cf4ba3efc6382eafb6f68f106c6650161 | 0.6.5 | | -| 6f95393409b502fef9ad9677b3c1ed1fe07ecc28 | 0.6.6 | | -| 63b54f2749ed5a4d9a7a53c27540e7d6f8dff63d | 0.6.7 | | -| 830037f5e5237d33ad66fe89ba45167a62d87829 | 0.6.8 | | -| d205031fff29ee4d48251e30b17090143ae5458c | 0.7.0 | switched to style submodule usage | -| d18254b61d87eb3d09d17b93783117dad7d13686 | 0.7.1 | | -| 9b9b0cb1c631273f574d3cd7618bd799f561db6c | 0.7.2 | | -| 11b30671d4948dfd30b7da14fe7295f386b54257 | 0.7.3 | | -| 767b3024fa3bbededab2a8d665b4b35b55854a1c | 0.7.4 | | -| 5c3cda58b147f16e1b9fdf1ed7b5499651df943d | 0.8.0 | changes to license file and submodule update | -| 8567604ea6b129ded8b0e6108362a30d039235a7 | 0.8.1 | | -| b2ea5b01aa47783b5f797310e16f1897e1839eb9 | 0.9.0 | Requirements updated and new nunjucks variables | -| df064b8a942f00dd3277a9dde696e91324dfd166 | 0.9.1 | | -| d812ed62084c90d4fac18b6c56a6dd3bf9bd7cba | 0.9.2 | | -| 84957f75a017d5d06a32874282d9eb9f3d537534 | 0.9.3 | | -| 489786aadc30bb589be769fe627389611c4f71f5 | 0.9.4 | | -| 003a1159231241140a262ae67bb1236978b22ec0 | 0.9.5 | | -| 731c19dd61215b8f373af9100ad5c23f19a4c2a3 | 0.9.6 | | -| dd5ff43e1695d2de0b5a0a9614c1f31ad7e7b85b | 0.9.7 | | -| dde26ec45eeb8d28a986093b8b5b29d8165e5a11 | 0.9.8 | | -| 06ba1113929183f51e8501d440c950e4b4d9f0d2 | 0.9.9 | | -| 827e6c1cde0aa4ca65e6c170174eae91da9aa4c9 | 0.9.10 | | -| 202729f9ba098b5ff07f6af43acce7a67007cd1b | 0.9.11 | | -| d22828400125f8572cfbe6243e2521ffab519adf | 0.9.12 | | -| bf1a6ca7421a0385f664f864a82850f0805522c0 | 0.9.13 | | -| 32215de810546f6ebd7f552816fc5bf3281a0a13 | 0.9.14 | | -| f7dd7c93e3a06bc430fcf4e12f4be3d3b1aa29c6 | 0.10.0 | Added card and portal modules | -| f54dbe92d912b9e7553a3a2263b009ed05017b0b | 0.10.1 | | -| 6b217b6ebbfcfa2f3e14bdf41e21bb36f88050a5 | 0.10.2 | | -| 534115ff282de4648c294ae78fe768d79e23d379 | 0.10.3 | | -| f7a5481fd2e1d1c96f7e9d82eb2c3db9483b5784 | 0.10.4 | | -| 31e896462e7693a4a6ba10d52657caf919e7f482 | 0.10.5 | | -| 778d7d14d5e8d4dbcce2f9cb996afbc4d7accf27 | 0.11.0 | logPerf without JQuery | -| 1d7f2eb839472524d73f395365ffb43e8fc5d115 | 0.12.0 | Migration to new home | -| 69c04c32349d3d11820da933ed2bbd648fabb040 | 0.12.1 | | -| 9415d4d9573a4f2a4e1c479c74c59abe3a69cd57 | 0.12.2 | | -| 6e7615b44d9ef26ade73a00102878804272cf717 | 0.12.3 | | -| b6ec313f26dde6b379da16edb65de082c6ca9b65 | 0.12.4 | | -| e856e5311439d5a64478f7cda79998476ebdfe33 | 0.12.5 | | -| ef9d665849f370b2284ae8d985d9625b5083fe37 | 0.13.0 | Introduced 11ty | -| 3358e1858bc764e520dad65cc614c842b4f66245 | 0.13.1 | | \ No newline at end of file +| Commit | Version | Description | +|:-----------------------------------------|:-------:|:------------------------------------------------| +| 6095870ce33fd3775718a1de3d33f604fd0630ab | 0.4.2 | Javascript again | +| 50a1a6d9257b272e076c2e3b5bac39c7d17b2793 | 0.5.0 | Changes to content | +| e2bbe9273a292a3806de1599f752258a2721d067 | 0.5.1 | | +| 3d4eef5eb0a1632b43e1e3372e38a70cd4b58914 | 0.5.2 | | +| 371cb450f81cd0d692c9005952af35ec066e01e1 | 0.6.0 | New es6 coding standard | +| 175816c3595d783e7d8b48f5336fbdd54dae145b | 0.6.1 | | +| 67e3cc1eca359bc2b927b8e971ccd7ba71f4c5a2 | 0.6.2 | | +| abeb843718988fab978de7c75d6d45806f5d35a7 | 0.6.3 | | +| 4401761a6bec9db19293353942479aea7bb8ead1 | 0.6.4 | | +| 83464a1cf4ba3efc6382eafb6f68f106c6650161 | 0.6.5 | | +| 6f95393409b502fef9ad9677b3c1ed1fe07ecc28 | 0.6.6 | | +| 63b54f2749ed5a4d9a7a53c27540e7d6f8dff63d | 0.6.7 | | +| 830037f5e5237d33ad66fe89ba45167a62d87829 | 0.6.8 | | +| d205031fff29ee4d48251e30b17090143ae5458c | 0.7.0 | switched to style submodule usage | +| d18254b61d87eb3d09d17b93783117dad7d13686 | 0.7.1 | | +| 9b9b0cb1c631273f574d3cd7618bd799f561db6c | 0.7.2 | | +| 11b30671d4948dfd30b7da14fe7295f386b54257 | 0.7.3 | | +| 767b3024fa3bbededab2a8d665b4b35b55854a1c | 0.7.4 | | +| 5c3cda58b147f16e1b9fdf1ed7b5499651df943d | 0.8.0 | changes to license file and submodule update | +| 8567604ea6b129ded8b0e6108362a30d039235a7 | 0.8.1 | | +| b2ea5b01aa47783b5f797310e16f1897e1839eb9 | 0.9.0 | Requirements updated and new nunjucks variables | +| df064b8a942f00dd3277a9dde696e91324dfd166 | 0.9.1 | | +| d812ed62084c90d4fac18b6c56a6dd3bf9bd7cba | 0.9.2 | | +| 84957f75a017d5d06a32874282d9eb9f3d537534 | 0.9.3 | | +| 489786aadc30bb589be769fe627389611c4f71f5 | 0.9.4 | | +| 003a1159231241140a262ae67bb1236978b22ec0 | 0.9.5 | | +| 731c19dd61215b8f373af9100ad5c23f19a4c2a3 | 0.9.6 | | +| dd5ff43e1695d2de0b5a0a9614c1f31ad7e7b85b | 0.9.7 | | +| dde26ec45eeb8d28a986093b8b5b29d8165e5a11 | 0.9.8 | | +| 06ba1113929183f51e8501d440c950e4b4d9f0d2 | 0.9.9 | | +| 827e6c1cde0aa4ca65e6c170174eae91da9aa4c9 | 0.9.10 | | +| 202729f9ba098b5ff07f6af43acce7a67007cd1b | 0.9.11 | | +| d22828400125f8572cfbe6243e2521ffab519adf | 0.9.12 | | +| bf1a6ca7421a0385f664f864a82850f0805522c0 | 0.9.13 | | +| 32215de810546f6ebd7f552816fc5bf3281a0a13 | 0.9.14 | | +| f7dd7c93e3a06bc430fcf4e12f4be3d3b1aa29c6 | 0.10.0 | Added card and portal modules | +| f54dbe92d912b9e7553a3a2263b009ed05017b0b | 0.10.1 | | +| 6b217b6ebbfcfa2f3e14bdf41e21bb36f88050a5 | 0.10.2 | | +| 534115ff282de4648c294ae78fe768d79e23d379 | 0.10.3 | | +| f7a5481fd2e1d1c96f7e9d82eb2c3db9483b5784 | 0.10.4 | | +| 31e896462e7693a4a6ba10d52657caf919e7f482 | 0.10.5 | | +| 778d7d14d5e8d4dbcce2f9cb996afbc4d7accf27 | 0.11.0 | logPerf without JQuery | +| 1d7f2eb839472524d73f395365ffb43e8fc5d115 | 0.12.0 | Migration to new home | +| 69c04c32349d3d11820da933ed2bbd648fabb040 | 0.12.1 | | +| 9415d4d9573a4f2a4e1c479c74c59abe3a69cd57 | 0.12.2 | | +| 6e7615b44d9ef26ade73a00102878804272cf717 | 0.12.3 | | +| b6ec313f26dde6b379da16edb65de082c6ca9b65 | 0.12.4 | | +| e856e5311439d5a64478f7cda79998476ebdfe33 | 0.12.5 | | +| ef9d665849f370b2284ae8d985d9625b5083fe37 | 0.13.0 | Introduced 11ty | +| 3358e1858bc764e520dad65cc614c842b4f66245 | 0.13.1 | | \ No newline at end of file diff --git a/source/code/hippie/app.js b/source/code/hippie/app.js index eb6eda9..e68fa40 100644 --- a/source/code/hippie/app.js +++ b/source/code/hippie/app.js @@ -1,3 +1,5 @@ +/* jshint strict: false */ + // TODO: Inhalte angleichen nach Zusammenfassung von app.js und function.js. // Benennung und Beschreibungen verbessern. @@ -190,13 +192,13 @@ function composeMail(tag, name, prov, suffix, text, topic) { el.innerHTML = elContent + text; el.setAttribute('href', 'mailto:' + mailString + topic); } else { - const els = document.getElementsByClassName(tag.slice(1)); + const elements = document.getElementsByClassName(tag.slice(1)); - for (let el of els) { - const elContent = el.innerHTML; + for (const element of elements) { + const content = element.innerHTML; - el.innerHTML = elContent + text; - el.setAttribute('href', 'mailto:' + mailString + topic); + element.innerHTML = content + text; + element.setAttribute('href', 'mailto:' + mailString + topic); } } } @@ -424,10 +426,10 @@ function randomIntFrom(min, max, pos = 0) { return Math.floor((Math.random() * (max - min + 1) + min) / pos) * pos; } -function randomFloatFrom(min, max, dec = 0) { +function randomFloatFrom(min, max, dec = 1) { dec = Math.pow(10, dec); - return Math.round((Math.random() * (max - min + 1) + min) * dec) / dec; + return Math.round((Math.random() * (max - min) + min) * dec) / dec; } /** @@ -554,6 +556,62 @@ function zeroFill(number, width) { // Retrieved 2026-03-08, License - CC BY-SA 4.0 const delay = ms => new Promise(res => setTimeout(res, ms)); +class RandomPixelCanvas { + constructor(containerElement, options = {}) { + this.container = containerElement; + this.width = options.width || 400; + this.height = options.height || 300; + this.colors = options.colors || ['#000000', '#ffffff']; + this.filter = options.filter || ''; + this.canvas = this.createCanvas(); + + this.fillWithRandomPixels(); + } + + createCanvas() { + const canvas = document.createElement('canvas'); + canvas.width = this.width; + canvas.height = this.height; + canvas.style.filter = this.filter; + + this.container.appendChild(canvas); + + return canvas; + } + + fillWithRandomPixels() { + const ctx = this.canvas.getContext('2d'); + const imageData = ctx.createImageData(this.width, this.height); + const data = imageData.data; + + for (let i = 0; i < data.length; i += 4) { + const color = this.getRandomColor(); + const rgb = this.hexToRgb(color); + + data[i] = rgb.r; // Red + data[i + 1] = rgb.g; // Green + data[i + 2] = rgb.b; // Blue + data[i + 3] = 255; // Alpha + } + + ctx.putImageData(imageData, 0, 0); + } + + getRandomColor() { + return this.colors[Math.floor(Math.random() * this.colors.length)]; + } + + hexToRgb(hex) { + const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + + return result ? { + r: parseInt(result[1], 16), + g: parseInt(result[2], 16), + b: parseInt(result[3], 16) + } : {r: 0, g: 0, b: 0}; + } +} + // CONCEPTS // NOTE: Benutzt private Zuweisungen diff --git a/source/data/menu.json b/source/data/menu.json new file mode 100644 index 0000000..f437630 --- /dev/null +++ b/source/data/menu.json @@ -0,0 +1,18 @@ +[ + { + "text": "New", + "href": "#new" + }, + { + "text": "Continue", + "href": "#continue" + }, + { + "text": "Settings", + "href": "#options" + }, + { + "text": "Leave", + "href": "/" + } +] \ No newline at end of file diff --git a/source/screens/demo/basics.liquid b/source/screens/demo/basics.liquid index f1c8560..d607592 100644 --- a/source/screens/demo/basics.liquid +++ b/source/screens/demo/basics.liquid @@ -208,7 +208,7 @@ order: 2
Fahne
{% comment %}// TODO: Durch Platzhalter ersetzten und Prozentangaben ermöglichen{% endcomment %} - Flag @@ -243,7 +243,7 @@ order: 2

Textebene

Verweise

-

Ein wesentlicher Bestandteil von Hypertext sind Verweise +

- diff --git a/source/screens/demo/examples/game/menu.liquid b/source/screens/demo/examples/game/menu.liquid index 7852bdb..c29a2ed 100644 --- a/source/screens/demo/examples/game/menu.liquid +++ b/source/screens/demo/examples/game/menu.liquid @@ -3,24 +3,11 @@ title: Menu tags: - game --- -{% assign bodyClass = 'body_game' -%} +{% assign bodyClass = 'body_menu' -%} {% layout 'hippie/simple.liquid' %} {% block body %} -
- -
+{% render 'hippie/partials/game-menu.liquid', links: menu %}