From 707048b58ba9a6988fb23978c64b57de209d6fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Gla=CC=88ser?= Date: Sat, 23 May 2026 08:14:32 +0200 Subject: [PATCH] Add an/aus activation toggle to interactive elements --- components/interactive-elements.html | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/components/interactive-elements.html b/components/interactive-elements.html index 9e56c0b..8a8fe9a 100644 --- a/components/interactive-elements.html +++ b/components/interactive-elements.html @@ -489,6 +489,25 @@ + +
+

Component: Aktivierungs-Schalter (an/aus)

+ +
+ + Status: aus +
+
+

Component: Slider

@@ -610,6 +629,21 @@ }); }); + document.querySelectorAll('.sg-activation-toggle-chip').forEach((toggle) => { + toggle.addEventListener('click', () => { + const nextState = toggle.dataset.active === 'an' ? 'aus' : 'an'; + const statusLabel = toggle.closest('[data-component="activation-toggle"]')?.querySelector('[data-component-part="activation-toggle-state"]'); + + toggle.dataset.active = nextState; + toggle.setAttribute('aria-pressed', String(nextState === 'an')); + toggle.setAttribute('aria-label', `Aktivierung ${nextState}`); + + if (statusLabel) { + statusLabel.textContent = `Status: ${nextState}`; + } + }); + }); + document.querySelectorAll('.sg-tab-button-group').forEach((group) => { group.querySelectorAll('.sg-tab-button').forEach((button) => { button.addEventListener('click', () => {