feat: Update card and placeholder
- Change card from njk to liquid - Fix flag placeholder - Update structure of card
This commit is contained in:
parent
f2ff20ce73
commit
fdef673886
5 changed files with 73 additions and 86 deletions
69
source/screens/demo/examples/card.liquid
Normal file
69
source/screens/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 %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue