feat: Change file structure
- Move return object to named export for 11ty config - screens is now view - 11ty data files moved to view/_data - templates is now view/_includes - Both are the default directories - data is now used as intended, for user data - Update index to reflect filenames and structure
This commit is contained in:
parent
610e22b3c9
commit
b67a8a893a
78 changed files with 21 additions and 19 deletions
975
source/view/demo/basics.liquid
Normal file
975
source/view/demo/basics.liquid
Normal file
|
|
@ -0,0 +1,975 @@
|
|||
---
|
||||
title: Basics
|
||||
tags:
|
||||
- demoIndex
|
||||
order: 2
|
||||
---
|
||||
{% layout 'hippie/page.liquid' %}
|
||||
|
||||
{% block title %}Grundlagen{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<div class="demo__intro">
|
||||
Dies ist einfach nur Text.<br>Weniger wäre nichts, denn dieser Text ist nicht durch ein spezifisches Element
|
||||
umschlossen.<br>Das ist normalerweise nicht vorgesehen und wird hier nur zur Einführung und Anschauung
|
||||
verwendet.<br><br>
|
||||
<article>
|
||||
<p>Es wirken nur die Eigenschaften des
|
||||
<code><body></code>
|
||||
Elements. Dieses Element umschließt den gesamten Inhalt des Dokumentes und kommt daher nur einmal vor.
|
||||
Inhalte sind normalerweise durch Elemente definiert. Grundlegende Elemente teilen das Dokument zunächst in
|
||||
Abschnitte.</p>
|
||||
<h1 id="sections">Bereiche</h1>
|
||||
<section>
|
||||
<p>Ein Abschnitt, welcher für sich alleine stehen kann, definiert sich durch
|
||||
<code><article></code>. Solch ein Element wird oft detailliert gestaltet, kommt aber auch ohne
|
||||
jegliche Gestaltung aus.</p>
|
||||
<p>Noch allgemeiner ist das
|
||||
<code><section></code>
|
||||
Element. Es schafft Bereiche, um Inhalte zu strukturieren.</p>
|
||||
<p>Bestimmte Bereiche haben einen vorgegebenen Zweck.<br>Folgende Bereiche sind vorgegeben:</p>
|
||||
</section>
|
||||
<!-- <div class="overflow"> -->
|
||||
<aside class="left">
|
||||
<p>Ein Bereich, der seitlich zum hauptsächlichen Inhalt verläuft, wird mit
|
||||
<code><aside></code>
|
||||
markiert.</p>
|
||||
</aside>
|
||||
<section class="bside">
|
||||
<header>
|
||||
<p>Um einleitenden Inhalt festzuhalten, wird das
|
||||
<code><header></code>
|
||||
Element eingesetzt. Es beinhaltet häufig auch Navigationselemente. Dabei bezieht es sich auf den
|
||||
nächsten, umgebenden Abschnitt.</p>
|
||||
<nav>
|
||||
<p>Das Element
|
||||
<code><nav></code>
|
||||
umfasst Elemente, die zur Navigation innerhalb des Dokumentes dienen.</p>
|
||||
</nav>
|
||||
</header>
|
||||
<footer>
|
||||
<p>Auch abschließender Inhalt kann für einen Abschnitt definiert werden. Dazu wird
|
||||
<code><footer></code>
|
||||
eingesetzt.</p>
|
||||
</footer>
|
||||
</section>
|
||||
<!-- </div> -->
|
||||
<p>Zur feineren Strukturierung und Gliederung von Texten sind einige weitere Elemente verfügbar. Diese werden
|
||||
nun der Reihe nach aufgeführt. Zu Beginn die Überschriften, da sie noch zu den Abschnitten gehören. Das
|
||||
kommt vermutlich daher, da Abschnitte häufig eine kennzeichnende Überschrift beinhalten.</p>
|
||||
<h1>Überschrift 1</h1>
|
||||
<p>Eine Überschrift erster Ordnung
|
||||
<code><h1></code>
|
||||
ist sehr groß und steht daher oft außerhalb eines Textflusses. Sie schafft eine deutliche Trennung sowohl
|
||||
inhaltlich wie auch optisch. Sie erzeugt einen Abstand gleich der horizontalen Linie über sich.</p>
|
||||
<h2>Überschrift 2</h2>
|
||||
<p>Die weiteren Überschriften
|
||||
<code><h2></code>
|
||||
bis
|
||||
<code><h6></code>
|
||||
gliedern Text und werden auch als Titel für andere Elemente eingesetzt.</p>
|
||||
<h3>Überschrift 3 ist in Großbuchstaben gesetzt</h3>
|
||||
<h4>Überschrift 4 verwendet normale Buchstaben und gleicht ansonsten Überschrift 3</h4>
|
||||
<h5>Überschrift 5 ist Überschrift 5</h5>
|
||||
<hgroup>
|
||||
<h6>Überschrift 6</h6>
|
||||
<p>Überschriften können mit dem Element <code><hgroup></code> mit Absätzen gruppiert werden, um
|
||||
beispielsweise Untertitel abzubilden.</p>
|
||||
</hgroup>
|
||||
</article>
|
||||
<article>
|
||||
<h1 id="grouping">Gruppierung</h1>
|
||||
<p>Ein Absatz
|
||||
<code><p></code>. Zugegeben ein kurzer.</p>
|
||||
<p>Aus mehreren Absätzen wird ein ganzer Text. Solche Texte haben gelegentlich großen informativen oder
|
||||
unterhaltsamen Charakter.<br>Einfache Zeilenumbrüche werden darin mit
|
||||
<code><br></code>
|
||||
erreicht. Dies ist allerdings ein Element der Textebene und keine Gruppierung.</p>
|
||||
<p>Die Unterteilung in Absätze ist eine von vielen Möglichkeiten Texte zu gruppieren und ihnen Struktur zu
|
||||
verleihen. In diesem Dokument flattert Text normalerweise von Links daher. Er ist schwarz und in einer
|
||||
serifenlosen Schrift gesetzt. Zu weiteren Formatierungen, die eher auf einer Ebene der Zeichen einzuordnen
|
||||
ist, wird im Verlauf näher eingegangen. Zunächst die Struktur:</p>
|
||||
<p class="txt_center js_pop">Text sitzt gerne auch mal zentriert.</p>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">p.txt_center</code>
|
||||
</div>
|
||||
<p class="txt_right js_pop">Rechtsbündig ist schon eher eine Ausnahme bzw. Besonderheit.</p>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">p.txt_right</code>
|
||||
</div>
|
||||
<address>Das Element
|
||||
<code><address></code>
|
||||
hat den Zweck, Kontaktinformationen bereitzustellen. Diese werden, je nach Position des Elements im
|
||||
Kontext der gesamten Seite, anders gewertet.
|
||||
</address>
|
||||
<p>Texte können auf verschiedene Arten unterteilt werden. Dafür werden unterschiedlich formatierte
|
||||
<code><hr></code>
|
||||
Elemente verwendet. Die horizontale Linie ist die Ausgangsformatierung, daher auch der abgekürzte Name des
|
||||
Elements. Eine Linie ist schwarz und durchgezogen.</p>
|
||||
<hr/>
|
||||
<p>Es ist auch eine unsichtbare Unterteilung möglich:</p>
|
||||
<hr class="hidden js_pop"/>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">hr.hidden</code>
|
||||
</div>
|
||||
<p>Die Linie darf auch gepunktet sein. Zudem sind verschiedene Längen möglich. Diese sind immer ein Prozentwert
|
||||
der verfügbaren Breite. Hier in gleicher Reihenfolge 100%, 50% und 25%:</p>
|
||||
<hr class="dotted js_pop"/>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">hr.dotted</code>
|
||||
</div>
|
||||
<hr class="space_even_half js_pop"/>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">hr.space_even_half</code>
|
||||
</div>
|
||||
<hr class="dotted space_even_fourth js_pop"/>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">hr.dotted.space_even_fourth</code>
|
||||
</div>
|
||||
<p class="column_2 js_pop">Zur horizontalen Unterteilung kommt natürlich auch eine vertikale Trennung hinzu.
|
||||
Text kann so zum Beispiel in mehrere Spalten unterteilt werden. Dies ist hilfreich, wenn ein Text durch eine
|
||||
breite Fläche sehr lange Zeilen bekommen würde. Es ist dann schwer den neuen Zeilenanfang zu finden. Die
|
||||
vertikale Trennung dient in erster Linie dazu, diesem Umstand zu begegnen. Auch hier kann die Unterteilung
|
||||
viele Formen annehmen.</p>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">p.column_2</code>
|
||||
</div>
|
||||
<p class="column_3 column_line js_pop">Drei Spalten gilt es jetzt also zu füllen. Dann erst wird die Trennung
|
||||
der Spalten durch eine Linie sichtbar.</p>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">p.column_3.column_line</code>
|
||||
</div>
|
||||
<p class="column_3 column_line">Ist der Text nicht lang genug bleibt eventuell eine Spalte leer. Diesmal wird
|
||||
dies aber nicht passieren, denn das Anschauungsbeispiel ist ja nun durch den vorherigen Absatz schon
|
||||
gegeben.<br>Oft ist es sinnvoll, Absätze mit mehreren Spalten deutlich von nachfolgenden Absätzen zu
|
||||
trennen. Da der Textfluss spaltenweise verläuft, liest man eventuell an der falschen Stelle weiter.<br>Auch
|
||||
das zeigen diese beiden Absätze ganz gut.</p>
|
||||
<p>Es gibt die Möglichkeit vorformatierten Text darzustellen
|
||||
<code><pre></code>.</p>
|
||||
<pre>dadurch<br> bleiben<br> einrückungen<br> durch<br> tabulatoren<br> erhalten.</pre>
|
||||
<p>Wird Bezug auf fremde Inhalte genommen, kommt ein Zitat
|
||||
<code><blockquote></code>
|
||||
zur Anwendung. Es besteht aus der Aussage und der Quelle.</p>
|
||||
<blockquote class="js_pop" cite="https://de.wikipedia.org/wiki/Zitat/">
|
||||
<p>Ein Zitat (das, lateinisch citatum „Angeführtes, Aufgerufenes“ zu lat. citāre „in Bewegung setzen,
|
||||
vorladen“, vgl. „jemanden vor Gericht zitieren“) ist eine wörtlich übernommene Stelle aus einem Text
|
||||
oder ein Hinweis auf eine bestimmte Textstelle.</p>
|
||||
<p class="quote_source">
|
||||
<a href="https://de.wikipedia.org/wiki/Zitat/">Wikipedia</a>
|
||||
</p>
|
||||
</blockquote>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">blockquote>p+p.quote_source</code>
|
||||
</div>
|
||||
<p>Gerade bei wörtlichen Zitierungen kommt häufig das Anführungszeichen zum Einsatz. Es kann durch die
|
||||
Formatierung automatisch ergänzt werden.</p>
|
||||
<blockquote class="quote_mark js_pop" cite="">
|
||||
<p>Das kannst du schon so machen aber dann isses halt Kacke.</p>
|
||||
<p class="quote_source">o. V.</p>
|
||||
</blockquote>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">blockquote.quote_mark>p+p.quote_source</code>
|
||||
</div>
|
||||
<h2>Listen</h2>
|
||||
<p>Text bekommt durch Listen besondere optische wie auch inhaltliche Struktur. Es gibt ungeordnete
|
||||
<code><ul></code>
|
||||
und geordnete Listen
|
||||
<code><ol></code>
|
||||
sowie Beschreibungslisten
|
||||
<code><dl></code>. Die beiden ersten Varianten beinhalten das Listenelement
|
||||
<code><li></code>. Beschreibungslisten beinhalten jeweils das Paar von Ausdruck
|
||||
<code><dt></code>
|
||||
und Beschreibung
|
||||
<code><dd></code>. Im Folgenden eine Liste der Listen in ihrer Ausgangskonfiguration:</p>
|
||||
<ul>
|
||||
<li>Ungeordnete</li>
|
||||
<li>Listen</li>
|
||||
</ul>
|
||||
<ul class="list_dash">
|
||||
<li>Verschiedener</li>
|
||||
<li>Art</li>
|
||||
</ul>
|
||||
<ol>
|
||||
<li>Geordnete</li>
|
||||
<li>Liste</li>
|
||||
</ol>
|
||||
<dl>
|
||||
<dt>Beschreibungsliste</dt>
|
||||
<dd>Auch Definitionslisten genannt</dd>
|
||||
<dt>Ausdruck</dt>
|
||||
<dd>Beschreibung</dd>
|
||||
</dl>
|
||||
<p>Auch Inhalte, die nicht in Textform sind, können durch einen Bezug integriert werden. Wie diese Fahne werden
|
||||
sie mit
|
||||
<code><figure></code>
|
||||
umschlossen und tragen eine Bezeichnung, welche mit
|
||||
<code><figcaption></code>
|
||||
ausgezeichnet wird.</p>
|
||||
<figure class="js_pop">
|
||||
<figcaption>Fahne</figcaption>
|
||||
{% comment %}// TODO: Durch Platzhalter ersetzten und Prozentangaben ermöglichen{% endcomment %}
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
||||
y="0px" width="10%" height="10%" viewbox="0 0 1920 1200" preserveaspectratio="xMinYMax slice">
|
||||
<desc>Flag</desc>
|
||||
<rect id="triangle-5" y="0" fill="#273F8B" width="1920" height="1200"/>
|
||||
<polygon id="triangle-6" fill="#8E1F68" points="0,1200 1920,458.25 1920,1200 "/>
|
||||
<polygon id="triangle-7" fill="#D30A51" points="0,1200 1920,522.75 1920,1200 "/>
|
||||
<polygon id="triangle-8" fill="#F2AF13" points="0,1200 1920,741.75 1920,1200 "/>
|
||||
<polygon id="triangle-9" fill="#FAD803" points="0,1200 1920,787.5 1920,1200 "/>
|
||||
<polygon id="triangle-4" fill="#3C579A" points="0,1200 0,0 733.5,0 "/>
|
||||
<polygon id="triangle-3" fill="#B7E0F0" points="0,1200 0,0 688.5,0 "/>
|
||||
<polygon id="triangle-2" fill="#6BC7D9" points="0,1200 0,0 453,0 "/>
|
||||
<polygon id="triangle-1" fill="#52BED1" points="0,1200 0,0 370.5,0 "/>
|
||||
</svg>
|
||||
</figure>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">figure>figcaption+{element}</code>
|
||||
</div>
|
||||
<hr class="hidden">
|
||||
<p>Eine sehr klar definierte Gruppierung stellt das Element
|
||||
<code><main></code>
|
||||
dar. Es umschließt den hauptsächlichen Inhalt des Dokumentes.</p>
|
||||
<p>Eine von sich aus undefinierte Möglichkeit zur Gruppierung von Text besteht durch
|
||||
<code><div></code>. Dieses Element hat, ohne weitere Klassifizierung keine Auswirkungen auf die
|
||||
Erscheinung oder die inhaltliche Aussage. Daher der allgemeine Einsatz.</p>
|
||||
<div class="div_info js_pop">
|
||||
<p>Es wird allerdings häufig eingesetzt und bekommt vielfältige Funktionen zugeordnet wie diese
|
||||
hervorgehobene Information zeigt.</p>
|
||||
</div>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">div.div_info>p</code>
|
||||
</div>
|
||||
</article>
|
||||
<article>
|
||||
<h1 id="textlevel">Textebene</h1>
|
||||
<h2>Verweise</h2>
|
||||
<p id="links">Ein wesentlicher Bestandteil von Hypertext sind <a href="">Verweise</a>
|
||||
<code><a></code>. Sie dienen als Sprungmarken innerhalb des Netzwerks. Es kann grob zwischen internen
|
||||
und externen Verweisen unterschieden werden.
|
||||
<a class="a_internal js_pop" href="#links">Interne Verweise</a>
|
||||
<span class="exp_pop">
|
||||
<code class="code_solo">a.a_line</code>
|
||||
</span>
|
||||
können Verknüpfungen innerhalb des aktuellen Dokumentes sein oder auch Funktionen aktivieren.
|
||||
<a class="a_external" href="https://de.wikipedia.org">Externe Verweise</a>
|
||||
verknüpfen Inhalte über das gesamte Netzwerk hinweg. Sie können zum Beispiel auch auf E-Mail-Adressen oder
|
||||
Dateien zeigen. Theoretisch kann solch ein Verweis
|
||||
<b>alles</b>
|
||||
auslösen. Anweisungen werden im
|
||||
<a href="https://tools.ietf.org/html/rfc1738">URL-Standard</a>
|
||||
übergeben.</p>
|
||||
<p>Nicht nur Text kann als Verweis verwendet werden. Auch andere Elemente wie Bilder können verknüpft werden.
|
||||
Abhängig von ihrer Funktion und ihrem Zweck werden Verweise unterschiedlich formatiert.
|
||||
<a class="a_internal" href="#">Farbige</a>
|
||||
oder
|
||||
<a class="a_line" href="#">unterstrichene Varianten</a>
|
||||
sind einfache Beispiele.</p>
|
||||
<p>Wird der Verweis innerhalb eines
|
||||
<code><nav></code>
|
||||
Elementes notiert, bekommt er die spezielle Bedeutung eines Navigationsverweises innerhalb des Dokumentes
|
||||
oder der Anwendung. Verweise werden dann durchaus auch wie Schaltflächen dargestellt.</p>
|
||||
<nav>
|
||||
<p>
|
||||
<a class="a_button_text" href="#textlevel">↥</a>
|
||||
(Zum Anfang des Abschnitts springen)
|
||||
<a class="a_button_text" href="#">⇫</a>
|
||||
(Zum Anfang der Seite springen)</p>
|
||||
</nav>
|
||||
<nav class="nav_center_old">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="/demo/examples/start.html" class="a_button">Startseite</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button a_internal">Hilfe</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">⌨</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">⋯</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h2>Formatierungen</h2>
|
||||
<p>Texte, Wörter oder Zeichen können vielfältig formatiert werden.</p>
|
||||
<p>Sie können
|
||||
<b>fett</b>
|
||||
<code><b></code>
|
||||
oder
|
||||
<i>kursiv</i>
|
||||
<code><i></code>
|
||||
geschrieben sein.
|
||||
<b>
|
||||
<i>Auch beides ist möglich!</i>?</b>! Sollen sie nicht nur anders
|
||||
<strong>aussehen</strong>, sondern auch
|
||||
<em>eine besondere inhaltliche Bedeutung</em>
|
||||
bekommen, werden sie mit
|
||||
<code><strong></code>
|
||||
und
|
||||
<code><em></code>
|
||||
ausgezeichnet.</p>
|
||||
<p>Das
|
||||
<code><u></code>
|
||||
Element stellt eine Spanne von Text mit einer unartikulierten, wenn auch explizit dargestellten,
|
||||
nicht-textuellen Anmerkung dar, wie z.B. die Beschriftung des Textes als Eigenname wie
|
||||
<u>Interaktionsweise</u>, oder die Beschriftung des Textes als
|
||||
<u>flasch</u>
|
||||
(falsch) geschrieben.</p>
|
||||
<p>Ähnlich ist es mit dem Element
|
||||
<code><small></code>.
|
||||
<small>Es steht für Randnotizen, wird aber häufig auch kleiner dargestellt.</small>
|
||||
</p>
|
||||
<p>Ist ein Text nicht mehr korrekt oder relevant kann er mit
|
||||
<code><s></code>
|
||||
markiert werden:<br>
|
||||
<s>Die Erde ist eine Scheibe.</s>
|
||||
</p>
|
||||
<p>Ein besonderer inhaltlicher Bezug ist der Titel eines Werkes. So was kann mit
|
||||
<code><cite></code>
|
||||
ausgezeichnet werden.
|
||||
<cite>Pulp Fiction</cite>, ist ein super Film - zum Beispiel.</p>
|
||||
<p>Um ein Zitat direkt im Text zu verwenden benutzt man das
|
||||
<code><q></code>
|
||||
Element. Es platziert Anführungszeichen um die Aussage:</p>
|
||||
<p>Sie sagte:
|
||||
<q>Du wolltest staubsaugen!</q><br>Er sagte:
|
||||
<q>Mach' ich morgen.</q>
|
||||
</p>
|
||||
<p>Mit dem
|
||||
<code><dfn></code>
|
||||
Element werden Begriffe definiert. Es wird häufig mit dem Element für Abkürzungen
|
||||
<code><abbr></code>
|
||||
gemeinsam verwendet. Die eigentliche Definition kann dabei auch im Attribut
|
||||
<code>title</code>
|
||||
stehen. Dies ist ein globales Attribut, das erklärende Informationen zu dem Element enthält. Diese wird
|
||||
typischerweise beim darauf Zeigen eingeblendet.</p>
|
||||
<p>
|
||||
<dfn>
|
||||
<abbr title="Hippie interweaves preeminent personal interface elements">HIPPIE</abbr>
|
||||
</dfn>
|
||||
is a recursive acronym for
|
||||
<dfn>Hippie interweaves preeminent personal interface elements</dfn>.</p>
|
||||
<p>Die besondere Auszeichnung
|
||||
<code><ruby></code>
|
||||
<q cite="https://de.wikipedia.org/wiki/Ruby_Annotation">bezeichnet ein Anmerkungssystem, bei dem der Text
|
||||
zusammen mit seiner Anmerkung in einer Zeile erscheint.</q>
|
||||
Das System verwendet die folgenden weiteren Elemente mit spezifischer Bedeutung:</p>
|
||||
<dl>
|
||||
<dt>
|
||||
<code><rb></code>
|
||||
</dt>
|
||||
<dd>Basis Textkomponente</dd>
|
||||
<dt>
|
||||
<code><rt></code>
|
||||
</dt>
|
||||
<dd>Annotation</dd>
|
||||
<dt>
|
||||
<code><rtc></code>
|
||||
</dt>
|
||||
<dd>Einzelne Komponente einer Annotation</dd>
|
||||
<dt>
|
||||
<code><rp></code>
|
||||
</dt>
|
||||
<dd>Alternative bei fehlender Unterstützung</dd>
|
||||
</dl>
|
||||
<hr class="dotted space_even_half">
|
||||
<div class="txt_center">
|
||||
<ruby class="space_right_small">
|
||||
<rb>Basis</rb>
|
||||
<rt>Auszeichnung</rt>
|
||||
</ruby>
|
||||
<ruby class="space_right_small">
|
||||
<rb>今日</rb>
|
||||
<rt>きょう</rt>
|
||||
</ruby>
|
||||
<ruby>
|
||||
♥
|
||||
<rp>:
|
||||
</rp>
|
||||
<rt>Herz</rt>
|
||||
<rp>,
|
||||
</rp>
|
||||
<rtc>
|
||||
<rt lang="fr">Cœur</rt>
|
||||
</rtc>
|
||||
<rp>.</rp>
|
||||
☘
|
||||
<rp>:
|
||||
</rp>
|
||||
<rt>Kleeblatt</rt>
|
||||
<rp>,
|
||||
</rp>
|
||||
<rtc>
|
||||
<rt lang="fr">Trèfle</rt>
|
||||
</rtc>
|
||||
<rp>.</rp>
|
||||
✶
|
||||
<rp>:
|
||||
</rp>
|
||||
<rt>Stern</rt>
|
||||
<rp>,
|
||||
</rp>
|
||||
<rtc>
|
||||
<rt lang="fr">Étoile</rt>
|
||||
</rtc>
|
||||
<rp>.</rp>
|
||||
</ruby>
|
||||
</div>
|
||||
<hr class="dotted space_even_half">
|
||||
<p>Wikipedia erklärt dies ausführlicher unter
|
||||
<a href="https://de.wikipedia.org/wiki/Ruby_Annotation">Ruby Annotation</a>.</p>
|
||||
<p>Es gibt auch mehrere besondere Elemente um Maschinensprache oder Programmiersprache zu bezeichnen. Dabei wird
|
||||
unterschieden, ob der Inhalt nur für Menschen ausgezeichnet wird oder auch maschinen-lesbar sein soll. Die
|
||||
Elemente
|
||||
<code><data></code>
|
||||
und
|
||||
<code><time></code>
|
||||
enthalten eine maschinen-lesbare Repräsentation des Inhaltes:</p>
|
||||
<dl>
|
||||
<dt>
|
||||
<data value="0">0</data>
|
||||
≠
|
||||
<data value="">NULL</data>
|
||||
</dt>
|
||||
<dd>
|
||||
<code><data>0</data> ≠ <data>NULL</data></code>
|
||||
</dd>
|
||||
<dt>Der Wert
|
||||
<data value="NULL">NULL</data>
|
||||
mit Attribut
|
||||
</dt>
|
||||
<dd>
|
||||
<code><data value="NULL">NULL</data></code>
|
||||
</dd>
|
||||
<dt>
|
||||
<time>2018-10-08</time>
|
||||
</dt>
|
||||
<dd>
|
||||
<code><time>2018-10-08</time></code>
|
||||
</dd>
|
||||
<dt>Die Zeitangabe
|
||||
<i>
|
||||
<time datetime="2018-10-08">Gestern</time>
|
||||
</i>
|
||||
mit Attribut
|
||||
</dt>
|
||||
<dd>
|
||||
<code><time datetime="2018-10-08">Gestern</time></code>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>Die Auszeichnung
|
||||
<code><code></code>
|
||||
wurde bis hier hin schon verwendet. Sie markiert ebenfalls Maschinensprache. Allerdings dient sie dazu von
|
||||
Menschen gelesen zu werden. In diesem Dokument werden alle Elemente, die erklärt werden wiederum mit diesem
|
||||
Element markiert.</p>
|
||||
<p>Für zusammenhängende Blöcke wird die Auszeichnung oft in Kombination mit dem Element
|
||||
<code><pre></code>
|
||||
verwendet:</p>
|
||||
<pre class="pre_code"><code><html><br> <head><br> <title>hyper text markup language</title><br> </head><br> <body id="root"><br> <!-- content goes here --><br> <p class="example">just like this.</p><br> </body><br></html></code></pre>
|
||||
<p>Dabei bleiben vorhandene Textformatierungen wie Zeilenumbrüche und Einrückung erhalten.</p>
|
||||
<p>
|
||||
<code>var def = "Definition einer Variablen";</code>
|
||||
</p>
|
||||
<p>In diesem Beispiel wird die Variable
|
||||
<var>def</var>
|
||||
definiert. Solch ein spezieller Typ Text kann mit dem dafür vorgesehenen Element
|
||||
<code><var></code>
|
||||
ausgezeichnet werden.</p>
|
||||
<p>Soll beispielhaft auf Ausgaben von Computern verwiesen werden, wird das
|
||||
<code><samp></code>
|
||||
Element verwendet. Der Computer hat gesagt:
|
||||
<samp>Ich kann das angegebene Objekt nicht finden</samp>.</p>
|
||||
<p>Benutzereingaben haben ebenfalls ein eigenes Element
|
||||
<code><kbd></code>. Damit werden Eingaben durch den Nutzer, wie zum Beispiel
|
||||
<q>Drücken Sie gleichzeitig <kbd>Strg</kbd> und <kbd>A</kbd></q>, gekennzeichnet.</p>
|
||||
<p>Hoch- und Tiefgestellte Zeichen werden durch die Elemente
|
||||
<code><sup></code>
|
||||
und
|
||||
<code><sub></code>
|
||||
repräsentiert. Sie dienen nicht dazu rein optische Auszeichnungen zu erreichen, sondern werden für ihren
|
||||
jeweiligen Zweck eingesetzt. In der Mathematik oder Chemie sind sie üblich:</p>
|
||||
<p>Beispielsweise die Formel
|
||||
<var>E</var>=<var>m</var>
|
||||
<var>c</var>
|
||||
<sup>2</sup>
|
||||
oder das Element H<sub>2</sub>O</p>
|
||||
<p>Die Zeichen in Absätzen bis hin zu ganzen Texten können, mit einem geeigneten Eingabegerät, markiert werden.
|
||||
Dies stellt sich wie folgt dar:</p>
|
||||
<p class="txt_center">Bei<mark class="mark_cursor">spiel zum mark</mark>ieren 😉.</p>
|
||||
<p>Eine Markierung kann, mittels
|
||||
<code><mark></code>, auch durch den Autor geschehen. Diese stellt sich ein wenig anders dar:
|
||||
<mark>Diese Worte sind markiert.</mark>
|
||||
</p>
|
||||
<p>Um Text, dessen schreibweise nicht vorhersehbar ist, zu markieren wie z.B. Benutzernamen
|
||||
<bdi>كائن بشري</bdi>
|
||||
, die auch rechtsbündig geschrieben sein können, wird das
|
||||
<code><bdi></code>
|
||||
Element eingesetzt.<br>Die Schreibweise kann auch vom Author vorgegeben und expliziert geändert werden.
|
||||
Dies wird dem
|
||||
<code><bdo></code>
|
||||
Element umgesetzt. Die Richtung wird dann mit dem Attribut
|
||||
<code>dir</code>
|
||||
angegeben.
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<bdo dir="rtl">كائن بشري</bdo>
|
||||
</li>
|
||||
<li>
|
||||
<bdo dir="rtl">إنسان آلي</bdo>
|
||||
</li>
|
||||
</ul>
|
||||
<p>Neben den vielen speziellen Elementen gibt es auch ein Element, das keine vordefinierte Bedeutung hat. Es ist
|
||||
das
|
||||
<code><span></code>
|
||||
Element.<br>Es dient dazu ganz individuelle Auszeichnungen zu ermöglichen die eher optische Auswirkungen
|
||||
haben und eben keine inhaltlichen. Mit den Attributen
|
||||
<code>id</code>
|
||||
oder
|
||||
<code>class</code>
|
||||
werden dazu eigene Typen des Elements definiert. Diese Möglichkeit der Definition von individuellen
|
||||
Elementen ist ein Grundprinzip der Auszeichnungssprache
|
||||
<abbr title="Hypertext Markup Language">HTML</abbr>.</p>
|
||||
<p>Mit der Einführung von Absätzen wurde auch schon das
|
||||
<code><br></code>
|
||||
Element erwähnt und seitdem häufig benutzt. Es erzeugt einen Zeilenumbruch. Es wird dadurch kein neuer
|
||||
Absatz erstellt. Es dient auch nicht dazu optischen Abstand zu erzeugen, sondern innerhalb eines Absatzes
|
||||
den Text umzubrechen.</p>
|
||||
<p>Eine besondere Form des Zeilenumbruchs kann mit
|
||||
<code><wbr></code>
|
||||
eingesetzt werden. Es stellt die Möglichkeit für einen Zeilenumbruch dar. Da das Format eines
|
||||
HTML-Dokumentes häufig nicht vorhersehbar ist, kann solch ein Element einen Umbruch erzeugen, falls ein Wort
|
||||
zu lang für eine Textzeile sein sollte.</p>
|
||||
<p>Und der Löwe brüllte "RRRR
|
||||
<wbr>
|
||||
rrrr
|
||||
<wbr>
|
||||
oooooooo
|
||||
<wbr>
|
||||
aaaa
|
||||
<wbr>
|
||||
AAAAAAAA
|
||||
<wbr>
|
||||
HHHH
|
||||
<wbr>
|
||||
hhhh
|
||||
<wbr>
|
||||
rrrrrrrrr"!
|
||||
</p>
|
||||
<p>Es kann auch innerhalb von vorformatierten Texten Zeilenumbrüche ermöglichen</p>
|
||||
<h2>Änderungen</h2>
|
||||
<p>Werden Texte geändert, können solche Änderungen sichtbar gemacht werden. Somit können sie besser
|
||||
nachvollzogen werden.<br>Zum Beispiel eine Ergänzung von Inhalt.</p>
|
||||
<aside>
|
||||
<ins>Dies ist auch wichtig.</ins>
|
||||
</aside>
|
||||
<p>Der Inhalt wird dann mit
|
||||
<code><ins></code>
|
||||
ausgezeichnet. Wird Text entfernt, kommt
|
||||
<code><del></code>
|
||||
zum Einsatz.</p>
|
||||
<h6>Zu Tun</h6>
|
||||
<ul>
|
||||
<li>Fahrrad reparieren</li>
|
||||
<li>
|
||||
<del>Staubsaugen</del>
|
||||
</li>
|
||||
<li>Tisch bauen</li>
|
||||
</ul>
|
||||
</article>
|
||||
<article>
|
||||
<h1 id="embedded">Eingebundene Inhalte</h1>
|
||||
{% render 'hippie/partials/placeholder-flag.liquid', type: 'img', width: '128', desc: 'Fahne von Interaktionsweise' %}
|
||||
<p>Dies ist ein Bild. Es wird mit dem Element
|
||||
<code><img></code>
|
||||
eingebunden. Solch ein Bild hat üblicherweise die Attribute
|
||||
<code>width</code>
|
||||
und
|
||||
<code>height</code>. Mit ihnen werden die Abmessungen (Breite und Höhe) festgelegt. Außerdem sollte immer
|
||||
das Attribut
|
||||
<code>alt</code>
|
||||
für eine alternative Beschreibung in Textform verwendet werden.</p>
|
||||
<p>Das Bild selbst liegt normalerweise als Datei vor. Die Quelle wird mit dem Attribut
|
||||
<code>src</code>
|
||||
angegeben. Es können einige Alternativen zur Angabe einer konkreten Datei eingesetzt werden. Zum Beispiel
|
||||
können mehrere Dateien in Abhängigkeit zur Darstellung oder dem unterstützen Format angegeben werden. Dafür
|
||||
können dann die Elemente
|
||||
<code><source></code>
|
||||
und
|
||||
<code><picture></code>
|
||||
in Kombination verwendet werden.</p>
|
||||
{% render 'hippie/partials/placeholder-flag.liquid', type: 'img', src: 'file', width: '128', desc: 'Fahne von Interaktionsweise' %}
|
||||
</article>
|
||||
<article>
|
||||
<h1>Tabellen</h1>
|
||||
<p>Tabellen bieten besonders geordnete Struktur. Häufig werden in ihnen Text und Daten kombiniert dargestellt.
|
||||
Dies erfordert individuelle Formatierungen. Einige grundlegende Eigenschaften werden im Folgenden
|
||||
aufgezeigt. Tabellen sind in ihrer Größe entweder vordefiniert (fixiert) oder richten sich nach ihrem
|
||||
Inhalt. Das bedeutet, die Spaltenbreite entspricht der breitesten ihrer Zellen.</p>
|
||||
<table class="width_full js_pop">
|
||||
<tr>
|
||||
<td>Eine</td>
|
||||
<td>einfache</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Tabelle</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">table.width_full>tr>td*2^tr>td[colspan=2]</code>
|
||||
</div>
|
||||
<div class="overflow">
|
||||
<table class="float_space_left js_pop">
|
||||
<tr>
|
||||
<td>Eine</td>
|
||||
<td>freie (nicht fixierte)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Tabelle</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">table>tr>td*2^tr>td[colspan=2]</code>
|
||||
</div>
|
||||
<table class="blank float_space_left js_pop">
|
||||
<tr>
|
||||
<td>Mit</td>
|
||||
<td>ohne</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">Linien</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">table.blank>tr>td*2^tr>td[colspan=2]</code>
|
||||
</div>
|
||||
</div>
|
||||
<p>Die nächste Tabelle verwendet alle zur Auszeichnung verfügbaren Elemente und hat eine starre
|
||||
Zellverteilung:</p>
|
||||
<table class="width_full fix js_pop">
|
||||
<caption>Beschreibung bzw. Zusammenhang der Tabelle</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Kopfzeile</th>
|
||||
<th>A</th>
|
||||
<th>B</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Tabelle</td>
|
||||
<td colspan="2"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>mit</td>
|
||||
<td>Titel</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2"></td>
|
||||
<td>Kopf-</td>
|
||||
<td>und</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>Fußzeile</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th scope="row">Fußzeile</th>
|
||||
<td>A</td>
|
||||
<td>B</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<div class="exp_pop">
|
||||
<code class="code_solo">table.width_full.fix>caption+thead>tr>th[scope="col"]*3^^tbody>(tr>td*3)*3^^tfoot>tr>th[scope="row"]+td*2</code>
|
||||
</div>
|
||||
<p>Viele weitere Formate sind möglich.</p>
|
||||
</article>
|
||||
<article>
|
||||
<h1>Formulare</h1>
|
||||
<p>Spätestens hier werden Betrachter zu Benutzern. Texteingabefelder und verschiedene Bedienelemente geben
|
||||
Möglichkeiten zur Interaktion. Diese Elemente sind in vielerlei Hinsicht besonders. Werden sie nicht
|
||||
explizit gestaltet, ist ihre Erscheinung system- bzw. browserabhängig.<br>Üblicherweise stehen alle
|
||||
Bedienelemente innerhalb eines
|
||||
<code><form></code>
|
||||
Elementes. Dieses ist notwendig um Angaben zur Kommunikation mit dem Server zu setzen. Es hat normalerweise
|
||||
keine gestalterische Funktion.</p>
|
||||
<p>Grundlegend ist das Element
|
||||
<code><input></code>. Es hat viele Attribute um den Typ der Eingabe anzupassen. Ist es undefiniert,
|
||||
nimmt es jegliche textbasierte Information auf und erhält eine Standardgröße.</p>
|
||||
<p><input value="Undefiniert"/><input class="input_io" value="Undefiniert mit Stil"/></p>
|
||||
<p>Ein spezieller Typ des Eingabefeldes hat die Funktion einer Schaltfläche
|
||||
<code><input[type="button"]></code>. Es gibt allerdings auch ein eigenes Element
|
||||
<code><button></code>
|
||||
dafür.</p>
|
||||
<p><input type="button" value="Input Button">
|
||||
<button>Button</button>
|
||||
</p>
|
||||
<p><input class="button_io" type="button" value="Input Button">
|
||||
<button class="button_io">Button</button>
|
||||
</p>
|
||||
<p>Interaktive Elemente können durch das Attribut
|
||||
<code>readonly</code>
|
||||
nur lesbar gemacht werden oder mittels
|
||||
<code>disabled</code>
|
||||
gänzlich deaktiviert werden.</p>
|
||||
{% comment %}// TODO: Abstände, besonders margin generell überarbeiten{% endcomment %}
|
||||
<p><input type="text" value="Nur lesbare Eingabe" readonly="readonly"><input type="text"
|
||||
value="Deaktivierte Eingabe"
|
||||
size="21" disabled="disabled">
|
||||
<button disabled="disabled">Deaktivierte Schaltfläche</button>
|
||||
</p>
|
||||
<p><input class="input_io" type="text" value="Nur lesbare Eingabe" readonly="readonly"><input class="input_io"
|
||||
type="text"
|
||||
value="Deaktivierte Eingabe"
|
||||
size="21"
|
||||
disabled="disabled">
|
||||
<button class="button_io" disabled="disabled">Deaktivierte Schaltfläche</button>
|
||||
</p>
|
||||
<p>Das Element
|
||||
<code><label></code>
|
||||
ergänzt interaktive Elemente um eine Beschriftung. Wichtig ist hier, dass die Beziehung beider Elemente
|
||||
zueinander deutlich ist.</p>
|
||||
<p>
|
||||
<label>Beschriftung:<input type="text"></label>
|
||||
</p>
|
||||
<div class="overflow">
|
||||
<div class="float_left">
|
||||
<table class="fix blank">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="demo__raw_a">Alpha:</label>
|
||||
</td>
|
||||
<td><input type="text" id="demo__raw_a"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="demo__raw_b">Beta:</label>
|
||||
</td>
|
||||
<td><input type="text" id="demo__raw_b"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<table class="float_right">
|
||||
<tr>
|
||||
<td class="txt_right demo__td_no_br demo__td_pl"><input class="input_io" type="text" id="demo__io_d"
|
||||
value="11.966504" size="10"></td>
|
||||
<td class="demo__td_pr">
|
||||
<label for="demo__io_a">x</label>
|
||||
</td>
|
||||
<td class="txt_right demo__td_no_br demo__td_pl"><input class="input_io" type="number"
|
||||
id="demo__io_a" value="10" min="0"
|
||||
max="1000"></td>
|
||||
<td class="demo__td_pr">
|
||||
<label for="demo__io_a">Breite</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="txt_right demo__td_no_br demo__td_pl"><input class="input_io" type="text" id="demo__io_e"
|
||||
value="51.503491" size="10"></td>
|
||||
<td class="demo__td_pr">
|
||||
<label for="demo__io_b">y</label>
|
||||
</td>
|
||||
<td class="txt_right demo__td_no_br demo__td_pl"><input class="input_io" type="number"
|
||||
id="demo__io_b" value="10" min="0"
|
||||
max="1000"></td>
|
||||
<td class="demo__td_pr">
|
||||
<label for="demo__io_b">Tiefe</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="txt_right demo__td_no_br demo__td_pl"><input class="input_io" type="text" id="demo__io_f"
|
||||
value="88" size="10"></td>
|
||||
<td class="demo__td_pr">
|
||||
<label for="demo__io_c">z</label>
|
||||
</td>
|
||||
<td class="txt_right demo__td_no_br demo__td_pl"><input class="input_io" type="number"
|
||||
id="demo__io_c" value="48" min="0"
|
||||
max="1000"></td>
|
||||
<td class="demo__td_pr">
|
||||
<label for="demo__io_c">Höhe</label>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<p>Zusätzlich zur Beschriftung einzelner Elemente gibt es auch die Möglichkeit Gruppierungen zu schaffen. Diese
|
||||
werden mit
|
||||
<code><fieldset></code>
|
||||
realisiert.</p>
|
||||
<fieldset>
|
||||
<div class="dis_grid grid_column_2">
|
||||
<label for="demo__input">Input:</label><input class="input_io" type="text" value="love"
|
||||
readonly="readonly" id="demo__input">
|
||||
<label for="demo__output">Output:</label><input class="input_io" type="text" value="happiness"
|
||||
readonly="readonly" id="demo__output">
|
||||
</div>
|
||||
</fieldset>
|
||||
<p>Sie können mittels
|
||||
<code><legend></code>
|
||||
auch eine eigene Beschriftung erhalten.</p>
|
||||
<fieldset>
|
||||
<legend>Einfache Eingabeelemente</legend>
|
||||
<div class="dis_grid grid_column_2">
|
||||
<label>Schaltflächen:</label>
|
||||
<div>
|
||||
<button>Senden</button>
|
||||
<input type="reset" value="Abbrechen"></div>
|
||||
<label>Zeicheneingaben:</label>
|
||||
<div><input type="text" placeholder="Text"><input type="number" value="0815"></div>
|
||||
<label>Einzelauswahl:</label>
|
||||
<div><input type="radio" name="direction" value="up" checked="checked"/><input type="radio"
|
||||
name="direction"
|
||||
value="down"/></div>
|
||||
<label>Mehrfachauswahl:</label>
|
||||
<div><input type="checkbox" name="speed" value="slow" checked="checked"/><input type="checkbox"
|
||||
name="speed"
|
||||
value="fast"/></div>
|
||||
<label>Auswahllisten:</label>
|
||||
<div>
|
||||
<select class="txt_top">
|
||||
<option value="A" selected="selected">Option A</option>
|
||||
<option value="B">Option B</option>
|
||||
</select>
|
||||
<select class="txt_top" size="3">
|
||||
<option value="red" selected="selected">Rot</option>
|
||||
<option value="green">Grün</option>
|
||||
<option value="blue">Blau</option>
|
||||
</select>
|
||||
</div>
|
||||
<label>Textfeld:</label>
|
||||
<textarea rows="3">Dies ist ein Eingabefeld für Fließtext. Es bildet auch Zeilenumbrüche ab und hat häufig variable Größen.</textarea>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Einfache Eingabeelemente mit Stil</legend>
|
||||
<div class="dis_grid grid_column_2">
|
||||
<label>Schaltflächen:</label>
|
||||
<div class="flex inline">
|
||||
<button class="button_io">Senden</button>
|
||||
<input class="button_io" type="reset" value="Abbrechen"></div>
|
||||
<label>Zeicheneingaben:</label>
|
||||
<div class="flex inline"><input class="input_io" type="text" placeholder="Text"><input class="input_io"
|
||||
type="number"
|
||||
value="0815">
|
||||
</div>
|
||||
<label>Einzelauswahl:</label>
|
||||
<div><input class="io_radio" type="radio" name="direction" value="up" checked="checked"/><input
|
||||
class="io_radio" type="radio" name="direction" value="down"/></div>
|
||||
<label>Mehrfachauswahl:</label>
|
||||
<div><input class="io_check" type="checkbox" name="speed" value="slow" checked="checked"/><input
|
||||
class="io_check" type="checkbox" name="speed" value="fast"/></div>
|
||||
<label>Auswahllisten:</label>
|
||||
<div class="flex inline">
|
||||
<select class="io_select txt_top">
|
||||
<option value="A" selected="selected">Option A</option>
|
||||
<option value="B">Option B</option>
|
||||
</select><select class="io_select txt_top" size="3">
|
||||
<option value="red" selected="selected">Rot</option>
|
||||
<option value="green">Grün</option>
|
||||
<option value="blue">Blau</option>
|
||||
</select>
|
||||
</div>
|
||||
<label>Textfeld:</label>
|
||||
<textarea class="io_textarea" rows="3">Dies ist ein Eingabefeld für Fließtext. Es bildet auch Zeilenumbrüche ab und hat häufig variable Größen.</textarea>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>Weitere Eingabemöglichkeiten</legend>
|
||||
<p>Innerhalb einer Gruppe können nicht nur Ein- und Ausgabefelder platziert werden. Andere Elemente ergänzen
|
||||
Information oder lockern das Erscheinungsbild auf.</p>
|
||||
<p>Hier nun eine Liste weiterer Arten von Eingabefeldern:</p>
|
||||
<form action="">
|
||||
<div class="dis_grid grid_column_2">
|
||||
<label class="">Farbauswahl<br>
|
||||
<code><input[type="color"]></code>
|
||||
</label>
|
||||
<div><input class="" type="color"></div>
|
||||
<label class="">Bereichsauswahl<br>
|
||||
<code><input[type="range"]></code>
|
||||
</label>
|
||||
<div><input class="" type="range"></div>
|
||||
<label class="">Datum<br>
|
||||
<code><input[type="date"]></code>
|
||||
</label>
|
||||
<div><input class="input_io" type="date"></div>
|
||||
<label class="">Uhrzeit<br>
|
||||
<code><input[type="time"]></code>
|
||||
</label>
|
||||
<div><input class="input_io" type="time"></div>
|
||||
<label class="">Datum und Zeit<br>
|
||||
<code><input[type="datetime-local"]></code>
|
||||
</label>
|
||||
<div><input class="input_io" type="datetime-local"></div>
|
||||
<label class="">Kalendermonat<br>
|
||||
<code><input[type="month"]></code>
|
||||
</label>
|
||||
<div><input class="input_io" type="month"></div>
|
||||
<label class="">Kalenderwoche<br>
|
||||
<code><input[type="week"]></code>
|
||||
</label>
|
||||
<div><input class="input_io" type="week"></div>
|
||||
<label class="">@dresse<br>
|
||||
<code><input[type="email"]></code>
|
||||
</label>
|
||||
<div><input class="input_io" placeholder="@" type="email"></div>
|
||||
<label class="">Passwort<br>
|
||||
<code><input[type="password"]></code>
|
||||
</label>
|
||||
<div><input class="input_io" value="admin" autocomplete="off" type="password"></div>
|
||||
<label class="">Telefonnummer<br>
|
||||
<code><input[type="tel"]></code>
|
||||
</label>
|
||||
<div><input class="input_io" value="0190123456" type="tel"></div>
|
||||
<label class="">URL<br>
|
||||
<code><input[type="url"]></code>
|
||||
</label>
|
||||
<div><input class="input_io" placeholder="url://" type="url"></div>
|
||||
<label class="">Suche<br>
|
||||
<code><input[type="search"]></code>
|
||||
</label>
|
||||
<div><input class="input_io" type="search"></div>
|
||||
<label class="">Datei<br>
|
||||
<code><input[type="file"]></code>
|
||||
</label>
|
||||
<div><input class="" type="file"></div>
|
||||
<label class="">Bild</label><input class="" type="image" alt="Alternativer Text"/>
|
||||
</div>
|
||||
</form>
|
||||
</fieldset>
|
||||
|
||||
<h2>Interaktive Elemente</h2>
|
||||
</article>
|
||||
<article>
|
||||
<h1>Struktur</h1>
|
||||
<div class="box_placeholder"></div>
|
||||
<hr class="hidden"/>
|
||||
<div class="box_placeholder">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
||||
y="0px" width="100%" height="100%">
|
||||
<line x1='0' y1='0' x2='100%' y2='100%' stroke='#000' stroke-width='.5'/>
|
||||
<line x1='0' y1='100%' x2='100%' y2='0' stroke='#000' stroke-width='.5'/>
|
||||
</svg>
|
||||
</div>
|
||||
<hr class="hidden"/>
|
||||
<div class="box_placeholder_bkg"></div>
|
||||
</article>
|
||||
<article>
|
||||
<h1>Medien</h1>
|
||||
</article>
|
||||
<article>
|
||||
<h1>Druck</h1>
|
||||
</article>
|
||||
|
||||
<section>
|
||||
<header class="header_txt">
|
||||
<h1>Ende der Einführung</h1>
|
||||
<p>Dies war eine Übersicht der grundlegenden Elemente. Nun folgen Komponenten mit Kombinationen und
|
||||
erweiterten Formatierungen.</p>
|
||||
</header>
|
||||
</section>
|
||||
</div>
|
||||
{% endblock %}
|
||||
397
source/view/demo/components.liquid
Normal file
397
source/view/demo/components.liquid
Normal file
|
|
@ -0,0 +1,397 @@
|
|||
---
|
||||
title: Components
|
||||
tags:
|
||||
- demoIndex
|
||||
order: 3
|
||||
---
|
||||
{% layout 'hippie/page.liquid' %}
|
||||
|
||||
{% block title %}Komponenten{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<section class="sec_main_center">
|
||||
<header class="header_txt">
|
||||
<h1>Medienformat Abfragen</h1>
|
||||
</header>
|
||||
<article>
|
||||
<div class="demo__query_example">Umbruch bei </div>
|
||||
<div class="demo__queries">
|
||||
<p class="query_phoneUp">Telefone und größer</p>
|
||||
<p class="query_phoneOnly">Nur Telefone</p>
|
||||
<p class="query_tabletPortraitOnly">Nur Schreibtafeln hochkant</p>
|
||||
<p class="query_tabletPortraitUp">Schreibtafeln und größer</p>
|
||||
<p class="query_tabletLandscapeOnly">Schreibtafeln im Querformat</p>
|
||||
<p class="query_tabletLandscapeUp">Schreibtafeln quer und größer</p>
|
||||
<p class="query_desktopOnly">Nur Arbeitsplatzrechner</p>
|
||||
<p class="query_desktopUp">Arbeitsplatzrechner und größer</p>
|
||||
<p class="query_bigDesktopUp">Richtige Monitore und größer</p>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="sec_main_center">
|
||||
<header class="header_txt">
|
||||
<h1>Übersicht aller Elemente</h1>
|
||||
<p>Es werden alle grundlegenden Elemente sowie ihre gestalteten Varianten angegeben. Die Elemente sind in
|
||||
Gruppen eingeteilt, die auch das W3Consortium (<a
|
||||
href="https://html.spec.whatwg.org/multipage/#toc-semantics">html.spec.whatwg.org/multipage/#toc-semantics</a>)
|
||||
verwendet.</p>
|
||||
<p>Zu jedem Element werden alle Attribute aufgelistet und die Umsetzung im HTML-Dokument als Emmet-Syntax
|
||||
dargestellt.</p>
|
||||
</header>
|
||||
<pre class="pre_code"><code>article>h1+p{Elemente:}+pre+h2{<tag>}+h4{Varianten}</code></pre>
|
||||
<article>
|
||||
<h1 id="sections">Bereiche</h1>
|
||||
<p>Elemente:</p>
|
||||
<pre>// body<br>// article<br>// section<br>// nav<br>// aside<br>// h1-h6<br>// header<br>// footer</pre>
|
||||
<h2><body></h2>
|
||||
<p>Keine speziellen Attribute. Bekommt üblicherweise allgemeine Klassen zur Steuerung der Abmessungen
|
||||
zugewiesen.</p>
|
||||
<h2><article></h2>
|
||||
<article>Ein Artikel.</article>
|
||||
<h2><section></h2>
|
||||
<section>Ein Bereich.</section>
|
||||
<h4>Varianten</h4>
|
||||
<pre class="pre_code"><code>section.sec_main_center</code></pre>
|
||||
<section class="sec_main_center">
|
||||
<p class="float_right">Ende.</p>
|
||||
<p>Zentrierter Bereich.</p>
|
||||
</section>
|
||||
<pre class="pre_code"><code>section.sec_main_status</code></pre>
|
||||
<section class="sec_main_status">Status-Bereich</section>
|
||||
<h2><nav></h2>
|
||||
<nav>Navigation</nav>
|
||||
<h2><aside></h2>
|
||||
<p>Fließt um andere Inhalte. Klassen zur Positionierung und Kombination mit <code>.bside</code>.</p>
|
||||
<pre class="pre_code"><code>aside.right+div.bside</code></pre>
|
||||
<section>
|
||||
<aside class="right">Seitenbereich, recht ausgerichtet.</aside>
|
||||
<div class="bside">Hauptbereich</div>
|
||||
</section>
|
||||
<h2><h*></h2>
|
||||
<h1>Überschrift 1</h1>
|
||||
<h2>Überschrift 2</h2>
|
||||
<h3>Überschrift 3</h3>
|
||||
<h4>Überschrift 4</h4>
|
||||
<h5>Überschrift 5</h5>
|
||||
<hgroup>
|
||||
<h6>Überschrift 6</h6>
|
||||
<p>Mit Absatz innerhalb von <code><hgroup></code>.</p>
|
||||
</hgroup>
|
||||
<hgroup>
|
||||
<h2>Überschrift 1 oder 2</h2>
|
||||
<p>Mit Absatz innerhalb von <code><hgroup></code>.</p>
|
||||
</hgroup>
|
||||
<h2><header></h2>
|
||||
<header>Kopfbereich</header>
|
||||
<pre class="pre_code"><code>header.header_page</code></pre>
|
||||
<pre class="pre_code"><code>header.header_txt>h1</code></pre>
|
||||
<header class="header_txt">
|
||||
<h1>Überschrift 1</h1>
|
||||
<p>Innerhalb eines <code><header></code>.</p>
|
||||
</header>
|
||||
<h2><footer></h2>
|
||||
<p>Bekommt üblicherweise Klassen zur Positionierung und der Abmessungen zugewiesen.</p>
|
||||
<footer>Fußbereich</footer>
|
||||
<div style="position:relative;height:256px;background-color:#b7e0f0;">
|
||||
{% render 'hippie/partials/footer-pinned.liquid' %}
|
||||
</div>
|
||||
</article>
|
||||
<article>
|
||||
<h1 id="grouping">Gruppierung</h1>
|
||||
<p>Elemente:</p>
|
||||
<pre>// p // address // hr // pre // blockquote // ol // ul // li // dl // dt // dd // figure // figcaption // main // div</pre>
|
||||
<h2><p></h2>
|
||||
<p>Ein Absatz. Ein <code>code</code> Element innerhalb wird besonders behandelt.</p>
|
||||
<h4>Varianten</h4>
|
||||
<pre class="pre_code"><code>p.column_2</code></pre>
|
||||
<p class="column_2">Spalten können angegeben werden.</p>
|
||||
<pre class="pre_code"><code>p.column_3.column_line</code></pre>
|
||||
<p class="column_3 column_line">Spalten können angegeben werden.</p>
|
||||
<h2><address></h2>
|
||||
<address>Anschrift, mit bestimmtem, ##### Format.</address>
|
||||
<h2><hr></h2>
|
||||
<hr>
|
||||
<h4>Varianten</h4>
|
||||
<pre class="pre_code"><code>hr.hidden+hr.dotted+hr.double</code></pre>
|
||||
<hr class="hidden">
|
||||
<hr class="dotted">
|
||||
<hr class="double">
|
||||
<pre class="pre_code"><code>hr.vertical</code></pre>
|
||||
<hr class="vertical">
|
||||
<h2><pre></h2>
|
||||
<pre>Vorformatierter Text.
|
||||
erhält Umbrüche und Einrückung.
|
||||
</pre>
|
||||
<pre class="pre_code"><code>pre.pre_code>code*2</code></pre>
|
||||
<pre class="pre_code"><code>let variable = true;</code>
|
||||
<code>()(){}</code></pre>
|
||||
<h2><blockquote></h2>
|
||||
<blockquote>Ein Zitat ist eingerückt.</blockquote>
|
||||
<pre class="pre_code"><code>blockquote.quote_mark>p+p.quote_source</code></pre>
|
||||
<blockquote class="quote_mark">
|
||||
<p>Zitat mit automatischen Anführungszeichen</p>
|
||||
<p class="quote_source">und Quellenangabe.</p>
|
||||
</blockquote>
|
||||
<h2><dl>, <ol>, <ul></h2>
|
||||
<dl>
|
||||
<dt>Begriff</dt>
|
||||
<dd>Definition</dd>
|
||||
</dl>
|
||||
<ol>
|
||||
<li>Eins</li>
|
||||
<li>Zwei</li>
|
||||
</ol>
|
||||
<ul class="horizontal">
|
||||
<li>Obst</li>
|
||||
<li>Gemüse</li>
|
||||
</ul>
|
||||
<h4>Varianten</h4>
|
||||
<pre class="pre_code"><code>ul.list_basic.list_dash>li*2</code></pre>
|
||||
<ul class="list_basic list_dash">
|
||||
<li>Mehr Abstand und</li>
|
||||
<li>mit Unterstrichen.</li>
|
||||
</ul>
|
||||
<pre class="pre_code"><code>ul.link>(li>a)*2</code></pre>
|
||||
<ul class="link">
|
||||
<li>
|
||||
<a href="">Mit</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">Verweisen</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h2><figure></h2>
|
||||
<pre class="pre_code"><code>figure>figcaption+{element}</code></pre>
|
||||
<figure>
|
||||
<figcaption>Bezeichnung</figcaption>
|
||||
Grafisches Element.
|
||||
</figure>
|
||||
<h2><main></h2>
|
||||
<main>Hauptbereich</main>
|
||||
<h2><div></h2>
|
||||
<h4>Varianten</h4>
|
||||
<pre class="pre_code"><code>div.div_info>p</code></pre>
|
||||
<div class="div_info">
|
||||
<p>Absatz in einer Box mit dem Typ <i>Information</i>.</p>
|
||||
</div>
|
||||
<pre class="pre_code"><code>div.box_space>div.box_cube>span</code></pre>
|
||||
<div class="box_space">
|
||||
<div class="box_cube"><span>Text</span></div>
|
||||
</div>
|
||||
<pre class="pre_code"><code>div.box_placeholder+hr+div.box_placeholder_bkg</code></pre>
|
||||
<div class="box_placeholder"></div>
|
||||
<hr>
|
||||
<div class="box_placeholder_bkg"></div>
|
||||
</article>
|
||||
<article>
|
||||
<h1 id="tabularData">Tabellen</h1>
|
||||
<p>Elemente:</p>
|
||||
<pre>// table // caption // colgroup // col // tbody // thead // tfoot // tr // td // th</pre>
|
||||
<h2><table></h2>
|
||||
<h4>Varianten</h4>
|
||||
<pre class="pre_code"><code>table.width_full.fix>(thead>tr>th.pre[scope="col"]+th[scope="col"]*3)+tbody>tr>td.pre+td*3</code></pre>
|
||||
<table class="width_full fix">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="pre" scope="col"></th>
|
||||
<th scope="col">Kopfzeile</th>
|
||||
<th scope="col">A</th>
|
||||
<th scope="col">B</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="pre">Vorspalte</td>
|
||||
<td>Eine</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pre">1</td>
|
||||
<td></td>
|
||||
<td>erweiterte</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="pre">2</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>Tabelle</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<pre class="pre_code"><code>table.width_full.striped.fix.free>tr>td*3</code></pre>
|
||||
<table class="width_full striped fix free">
|
||||
<tr>
|
||||
<td>Tabelle</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>ohne</td>
|
||||
<td>Rahmen</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>jedoch</td>
|
||||
<td>mit</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td>Streifen</td>
|
||||
</tr>
|
||||
</table>
|
||||
<pre class="pre_code"><code>table>(thead>tr>th[scope="col"]*3)+(tbody>tr>td*2+td.txt_right)+tfoot>tr>th[colspan="2"]+td.txt_right</code></pre>
|
||||
<table>
|
||||
<caption>Die Verteilung der Zellen ist hier von ihrem Inhalt abhängig.</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Bezeichnung</th>
|
||||
<th scope="col">Menge</th>
|
||||
<th scope="col">Wert</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Alpha</td>
|
||||
<td>1</td>
|
||||
<td class="txt_right">8990</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bravo</td>
|
||||
<td>10</td>
|
||||
<td class="txt_right">1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Charlie</td>
|
||||
<td>1</td>
|
||||
<td class="txt_right">1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th colspan="2" class="txt_right" scope="row">Summe</th>
|
||||
<td class="txt_right" title=">9000">9001</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<pre class="pre_code"><code>table.width_full.fix>tr>td+td.ellipsis+td[style="width: 50%"]</code></pre>
|
||||
<table class="width_full fix">
|
||||
<tr>
|
||||
<td>Index</td>
|
||||
<td class="ellipsis">Zelle mit viel Inhalt der nicht umbricht und eingeschränkt wird.</td>
|
||||
<td style="width: 50%">Zelle mit Angabe der Breite.</td>
|
||||
</tr>
|
||||
</table>
|
||||
<pre class="pre_code"><code>table.grid>(tr>td+td.ellipsis+td)*2</code></pre>
|
||||
<table class="grid">
|
||||
<tr>
|
||||
<td>Index</td>
|
||||
<td class="ellipsis">Zelle mit viel Inhalt der nicht umbricht und eingeschränkt wird.</td>
|
||||
<td>Inhalt bestimmt die Breite</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>101</td>
|
||||
<td class="ellipsis">Zelle mit viel Inhalt der nicht umbricht und eingeschränkt wird.</td>
|
||||
<td>Zelle</td>
|
||||
</tr>
|
||||
</table>
|
||||
</article>
|
||||
<article>
|
||||
<h1 id="forms">Formulare</h1>
|
||||
<p>Elemente:</p>
|
||||
<pre>// form // label // input // button // select // datalist // optgroup // option // textarea // output // progress // meter // fieldset // legend</pre>
|
||||
<h2><input></h2>
|
||||
<div class="inline">
|
||||
<input value="Undefiniert"/>
|
||||
<input type="text" size="8" value="Text"/>
|
||||
<input type="text" size="8" value="Deaktiviert" disabled="disabled"/>
|
||||
<input type="button" value="Auswählen">
|
||||
<input type="submit" value="Senden" disabled="disabled"/>
|
||||
</div>
|
||||
<h4>Varianten</h4>
|
||||
<pre class="pre_code"><code>input.button_io+button.button_io</code></pre>
|
||||
<div class="inline">
|
||||
<input class="button_io" type="button" value="Input type button">
|
||||
<button class="button_io">Button</button>
|
||||
</div>
|
||||
<div class="inline">
|
||||
<input class="input_io" type="text" value="Nur lesbare Eingabe" readonly="readonly">
|
||||
<input class="input_io" type="text" value="Deaktivierte Eingabe" size="21" disabled="disabled">
|
||||
<button class="button_io" disabled="disabled">Deaktivierte Schaltfläche</button>
|
||||
</div>
|
||||
<div id="capsCheck">
|
||||
<form action="">
|
||||
<input id="inpPass" type="password"/>
|
||||
<span id="hintPass" style="visibility:hidden"><kbd>Shift</kbd> is pressed.</span>
|
||||
<br>
|
||||
<input id="inpText" type="text"/>
|
||||
<span id="hintText"><kbd>CapsLock</kbd> is on.</span>
|
||||
</form>
|
||||
</div>
|
||||
<h2><select></h2>
|
||||
<select name="F">
|
||||
<option value="0">
|
||||
Plain list
|
||||
</option>
|
||||
<option value="1" selected="selected">
|
||||
Fancy list
|
||||
</option>
|
||||
<option value="2">
|
||||
Table list
|
||||
</option>
|
||||
</select>
|
||||
</article>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
{{ block.super -}}
|
||||
<script>
|
||||
const capsHint = document.getElementById('hintPass');
|
||||
let isShiftPressed = false;
|
||||
|
||||
document.getElementById('inpPass').addEventListener('keydown', shiftDetect);
|
||||
|
||||
function shiftDetect(event) {
|
||||
if (event.getModifierState('Shift')) {
|
||||
isShiftPressed = true;
|
||||
capsHint.style.visibility = 'visible';
|
||||
} else {
|
||||
isShiftPressed = false;
|
||||
capsHint.style.visibility = 'hidden';
|
||||
}
|
||||
|
||||
console.log('Shift', isShiftPressed);
|
||||
}
|
||||
|
||||
document.getElementById('inpPass').addEventListener('keyup', (event) => {
|
||||
if (event.key === 'Shift') {
|
||||
isShiftPressed = false;
|
||||
capsHint.style.visibility = 'hidden';
|
||||
}
|
||||
});
|
||||
|
||||
function capsDetect() {
|
||||
const capsHint = document.getElementById('hintText');
|
||||
let isCapsOn = false;
|
||||
|
||||
document.getElementById('inpText').addEventListener('keyup', function (e) {
|
||||
if (event.getModifierState('CapsLock')) {
|
||||
capsHint.style.display = 'inline';
|
||||
isCapsOn = true;
|
||||
} else {
|
||||
capsHint.style.display = 'none';
|
||||
isCapsOn = false;
|
||||
}
|
||||
|
||||
console.log('CapsLock', isCapsOn);
|
||||
});
|
||||
}
|
||||
|
||||
capsDetect();
|
||||
</script>
|
||||
{% endblock %}
|
||||
69
source/view/demo/examples/10print.liquid
Normal file
69
source/view/demo/examples/10print.liquid
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
---
|
||||
title: 10print
|
||||
tags:
|
||||
- demoExample
|
||||
---
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block style %}
|
||||
<style>
|
||||
canvas {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<canvas id="pattern"></canvas>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script>
|
||||
const canvas = document.getElementById('pattern');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
const lineWidth = 20;
|
||||
const randomSeed = Math.random;
|
||||
|
||||
// Function to draw the 10PRINT pattern
|
||||
function draw10Print() {
|
||||
// Clear the canvas
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
// Set line style
|
||||
ctx.strokeStyle = 'black';
|
||||
ctx.lineWidth = 2;
|
||||
|
||||
// Loop through the canvas grid
|
||||
for (let x = 0; x < canvas.width; x += lineWidth) {
|
||||
for (let y = 0; y < canvas.height; y += lineWidth) {
|
||||
// Randomly choose between two diagonal lines
|
||||
if (randomSeed() > 0.5) {
|
||||
// Draw line from top-left to bottom-right
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x, y);
|
||||
ctx.lineTo(x + lineWidth, y + lineWidth);
|
||||
ctx.stroke();
|
||||
} else {
|
||||
// Draw line from top-right to bottom-left
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x + lineWidth, y);
|
||||
ctx.lineTo(x, y + lineWidth);
|
||||
ctx.stroke();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function resizeCanvas() {
|
||||
canvas.width = window.innerWidth;
|
||||
canvas.height = window.innerHeight;
|
||||
}
|
||||
|
||||
resizeCanvas();
|
||||
draw10Print();
|
||||
|
||||
// window.addEventListener('resize', resizeCanvas);
|
||||
canvas.addEventListener('click', draw10Print);
|
||||
</script>
|
||||
{% endblock %}
|
||||
32
source/view/demo/examples/blog.liquid
Normal file
32
source/view/demo/examples/blog.liquid
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
title: Blog
|
||||
tags:
|
||||
- demoExample
|
||||
---
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="sec_main_center">
|
||||
<header class="header_txt">
|
||||
<h1>Blog</h1>
|
||||
</header>
|
||||
<nav role="doc-toc">
|
||||
<h2>Inhaltsverzeichnis</h2>
|
||||
<ul>
|
||||
{%- for blog in collections.blog -%}
|
||||
<li>
|
||||
<a href="{{ blog.page.url }}">{{ blog.data.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</nav>
|
||||
<hr class="double dotted">
|
||||
{%- for post in collections.article -%}
|
||||
<article>
|
||||
{{ post.content }}
|
||||
</article>
|
||||
{%- endfor -%}
|
||||
<hr/>
|
||||
<address>{% text hippie.placeholders.name %}</address>
|
||||
</div>
|
||||
{% endblock %}
|
||||
11
source/view/demo/examples/blog/article.md
Normal file
11
source/view/demo/examples/blog/article.md
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
tags:
|
||||
- blog
|
||||
- article
|
||||
title: "Artikel"
|
||||
publishDate: JJJJ
|
||||
description: Text
|
||||
---
|
||||
# Titel
|
||||
|
||||
Inhalt
|
||||
69
source/view/demo/examples/card.liquid
Normal file
69
source/view/demo/examples/card.liquid
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
---
|
||||
title: Card
|
||||
tags:
|
||||
- demoExample
|
||||
---
|
||||
{% assign pageClass = "html_card" %}
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="card_bkg">
|
||||
<div id="dither"></div>
|
||||
{% render 'hippie/partials/placeholder-flag.liquid', type: '', id: 'flag' %}
|
||||
{% comment %}<img id="dither" src="art/flag_dither.png" width="1920" height="1200" alt="Background flag dithered"/>{% endcomment %}
|
||||
</div>
|
||||
<div class="card_box">
|
||||
<main>
|
||||
<p>Titel<br/>und Beschreibung</p>
|
||||
<h1>{% text hippie.placeholders.name %}</h1>
|
||||
<p>
|
||||
{% link hippie.placeholders.mail, '', '', 'card_address' %}<br/>
|
||||
{% link hippie.placeholders.domain, 'site.tld', '', 'decent' %}
|
||||
·
|
||||
{% text hippie.placeholders.address, '', 'decent' %}</p>
|
||||
</main>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script>
|
||||
const flag = document.getElementById('flag');
|
||||
let colors = new Array();
|
||||
let iId = undefined;
|
||||
let position = 0;
|
||||
|
||||
for (let i = 1; i <= flag.childElementCount; i++) {
|
||||
colors.push(document.getElementById('triangle-' + i).getAttribute('fill'));
|
||||
}
|
||||
|
||||
document
|
||||
.querySelector('main')
|
||||
.addEventListener('mouseenter', () => {
|
||||
iId = setInterval(() => {
|
||||
for (let i = 1; i <= colors.length; i++) {
|
||||
position++;
|
||||
|
||||
if (position >= colors.length) {
|
||||
position = 0;
|
||||
}
|
||||
|
||||
document
|
||||
.getElementById('triangle-' + i)
|
||||
.setAttribute('fill', colors[position]);
|
||||
}
|
||||
|
||||
position++;
|
||||
|
||||
if (position >= colors.length) {
|
||||
position = 0;
|
||||
}
|
||||
}, 600);
|
||||
});
|
||||
|
||||
document
|
||||
.querySelector('main')
|
||||
.addEventListener('mouseleave', () => {
|
||||
iId && clearInterval(iId);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
488
source/view/demo/examples/clock.liquid
Normal file
488
source/view/demo/examples/clock.liquid
Normal file
|
|
@ -0,0 +1,488 @@
|
|||
---
|
||||
title: Clock
|
||||
tags:
|
||||
- demoExample
|
||||
---
|
||||
{% assign bodyClass = 'body_clock' -%}
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<header class="io pos_fix pin_top pin_right pin_left">
|
||||
<button id="tglOverlay" title="Toggle overlay">☰</button>
|
||||
<nav>
|
||||
<button id="tglFormat" title="Toggle hour display">12-Stunden</button>
|
||||
<button id="tglSections" title="Toggle sections">Abschnitte</button>
|
||||
</nav>
|
||||
</header>
|
||||
<main></main>
|
||||
{% endblock %}
|
||||
|
||||
{% block assets %}
|
||||
<script src="/vendor/hippie-script.js"></script>
|
||||
<script src="/js/globals.js"></script>
|
||||
<script src="/js/app.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script>
|
||||
class HippieClock {
|
||||
constructor(element, date = new Date(), options = {}) {
|
||||
this.element = element;
|
||||
this.date = date;
|
||||
this.defaults = {
|
||||
debug: true,
|
||||
size: Math.floor(this.getSize().value * 0.9),
|
||||
h24: true,
|
||||
sections: true,
|
||||
overlay: false
|
||||
};
|
||||
this.options = {...this.defaults, ...options};
|
||||
this.values = this.getTime();
|
||||
this.parts = [];
|
||||
this.shapes = [];
|
||||
|
||||
this.#init();
|
||||
}
|
||||
|
||||
#init() {
|
||||
this.#createContext(['background', 'hands']);
|
||||
// this.createOverlay();
|
||||
|
||||
this.addRing('seconds', 1, 21, 60, `rgb(250, 216, 3)`);
|
||||
this.addRing('minutes', .9, 46, 60, `rgb(242, 175, 19)`);
|
||||
this.addRing('hours', .8, 6, this.options.h24 ? 24 : 12, `rgb(211, 10, 81)`);
|
||||
this.addRing('dotweek', .7, 2, 7, `rgb(142, 31, 104)`);
|
||||
this.addRing('dotmonth', .6, 12, this.values.daysMonth, `rgb(39, 63, 139)`);
|
||||
this.addRing('dotyear', .5, 256, this.values.daysYear, `rgb(60, 87, 154)`);
|
||||
this.addRing('week', .4, 10, this.values.weeksYear, `rgb(183, 224, 240)`);
|
||||
this.addRing('month', .3, 10, 12, `rgb(107, 199, 217)`);
|
||||
this.addRing('moon', .2, 4, 8, `rgb(82, 190, 209)`);
|
||||
|
||||
this.#resize();
|
||||
window.addEventListener('resize', () => this.#resize());
|
||||
|
||||
// console.debug(this);
|
||||
if (this.options.debug) {
|
||||
console.group('Clock');
|
||||
console.info('\nOptions:', this.options, '\n\n');
|
||||
console.info('Date:', this.date);
|
||||
console.groupEnd();
|
||||
}
|
||||
}
|
||||
|
||||
#resize() {
|
||||
this.updateOptions({size: Math.floor(this.getSize().value * 0.9)});
|
||||
this.parts.forEach(part => {
|
||||
if (part.name === 'wrap') {
|
||||
part.element.style.height = this.options.size + 'px';
|
||||
part.element.style.width = this.options.size + 'px';
|
||||
}
|
||||
|
||||
// part.element.width = part.element.offsetWidth;
|
||||
// part.element.height = part.element.offsetHeight;
|
||||
part.element.width = this.options.size;
|
||||
part.element.height = this.options.size;
|
||||
|
||||
this.draw();
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: Zuweisung von shapes zu parts anpassen
|
||||
draw() {
|
||||
// TODO: Nur geänderte Teile löschen
|
||||
this.parts.forEach(part => {
|
||||
part.context?.clearRect(0, 0, part.element.width, part.element.height);
|
||||
});
|
||||
|
||||
let ctx = undefined;
|
||||
|
||||
this.shapes
|
||||
.filter(item => item.type === 'circle')
|
||||
.forEach((shape) => {
|
||||
const radius = this.#toPixelSize(shape.radius) / 2;
|
||||
ctx = this.parts[0].context;
|
||||
|
||||
ctx.fillStyle = shape.color;
|
||||
ctx.beginPath();
|
||||
ctx.arc(
|
||||
this.#toPixelX(shape.center),
|
||||
this.#toPixelY(shape.center),
|
||||
radius,
|
||||
0,
|
||||
Math.PI * 2
|
||||
);
|
||||
ctx.fill();
|
||||
});
|
||||
|
||||
this.shapes
|
||||
.filter(item => item.type === 'ring')
|
||||
.forEach((shape) => {
|
||||
if (this.options.sections) {
|
||||
const outerRadius = this.#toPixelSize(shape.radius) / 2;
|
||||
const innerRadius = this.#toPixelSize(shape.radius) / 2 - shape.stroke;
|
||||
ctx = this.parts[0].context;
|
||||
|
||||
for (let i = 0; i < shape.max; i++) {
|
||||
const angle = (i * (360 / shape.max) - 90) * (Math.PI / 180); // -90 to start at top
|
||||
const outerX = this.#toPixelX(shape.center) + outerRadius * Math.cos(angle);
|
||||
const outerY = this.#toPixelY(shape.center) + outerRadius * Math.sin(angle);
|
||||
const innerX = this.#toPixelX(shape.center) + innerRadius * Math.cos(angle);
|
||||
const innerY = this.#toPixelY(shape.center) + innerRadius * Math.sin(angle);
|
||||
|
||||
ctx.strokeStyle = `rgba(0, 0, 0, .25)`;
|
||||
ctx.lineWidth = mapRange(shape.max, 7, 72, .1, 5, true, true);
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(outerX, outerY);
|
||||
ctx.lineTo(innerX, innerY);
|
||||
ctx.stroke();
|
||||
}
|
||||
}
|
||||
|
||||
const radius = this.#toPixelSize(shape.radius) / 2 - shape.stroke / 2;
|
||||
const start = -0.5 * Math.PI; // Start at the top
|
||||
const angle = start + (2 * Math.PI * (shape.angle / shape.max));
|
||||
ctx = this.parts[1].context;
|
||||
|
||||
ctx.strokeStyle = shape.color;
|
||||
ctx.lineWidth = shape.stroke;
|
||||
ctx.beginPath();
|
||||
ctx.arc(
|
||||
this.#toPixelX(shape.center),
|
||||
this.#toPixelY(shape.center),
|
||||
radius,
|
||||
start,
|
||||
angle
|
||||
);
|
||||
ctx.stroke();
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: Erfassung für geänderte Formen ergänzen
|
||||
update() {
|
||||
this.values = this.getTime();
|
||||
const second = this.values.second;
|
||||
const minute = this.values.minute;
|
||||
const hour = this.values.hour;
|
||||
|
||||
this.updateShape('seconds', (second === 0) ? 60 : second);
|
||||
this.updateShape('minutes', (minute === 0) ? 60 : minute);
|
||||
this.updateShape('hours', this.options.h24 ? hour : hour % 12, this.options.h24 ? 24 : 12);
|
||||
this.updateShape('dotweek', this.values.dayWeek);
|
||||
this.updateShape('dotmonth', this.values.dayMonth, this.values.daysMonth);
|
||||
this.updateShape('dotyear', this.values.dayYear);
|
||||
this.updateShape('week', this.values.week);
|
||||
this.updateShape('month', this.values.month);
|
||||
this.updateShape('moon', this.values.moon);
|
||||
this.draw();
|
||||
}
|
||||
|
||||
#toPixelX(number) {
|
||||
return number * this.parts[0].element.width;
|
||||
}
|
||||
|
||||
#toPixelY(number) {
|
||||
return number * this.parts[0].element.height;
|
||||
}
|
||||
|
||||
#toPixelSize(number) {
|
||||
return number * Math.min(this.parts[0].element.width, this.parts[0].element.height);
|
||||
}
|
||||
|
||||
// TODO: DateDisplay und TimeDisplay benutzen
|
||||
// TODO: Parameter für Wochenstart ergänzen
|
||||
getWeekday(date) {
|
||||
const weekday = date.getDay(); // 0 (Sunday) to 6 (Saturday)
|
||||
|
||||
return (weekday === 0) ? 7 : weekday;
|
||||
}
|
||||
|
||||
getYearDay(date) {
|
||||
const start = new Date(date.getFullYear(), 0, 0);
|
||||
|
||||
return Math.floor((date - start) / 86400000);
|
||||
}
|
||||
|
||||
isLeapYear(year) {
|
||||
return (year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0);
|
||||
}
|
||||
|
||||
getDaysInYear(year) {
|
||||
return this.isLeapYear(year) ? 366 : 365;
|
||||
}
|
||||
|
||||
getYearInfo(date) {
|
||||
const current = this.getYearDay(date);
|
||||
const total = this.getDaysInYear(date.getFullYear());
|
||||
const remaining = total - current;
|
||||
|
||||
return {
|
||||
total: total,
|
||||
current: current,
|
||||
remaining: remaining
|
||||
}
|
||||
}
|
||||
|
||||
getDaysInMonth(month, year) {
|
||||
return new Date(year, month, 0).getDate();
|
||||
}
|
||||
|
||||
// ISO 8601
|
||||
getISOWeek(date) {
|
||||
const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
|
||||
const dayNum = d.getUTCDay() || 7;
|
||||
d.setUTCDate(d.getUTCDate() + 4 - dayNum);
|
||||
const start = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
|
||||
|
||||
return Math.ceil((((d - start) / 86400000) + 1) / 7);
|
||||
}
|
||||
|
||||
getISOWeeksInYear(year) {
|
||||
// Check if Dec 28 is in week 53
|
||||
return this.getISOWeek(new Date(year, 11, 28)) === 53 ? 53 : 52;
|
||||
}
|
||||
|
||||
getISOWeekInfo(date) {
|
||||
const current = this.getISOWeek(date);
|
||||
const weeksYear = this.getISOWeeksInYear(date.getFullYear());
|
||||
|
||||
return {
|
||||
current,
|
||||
weeksYear
|
||||
};
|
||||
}
|
||||
|
||||
getMoonNameFrom(phase) {
|
||||
if (phase < 0.125) return 'New Moon';
|
||||
if (phase < 0.25) return 'Waxing Crescent';
|
||||
if (phase < 0.375) return 'First Quarter';
|
||||
if (phase < 0.5) return 'Waxing Gibbous';
|
||||
if (phase < 0.625) return 'Full Moon';
|
||||
if (phase < 0.75) return 'Waning Gibbous';
|
||||
if (phase < 0.875) return 'Last Quarter';
|
||||
return 'Waning Crescent';
|
||||
}
|
||||
|
||||
getMoonPhase(date) {
|
||||
// Known new moon date: January 6, 2000
|
||||
const newMoon = new Date(2000, 0, 6);
|
||||
const lunarCycle = 29.53058867; // days
|
||||
|
||||
const daysSinceNewMoon = (date - newMoon) / (1000 * 60 * 60 * 24);
|
||||
const phase = (daysSinceNewMoon % lunarCycle) / lunarCycle;
|
||||
|
||||
return {
|
||||
illumination: Math.abs(Math.cos(Math.PI * phase)),
|
||||
phase: mapRange(phase, 0, 1, 1, 8),
|
||||
phaseName: this.getMoonNameFrom(phase)
|
||||
};
|
||||
}
|
||||
|
||||
getSize() {
|
||||
const height = window.innerHeight;
|
||||
const width = window.innerWidth;
|
||||
|
||||
return {
|
||||
value: Math.min(height, width),
|
||||
smaller: height < width ? 'height' : 'width'
|
||||
};
|
||||
}
|
||||
|
||||
getTime(date) {
|
||||
this.date = date || new Date();
|
||||
|
||||
return {
|
||||
second: this.date.getSeconds(),
|
||||
minute: this.date.getMinutes(),
|
||||
hour: this.date.getHours(),
|
||||
dayWeek: this.getWeekday(this.date),
|
||||
dayMonth: this.date.getDate(),
|
||||
dayYear: this.getYearInfo(this.date).current,
|
||||
daysYear: this.getYearInfo(this.date).total,
|
||||
week: this.getISOWeekInfo(this.date).current,
|
||||
weeksYear: this.getISOWeekInfo(this.date).weeksYear,
|
||||
month: this.date.getMonth() + 1, // Get current month (0-11)
|
||||
daysMonth: this.getDaysInMonth(this.date.getMonth() + 1, this.date.getFullYear()),
|
||||
moon: this.getMoonPhase(this.date).phase
|
||||
};
|
||||
}
|
||||
|
||||
#createContext(names) {
|
||||
const wrap = document.createElement('div');
|
||||
|
||||
wrap.style.position = 'relative';
|
||||
wrap.style.height = this.options.size + 'px';
|
||||
wrap.style.width = this.options.size + 'px';
|
||||
|
||||
names.forEach(name => {
|
||||
const canvas = document.createElement('canvas');
|
||||
|
||||
canvas.style.position = 'absolute';
|
||||
canvas.style.top = '0px';
|
||||
canvas.style.left = '0px';
|
||||
canvas.style.height = '100%';
|
||||
canvas.style.width = '100%';
|
||||
canvas.height = canvas.offsetHeight;
|
||||
canvas.width = canvas.offsetWidth;
|
||||
|
||||
wrap.appendChild(canvas);
|
||||
this.parts.push({name: name, element: canvas, context: canvas.getContext('2d')});
|
||||
});
|
||||
|
||||
this.element.appendChild(wrap);
|
||||
this.parts.push({name: 'wrap', element: wrap});
|
||||
}
|
||||
|
||||
createOverlay() {
|
||||
const overlay = document.createElement('div');
|
||||
const text = document.createElement('p');
|
||||
const timeElement = document.createElement('span');
|
||||
const dateElement = document.createElement('span');
|
||||
|
||||
new DateDisplay(dateElement);
|
||||
new TimeDisplay(timeElement);
|
||||
|
||||
Object.assign(overlay.style, {
|
||||
zIndex: 5,
|
||||
position: 'absolute',
|
||||
top: '0px',
|
||||
left: '0px',
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
display: this.options.overlay ? 'flex' : 'none',
|
||||
// display: 'flex',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
backgroundColor: `rgba(0, 0, 0, .6)`,
|
||||
color: 'white'
|
||||
});
|
||||
overlay.dataset.part = 'overlay';
|
||||
|
||||
text.appendChild(timeElement);
|
||||
text.insertAdjacentText('beforeend', ' ');
|
||||
text.appendChild(dateElement);
|
||||
overlay.appendChild(text);
|
||||
this.element.appendChild(overlay);
|
||||
this.parts.push({name: 'overlay', element: overlay});
|
||||
}
|
||||
|
||||
removeOverlay() {
|
||||
const index = this.parts.findIndex(s => s.name === 'overlay');
|
||||
|
||||
if (index !== -1) {
|
||||
this.parts[index].element.remove();
|
||||
this.parts.splice(index, 1);
|
||||
this.draw();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Proxy für Optionen benutzen
|
||||
updateOptions(changes) {
|
||||
this.options = {...this.options, ...changes};
|
||||
|
||||
// TODO: Änderungen durch setzen von Optionen vornehmen, oder nicht?
|
||||
const drawOptions = new Set(['sections', 'h24']);
|
||||
const hasKey = Object.keys(changes).some(key => drawOptions.has(key));
|
||||
|
||||
if (hasKey) {
|
||||
this.draw();
|
||||
}
|
||||
}
|
||||
|
||||
updateShape(id, angle, max) {
|
||||
const shape = this.shapes.find(s => s.id === id);
|
||||
|
||||
if (shape) {
|
||||
shape.angle = angle;
|
||||
if (max) shape.max = max;
|
||||
}
|
||||
}
|
||||
|
||||
removeShape(id) {
|
||||
const index = this.shapes.findIndex(s => s.id === id);
|
||||
|
||||
if (index !== -1) {
|
||||
this.shapes.splice(index, 1);
|
||||
this.draw();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
clearShapes() {
|
||||
this.shapes = [];
|
||||
this.draw();
|
||||
}
|
||||
|
||||
findShape(id) {
|
||||
return this.shapes.some(s => s.id === id);
|
||||
}
|
||||
|
||||
getShape(id) {
|
||||
return this.shapes.find(s => s.id === id);
|
||||
}
|
||||
|
||||
addCircle(id, center, radius, color = `rgba(0, 0, 0, .1)`) {
|
||||
this.shapes.push({type: 'circle', id, center, radius, color});
|
||||
}
|
||||
|
||||
addRing(id, radius, angle, max, color = 'white', center = .5, stroke = 16) {
|
||||
this.shapes.push({type: 'ring', id, radius, angle, max, color, center, stroke});
|
||||
}
|
||||
|
||||
addSection(id, radius, color = 'black', center = .5, stroke = 1) {
|
||||
this.shapes.push({type: 'section', id, radius, color, center, stroke});
|
||||
}
|
||||
}
|
||||
|
||||
const container = document.querySelector('#clock main');
|
||||
const clock = new HippieClock(container);
|
||||
|
||||
clock.addCircle('base', .5, 1);
|
||||
clock.draw();
|
||||
|
||||
// TODO: Alternative mit requestAnimationFrame()
|
||||
// TODO: Möglichkeit für Start/Stop wie bei TimeDisplay
|
||||
setInterval(() => {
|
||||
clock.update();
|
||||
}, 1000);
|
||||
|
||||
// TODO: Aktionen gehören quasi zu HippieClock
|
||||
document.getElementById('tglFormat').addEventListener('click', () => {
|
||||
if (clock) {
|
||||
clock.updateOptions({h24: !clock.options.h24});
|
||||
document.getElementById('tglFormat').textContent = clock.options.h24 ? '12-Stunden' : '24-Stunden';
|
||||
} else {
|
||||
console.log('No clock available');
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('tglSections').addEventListener('click', () => {
|
||||
if (clock) {
|
||||
clock.updateOptions({sections: !clock.options.sections});
|
||||
} else {
|
||||
console.log('No clock available');
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('tglOverlay').addEventListener('click', () => {
|
||||
if (clock) {
|
||||
// TODO: Anzeigen und ausblenden, anstatt löschen und hinzufügen?
|
||||
clock.updateOptions({overlay: !clock.options.overlay});
|
||||
|
||||
if (clock.options.overlay) {
|
||||
clock.createOverlay();
|
||||
} else {
|
||||
clock.removeOverlay();
|
||||
}
|
||||
} else {
|
||||
console.log('No clock available');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
22
source/view/demo/examples/game/index.liquid
Normal file
22
source/view/demo/examples/game/index.liquid
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
title: Game
|
||||
tags:
|
||||
- demoExample
|
||||
- index
|
||||
---
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="sec_main_center">
|
||||
<nav role="doc-toc">
|
||||
<h1>{{ title }}</h1>
|
||||
<ul class="link">
|
||||
{%- for game in collections.game -%}
|
||||
<li>
|
||||
<a href="{{ game.page.url }}">{{ game.data.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{% endblock %}
|
||||
141
source/view/demo/examples/game/intro.liquid
Normal file
141
source/view/demo/examples/game/intro.liquid
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
---
|
||||
title: Intro
|
||||
tags:
|
||||
- game
|
||||
---
|
||||
{% assign bodyClass = 'body_intro' -%}
|
||||
{% layout 'hippie/app.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<div id="loader" class="step op_show">
|
||||
<div id="bar">
|
||||
<div id="spinner">
|
||||
<span>I</span>
|
||||
</div>
|
||||
<div id="wrap">
|
||||
<div id="progress"></div>
|
||||
</div>
|
||||
<div id="status">0%</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="init" class="step op_hide">
|
||||
<div id="hint" class="toast di_none" role="alert" aria-live="assertive" aria-atomic="true">
|
||||
<p>Hold
|
||||
<kbd>space</kbd>
|
||||
to skip.</p>
|
||||
</div>
|
||||
{% brand 'brand' %}
|
||||
<h1>Marke</h1>
|
||||
{% endbrand %}
|
||||
<p>Powered by</p>
|
||||
<ul class="tech-stack">
|
||||
<li>Vendor</li>
|
||||
<li>IDE</li>
|
||||
<li>Engine</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="agreement" class="step op_hide">
|
||||
<h1>Agreement</h1>
|
||||
<p>This needs to be seen and acknowledged.<br>So an interaction must be made to continue.</p>
|
||||
</div>
|
||||
<div id="idle" class="step op_hide">
|
||||
<div class="mouse_overlay"></div>
|
||||
<div class="hello">Hello World!</div>
|
||||
<p class="hello">Only left mouse click or any key</p>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block assets %}
|
||||
{{ block.super -}}
|
||||
<script src="/js/intro.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{%- block script %}
|
||||
{{ block.super -}}
|
||||
<script>
|
||||
//let intro = new Intro('Intro');
|
||||
//intro.init();
|
||||
|
||||
//const ui = new UI();
|
||||
//ui
|
||||
// .init()
|
||||
// .then(() => ui.showIntro())
|
||||
// .then(() => ui.showHint())
|
||||
// .then(() => ui.showIdle())
|
||||
// .catch((error) => console.error(error));
|
||||
|
||||
let introDelay = 6;
|
||||
let hintDelay = 1;
|
||||
let cycleDelay = 2;
|
||||
let isAgree = false;
|
||||
const steps = {
|
||||
agreement: {
|
||||
element: document.getElementById('agreement'),
|
||||
msgIn: 'Agreement shown.',
|
||||
msgOut: 'Agreement accepted.',
|
||||
msgNo: 'No agreement today.'
|
||||
}
|
||||
};
|
||||
const intro = document.getElementById('init');
|
||||
const agreement = steps.agreement.element;
|
||||
const hint = {
|
||||
element: document.getElementById('hint'),
|
||||
delay: hintDelay * 1000,
|
||||
show() {
|
||||
if (typeof this.timeoutId === 'number') {
|
||||
this.cancel();
|
||||
}
|
||||
this
|
||||
.element
|
||||
.classList
|
||||
.remove('di_none');
|
||||
this.timeoutId = setTimeout(() => {
|
||||
this.dismiss();
|
||||
}, this.delay);
|
||||
},
|
||||
dismiss() {
|
||||
this
|
||||
.element
|
||||
.classList
|
||||
.add('di_none');
|
||||
this.timeoutId = undefined;
|
||||
},
|
||||
cancel() {
|
||||
clearTimeout(this.timeoutId);
|
||||
}
|
||||
};
|
||||
const loader = document.getElementById('loader');
|
||||
const idle = {
|
||||
element: document.getElementById('idle'),
|
||||
delay: cycleDelay * 1000,
|
||||
position: 0,
|
||||
cycle() {
|
||||
if (typeof this.intervalId === 'number') {
|
||||
this.cancel();
|
||||
}
|
||||
this.intervalId = setInterval(() => {
|
||||
this.position++;
|
||||
if (this.position >= flagColors.length) {
|
||||
this.position = 0;
|
||||
}
|
||||
this.element.style.backgroundColor = '#' + flagColors[this.position];
|
||||
}, this.delay);
|
||||
},
|
||||
cancel() {
|
||||
this.intervalId && clearInterval(this.intervalId);
|
||||
}
|
||||
}
|
||||
init()
|
||||
.then(loadCore)
|
||||
.then(showIntro)
|
||||
.catch(er => console.error(er))
|
||||
.then(showAgreement)
|
||||
.then(showIdle)
|
||||
.catch(er => console.error(er))
|
||||
.finally(() => {
|
||||
console.debug('Init end.', isAgree);
|
||||
// location = 'demo/examples/ui/new.html';
|
||||
window.location.href = './menu.html';
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
16
source/view/demo/examples/game/menu.liquid
Normal file
16
source/view/demo/examples/game/menu.liquid
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
title: Menu
|
||||
tags:
|
||||
- game
|
||||
---
|
||||
{% assign bodyClass = 'body_menu' -%}
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
{% render 'hippie/partials/game-menu.liquid', links: menu %}
|
||||
<footer>
|
||||
{% brand 'brand', 'last' %}
|
||||
<p>Marke</p>
|
||||
{% endbrand %}
|
||||
</footer>
|
||||
{% endblock %}
|
||||
86
source/view/demo/examples/game/mwo.liquid
Normal file
86
source/view/demo/examples/game/mwo.liquid
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
---
|
||||
title: MWO
|
||||
tags:
|
||||
- game
|
||||
---
|
||||
{% assign bodyClass = 'body_mwo' -%}
|
||||
{% layout 'hippie/game.liquid' %}
|
||||
|
||||
{% block links %}
|
||||
{{ block.super -}}
|
||||
<link href="/vendor/bootstrap-icons/font/bootstrap-icons.min.css" rel="stylesheet">
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<canvas id="view"></canvas>
|
||||
|
||||
<header class="io controls">
|
||||
<nav>
|
||||
<button onclick="toggleAnimation()">Toggle</button>
|
||||
</nav>
|
||||
<nav>
|
||||
<span>Color</span>
|
||||
<button onclick="changeColor('black')">Black</button>
|
||||
<button onclick="changeColor('white')">White</button>
|
||||
<button onclick="changeColor('crimson')">Red</button>
|
||||
<button onclick="changeColor('#00ffff')">Cyan</button>
|
||||
</nav>
|
||||
<nav>
|
||||
<span>Crosshair</span>
|
||||
<button onclick="changeCrosshairStyle('cross')"><i class="bi bi-plus-lg"></i></button>
|
||||
<button onclick="changeCrosshairStyle('circle')"><i class="bi bi-circle"></i></button>
|
||||
<button onclick="changeCrosshairStyle('dot')"><i class="bi bi-dot"></i></button>
|
||||
<button onclick="changeCrosshairStyle('level')"><i class="bi bi-dash-circle"></i></button>
|
||||
</nav>
|
||||
<nav>
|
||||
<span>Connector</span>
|
||||
<button onclick="toggleConnector()">Toggle</button>
|
||||
<hr class="vertical">
|
||||
<button onclick="changeConnectorStyle('arrow')"><i class="bi bi-caret-up-fill"></i></button>
|
||||
<button onclick="changeConnectorStyle('square')"><i class="bi bi-square-fill"></i></button>
|
||||
<button onclick="changeConnectorStyle('circle')"><i class="bi bi-circle-fill"></i></button>
|
||||
<button onclick="changeConnectorStyle('diamond')"><i class="bi bi-diamond-fill"></i></button>
|
||||
</nav>
|
||||
</header>
|
||||
{% endblock %}
|
||||
|
||||
{% block assets %}
|
||||
<script src="/js/game.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script>
|
||||
const canvas = document.getElementById('view');
|
||||
canvas.width = window.innerWidth;
|
||||
canvas.height = window.innerHeight;
|
||||
|
||||
const crosshair = new HippieCrosshair(canvas);
|
||||
|
||||
function changeCrosshairStyle(style) {
|
||||
crosshair.setCrosshairStyle(style);
|
||||
}
|
||||
|
||||
function changeConnectorStyle(style) {
|
||||
crosshair.setConnectorStyle(style);
|
||||
}
|
||||
|
||||
function changeColor(color) {
|
||||
crosshair.setCrosshairColor(color);
|
||||
crosshair.setConnectorColor(color);
|
||||
crosshair.lineColor = `rgba(${parseInt(color.slice(1, 3), 16)}, ${parseInt(color.slice(3, 5), 16)}, ${parseInt(color.slice(5, 7), 16)}, 0.3)`;
|
||||
}
|
||||
|
||||
function toggleConnector() {
|
||||
crosshair.setConnectorVisibility(!crosshair.connectorShow);
|
||||
}
|
||||
|
||||
function toggleAnimation() {
|
||||
crosshair.toggleAnimation();
|
||||
}
|
||||
|
||||
window.addEventListener('resize', () => {
|
||||
canvas.width = window.innerWidth;
|
||||
canvas.height = window.innerHeight;
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
236
source/view/demo/examples/game/tfw.liquid
Normal file
236
source/view/demo/examples/game/tfw.liquid
Normal file
|
|
@ -0,0 +1,236 @@
|
|||
---
|
||||
title: TFW
|
||||
tags:
|
||||
- game
|
||||
---
|
||||
{% assign bodyClass = 'body_tfw' -%}
|
||||
{% layout 'hippie/game.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<header class="io">
|
||||
<button data-action="escape">☰</button>
|
||||
<button data-direction="previous"><</button>
|
||||
<button data-view="quest">Quests</button>
|
||||
<button data-view="region">Regions</button>
|
||||
<button data-view="vendor">Vendors</button>
|
||||
<button data-view="manufacture">Manufacture</button>
|
||||
<button data-view="character">Characters</button>
|
||||
<button data-view="stash">Stash</button>
|
||||
<button data-view="secret">Secret Storage</button>
|
||||
<button data-view="squad">Squads</button>
|
||||
<button data-view="ready">Ready Room</button>
|
||||
<button data-direction="next">></button>
|
||||
</header>
|
||||
<div id="viewQuest" class="view">
|
||||
<main>
|
||||
<nav>
|
||||
<div class="important">Filter</div>
|
||||
<input placeholder="Search" aria-label="search" type="text">
|
||||
<select name="type" aria-label="type">
|
||||
<option value="" selected>Type</option>
|
||||
<option value="all">All</option>
|
||||
<option value="assasin">Assasination</option>
|
||||
<option value="loot">Looting</option>
|
||||
<option value="extract">Extract</option>
|
||||
<option value="fetch">Fetch</option>
|
||||
<option value="kill">Kill</option>
|
||||
</select>
|
||||
</nav>
|
||||
<div>
|
||||
<div>
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="l">
|
||||
<col class="q">
|
||||
<col class="t">
|
||||
</colgroup>
|
||||
<tr>
|
||||
<th>Location</th>
|
||||
<th>Quest</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="background">
|
||||
<span>Scorched Earth</span>
|
||||
</td>
|
||||
<td>...</td>
|
||||
<td class="subtle">Available</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="background">
|
||||
<span>Location name</span>
|
||||
</td>
|
||||
<td>...</td>
|
||||
<td class="subtle">Available</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
<table>
|
||||
<colgroup>
|
||||
<col class="l">
|
||||
<col class="q">
|
||||
<col class="s">
|
||||
</colgroup>
|
||||
<tr>
|
||||
<th colspan="3">Active quests (Max.: 4)</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="background"></td>
|
||||
<td>King Of Kings</td>
|
||||
<td class="subtle">Active</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="background"></td>
|
||||
<td>Garage Days Pt. 1</td>
|
||||
<td class="subtle success">Complete</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="quest">
|
||||
<div class="background">
|
||||
<h2>King Of Kings</h2>
|
||||
</div>
|
||||
<p>A hijacked medium mech dubbed the "Rat King" ...</p>
|
||||
<hr class="dotted">
|
||||
<p>Collect Rat King residue.</p>
|
||||
<hr>
|
||||
<p>Multiple rig container upgrades, 5000 CR, 5000 XP, 2 days of water, + Scav faction
|
||||
rating</p>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<footer class="io">
|
||||
<button data-action="back">Back</button>
|
||||
<button data-action="accept">Accept</button>
|
||||
</footer>
|
||||
</div>
|
||||
<div id="viewRegion" class="view"></div>
|
||||
<div id="viewVendor" class="view"></div>
|
||||
{% endblock %}
|
||||
|
||||
{%- block script %}
|
||||
{{ block.super -}}
|
||||
<script>
|
||||
const menu = document.querySelector('body > header');
|
||||
const placeholder = document.querySelectorAll('.background');
|
||||
const viewQuest = document.getElementById('viewQuest');
|
||||
|
||||
class Menu {
|
||||
constructor(element, options = {}) {
|
||||
this._element = element;
|
||||
this._siblings = element.querySelectorAll('button[data-view]');
|
||||
this.default = options.default || 'quest';
|
||||
|
||||
element.addEventListener('click', this.onClick.bind(this)); // Bind to get the clicked element and not the DOM element of the class
|
||||
|
||||
this.#init();
|
||||
}
|
||||
|
||||
escape() {
|
||||
console.log('escape');
|
||||
}
|
||||
|
||||
#init() {
|
||||
const currentBtn = Array.from(this._siblings).find(
|
||||
el => el.dataset.view === this.default
|
||||
);
|
||||
|
||||
currentBtn.classList.add('active');
|
||||
this.changeView(this.default);
|
||||
}
|
||||
|
||||
// TODO: Sollte auch die Menüauswahl anpassen
|
||||
changeView(type) {
|
||||
console.debug(type);
|
||||
const id = 'view' + capitalizeFirstLetter(type);
|
||||
const views = document.querySelectorAll('.view');
|
||||
|
||||
for (const view of views) {
|
||||
view.style.display = 'none';
|
||||
}
|
||||
|
||||
document.getElementById(id).style.display = 'flex';
|
||||
}
|
||||
|
||||
onClick(event) {
|
||||
const siblings = this._siblings;
|
||||
const action = event.target.dataset.action;
|
||||
const view = event.target.dataset.view;
|
||||
const direction = event.target.dataset.direction;
|
||||
|
||||
if (event.button !== 0) return;
|
||||
|
||||
if (direction) {
|
||||
const currentBtn = this._element.querySelector('.active');
|
||||
let newButton, newView = undefined;
|
||||
|
||||
if (currentBtn === null) return;
|
||||
|
||||
if (direction === 'next') {
|
||||
newButton = currentBtn.nextElementSibling;
|
||||
newView = currentBtn.nextElementSibling.dataset.view;
|
||||
} else {
|
||||
newButton = currentBtn.previousElementSibling;
|
||||
newView = currentBtn.previousElementSibling.dataset.view;
|
||||
}
|
||||
|
||||
if (!newButton.dataset.view) {
|
||||
newButton = direction === 'next' ? siblings[0] : siblings[siblings.length - 1];
|
||||
}
|
||||
|
||||
currentBtn.classList.remove('active');
|
||||
newButton.classList.add('active');
|
||||
this.changeView(newView);
|
||||
}
|
||||
|
||||
if (view) {
|
||||
for (const sibling of siblings) {
|
||||
sibling.classList.remove('active');
|
||||
}
|
||||
|
||||
this.changeView(view);
|
||||
event.target.classList.add('active');
|
||||
}
|
||||
|
||||
if (action) this[action]();
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: Allgemeinere Umsetzung anstreben
|
||||
viewQuest.addEventListener('click', (event) => {
|
||||
const rows = viewQuest.querySelectorAll('tr');
|
||||
const rowTarget = event.target.closest('tr');
|
||||
|
||||
if (event.button !== 0) return;
|
||||
|
||||
// TODO: Ziele unterscheiden
|
||||
if (rowTarget) {
|
||||
for (const row of rows) {
|
||||
row.classList.remove('active');
|
||||
}
|
||||
|
||||
rowTarget.classList.add('active');
|
||||
document.querySelector('.quest').style.opacity = 1;
|
||||
document.querySelector('footer button[data-action=accept]').style.display = 'inline-block';
|
||||
}
|
||||
});
|
||||
|
||||
placeholder.forEach(element => {
|
||||
const hue = randomIntFrom(0, 360);
|
||||
const grayscale = randomFloatFrom(0, 1);
|
||||
|
||||
new RandomPixelPlaceholder(element, {
|
||||
width: Math.floor(element.clientWidth),
|
||||
height: Math.floor(element.clientHeight),
|
||||
colors: ['#fad803', '#d30a51', '#273f8b', '#b7e0f0', '#52bed1', '#0c85ff'],
|
||||
filter: 'grayscale(' + grayscale + ') hue-rotate(' + hue + 'deg)',
|
||||
type: 'img'
|
||||
});
|
||||
});
|
||||
|
||||
new Menu(menu);
|
||||
</script>
|
||||
{% endblock %}
|
||||
10
source/view/demo/examples/hello.md
Normal file
10
source/view/demo/examples/hello.md
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
title: "Hello World"
|
||||
layout: hippie/world.liquid
|
||||
tags:
|
||||
- demoExample
|
||||
---
|
||||
|
||||
# {{ title }}
|
||||
|
||||
This is a simple example for a *screen* written in Markdown, using Liquid *templates*.
|
||||
167
source/view/demo/examples/matrix.liquid
Normal file
167
source/view/demo/examples/matrix.liquid
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
---
|
||||
title: Matrix
|
||||
tags:
|
||||
- demoExample
|
||||
---
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block style %}
|
||||
<style>
|
||||
html, body {
|
||||
height: 100vh;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
background-color: grey;
|
||||
font-family: 'Courier New', Courier, monospace;
|
||||
}
|
||||
|
||||
#canvas {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<canvas id="canvas"></canvas>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script>
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const canvas = document.getElementById("canvas");
|
||||
const ctx = canvas.getContext("2d");
|
||||
// const observer = new ResizeObserver(() => {
|
||||
// canvas.width = canvas.clientWidth;
|
||||
// canvas.height = canvas.clientHeight;
|
||||
// console.log("resize");
|
||||
// });
|
||||
|
||||
canvas.width = canvas.clientWidth;
|
||||
canvas.height = canvas.clientHeight;
|
||||
|
||||
// observer.observe(canvas);
|
||||
|
||||
ctx.font = "24px 'Courier New', Courier, monospace";
|
||||
ctx.textBaseline = "top";
|
||||
|
||||
let char = characters.charAt(Math.floor(Math.random() * characters.length));
|
||||
let charMeasure = ctx.measureText(char);
|
||||
let charW = Math.ceil(Math.max(charMeasure.actualBoundingBoxLeft + charMeasure.actualBoundingBoxRight, charMeasure.width));
|
||||
let charH = charMeasure.fontBoundingBoxDescent + charMeasure.fontBoundingBoxAscent;
|
||||
let glyph = {
|
||||
text: char,
|
||||
x: 0,
|
||||
y: 0,
|
||||
w: charH,
|
||||
h: charH
|
||||
}
|
||||
let lane = [];
|
||||
let max = Math.floor(canvas.clientHeight / glyph.h);
|
||||
|
||||
let newId = undefined;
|
||||
let holdId = undefined;
|
||||
let cleanId = undefined;
|
||||
let newInterval = 300;
|
||||
let holdInterval = 1000;
|
||||
let cleanInterval = 400;
|
||||
let newIndex = 0;
|
||||
let cleanIndex = randomIntFrom(1, max);
|
||||
|
||||
console.log("init", newInterval);
|
||||
console.log(glyph);
|
||||
|
||||
newId = setInterval(newTrail, newInterval);
|
||||
|
||||
function newTrail() {
|
||||
clearInterval(holdId);
|
||||
|
||||
glyph.text = characters.charAt(Math.floor(Math.random() * characters.length));
|
||||
console.log(newIndex, glyph.text);
|
||||
|
||||
lane.push([newIndex, glyph.text, glyph.y]);
|
||||
|
||||
ctx.fillStyle = "white";
|
||||
ctx.fillRect(glyph.x, glyph.y, glyph.w, glyph.h);
|
||||
ctx.fillStyle = "black";
|
||||
ctx.fillText(glyph.text, Math.floor((charH - charW) / 2), glyph.y);
|
||||
|
||||
if (newIndex > 0) {
|
||||
let prevY = glyph.y - glyph.h;
|
||||
let alpha = randomBetween(.2, 1);
|
||||
ctx.clearRect(glyph.x, prevY, glyph.w, glyph.h);
|
||||
ctx.fillStyle = "rgba(0, 0, 0, " + alpha + ")";
|
||||
ctx.fillRect(glyph.x, prevY, glyph.w, glyph.h);
|
||||
ctx.fillStyle = "rgba(255, 255, 255, " + alpha + ")";
|
||||
// TODO: can not use array lane if it is changed by cleanTrail()
|
||||
ctx.fillText(lane[newIndex - 1][1], Math.floor((charH - charW) / 2), prevY);
|
||||
}
|
||||
|
||||
if (newIndex === cleanIndex) {
|
||||
console.log("clean", cleanInterval, cleanIndex);
|
||||
|
||||
cleanId = setInterval(cleanTrail, cleanInterval);
|
||||
}
|
||||
|
||||
newIndex++;
|
||||
glyph.y += glyph.h;
|
||||
|
||||
if (newIndex > max) {
|
||||
// console.log("hold", holdInterval);
|
||||
console.log("end");
|
||||
|
||||
clearInterval(newId);
|
||||
|
||||
newIndex = 0;
|
||||
glyph.y = 0;
|
||||
newInterval = randomIntFrom(100, 1000, 2);
|
||||
|
||||
// holdId = setTimeout(() => {
|
||||
// console.log("clean", cleanInterval);
|
||||
|
||||
// holdInterval = randomIntFrom(1000, 10000, 3);
|
||||
// cleanId = setInterval(cleanTrail, cleanInterval);
|
||||
// }, holdInterval);
|
||||
}
|
||||
}
|
||||
|
||||
function cleanTrail() {
|
||||
let pos = lane.shift();
|
||||
console.log(pos);
|
||||
|
||||
ctx.clearRect(0, pos[2], glyph.w, glyph.h);
|
||||
|
||||
if (!lane.length) {
|
||||
console.log("hold", holdInterval);
|
||||
|
||||
clearInterval(cleanId);
|
||||
|
||||
holdId = setTimeout(() => {
|
||||
console.clear();
|
||||
console.log("new", newInterval);
|
||||
|
||||
cleanIndex = randomIntFrom(1, max);
|
||||
cleanInterval = randomIntFrom(1000, 10000, 3);
|
||||
holdInterval = randomIntFrom(1000, 10000, 3);
|
||||
newId = setInterval(newTrail, newInterval);
|
||||
}, holdInterval);
|
||||
}
|
||||
}
|
||||
|
||||
function randomBetween(min, max) {
|
||||
return (Math.random() * (max - min) + min).toFixed(2);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
29
source/view/demo/examples/portal.liquid
Normal file
29
source/view/demo/examples/portal.liquid
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
title: Portal
|
||||
tags:
|
||||
- demoExample
|
||||
image:
|
||||
src: '/art/flag_websafe_128x80.gif'
|
||||
alt: 'Flag of Interaktionsweise'
|
||||
links:
|
||||
- name: '1'
|
||||
href: 'http://domain.tld'
|
||||
img: '/art/bullet.gif'
|
||||
- name: 'Zwei'
|
||||
href: 'http://domain.tld'
|
||||
img: '/art/bullet.gif'
|
||||
---
|
||||
{% assign bodyClass = "body_portal" %}
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="portal">
|
||||
{% render 'hippie/partials/gate-list',
|
||||
name: 'Tor mit Symbol und Liste',
|
||||
url: '../demo',
|
||||
image: image,
|
||||
links: links
|
||||
%}
|
||||
{% render 'hippie/partials/gate-simple', name: 'Tor', url: '../demo' %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
39
source/view/demo/examples/songbook.liquid
Normal file
39
source/view/demo/examples/songbook.liquid
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
title: Songbook
|
||||
tags:
|
||||
- demoExample
|
||||
---
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="sec_main_center">
|
||||
<header class="header_txt">
|
||||
<h1>Titel</h1>
|
||||
<p>Jahr</p>
|
||||
</header>
|
||||
<nav role="doc-toc">
|
||||
<h2>Inhaltsverzeichnis</h2>
|
||||
<ul>
|
||||
{%- for song in collections.song -%}
|
||||
<li>
|
||||
<a href="{{ song.page.url }}">{{ song.data.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</nav>
|
||||
<h2>Vorwort</h2>
|
||||
<p>Liederbuch für
|
||||
<em>Name</em>.</p>
|
||||
<p>Gibt es gebunden und hier
|
||||
{% link hippie.placeholders.domain %}.<br/>
|
||||
Bestellungen bitte an
|
||||
{% text hippie.placeholders.name %}
|
||||
richten.</p>
|
||||
<hr class="double dotted">
|
||||
{%- for piece in collections.song -%}
|
||||
{% render 'hippie/partials/song.liquid', index: forloop.index0, data: piece.data, content: piece.content %}
|
||||
{%- endfor -%}
|
||||
<hr/>
|
||||
<address>{% text hippie.placeholders.name %}</address>
|
||||
</div>
|
||||
{% endblock %}
|
||||
26
source/view/demo/examples/songbook/0_artist-title.md
Executable file
26
source/view/demo/examples/songbook/0_artist-title.md
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
---
|
||||
tags:
|
||||
- songbook
|
||||
- song
|
||||
title: "Interpret - Titel"
|
||||
releaseDate: JJJJ
|
||||
description: Text
|
||||
---
|
||||
~~~
|
||||
[verse 1]
|
||||
strophe 1
|
||||
|
||||
[chorus]
|
||||
refrain
|
||||
|
||||
[verse 2]
|
||||
strophe 2
|
||||
|
||||
[chorus]
|
||||
[bridge]
|
||||
überleitung
|
||||
|
||||
[interlude]
|
||||
[chorus]
|
||||
[outro]
|
||||
~~~
|
||||
184
source/view/demo/examples/start.liquid
Normal file
184
source/view/demo/examples/start.liquid
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
---
|
||||
title: Start
|
||||
tags:
|
||||
- demoExample
|
||||
---
|
||||
{% assign pageId = page.fileSlug -%}
|
||||
{% assign bodyClass = 'body_start' -%}
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
{% render 'hippie/partials/header-status', hippie: hippie, links: start %}
|
||||
<main>
|
||||
<header class="io">
|
||||
<form id="wwwForm" class="group_nav" action="https://duckduckgo.com/">
|
||||
<input id="qrySearch" class="input_io" name="q" placeholder="Suchbegriff" type="text" required/>
|
||||
<input class="button_io" value="Suchen" type="submit"/>
|
||||
</form>
|
||||
<nav>
|
||||
<hr class="vertical">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="" class="a_button">A</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">B</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="area">
|
||||
<div>1</div>
|
||||
<div>2</div>
|
||||
<div>3</div>
|
||||
<div>4</div>
|
||||
</div>
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
||||
{% block assets %}
|
||||
<script src="/vendor/hippie-script.js"></script>
|
||||
<script src="/js/globals.js"></script>
|
||||
<script src="/js/app.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
<script>
|
||||
const timeElement = document.getElementById('time');
|
||||
const dateElement = document.getElementById('date');
|
||||
// NOTE: https://duckduckgo.com/duckduckgo-help-pages/settings/params
|
||||
const defaultOptions = {
|
||||
kl: 'de-de',
|
||||
kp: '-2',
|
||||
kz: '-1',
|
||||
// kae: 't',
|
||||
k1: '-1'
|
||||
};
|
||||
let options = Object.assign({}, defaultOptions);
|
||||
|
||||
function setOptions(jsonOptions) {
|
||||
if (!jsonOptions || typeof jsonOptions !== 'object') return;
|
||||
|
||||
options = Object.assign({}, options, jsonOptions);
|
||||
}
|
||||
|
||||
function buildSearchUrl(query) {
|
||||
const base = 'https://duckduckgo.com/';
|
||||
const params = new URLSearchParams({q: query});
|
||||
|
||||
for (const [k, v] of Object.entries(options)) {
|
||||
if (v === undefined || v === null || v === '') continue;
|
||||
|
||||
params.set(k, String(v));
|
||||
}
|
||||
|
||||
return base + '?' + params.toString();
|
||||
}
|
||||
|
||||
// Example of setting options programmatically:
|
||||
// setOptions({ kl: 'de-de', kp: '2', iar: 'images' });
|
||||
|
||||
new TimeDisplay(timeElement, {hour: '2-digit', minute: '2-digit'});
|
||||
new DateDisplay(dateElement, {
|
||||
weekday: "long",
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
});
|
||||
// ongoing();
|
||||
|
||||
document.addEventListener('mousemove', (event) => {
|
||||
document
|
||||
.getElementById('log')
|
||||
.textContent = "X: " + event.pageX + ", Y: " + event.pageY;
|
||||
});
|
||||
|
||||
document.getElementById('wwwForm').addEventListener('submit', function (event) {
|
||||
event.preventDefault();
|
||||
const query = document.getElementById('qrySearch').value.trim();
|
||||
|
||||
if (!query) return;
|
||||
|
||||
const url = buildSearchUrl(query);
|
||||
|
||||
window.open(url, '_blank', 'noopener');
|
||||
});
|
||||
|
||||
function ongoing() {
|
||||
var now = new Date();
|
||||
var w = Math.floor(now.getDay());
|
||||
var D = ['Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'];
|
||||
var DNumb = Math.floor(now.getDate());
|
||||
var MNumb = Math.floor(now.getMonth());
|
||||
var M = ['Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'];
|
||||
var y = Math.floor(now.getYear());
|
||||
if (y < 999) y += 1900;
|
||||
|
||||
var ms = Math.floor(now.getMilliseconds());
|
||||
var s = Math.floor(now.getSeconds());
|
||||
var m = Math.floor(now.getMinutes() + s / 60);
|
||||
var h = Math.floor(now.getHours() + m / 60);
|
||||
|
||||
var j2000 = new Date(); // Bezugspunkt ist der 1.1.2000 0:00 UT (entspricht JD 2451544,5)
|
||||
j2000.setUTCFullYear(2000, 0, 1);
|
||||
j2000.setUTCHours(0, 0, 0, 0);
|
||||
|
||||
var utc = new Date();
|
||||
utc.setUTCFullYear(y, MNumb, DNumb); // Monate müssen im Wertebereich 0...11 übergeben werden
|
||||
utc.setUTCHours(h, m, s, ms);
|
||||
|
||||
var utc0 = new Date();
|
||||
utc0.setUTCFullYear(y, MNumb, DNumb);
|
||||
utc0.setUTCHours(0, 0, 0, 0);
|
||||
|
||||
var jd = 2451544.5 + (utc - j2000) / 86400000; // Zählung erfolgt in Millisekunden, 1 Tag = 86.400.000 ms
|
||||
var jdUTC0 = 2451544.5 + (utc0 - j2000) / 86400000;
|
||||
|
||||
var N = jd - 2451545.0;
|
||||
var L = 280.460 + 0.9856474 * N; // mittlere ekliptikale Länge der Sonne
|
||||
var g = 357.528 + 0.9856003 * N; // mittlere Anomalie
|
||||
var el = L + 1.915 * Math.sin(g) + 0.020 * Math.sin(2 * g);
|
||||
var e = 23.439 - 0.0000004 * N;
|
||||
var rektaszension = Math.atan((Math.cos(e) * Math.sin(el)) / Math.cos(el));
|
||||
|
||||
var T = (jdUTC0 - 2451545.0) / 36525;
|
||||
var stGMT = (((6 * 3600) + (41 * 60) + 50.54841) + (8640184.812866 * T) + (0.093104 * Math.pow(T, 2)) - (0.0000062 * Math.pow(T, 3))) / 3600;
|
||||
|
||||
var stGMT2 = 6.697376 + 2400.05134 * T + 1.002738 * T;
|
||||
var hWGMT = stGMT2 * 15;
|
||||
var hW = hWGMT + 11.9566185772;
|
||||
|
||||
var st = (stGMT + (now.getUTCHours() * 1.00273790935)) + (11.9566185772 / 15); // Sommerzeit muss noch berücksichtigt werden
|
||||
var st24 = Math.abs(st - (Math.round(st / 24) * 24));
|
||||
var stH = Math.floor(st24);
|
||||
var stM = Math.floor((st24 % 1) * 60);
|
||||
var stS = zeroFill(Math.floor((((st24 % 1) * 60) % 1) * 60), 2);
|
||||
|
||||
const travelWidth = document.body.clientWidth;
|
||||
const travelHeight = document.body.clientHeight;
|
||||
var sunPosX = 0;
|
||||
var sunPosY = 0;
|
||||
var moonPosX = 0;
|
||||
var moonPosY = 0;
|
||||
|
||||
const sun = document.getElementById('sun');
|
||||
|
||||
if (sun) {
|
||||
sun.style.left = (s / 60) * travelWidth;
|
||||
sun.style.top = (m / 60) * travelHeight;
|
||||
}
|
||||
|
||||
/*document.getElementById('time').textContent = '' + zeroFill(h, 2) + ':' + zeroFill(m, 2) + ':' + zeroFill(s, 2);
|
||||
document.getElementById('day').textContent = D[w];
|
||||
document.getElementById('dayNumb').textContent = DNumb;
|
||||
document.getElementById('month').textContent = M[MNumb];
|
||||
document.getElementById('year').textContent = y;
|
||||
|
||||
document.getElementById('julian').textContent = jd.toFixed(6);
|
||||
document.getElementById('star').textContent = stH + ':' + stM + ':' + stS;
|
||||
document.getElementById('star').textContent = stH + ':' + stM;
|
||||
document.getElementById('star1').textContent = stGMT;
|
||||
document.getElementById('star2').textContent = stGMT2;*/
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
60
source/view/demo/examples/ui/cli.liquid
Normal file
60
source/view/demo/examples/ui/cli.liquid
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
---
|
||||
title: CLI
|
||||
tags:
|
||||
- ui
|
||||
---
|
||||
{% assign bodyClass = 'body_cli' -%}
|
||||
{% layout 'hippie/app.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<div id="cli">
|
||||
<div id="history">
|
||||
<pre>Previous prompt</pre>
|
||||
</div>
|
||||
<div id="line">
|
||||
<textarea name="prefix" id="prefix" rows="1" cols="1" readonly>></textarea>
|
||||
<textarea name="prompt" id="prompt" rows="1" autofocus></textarea>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{%- block script %}
|
||||
{{ block.super -}}
|
||||
<script>
|
||||
function resizeTextArea(textarea) {
|
||||
const {style, value} = textarea;
|
||||
|
||||
style.height = style.minHeight = 'auto';
|
||||
style.minHeight = `${Math.min(textarea.scrollHeight + 4, parseInt(textarea.style.maxHeight))}px`;
|
||||
style.height = `${textarea.scrollHeight}px`;
|
||||
}
|
||||
|
||||
const textarea = document.getElementById('prompt');
|
||||
|
||||
document
|
||||
.body
|
||||
.addEventListener('click', () => {
|
||||
textarea.focus();
|
||||
});
|
||||
|
||||
textarea.addEventListener('input', () => {
|
||||
resizeTextArea(textarea);
|
||||
});
|
||||
|
||||
window.addEventListener("keydown", (event) => {
|
||||
if (event.key === 'Enter' && !event.shiftKey) {
|
||||
event.preventDefault();
|
||||
|
||||
const p = document.createElement("pre");
|
||||
|
||||
p.textContent = event.target.value;
|
||||
document
|
||||
.getElementById("history")
|
||||
.appendChild(p);
|
||||
// window.scrollTo(0, document.body.scrollHeight);
|
||||
|
||||
event.target.value = '';
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
52
source/view/demo/examples/ui/drag.liquid
Executable file
52
source/view/demo/examples/ui/drag.liquid
Executable file
|
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
title: Drag
|
||||
tags:
|
||||
- ui
|
||||
---
|
||||
{% layout 'hippie/app.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<header class="io pos_fix pin_top pin_right pin_left">
|
||||
<button data-action="add">Add</button>
|
||||
</header>
|
||||
<div id="space"></div>
|
||||
<div>
|
||||
<div id="test">
|
||||
<div class="body_frame">
|
||||
{% render 'hippie/partials/frame-header.liquid' %}
|
||||
<main></main>
|
||||
{% render 'hippie/partials/frame-mode.liquid' %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block assets %}
|
||||
{{ block.super -}}
|
||||
<script src="/js/drag.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{%- block script %}
|
||||
<script>
|
||||
// Get the space element
|
||||
const space = document.getElementById('space');
|
||||
const add = document.querySelector('[data-action=add]');
|
||||
const test = document.getElementById('test');
|
||||
|
||||
// Add event listener to the add space button
|
||||
add.addEventListener('click', () => {
|
||||
const newDiv = new NewDiv(100, 100, 100, 100, getRandomColor());
|
||||
newDiv.createDiv();
|
||||
newDiv.appendToFrame(space);
|
||||
});
|
||||
|
||||
// Create a new NewDiv instance
|
||||
const newDiv = new NewDiv(100, 100, 200, 200, '#000');
|
||||
newDiv.createDiv();
|
||||
newDiv.appendToFrame(space);
|
||||
|
||||
const explorer = new NewDiv(256, 128, 800, 600, '#fff', test);
|
||||
explorer.createDiv();
|
||||
explorer.appendToFrame(space);
|
||||
</script>
|
||||
{% endblock %}
|
||||
145
source/view/demo/examples/ui/explorer.liquid
Normal file
145
source/view/demo/examples/ui/explorer.liquid
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
---
|
||||
title: Explorer
|
||||
tags:
|
||||
- ui
|
||||
---
|
||||
{% assign bodyClass = 'body_frame' -%}
|
||||
{% layout 'hippie/app.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
{% render 'hippie/partials/frame-header.liquid' %}
|
||||
<main class="io">
|
||||
<aside class="io">
|
||||
<nav>
|
||||
<span>location-pane</span>
|
||||
<ul class="vertical">
|
||||
<li>
|
||||
<a class="a_button" href="">
|
||||
<span>Start/Home</span>
|
||||
<i class="bi bi-pin-fill"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="a_button" href="">
|
||||
<span>System</span>
|
||||
<i class="bi bi-pin-fill"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<hr>
|
||||
<nav>
|
||||
<ul class="vertical">
|
||||
<li>
|
||||
<a class="a_button" href="">
|
||||
<span>💽 disc link</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="a_button" href="">
|
||||
<span>📁 folder link</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="a_button" href="">
|
||||
<span>🔗 location link</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</aside>
|
||||
<section>
|
||||
<header class="io">
|
||||
<nav>
|
||||
<button title="back">
|
||||
<i class="bi bi-caret-left"></i>
|
||||
</button>
|
||||
<button title="up">
|
||||
<i class="bi bi-caret-up"></i>
|
||||
</button>
|
||||
<button title="forward">
|
||||
<i class="bi bi-caret-right"></i>
|
||||
</button>
|
||||
<button title="reload">
|
||||
<i class="bi bi-arrow-clockwise"></i>
|
||||
</button>
|
||||
<input placeholder="//" type="text">
|
||||
</nav>
|
||||
<nav>
|
||||
<span>location-bar</span>
|
||||
<hr class="vertical">
|
||||
<button title="search">
|
||||
<i class="bi bi-search"></i>
|
||||
</button>
|
||||
<input placeholder="*" type="text">
|
||||
</nav>
|
||||
</header>
|
||||
<header class="io">
|
||||
<nav>
|
||||
<button title="add">
|
||||
<i class="bi bi-plus-circle"></i>
|
||||
</button>
|
||||
<div class="spacer a"></div>
|
||||
<button title="cut">
|
||||
<i class="bi bi-scissors"></i>
|
||||
</button>
|
||||
<button title="copy">
|
||||
<i class="bi bi-copy"></i>
|
||||
</button>
|
||||
<button title="paste">
|
||||
<i class="bi bi-clipboard-check-fill"></i>
|
||||
</button>
|
||||
<div class="spacer b"></div>
|
||||
<button title="delete">
|
||||
<i class="bi bi-trash"></i>
|
||||
</button>
|
||||
</nav>
|
||||
<hr class="vertical">
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<button title="collapse">
|
||||
<i class="bi bi-arrows-collapse"></i>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button title="expand">
|
||||
<i class="bi bi-arrows-expand-vertical"></i>
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
<span>options-bar</span>
|
||||
</nav>
|
||||
<nav></nav>
|
||||
</header>
|
||||
<div id="content">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>name</th>
|
||||
<th>date</th>
|
||||
<th>type</th>
|
||||
<th>size</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>folder</td>
|
||||
<td>YYYY-MM-DD</td>
|
||||
<td>folder</td>
|
||||
<td>4KB</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>file</td>
|
||||
<td>YYYY-MM-DD</td>
|
||||
<td>folder</td>
|
||||
<td>1B</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% render 'hippie/partials/frame-status.liquid' %}
|
||||
</section>
|
||||
</main>
|
||||
{% render 'hippie/partials/frame-mode.liquid' %}
|
||||
{% endblock %}
|
||||
56
source/view/demo/examples/ui/form.liquid
Normal file
56
source/view/demo/examples/ui/form.liquid
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
title: Form
|
||||
tags:
|
||||
- ui
|
||||
---
|
||||
{% assign bodyClass = 'body_frame' -%}
|
||||
{% layout 'hippie/app.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
{% render 'hippie/partials/frame-header.liquid' %}
|
||||
<header class="io">
|
||||
<h1>Formulare</h1>
|
||||
<button data-action="add">Hinzufügen</button>
|
||||
<button data-action="change">Ändern</button>
|
||||
<hr>
|
||||
</header>
|
||||
<form id="form" action="">
|
||||
<div id="grid">
|
||||
<div>a</div>
|
||||
<div>b</div>
|
||||
<div>c</div>
|
||||
</div>
|
||||
</form>
|
||||
{% endblock %}
|
||||
|
||||
{%- block script %}
|
||||
{{ block.super -}}
|
||||
<script>
|
||||
const add = document.querySelector('[data-action=add]');
|
||||
const change = document.querySelector('[data-action=change]');
|
||||
const grid = document.getElementById('grid');
|
||||
|
||||
add.addEventListener('click', (e) => {
|
||||
const item = document.createElement('div');
|
||||
|
||||
item.style.backgroundColor = '#f0f';
|
||||
item.textContent = 'c'
|
||||
|
||||
grid.appendChild(item);
|
||||
});
|
||||
|
||||
change.addEventListener('click', (e) => {
|
||||
changeLayout(grid);
|
||||
});
|
||||
|
||||
function changeLayout(grid) {
|
||||
const currentTemplate = grid.style.gridTemplateColumns;
|
||||
|
||||
if (currentTemplate === 'repeat(4, 1fr)') {
|
||||
grid.style.gridTemplateColumns = 'repeat(2, 1fr)';
|
||||
} else {
|
||||
grid.style.gridTemplateColumns = 'repeat(4, 1fr)';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
78
source/view/demo/examples/ui/gallery.liquid
Executable file
78
source/view/demo/examples/ui/gallery.liquid
Executable file
|
|
@ -0,0 +1,78 @@
|
|||
---
|
||||
title: Gallery
|
||||
tags:
|
||||
- ui
|
||||
---
|
||||
{% assign bodyClass = 'body_frame' -%}
|
||||
{% layout 'hippie/app.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
{% render 'hippie/partials/frame-header.liquid' %}
|
||||
<main class="io">
|
||||
<section>
|
||||
<header class="io">
|
||||
<nav>
|
||||
<div class="group_nav">
|
||||
<input id="setSize" value="5" min="1" max="10" step="1" type="range"/>
|
||||
<label class="right" for="setSize">Größe</label>
|
||||
</div>
|
||||
<button title="details">
|
||||
<i class="bi bi-layout-sidebar-reverse"></i> Details
|
||||
</button>
|
||||
</nav>
|
||||
<nav></nav>
|
||||
</header>
|
||||
<div class="gallery">
|
||||
<div>A</div>
|
||||
<div>B</div>
|
||||
<div>C</div>
|
||||
</div>
|
||||
{% render 'hippie/partials/frame-status.liquid' %}
|
||||
</section>
|
||||
</main>
|
||||
{% render 'hippie/partials/frame-mode.liquid' %}
|
||||
{% endblock %}
|
||||
|
||||
{%- block script %}
|
||||
{{ block.super -}}
|
||||
<script>
|
||||
const sizeSlider = document.getElementById('setSize');
|
||||
const galleryItems = document.querySelectorAll('.gallery > div');
|
||||
|
||||
// Set the default size
|
||||
const defaultSize = 128; // In pixels
|
||||
const minSize = 16; // Minimum width in pixels
|
||||
const steps = 10;
|
||||
// Define specific sizes for each step (from 1 to 10)
|
||||
const sizes = [16, 32, 64, 96, 128, 256, 512, 1024, 2048]; // Sizes in pixels
|
||||
|
||||
|
||||
// Calculate width based on slider value
|
||||
function calculateWidth(value) {
|
||||
// Map 1-10 to a pixel width
|
||||
return Math.floor(minSize + (value - 1) * (defaultSize - minSize) / (steps - 1));
|
||||
}
|
||||
|
||||
// Set initial size
|
||||
galleryItems.forEach(item => {
|
||||
item.style.width = `${defaultSize}px`;
|
||||
item.style.width = `${sizes[5]}px`; // Initial width based on the default step (8 corresponds to index 7)
|
||||
});
|
||||
|
||||
sizeSlider.addEventListener('input', function () {
|
||||
console.debug('Change size');
|
||||
// const newSize = calculateWidth(Number(sizeSlider.value));
|
||||
// galleryItems.forEach(item => {
|
||||
// item.style.width = `${newSize}px`;
|
||||
// });
|
||||
const selectedStep = Number(sizeSlider.value) - 1; // Adjust for zero-indexing
|
||||
const newSize = sizes[selectedStep]; // Get size from the array using slider value
|
||||
galleryItems.forEach(item => {
|
||||
item.style.width = `${newSize}px`;
|
||||
});
|
||||
});
|
||||
|
||||
// Initialize slider to default
|
||||
sizeSlider.value = 6; // Sets default to 128px width
|
||||
</script>
|
||||
{% endblock %}
|
||||
24
source/view/demo/examples/ui/index.liquid
Normal file
24
source/view/demo/examples/ui/index.liquid
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
title: UI
|
||||
tags:
|
||||
- demoExample
|
||||
- index
|
||||
---
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="sec_main_center">
|
||||
<nav role="doc-toc">
|
||||
<h1>{{ title }}</h1>
|
||||
<ul class="link">
|
||||
{%- for ui in collections.ui -%}
|
||||
<li>
|
||||
<a href="{{ ui.page.url }}">{{ ui.data.title }}</a>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{% endblock %}
|
||||
462
source/view/demo/examples/ui/table.liquid
Executable file
462
source/view/demo/examples/ui/table.liquid
Executable file
|
|
@ -0,0 +1,462 @@
|
|||
---
|
||||
title: Table
|
||||
tags:
|
||||
- ui
|
||||
---
|
||||
{% assign bodyClass = 'body_frame' -%}
|
||||
{% layout 'hippie/app.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
{% render 'hippie/partials/frame-header.liquid' %}
|
||||
<main class="io">
|
||||
<section>
|
||||
<header class="io">
|
||||
<nav>
|
||||
<div class="group_nav">
|
||||
<button id="addEntry" title="Add entry">
|
||||
<i class="bi bi-plus-circle"></i>
|
||||
</button>
|
||||
<div class="wrap_input"><input id="setScroll" type="checkbox"></div>
|
||||
<label for="setScroll">Scroll to new entry</label>
|
||||
</div>
|
||||
</nav>
|
||||
<nav>
|
||||
<button id="tglIndex" title="Toggle index column">
|
||||
<i class="bi bi-hash"></i>
|
||||
</button>
|
||||
<div class="group_nav">
|
||||
<select id="sltNum" name="position-number" aria-label="numbering">
|
||||
<option value="" selected>None</option>
|
||||
<option value="numeric">123</option>
|
||||
<option value="latin">ABC</option>
|
||||
<option value="roman">IVX</option>
|
||||
</select>
|
||||
<button id="setPosNum" title="Set numbering" type="button"><i class="bi bi-list-ol"></i></button>
|
||||
</div>
|
||||
{% comment %}TODO: Auswahl für ziehbares Element hinzufügen{% endcomment %}
|
||||
</nav>
|
||||
</header>
|
||||
<table id="content" class="draggable content horizontal">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" title="Index">#</th>
|
||||
<th scope="col"></th>
|
||||
<th scope="col" title="Position">#</th>
|
||||
<th scope="col">Number</th>
|
||||
<th scope="col">Name</th>
|
||||
<th class="max" scope="col">Description</th>
|
||||
<th scope="col">Amount</th>
|
||||
<th scope="col">Unit</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Sum</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="positions"></tbody>
|
||||
</table>
|
||||
{% render 'hippie/partials/frame-status.liquid' %}
|
||||
</section>
|
||||
</main>
|
||||
<template id="rowDefault">
|
||||
<tr draggable="true">
|
||||
<th scope="row"></th>
|
||||
<td class="io">
|
||||
<nav>
|
||||
<input class="input_io" name="active" aria-label="active" type="checkbox">
|
||||
<span class="a_button" data-action="drag"><i class="bi bi-grip-horizontal" title="Drag"></i></span>
|
||||
</nav>
|
||||
</td>
|
||||
<td class="pos-num"></td>
|
||||
<td><input class="input_io" name="number" aria-label="number" type="text"></td>
|
||||
<td><input class="input_io" name="name" aria-label="name" type="text"></td>
|
||||
{% comment %}<td class="ellipsis"></td>{% endcomment %}
|
||||
<td>
|
||||
<textarea class="fit" name="description" cols="64" rows="2" aria-label="description"></textarea>
|
||||
</td>
|
||||
<td><input class="input_io" name="amount" aria-label="amount" type="number"></td>
|
||||
<td>
|
||||
<select class="io_select" name="unit" aria-label="unit">
|
||||
<option value="">None</option>
|
||||
<option value="piece">Piece(s)</option>
|
||||
<option value="hour">Hour(s)</option>
|
||||
</select>
|
||||
</td>
|
||||
<td><input class="input_io" name="price" aria-label="price" type="text"></td>
|
||||
<td class="unit"></td>
|
||||
<td class="io">
|
||||
<nav>
|
||||
<button title="Event"><i class="bi bi-calendar-event"></i></button>
|
||||
<button title="Note"><i class="bi bi-journal"></i></button>
|
||||
<button title="Delete"><i class="bi bi-trash"></i></button>
|
||||
</nav>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="rowArticle">
|
||||
<tr draggable="true">
|
||||
<th scope="row"></th>
|
||||
<td class="io">
|
||||
<nav>
|
||||
<input class="input_io" name="active" aria-label="active" type="checkbox">
|
||||
<span class="a_button" data-action="drag"><i class="bi bi-grip-horizontal" title="Drag"></i></span>
|
||||
</nav>
|
||||
</td>
|
||||
<td class="pos-num"></td>
|
||||
<td class="rigid"></td>
|
||||
<td></td>
|
||||
<td>
|
||||
<textarea class="fit" name="description" cols="64" rows="2" aria-label="description"></textarea>
|
||||
</td>
|
||||
<td><input name="amount" aria-label="number" type="number"></td>
|
||||
<td>
|
||||
<select name="unit" aria-label="unit">
|
||||
<option value="">None</option>
|
||||
<option value="piece">Piece(s)</option>
|
||||
<option value="hour">Hour(s)</option>
|
||||
</select>
|
||||
</td>
|
||||
<td class="unit"></td>
|
||||
<td class="unit"></td>
|
||||
<td class="io">
|
||||
<nav>
|
||||
<button title="Event"><i class="bi bi-calendar-event"></i></button>
|
||||
<button title="Note"><i class="bi bi-journal"></i></button>
|
||||
<button title="Delete"><i class="bi bi-trash"></i></button>
|
||||
</nav>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="rowText">
|
||||
<tr draggable="true">
|
||||
<th scope="row"></th>
|
||||
<td class="io">
|
||||
<nav>
|
||||
<input class="input_io" name="active" aria-label="active" type="checkbox">
|
||||
<span class="a_button" data-action="drag"><i class="bi bi-grip-horizontal" title="Drag"></i></span>
|
||||
</nav>
|
||||
</td>
|
||||
<td class="pos-num"></td>
|
||||
<td colspan="7">
|
||||
<textarea class="fit" name="description" cols="64" rows="2" aria-label="description"></textarea>
|
||||
</td>
|
||||
<td class="io">
|
||||
<nav>
|
||||
<button title="Delete"><i class="bi bi-trash"></i></button>
|
||||
</nav>
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="rowGroup">
|
||||
<tr draggable="true" class="header">
|
||||
<th scope="row"></th>
|
||||
<td class="io">
|
||||
<nav>
|
||||
<input class="input_io" name="active" aria-label="active" type="checkbox">
|
||||
<span class="a_button" data-action="drag"><i class="bi bi-grip-horizontal" title="Drag"></i></span>
|
||||
<button name="group" title="Expand"><i class="bi bi-arrows-expand"></i></button>
|
||||
</nav>
|
||||
</td>
|
||||
<td class="pos-num"></td>
|
||||
<td colspan="7">Group</td>
|
||||
<td class="io">
|
||||
<nav>
|
||||
<button title="Delete"><i class="bi bi-trash"></i></button>
|
||||
</nav>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td class="pos-num"></td>
|
||||
<td colspan="7">Content</td>
|
||||
<td class="io">
|
||||
<nav>
|
||||
<button title="Event"><i class="bi bi-calendar-event"></i></button>
|
||||
<button title="Note"><i class="bi bi-journal"></i></button>
|
||||
<button title="Delete"><i class="bi bi-trash"></i></button>
|
||||
</nav>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="footer">
|
||||
<th scope="row"></th>
|
||||
<td></td>
|
||||
<td class="pos-num"></td>
|
||||
<td colspan="8">End</td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
{% render 'hippie/partials/frame-mode.liquid' %}
|
||||
{% endblock %}
|
||||
|
||||
{%- block script %}
|
||||
{{ block.super -}}
|
||||
<script>
|
||||
const placeholderNames = [
|
||||
'Mac',
|
||||
'Sonic',
|
||||
'Furiosa',
|
||||
'Leia',
|
||||
'Frisbee',
|
||||
'Ripley',
|
||||
'Motoko',
|
||||
'Lupin',
|
||||
'Yoda',
|
||||
'Spike',
|
||||
'Obelix',
|
||||
'Samus',
|
||||
'Plisken'
|
||||
];
|
||||
const placeholderAttributes = [
|
||||
'blue',
|
||||
'tall',
|
||||
'clever',
|
||||
'true'
|
||||
];
|
||||
const placeholderContents = [
|
||||
'Description - At vero eos et accusam et justo duo dolores et ea rebum.',
|
||||
'',
|
||||
"Content with linebreaks - \nPhasellus finibus mollis diam non posuere. Vestibulum porttitor volutpat consectetur. Duis neque sapien, tincidunt ac odio vel, laoreet ultricies ligula. Suspendisse erat eros, volutpat vel fringilla at, placerat ac nisi. \nNulla arcu elit, facilisis egestas risus ac, aliquet varius sapien. Sed et nisi fringilla nibh ultrices sagittis ac in nisl. \nPellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam porta lectus ac pharetra feugiat. In ligula nunc, porttitor non arcu vel, feugiat tempor mi. Aenean pellentesque ipsum ac ligula pulvinar, vel auctor diam vehicula. Sed at arcu lacus.",
|
||||
'Very long content - Suspendisse lectus orci, convallis vitae sapien et, iaculis cursus magna. Pellentesque ultrices sodales eros eget vehicula. Aliquam tincidunt nulla non finibus ullamcorper. Ut accumsan nisi non aliquam fermentum. Vestibulum sit amet purus eu dolor vulputate pretium in eget libero. Donec vitae quam in leo eleifend semper. Cras mollis orci augue, vitae aliquam quam consequat quis. Donec sed nisi sed nulla ultricies ultricies quis ac erat. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris euismod mollis neque sit amet varius. In malesuada nibh faucibus orci tincidunt, in elementum sapien pretium. Cras vel urna felis. Proin cursus tempor egestas. Nulla facilisis justo enim. Mauris fermentum, tortor a malesuada facilisis, leo tortor aliquam elit, sed sodales ipsum tortor et tellus.',
|
||||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum facilisis condimentum quam, bibendum tristique odio.'
|
||||
];
|
||||
|
||||
const currencyEuro = new Intl.NumberFormat('de-DE', {style: 'currency', currency: 'EUR'});
|
||||
|
||||
const content = document.querySelector('main.io section > table');
|
||||
const tbodyPosition = document.getElementById('positions');
|
||||
|
||||
tbodyPosition.addEventListener('click', (event) => {
|
||||
const rows = tbodyPosition.querySelectorAll('tr');
|
||||
const rowTarget = event.target.closest('tr');
|
||||
const groupTarget = event.target.closest('[name="group"]');
|
||||
|
||||
if (event.button !== 0) return;
|
||||
|
||||
if (rowTarget) {
|
||||
for (const row of rows) {
|
||||
row.classList.remove('active');
|
||||
}
|
||||
|
||||
rowTarget.classList.add('active');
|
||||
}
|
||||
|
||||
if (groupTarget) {
|
||||
console.log('group');
|
||||
let currentRow = groupTarget.closest('tr').nextElementSibling;
|
||||
|
||||
while (currentRow && !currentRow.classList.contains('footer')) {
|
||||
currentRow.classList.toggle('di_none');
|
||||
currentRow = currentRow.nextElementSibling;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
for (let i = 0; i < 256; i++) {
|
||||
const t = Math.random();
|
||||
let type = undefined;
|
||||
|
||||
if (t < .2) {
|
||||
type = 'default';
|
||||
} else if (t >= .2 && t < .4) {
|
||||
type = 'text';
|
||||
} else if (t >= .4 && t < .5) {
|
||||
type = 'group';
|
||||
} else {
|
||||
type = 'article';
|
||||
}
|
||||
|
||||
tbodyPosition.appendChild(cloneRow(i, type));
|
||||
}
|
||||
|
||||
const selectNum = document.getElementById('sltNum');
|
||||
const buttonPosNum = document.getElementById('setPosNum');
|
||||
|
||||
buttonPosNum.addEventListener('click', () => {
|
||||
const numType = selectNum.value;
|
||||
const cells = tbodyPosition.querySelectorAll('td.pos-num');
|
||||
let num = '';
|
||||
|
||||
for (let i = 0; i < cells.length; i++) {
|
||||
switch (numType) {
|
||||
case 'numeric':
|
||||
num = (i + 1).toString();
|
||||
break;
|
||||
case 'roman':
|
||||
num = convertToRomanNumeral((i + 1)).toString();
|
||||
break;
|
||||
case '':
|
||||
default:
|
||||
}
|
||||
|
||||
cells[i].textContent = num;
|
||||
}
|
||||
});
|
||||
|
||||
const buttonIndex = document.getElementById('tglIndex');
|
||||
|
||||
buttonIndex.addEventListener('click', () => {
|
||||
const cells = content.querySelectorAll('th:first-child');
|
||||
const isHidden = cells[0].classList.contains('di_none');
|
||||
|
||||
for (const cell of cells) {
|
||||
if (isHidden) {
|
||||
cell.classList.remove('di_none');
|
||||
} else {
|
||||
cell.classList.add('di_none');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const buttonAdd = document.getElementById('addEntry');
|
||||
const checkScroll = document.getElementById('setScroll');
|
||||
|
||||
buttonAdd.addEventListener('click', () => {
|
||||
const clone = cloneRow();
|
||||
const viewportHeight = window.innerHeight;
|
||||
const elementActive = tbodyPosition.querySelector('tr.active');
|
||||
let elementNew;
|
||||
let elementBound = undefined;
|
||||
|
||||
if (elementActive) {
|
||||
elementActive.after(clone);
|
||||
elementNew = elementActive.nextElementSibling;
|
||||
} else {
|
||||
tbodyPosition.appendChild(clone);
|
||||
elementNew = tbodyPosition.lastElementChild;
|
||||
}
|
||||
|
||||
if (checkScroll.checked) {
|
||||
elementBound = elementNew.getBoundingClientRect();
|
||||
|
||||
if (elementBound.bottom > viewportHeight || elementBound.top < 0) {
|
||||
elementNew.scrollIntoView({behavior: 'smooth', block: 'nearest'});
|
||||
}
|
||||
}
|
||||
|
||||
reindexRows(tbodyPosition);
|
||||
});
|
||||
|
||||
let draggedRow = null;
|
||||
|
||||
tbodyPosition.addEventListener('dragstart', (event) => {
|
||||
const rowTarget = event.target.closest('tr[draggable="true"]');
|
||||
|
||||
if (rowTarget) {
|
||||
draggedRow = rowTarget;
|
||||
rowTarget.classList.add('dragging');
|
||||
event.dataTransfer.effectAllowed = 'move';
|
||||
|
||||
console.debug('Drag', rowTarget);
|
||||
}
|
||||
});
|
||||
|
||||
tbodyPosition.addEventListener('dragend', () => {
|
||||
if (draggedRow) {
|
||||
draggedRow.classList.remove('dragging');
|
||||
draggedRow = null;
|
||||
}
|
||||
});
|
||||
|
||||
tbodyPosition.addEventListener('dragover', (event) => {
|
||||
event.preventDefault();
|
||||
event.dataTransfer.dropEffect = 'move';
|
||||
|
||||
const rowTarget = event.target.closest('tr');
|
||||
|
||||
if (rowTarget && rowTarget !== draggedRow) {
|
||||
const rows = [...tbodyPosition.querySelectorAll('tr')];
|
||||
const draggedIndex = rows.indexOf(draggedRow);
|
||||
const targetIndex = rows.indexOf(rowTarget);
|
||||
|
||||
if (draggedIndex < targetIndex) {
|
||||
rowTarget.parentNode.insertBefore(draggedRow, rowTarget.nextSibling);
|
||||
} else {
|
||||
rowTarget.parentNode.insertBefore(draggedRow, rowTarget);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
tbodyPosition.addEventListener('drop', (event) => {
|
||||
event.preventDefault();
|
||||
reindexRows(event.currentTarget);
|
||||
|
||||
console.debug('Drop');
|
||||
});
|
||||
|
||||
function cloneRow(index, type = 'article') {
|
||||
const id = 'row' + capitalizeFirstLetter(type);
|
||||
|
||||
const rowFragment = document.getElementById(id).content;
|
||||
const tr = rowFragment.querySelector('tr');
|
||||
const th = rowFragment.querySelector('th');
|
||||
const td = rowFragment.querySelectorAll('td');
|
||||
|
||||
const j = index % placeholderNames.length;
|
||||
const k = randomIntFrom(0, placeholderContents.length - 1);
|
||||
const l = Math.random() > .2;
|
||||
const amount = randomIntFrom(1, 100);
|
||||
const price = randomFloatFrom(1, 10000, 2);
|
||||
const sum = amount * price;
|
||||
|
||||
tr.setAttribute('data-id', index);
|
||||
th.textContent = index + 1;
|
||||
td[0].querySelector('[name="active"]').checked = l;
|
||||
// td[2].innerHTML = replaceLineBreaks(placeholderContents[k]);
|
||||
|
||||
switch (type) {
|
||||
case 'default':
|
||||
td[2].firstElementChild.style.width = '9ch';
|
||||
td[3].firstElementChild.style.width = '6ch';
|
||||
td[4].firstElementChild.textContent = placeholderContents[k];
|
||||
td[5].firstElementChild.value = amount;
|
||||
td[5].firstElementChild.style.width = '4em';
|
||||
td[7].firstElementChild.style.width = '8ch';
|
||||
td[8].textContent = currencyEuro.format(sum);
|
||||
break;
|
||||
case 'article':
|
||||
td[2].textContent = getRandomFormattedString();
|
||||
td[3].textContent = placeholderNames[j];
|
||||
td[4].firstElementChild.textContent = placeholderContents[k];
|
||||
td[5].firstElementChild.value = amount;
|
||||
td[5].firstElementChild.style.width = '4em';
|
||||
td[7].textContent = currencyEuro.format(price);
|
||||
td[8].textContent = currencyEuro.format(sum);
|
||||
break;
|
||||
case 'text':
|
||||
td[2].firstElementChild.textContent = placeholderContents[k];
|
||||
break;
|
||||
default:
|
||||
console.debug('No matching type found.');
|
||||
}
|
||||
|
||||
return document.importNode(rowFragment, true);
|
||||
}
|
||||
|
||||
function reindexRows(parent, selector = 'tr') {
|
||||
const rows = parent.querySelectorAll(selector);
|
||||
let th = undefined;
|
||||
|
||||
for (let i = 0; i < rows.length; i++) {
|
||||
th = rows[i].querySelector('th');
|
||||
th.textContent = i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
function toggleGroup(headerRow) {
|
||||
// Get the toggle icon
|
||||
const icon = headerRow.querySelector('.toggle-icon');
|
||||
|
||||
// Get all rows after this header
|
||||
let currentRow = headerRow.nextElementSibling;
|
||||
|
||||
// Toggle visibility of group rows until next header
|
||||
while (currentRow && !currentRow.classList.contains('group-header')) {
|
||||
currentRow.classList.toggle('hidden');
|
||||
currentRow = currentRow.nextElementSibling;
|
||||
}
|
||||
|
||||
// Toggle the icon rotation
|
||||
icon.classList.toggle('collapsed');
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
13
source/view/demo/examples/ui/tui.liquid
Normal file
13
source/view/demo/examples/ui/tui.liquid
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: TUI
|
||||
tags:
|
||||
- ui
|
||||
---
|
||||
{% assign bodyClass = 'body_frame' -%}
|
||||
{% layout 'hippie/app.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
{% render 'hippie/partials/frame-header.liquid' %}
|
||||
<main class="io"></main>
|
||||
{% render 'hippie/partials/frame-mode.liquid' %}
|
||||
{% endblock %}
|
||||
82
source/view/demo/examples/ui/windows.liquid
Normal file
82
source/view/demo/examples/ui/windows.liquid
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
---
|
||||
title: Windows
|
||||
tags:
|
||||
- ui
|
||||
---
|
||||
{% assign bodyClass = 'body_frame' -%}
|
||||
{% layout 'hippie/app.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<div id="task-bar">
|
||||
<nav>
|
||||
<button data-action="start"><i class="bi bi-microsoft"></i></button>
|
||||
</nav>
|
||||
<nav>
|
||||
<button><i class="bi bi-search"></i></button>
|
||||
<button><i class="bi bi-layers-half"></i></button>
|
||||
</nav>
|
||||
<nav class="big">
|
||||
<button><i class="bi bi-folder"></i></button>
|
||||
<button><i class="bi bi-terminal"></i></button>
|
||||
<button id="setPause"><i class="bi bi-pause"></i></button>
|
||||
<button id="setPlay"><i class="bi bi-play"></i></button>
|
||||
</nav>
|
||||
<div>
|
||||
<nav class="small">
|
||||
<button><i class="bi bi-chevron-up"></i></button>
|
||||
<button><i class="bi bi-steam"></i></button>
|
||||
<button><i class="bi bi-router"></i></button>
|
||||
<button><i class="bi bi-mic"></i></button>
|
||||
<button><i class="bi bi-volume-down"></i></button>
|
||||
</nav>
|
||||
<div class="clock">
|
||||
<span id="time">##:##</span>
|
||||
<br>
|
||||
</div>
|
||||
<nav>
|
||||
<button data-action="notification"><i class="bi bi-bell-fill"></i></button>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
<div id="screen-space"></div>
|
||||
<div id="placeholder">
|
||||
<div class="box"></div>
|
||||
<div class="box_brd"></div>
|
||||
<div>
|
||||
<span>task bar</span>
|
||||
<div class="box_brd"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block assets %}
|
||||
{{ block.super -}}
|
||||
<script src="/js/windows.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{%- block script %}
|
||||
{{ block.super -}}
|
||||
<script>
|
||||
console.log(HIPPIE.brand);
|
||||
// Get the space element
|
||||
const space = document.getElementById('screen-space');
|
||||
const start = document.querySelector('[data-action=start]');
|
||||
const draggableElement = document.getElementById('task-bar');
|
||||
const placeholderElement = document.getElementById('placeholder');
|
||||
// TODO: TimeDisplay in HippieTaskbar aufnehmen
|
||||
const timeElement = document.getElementById('time');
|
||||
|
||||
const taskBar = new HippieTaskBar(draggableElement, placeholderElement);
|
||||
const timeFormat = {hour: '2-digit', minute: '2-digit'};
|
||||
const timeDisplay = new TimeDisplay(timeElement, timeFormat);
|
||||
|
||||
document.getElementById('setPause').addEventListener('click', () => {
|
||||
timeDisplay.pause();
|
||||
console.info('Pause time');
|
||||
});
|
||||
document.getElementById('setPlay').addEventListener('click', () => {
|
||||
timeDisplay.resume();
|
||||
console.info('Resume time');
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
70
source/view/demo/index.liquid
Normal file
70
source/view/demo/index.liquid
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
---
|
||||
permalink: "{{ hippie.permalink }}"
|
||||
title: Index
|
||||
---
|
||||
{% assign pageId = page.fileSlug -%}
|
||||
{% assign pageClass = 'h_full_view' -%}
|
||||
{% layout 'hippie/full.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="wrap">
|
||||
<div class="hello">
|
||||
<h2>This is {{ hippie.brand | upcase }}</h2>
|
||||
<p>You can start using it by replacing this file with your own index page.</p>
|
||||
<p>To do this you need to create a file
|
||||
<code>index.liquid|njk</code>
|
||||
inside the
|
||||
<i>source/view</i>
|
||||
folder. You can also create a
|
||||
<code>data.json</code>
|
||||
file inside the
|
||||
<i>source/view</i>
|
||||
folder as a global data source for your template files.</p>
|
||||
<p>For a very basic start you can make a copy of the demo page
|
||||
<code>blank.liquid|njk</code>. You can find it at
|
||||
<i>/source/view/demo/pages</i>.</p>
|
||||
<p>The
|
||||
<i>source/demo</i>
|
||||
folder contains an overview of all HTML elements and also examples for CSS style combinations and even whole
|
||||
page layouts.<br/>Follow the white rabbit.</p>
|
||||
<div class="pos_rel">
|
||||
<pre class="txt_tiny txt_white pos_abs pin_down pin_right"> ()()<br> (..)<br>c(")(")</pre>
|
||||
<h3>Overview</h3>
|
||||
</div>
|
||||
<nav>
|
||||
<ul class="block link">
|
||||
{% assign indexByOrder = collections.demoIndex | sort: 'data.order' %}
|
||||
{% for link in indexByOrder %}
|
||||
<li>
|
||||
<a href="{{ link.page.url }}">{{ link.data.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
<div class="responsive">
|
||||
<section>
|
||||
<h3>Page</h3>
|
||||
<ul class="block link">
|
||||
{% assign pagesByTitle = collections.demoPage | sort: 'data.title' %}
|
||||
{% for link in pagesByTitle %}
|
||||
<li>
|
||||
<a href="{{ link.page.url }}">{{ link.data.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
<section>
|
||||
<h3>Example</h3>
|
||||
<ul class="block link">
|
||||
{% assign examplesByTitle = collections.demoExample | sort: 'data.title' %}
|
||||
{% for link in examplesByTitle %}
|
||||
<li>
|
||||
<a href="{{ link.page.url }}">{{ link.data.title }}</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
35
source/view/demo/introduction.liquid
Normal file
35
source/view/demo/introduction.liquid
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
title: Introduction
|
||||
tags:
|
||||
- demoIndex
|
||||
order: 1
|
||||
---
|
||||
{% layout 'hippie/page.liquid' %}
|
||||
|
||||
{% block title %}Einführung{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<section class="sec_main_center">
|
||||
<header>
|
||||
<hgroup>
|
||||
<h1>Introduction to HIPPIE</h1>
|
||||
<p>Hippie interweaves preeminent personal interface elements.</p>
|
||||
</hgroup>
|
||||
</header>
|
||||
<article>
|
||||
<p>…</p>
|
||||
<p>Contact: <a id="special" href=""></a>
|
||||
</p>
|
||||
<p>More: <a class="general" href=""></a>, <a class="general" href=""></a>
|
||||
</p>
|
||||
</article>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block script %}
|
||||
{{ block.super -}}
|
||||
<script>
|
||||
composeMail('special', 'me', 'domain', 'tld', 'Me', 'HIPPIE')
|
||||
composeMail('.general', 'name', 'domain', 'tld', '', '')
|
||||
</script>
|
||||
{% endblock %}
|
||||
329
source/view/demo/layouts.liquid
Normal file
329
source/view/demo/layouts.liquid
Normal file
|
|
@ -0,0 +1,329 @@
|
|||
---
|
||||
title: Layouts
|
||||
tags:
|
||||
- demoIndex
|
||||
order: 4
|
||||
---
|
||||
{% layout 'hippie/page.liquid' %}
|
||||
|
||||
{% block title %}Gestaltungen{% endblock %}
|
||||
|
||||
{% block main %}
|
||||
<section class="sec_main_center">
|
||||
<header class="header_txt">
|
||||
<h1>Sammlung formatierter Elemente</h1>
|
||||
<p>Die Elemente werden fortlaufend komplexer</p>
|
||||
</header>
|
||||
<article>
|
||||
<h2 id="sections">Bereiche (sections)</h2>
|
||||
<h3>section</h3>
|
||||
<pre class="pre_code"><code>section.overflow>div.float_space_left>img^p+p>br+a.lineLink</code></pre>
|
||||
<section class="overflow">
|
||||
<div class="float_space_left demo__avatar">
|
||||
{% render 'hippie/partials/placeholder-flag.liquid', type: 'img', src: 'file', width: '256', desc: 'Avatar' %}
|
||||
</div>
|
||||
<p>{% text hippie.placeholders.name %}<br>{% text hippie.placeholders.address %}</p>
|
||||
<p>{% text hippie.placeholders.phone %}<br>{% link hippie.placeholders.mail, '', '', 'a_line' %}</p>
|
||||
</section>
|
||||
<h3>nav</h3>
|
||||
<pre class="pre_code"><code>div.overflow>(nav.float_space_left>ul>(li>a.a_button{punkt $})*4+nav>ul>(li>a.a_button_border{stufe $})*4)</code></pre>
|
||||
<div class="overflow">
|
||||
<nav class="float_space_left">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="" class="a_button" data-hippie-button-value="1">Erster Punkt</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button" data-hippie-button-value="2">Zweiter Punkt</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button" data-hippie-button-value="3">Dritter Punkt</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button" data-hippie-button-value="4">Vierter Punkt</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="" class="a_button_border">Stufe 1</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button_border">Stufe 2</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button_border">Stufe 3</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button_border">Stufe 4</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<pre class="pre_code"><code>nav.nav_horizontal>ul>(li>a.a_button{abschnitt $})*4</code></pre>
|
||||
<nav class="nav_horizontal">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="" class="a_button">Abschnitt 1</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">Abschnitt 2</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">Abschnitt 3</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">Abschnitt 4</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<pre class="pre_code"><code>div.overflow>nav.nav_center_old>ul>(li>a.a_button{typ $})*4</code></pre>
|
||||
<div class="overflow">
|
||||
<nav class="nav_center_old">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="" class="a_button">Typ 1</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">Typ 2</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">Typ 3</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">Typ 4</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<h3>header</h3>
|
||||
<pre class="pre_code"><code>header.header_page>h1+p+nav.nav_separate_right>ul>(li>a.a_button{nav $})*4^+nav.nav_right>ul>(li>a.a_button{nav $})*4</code></pre>
|
||||
<header class="header_page demo__header header_fancy">
|
||||
<h1>Aufmacher</h1>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis nec consectetur diam. Sed nisl odio,
|
||||
volutpat nec nisi sit amet, commodo faucibus est. Donec lacinia vestibulum sapien. Morbi porttitor nibh
|
||||
quis imperdiet scelerisque. Praesent rutrum quam eu sodales luctus.</p>
|
||||
<nav class="nav_separate_right">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="" class="a_button">Mensch</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">Pflanze</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<nav class="nav_right">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="" class="a_button">Blau</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">Gelb</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<pre class="pre_code"><code>header.header_page>nav.nav_right>ul>(li>a.a_button{nav $})*4</code></pre>
|
||||
<div class="box_space h_basic">
|
||||
<header id="js_demo_fix" class="header_page demo__header header_fix">
|
||||
<nav class="nav_right">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="" class="a_button">Eins</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button">Zwei</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<div class="pos_abs pin_bottom width_full">
|
||||
<pre
|
||||
class="pre_code"><code>footer.pos_abs.pin_bottom>nav.nav_column>ul>(li>a.a_button_text)*4</code></pre>
|
||||
<footer id="js_demo_stop" class="demo_footer">
|
||||
<nav class="nav_column nav_separate">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="" class="a_button_text">Alpha</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button_text">Bravo</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button_text">Charlie</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="" class="a_button_text">Delta</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<p class="txt_center demo__credits">
|
||||
<i class="i_bright">👨💻</i>
|
||||
mit
|
||||
<i class="i_bright">❤</i>
|
||||
von
|
||||
<a href="https://interaktionsweise.de">Interaktionsweise</a>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
<article>
|
||||
<h2 id="grouping">Gruppierung (grouping)</h2>
|
||||
<h3>p</h3>
|
||||
<pre class="pre_code"><code>p.txt_right+p.txt_center+p.txt_left</code></pre>
|
||||
<p class="txt_right">Rechts</p>
|
||||
<p class="txt_center">Mittig</p>
|
||||
<p class="txt_left">Links</p>
|
||||
<h3>h*</h3>
|
||||
<pre class="pre_code"><code>h3.txt_color_dark+p.txt_tiny</code></pre>
|
||||
<h3 class="txt_color_dark">Dunkle Überschrift</h3>
|
||||
<p class="txt_tiny">Mit winzigem Textabsatz</p>
|
||||
<pre class="pre_code"><code>a>h4</code></pre>
|
||||
<a href="">
|
||||
<h4>Überschrift als Block-Verweis</h4>
|
||||
</a>
|
||||
<h1>Überschrift 1</h1>
|
||||
<h1>Kann mehrmals, ohne großen Abstand oberhalb, untereinander stehen.</h1>
|
||||
<h2>Überschrift 2</h2>
|
||||
<h2>kann das ebenso.</h2>
|
||||
<h3>hr</h3>
|
||||
<pre class="pre_code"><code>hr.space_even_half</code></pre>
|
||||
<hr class="space_even_half">
|
||||
<pre class="pre_code"><code>hr.dotted.space_even_fourth</code></pre>
|
||||
<hr class="dotted space_even_fourth">
|
||||
<h3>ul</h3>
|
||||
<pre class="pre_code"><code>nav>ul.link>(li>a)+li>a>img+span</code></pre>
|
||||
<nav>
|
||||
<ul class="link">
|
||||
<li>{% link hippie.placeholders.mail, '📧 name@domain.tld' %}</li>
|
||||
<li>
|
||||
<a href=""><img src="/art/bullet.gif" alt="">{% text hippie.placeholders.name %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<h3>div</h3>
|
||||
<pre class="pre_code"><code>div.space_left_fourth>(hr+p+hr)</code></pre>
|
||||
<div class="space_left_fourth">
|
||||
<hr/>
|
||||
<p>Eingerückter Inhalt</p>
|
||||
<hr/>
|
||||
</div>
|
||||
</article>
|
||||
<article>
|
||||
<h2>Eingebettet</h2>
|
||||
<div class="demo__flag">
|
||||
{% render 'hippie/partials/placeholder-flag.liquid', type: '', width: '128', desc: 'Fahne von Interaktionsweise' %}
|
||||
</div>
|
||||
</article>
|
||||
<article>
|
||||
<h2 id="tabularData">Tabellen (tabular data)</h2>
|
||||
<pre class="pre_code"><code>table.link>thead>tr>th{&nbsp;}+th{ab / zy}+th{neu / alt}^^(tbody>tr>td.icon[rowspan="2"]>img[width=16 height=16]^+td.link>span{name}+a[target=_blank]{url}^+td[rowspan="2"]{yyy-mm-dd}^tr>td.text>div.shorten{beschreibung})*2</code></pre>
|
||||
<table class="link js_pop">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>Ab / Zy</th>
|
||||
<th>Neu / Alt</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="icon" rowspan="2">■</td>
|
||||
<td class="link">
|
||||
<span>Name</span>
|
||||
<a href="" target="_blank">URL</a>
|
||||
</td>
|
||||
<td rowspan="2">YYYY-MM-DD</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text">
|
||||
<div class="shorten">Beschreibung</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="icon" rowspan="2">■</td>
|
||||
<td class="link">
|
||||
<span>Name</span>
|
||||
<a href="" target="_blank">URL</a>
|
||||
</td>
|
||||
<td rowspan="2">YYYY-MM-DD</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="text">
|
||||
<div class="shorten">Beschreibung</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</article>
|
||||
<article>
|
||||
<h2 id="forms">Formulare (forms)</h2>
|
||||
<h3>form</h3>
|
||||
<form method="get">
|
||||
<p>Show me a
|
||||
<select name="F">
|
||||
<option value="0">Plain list</option>
|
||||
<option value="1" selected="selected">Fancy list</option>
|
||||
<option value="2">Table list</option>
|
||||
</select>
|
||||
Sorted by
|
||||
<select name="C">
|
||||
<option value="N" selected="selected">Name</option>
|
||||
<option value="M">Date Modified</option>
|
||||
<option value="S">Size</option>
|
||||
<option value="D">Description</option>
|
||||
</select>
|
||||
<select name="O">
|
||||
<option value="A" selected="selected">Ascending</option>
|
||||
<option value="D">Descending</option>
|
||||
</select>
|
||||
<select name="V">
|
||||
<option value="0" selected="selected">in Normal order</option>
|
||||
<option value="1">in Version order</option>
|
||||
</select>
|
||||
Matching
|
||||
<input type="text" name="P" value="*"/>
|
||||
<input type="submit" name="X" value="Go"/>
|
||||
</p>
|
||||
</form>
|
||||
<hr class="hidden">
|
||||
<form action="" name="login">
|
||||
<div>
|
||||
<p>Anmeldung</p>
|
||||
<input placeholder="Benutzername" name="username" type="text" autocomplete="username">
|
||||
<input placeholder="Passwort" name="password" type="password" autocomplete="current-password">
|
||||
</div>
|
||||
</form>
|
||||
<h3>input</h3>
|
||||
<div class="flex inline">
|
||||
<input value="Undefiniert"/>
|
||||
<input type="text" size="8" value="Text"/>
|
||||
<input type="text" size="8" value="Deaktiviert" disabled="disabled"/>
|
||||
<input type="button" value="Auswählen">
|
||||
<input type="submit" value="Senden" disabled="disabled"/>
|
||||
</div>
|
||||
</article>
|
||||
<article>
|
||||
<h2 id="interactive">Interaktiv (interactive)</h2>
|
||||
</article>
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block assets %}
|
||||
{{ block.super -}}
|
||||
<script src="/vendor/jq-sticky-anything.min.js"></script>
|
||||
{% endblock %}
|
||||
{% block script %}
|
||||
{{ block.super -}}
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
// jq-sticky-anything
|
||||
$('#js_demo_fix').stickThis({pushup: '#js_demo_stop'});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
5
source/view/demo/pages/blank.liquid
Normal file
5
source/view/demo/pages/blank.liquid
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Blank
|
||||
---
|
||||
{% assign pageId = page.fileSlug -%}
|
||||
{% layout 'hippie/simple.liquid' %}
|
||||
13
source/view/demo/pages/default.liquid
Normal file
13
source/view/demo/pages/default.liquid
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
title: Default
|
||||
---
|
||||
{% assign pageId = page.fileSlug -%}
|
||||
{% assign pageClass = 'default' -%}
|
||||
{% assign bodyClass = 'default' -%}
|
||||
{% layout 'hippie/default.liquid' %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<!-- {{ title }} body -->
|
||||
{% endblock %}
|
||||
19
source/view/demo/pages/error/304.liquid
Normal file
19
source/view/demo/pages/error/304.liquid
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
---
|
||||
title: 304
|
||||
---
|
||||
{% assign bodyClass = 'body_status' %}
|
||||
{% layout 'hippie/status.liquid' %}
|
||||
|
||||
{% block main %}
|
||||
{{ block.super -}}
|
||||
<h3>Umleitung</h3>
|
||||
<p>Unverändert <dfn>Not Modified</dfn></p>
|
||||
<blockquote cite="https://de.wikipedia.org/wiki/HTTP-Statuscode#3xx_%E2%80%93_Umleitung">
|
||||
<p>Der Inhalt der angeforderten Ressource hat sich seit der letzten Abfrage des Clients nicht verändert und wird
|
||||
deshalb nicht übertragen. Zu den Einzelheiten siehe <a
|
||||
href="https://de.wikipedia.org/wiki/Browser-Cache#Versionsvergleich" title="Browser-Cache">Browser-Cache-Versionsvergleich</a>.
|
||||
</p>
|
||||
<p class="quote_source"><a
|
||||
href="https://de.wikipedia.org/wiki/HTTP-Statuscode#3xx_%E2%80%93_Umleitung">Wikipedia</a></p>
|
||||
</blockquote>
|
||||
{% endblock %}
|
||||
16
source/view/demo/pages/error/400.liquid
Normal file
16
source/view/demo/pages/error/400.liquid
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
title: 400
|
||||
---
|
||||
{% assign bodyClass = 'body_status' %}
|
||||
{% layout 'hippie/status.liquid' %}
|
||||
|
||||
{% block main %}
|
||||
{{ block.super -}}
|
||||
<h3>Client-Fehler</h3>
|
||||
<p>Fehlerhafte Anfrage! <dfn>Bad Request</dfn></p>
|
||||
<blockquote cite="https://de.wikipedia.org/wiki/HTTP-Statuscode#4xx_.E2.80.93_Client-Fehler">
|
||||
<p>Die Anfrage-Nachricht war fehlerhaft aufgebaut.</p>
|
||||
<p class="quote_source"><a href="https://de.wikipedia.org/wiki/HTTP-Statuscode#4xx_.E2.80.93_Client-Fehler">Wikipedia</a>
|
||||
</p>
|
||||
</blockquote>
|
||||
{% endblock %}
|
||||
17
source/view/demo/pages/error/401.liquid
Normal file
17
source/view/demo/pages/error/401.liquid
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
title: 401
|
||||
---
|
||||
{% assign bodyClass = 'body_status' %}
|
||||
{% layout 'hippie/status.liquid' %}
|
||||
|
||||
{% block main %}
|
||||
{{ block.super -}}
|
||||
<h3>Client-Fehler</h3>
|
||||
<p>Nicht autorisiert! <dfn>Unauthorized</dfn></p>
|
||||
<blockquote cite="https://de.wikipedia.org/wiki/HTTP-Statuscode#4xx_.E2.80.93_Client-Fehler">
|
||||
<p>Die Anfrage kann nicht ohne gültige Authentifizierung durchgeführt werden. Wie die Authentifizierung durchgeführt
|
||||
werden soll, wird im „WWW-Authenticate“-Header-Feld der Antwort übermittelt.</p>
|
||||
<p class="quote_source"><a href="https://de.wikipedia.org/wiki/HTTP-Statuscode#4xx_.E2.80.93_Client-Fehler">Wikipedia</a>
|
||||
</p>
|
||||
</blockquote>
|
||||
{% endblock %}
|
||||
17
source/view/demo/pages/error/403.liquid
Normal file
17
source/view/demo/pages/error/403.liquid
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
title: 403
|
||||
---
|
||||
{% assign bodyClass = 'body_status' %}
|
||||
{% layout 'hippie/status.liquid' %}
|
||||
|
||||
{% block main %}
|
||||
{{ block.super -}}
|
||||
<h3>Client-Fehler</h3>
|
||||
<p>Nicht erlaubt! <dfn>Forbidden</dfn></p>
|
||||
<blockquote cite="https://de.wikipedia.org/wiki/HTTP-Statuscode#4xx_.E2.80.93_Client-Fehler">
|
||||
<p>Die Anfrage wurde mangels Berechtigung des Clients nicht durchgeführt, bspw. weil der authentifizierte Benutzer
|
||||
nicht berechtigt ist, oder eine als HTTPS konfigurierte URL nur mit HTTP aufgerufen wurde.</p>
|
||||
<p class="quote_source"><a href="https://de.wikipedia.org/wiki/HTTP-Statuscode#4xx_.E2.80.93_Client-Fehler">Wikipedia</a>
|
||||
</p>
|
||||
</blockquote>
|
||||
{% endblock %}
|
||||
18
source/view/demo/pages/error/404.liquid
Normal file
18
source/view/demo/pages/error/404.liquid
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
title: 404
|
||||
---
|
||||
{% assign bodyClass = 'body_status' %}
|
||||
{% layout 'hippie/status.liquid' %}
|
||||
|
||||
{% block main %}
|
||||
{{ block.super -}}
|
||||
<h3>Client-Fehler</h3>
|
||||
<p>Hier ist nichts. <dfn>Not Found</dfn></p>
|
||||
<blockquote cite="https://de.wikipedia.org/wiki/HTTP-Statuscode#4xx_.E2.80.93_Client-Fehler">
|
||||
<p>Die angeforderte Ressource wurde nicht gefunden. Dieser Statuscode kann ebenfalls verwendet werden, um eine
|
||||
Anfrage ohne näheren Grund abzuweisen. Links, welche auf solche Fehlerseiten verweisen, werden auch als Tote
|
||||
Links bezeichnet.</p>
|
||||
<p class="quote_source"><a href="https://de.wikipedia.org/wiki/HTTP-Statuscode#4xx_.E2.80.93_Client-Fehler">Wikipedia</a>
|
||||
</p>
|
||||
</blockquote>
|
||||
{% endblock %}
|
||||
16
source/view/demo/pages/error/408.liquid
Normal file
16
source/view/demo/pages/error/408.liquid
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
title: 408
|
||||
---
|
||||
{% assign bodyClass = 'body_status' %}
|
||||
{% layout 'hippie/status.liquid' %}
|
||||
|
||||
{% block main %}
|
||||
{{ block.super -}}
|
||||
<h3>Client-Fehler</h3>
|
||||
<p>Zeitüberschreitung der Anforderung. <dfn>Request Timeout</dfn></p>
|
||||
<blockquote cite="https://de.wikipedia.org/wiki/HTTP-Statuscode#4xx_.E2.80.93_Client-Fehler">
|
||||
<p>Innerhalb der vom Server erlaubten Zeitspanne wurde keine vollständige Anfrage des Clients empfangen.</p>
|
||||
<p class="quote_source"><a href="https://de.wikipedia.org/wiki/HTTP-Statuscode#4xx_.E2.80.93_Client-Fehler">Wikipedia</a>
|
||||
</p>
|
||||
</blockquote>
|
||||
{% endblock %}
|
||||
16
source/view/demo/pages/error/500.liquid
Normal file
16
source/view/demo/pages/error/500.liquid
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
title: 500
|
||||
---
|
||||
{% assign bodyClass = 'body_status' %}
|
||||
{% layout 'hippie/status.liquid' %}
|
||||
|
||||
{% block main %}
|
||||
{{ block.super -}}
|
||||
<h3>Server-Fehler</h3>
|
||||
<p>Allgemeiner Server Fehler!!! <dfn>Internal Server Error</dfn></p>
|
||||
<blockquote cite="https://de.wikipedia.org/wiki/HTTP-Statuscode#5xx_%E2%80%93_Server-Fehler">
|
||||
<p>Dies ist ein „Sammel-Statuscode“ für unerwartete Serverfehler.</p>
|
||||
<p class="quote_source"><a href="https://de.wikipedia.org/wiki/HTTP-Statuscode#5xx_%E2%80%93_Server-Fehler">Wikipedia</a>
|
||||
</p>
|
||||
</blockquote>
|
||||
{% endblock %}
|
||||
18
source/view/demo/pages/error/503.liquid
Normal file
18
source/view/demo/pages/error/503.liquid
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
---
|
||||
title: 503
|
||||
---
|
||||
{% assign bodyClass = 'body_status' %}
|
||||
{% layout 'hippie/status.liquid' %}
|
||||
|
||||
{% block main %}
|
||||
{{ block.super -}}
|
||||
<h3>Server-Fehler</h3>
|
||||
<p>Dienst nicht verfügbar. <dfn>Service Unavailable</dfn></p>
|
||||
<blockquote cite="https://de.wikipedia.org/wiki/HTTP-Statuscode#5xx_%E2%80%93_Server-Fehler">
|
||||
<p>Der Server steht temporär nicht zur Verfügung, zum Beispiel wegen Überlastung oder Wartungsarbeiten. Ein
|
||||
„Retry-After“-Header-Feld in der Antwort kann den Client auf einen Zeitpunkt hinweisen, zu dem die Anfrage
|
||||
eventuell bearbeitet werden könnte.</p>
|
||||
<p class="quote_source"><a href="https://de.wikipedia.org/wiki/HTTP-Statuscode#5xx_%E2%80%93_Server-Fehler">Wikipedia</a>
|
||||
</p>
|
||||
</blockquote>
|
||||
{% endblock %}
|
||||
12
source/view/demo/pages/maintenance.liquid
Normal file
12
source/view/demo/pages/maintenance.liquid
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
title: Maintenance
|
||||
---
|
||||
{% assign pageClass = 'h_full_view' -%}
|
||||
{% layout 'hippie/status.liquid' %}
|
||||
|
||||
{% block body %}
|
||||
<hgroup id="root" class="txt_center">
|
||||
<h1 class="txt_hero txt_gradient">HIPPIE</h1>
|
||||
<p>Diese Seite wird gerade gewartet.</p>
|
||||
</hgroup>
|
||||
{% endblock %}
|
||||
3
source/view/demo/pages/pages.json
Normal file
3
source/view/demo/pages/pages.json
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"tags": "demoPage"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue