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;