From 9fbc19388f1ed600868469cb30220306a8f4a52e Mon Sep 17 00:00:00 2001 From: sthag Date: Sun, 18 May 2025 12:44:47 +0200 Subject: [PATCH] feat: Update card script - Use vanilla instead of jQuery - Remove super script - Remove event for dither variant - Reindent --- source/screens/demo/examples/card.njk | 161 ++++++++++++-------------- 1 file changed, 76 insertions(+), 85 deletions(-) diff --git a/source/screens/demo/examples/card.njk b/source/screens/demo/examples/card.njk index ee7011a..7db860b 100644 --- a/source/screens/demo/examples/card.njk +++ b/source/screens/demo/examples/card.njk @@ -9,100 +9,91 @@ tags: {% extends "demo/_default.njk" %} {% import "hippie/macros/_placeholder.njk" as ph %} -{% block title %}{{ title }}{% endblock %} +{% block title %}{{ title }} +{% endblock %} {% block head %} - {{ super() }} + {{ super() }} {% endblock %} {% block body %} - -
-
- - {# - - - - - - - - - - - #} - - - - - - - - - - - {# Background flag dithered #} -
-
-
-

Titel
und Beschreibung

-

{{ ph.name() }}

-

- {{ ph.email('card_address') }}
- {{ ph.link('decent', 'site.tld') }} - · - {{ ph.address('decent') }}

-
-
+ + +
+
+ + {# + + + + + + + + + + + #} + + + + + + + + + + + {# Background flag dithered #} +
+
+
+

Titel
und Beschreibung

+

{{ ph.name() }}

+

+ {{ ph.email('card_address') }}
+ {{ ph.link('decent', 'site.tld') }} + · + {{ ph.address('decent') }}

+
+
{% endblock %} {% block script %} - {{ super() }} - + 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]); + } + + position++; + + if (position >= colors.length) { + position = 0; + } + }, 600); + }); + + document.getElementById('js_content').addEventListener('mouseleave', () => { + iId && clearInterval(iId); + }); + {% endblock %} \ No newline at end of file