2024-08-11 15:15:07 +02:00
|
|
|
---
|
|
|
|
|
title: Card
|
|
|
|
|
tags:
|
2024-08-11 15:34:55 +02:00
|
|
|
- demoExample
|
2024-08-11 15:15:07 +02:00
|
|
|
---
|
|
|
|
|
{% set pageId = page.fileSlug %}
|
2020-04-04 23:56:49 +02:00
|
|
|
{% set pageClass = "html_card" %}
|
|
|
|
|
|
2024-08-11 12:05:18 +02:00
|
|
|
{% extends "demo/_default.njk" %}
|
2024-08-08 20:42:28 +02:00
|
|
|
{% import "hippie/macros/_placeholder.njk" as ph %}
|
2020-04-04 23:56:49 +02:00
|
|
|
|
2025-05-18 12:44:47 +02:00
|
|
|
{% block title %}{{ title }}
|
|
|
|
|
{% endblock %}
|
2020-04-04 23:56:49 +02:00
|
|
|
|
|
|
|
|
{% block head %}
|
2025-05-18 12:44:47 +02:00
|
|
|
{{ super() }}
|
2020-04-04 23:56:49 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block body %}
|
2025-05-18 12:44:47 +02:00
|
|
|
|
|
|
|
|
<!-- {{ page.fileSlug }}.page -->
|
|
|
|
|
<div class="card_bkg">
|
|
|
|
|
<div id="dither"></div>
|
2025-06-21 12:11:03 +02:00
|
|
|
{{ ph.flag('svg', '', 'flag', '') }}
|
2025-05-18 12:44:47 +02:00
|
|
|
{# <img id="dither" src="art/flag_dither.png" width="1920" height="1200" alt="Background flag dithered"/> #}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card_box">
|
|
|
|
|
<div id="js_content">
|
|
|
|
|
<p>Titel<br/>und Beschreibung</p>
|
|
|
|
|
<h1>{{ ph.name() }}</h1>
|
|
|
|
|
<p>
|
|
|
|
|
{{ ph.email('card_address') }}<br/>
|
|
|
|
|
{{ ph.link('decent', 'site.tld') }}
|
|
|
|
|
·
|
|
|
|
|
{{ ph.address('decent') }}</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-04-04 23:56:49 +02:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
|
|
{% block script %}
|
2025-05-18 12:44:47 +02:00
|
|
|
<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"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// console.log(colors);
|
|
|
|
|
|
2025-06-21 12:11:03 +02:00
|
|
|
document
|
|
|
|
|
.getElementById('js_content')
|
|
|
|
|
.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]);
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-18 12:44:47 +02:00
|
|
|
position++;
|
|
|
|
|
|
|
|
|
|
if (position >= colors.length) {
|
|
|
|
|
position = 0;
|
|
|
|
|
}
|
2025-06-21 12:11:03 +02:00
|
|
|
}, 600);
|
|
|
|
|
});
|
2025-05-18 12:44:47 +02:00
|
|
|
|
2025-06-21 12:11:03 +02:00
|
|
|
document
|
|
|
|
|
.getElementById('js_content')
|
|
|
|
|
.addEventListener('mouseleave', () => {
|
|
|
|
|
iId && clearInterval(iId);
|
|
|
|
|
});
|
2025-05-18 12:44:47 +02:00
|
|
|
</script>
|
2021-03-09 22:54:56 +01:00
|
|
|
{% endblock %}
|