Skip to content

Commit 09f5cdb

Browse files
authored
Merge pull request #32 from itk-dev/feature/deltag-aarhus-hoeringsdetalje-additions
feat: embed explainer video in Høring glossary tooltip (deltag-aarhus)
2 parents e986bfb + 6ebc105 commit 09f5cdb

4 files changed

Lines changed: 166 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

77
## [Unreleased]
88

9+
### Added — Explainer video in "Høring" glossary tooltip (deltag-aarhus)
10+
- The "Høring" glossary tooltip now shows an embedded explainer video above the existing definition text, so readers can watch or read. The player is a self-contained mock poster frame (no external video host); clicking play reveals a "mock" note below it while the poster stays in place.
11+
- Added a close (X) button to every glossary tooltip so it can be dismissed directly, not only by clicking outside.
12+
913
### Added — Arbejdsmiljøhandleplan Project
1014
- Clickable prototype of a digital work-environment action plan for Aarhus Kommune, based on Borgmesterens Afdeling's Word template — copied from the `arbejdsmiljo-handleplan` concept
1115
- Minimal overview (`index.md`) with background, purpose, what the prototype shows and demo logins, plus a `mocks.md` listing page

docs/public/projects/deltag-aarhus/mocks/css/glossary.css

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
border: 1px solid var(--border-default);
3535
box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
3636
padding: 16px;
37+
padding-right: 36px; /* room for the close button */
3738
width: 320px;
3839
font-family: var(--font-family-inter);
3940
font-size: var(--fs-small);
@@ -50,6 +51,143 @@
5051
font-weight: var(--fw-semibold);
5152
}
5253

54+
/* Close (X) button — top-right of every tooltip */
55+
.glossary-term__close {
56+
position: absolute;
57+
top: 8px;
58+
right: 8px;
59+
display: flex;
60+
align-items: center;
61+
justify-content: center;
62+
width: 24px;
63+
height: 24px;
64+
padding: 0;
65+
border: none;
66+
border-radius: 4px;
67+
background: none;
68+
color: var(--text-muted);
69+
font-size: 14px;
70+
line-height: 1;
71+
cursor: pointer;
72+
transition: background var(--transition-fast), color var(--transition-fast);
73+
}
74+
75+
.glossary-term__close:hover {
76+
background: var(--gray-100);
77+
color: var(--text-primary);
78+
}
79+
80+
.glossary-term__close:focus-visible {
81+
outline: 2px solid var(--petroleum);
82+
outline-offset: 1px;
83+
}
84+
5385
.glossary-term--open > .glossary-term__tooltip {
5486
display: block;
5587
}
88+
89+
/* Tooltip with an embedded explainer video — wider so the 16:9 frame is legible.
90+
Anchored below the term: the video makes it tall, and the glossary terms sit
91+
near the top of the body text where there isn't room to open upward. */
92+
.glossary-term__tooltip--video {
93+
width: 360px;
94+
bottom: auto;
95+
top: calc(100% + 8px);
96+
}
97+
98+
.glossary-video {
99+
position: relative;
100+
display: block;
101+
width: 100%;
102+
aspect-ratio: 16 / 9;
103+
margin-bottom: 12px;
104+
border: none;
105+
padding: 0;
106+
border-radius: 6px;
107+
overflow: hidden;
108+
cursor: pointer;
109+
/* Mock poster frame — brand-tinted gradient stands in for a real thumbnail */
110+
background: linear-gradient(135deg, var(--petroleum-900) 0%, var(--petroleum) 100%);
111+
color: var(--white);
112+
font-family: var(--font-family-inter);
113+
}
114+
115+
.glossary-video__play {
116+
position: absolute;
117+
top: 50%;
118+
left: 50%;
119+
transform: translate(-50%, -50%);
120+
width: 48px;
121+
height: 48px;
122+
display: flex;
123+
align-items: center;
124+
justify-content: center;
125+
border-radius: 50%;
126+
background: rgb(255 255 255 / 92%);
127+
color: var(--petroleum-900);
128+
font-size: 18px;
129+
padding-left: 3px; /* optically center the triangle */
130+
transition: transform var(--transition-fast), background var(--transition-fast);
131+
}
132+
133+
.glossary-video:hover .glossary-video__play,
134+
.glossary-video:focus-visible .glossary-video__play {
135+
transform: translate(-50%, -50%) scale(1.08);
136+
background: var(--white);
137+
}
138+
139+
.glossary-video:focus-visible {
140+
outline: 2px solid var(--white);
141+
outline-offset: 2px;
142+
}
143+
144+
.glossary-video__caption {
145+
position: absolute;
146+
left: 0;
147+
right: 0;
148+
bottom: 0;
149+
padding: 8px 10px;
150+
background: linear-gradient(to top, rgb(0 0 0 / 55%), transparent);
151+
font-size: var(--fs-xs);
152+
font-weight: var(--fw-semibold);
153+
text-align: left;
154+
}
155+
156+
.glossary-video__duration {
157+
position: absolute;
158+
top: 8px;
159+
right: 8px;
160+
padding: 2px 6px;
161+
border-radius: 4px;
162+
background: rgb(0 0 0 / 65%);
163+
font-size: var(--fs-xs);
164+
font-variant-numeric: tabular-nums;
165+
}
166+
167+
/* Definition text under the video — keep it clearly separated and readable.
168+
A <span> (block via CSS) because the tooltip itself is an inline <span>,
169+
which cannot legally contain block elements like <p>. */
170+
.glossary-video__text {
171+
display: block;
172+
}
173+
174+
/* Mock "playing" note — appears under the poster when play is clicked.
175+
The poster stays in place; this just signals it's a mock. */
176+
.glossary-video__note {
177+
display: none;
178+
margin: 0 0 12px;
179+
padding: 8px 10px;
180+
border-radius: 6px;
181+
background: var(--petroleum-100);
182+
color: var(--petroleum-900);
183+
font-size: var(--fs-xs);
184+
line-height: 16px;
185+
}
186+
187+
.glossary-video__note i {
188+
margin-right: 6px;
189+
}
190+
191+
.glossary-term--video-played .glossary-video__note {
192+
display: block;
193+
}

docs/public/projects/deltag-aarhus/mocks/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ <h1 class="hearing-header__title">Forslag til Lokalplan nr. 1237 med miljøvurde
146146
<div class="body-section">
147147
<div class="body-section__content">
148148
<div class="body-section__text">
149-
<p><span class="glossary-term" data-glossary="hoering">Høringen<button class="glossary-term__icon" aria-label="Forklaring af høring"><i class="fa-solid fa-circle-question" aria-hidden="true"></i></button><span class="glossary-term__tooltip">En høring er en periode hvor borgere, organisationer og myndigheder kan komme med kommentarer og forslag til et bestemt planforslag, før det vedtages endeligt. <a href="#">Læs mere om høringer</a></span></span> vedrører Forslag til Lokalplan nr. 1237 med tilhørende miljøvurderingsrapport for opstilling af vindmøller ved Vosnæs nord for Aarhus. Bemærk at høringssvar først gennemgås efter endt høringsfrist.</p>
149+
<p><span class="glossary-term" data-glossary="hoering">Høringen<button class="glossary-term__icon" aria-label="Forklaring af høring"><i class="fa-solid fa-circle-question" aria-hidden="true"></i></button><span class="glossary-term__tooltip glossary-term__tooltip--video"><button type="button" class="glossary-term__close" aria-label="Luk forklaring"><i class="fa-solid fa-xmark" aria-hidden="true"></i></button><button type="button" class="glossary-video" aria-label="Afspil video: Hvad er en høring? (1:32)"><span class="glossary-video__duration">1:32</span><span class="glossary-video__play" aria-hidden="true"><i class="fa-solid fa-play"></i></span><span class="glossary-video__caption">Hvad er en høring?</span></button><span class="glossary-video__note"><i class="fa-solid fa-circle-info" aria-hidden="true"></i>Dette er en mock — videoen afspilles ikke.</span><span class="glossary-video__text">En høring er en periode hvor borgere, organisationer og myndigheder kan komme med kommentarer og forslag til et bestemt planforslag, før det vedtages endeligt. <a href="#">Læs mere om høringer</a></span></span></span> vedrører Forslag til Lokalplan nr. 1237 med tilhørende miljøvurderingsrapport for opstilling af vindmøller ved Vosnæs nord for Aarhus. Bemærk at høringssvar først gennemgås efter endt høringsfrist.</p>
150150
</div>
151151
<div class="body-section__text">
152-
<p>Aarhus Kommune har udarbejdet forslag til lokalplan for Vosnæs-området samt tillæg nr. 169 til <span class="glossary-term" data-glossary="kommuneplan">Kommuneplan 2017<button class="glossary-term__icon" aria-label="Forklaring af Kommuneplan 2017"><i class="fa-solid fa-circle-question" aria-hidden="true"></i></button><span class="glossary-term__tooltip">Kommuneplanen er kommunens overordnede plan for arealanvendelse de næste 12 år. Den sætter rammerne for hvad der må bygges hvor. <a href="#">Læs mere om kommuneplanen</a></span></span>. Der er gennemført en samlet <span class="glossary-term" data-glossary="miljoevurdering">miljøvurdering<button class="glossary-term__icon" aria-label="Forklaring af miljøvurdering"><i class="fa-solid fa-circle-question" aria-hidden="true"></i></button><span class="glossary-term__tooltip">En miljøvurdering er en systematisk vurdering af, hvordan et planforslag eller projekt påvirker miljøet — fx natur, støj, landskab og menneskers sundhed. Den er lovpligtig ved væsentlig miljøpåvirkning. <a href="#">Læs mere om miljøvurdering</a></span></span> for alle planer og projekter i området.</p>
153-
<p>Planerne kan ses på Aarhus Lokalplanportal samt fysisk på Dokk1 Hovedbibliotek fra den 5. juni 2025. Lokalplanen udlægger området til <span class="glossary-term" data-glossary="tekniske-anlaeg">tekniske anlæg<button class="glossary-term__icon" aria-label="Forklaring af tekniske anlæg"><i class="fa-solid fa-circle-question" aria-hidden="true"></i></button><span class="glossary-term__tooltip">Tekniske anlæg dækker over installationer som vindmøller, solcelleanlæg, transformerstationer og lignende infrastruktur, der er nødvendig for energiforsyning og teknisk drift. <a href="#">Læs mere om tekniske anlæg</a></span></span> og muliggør opstilling af tre vindmøller med en totalhøjde på op til 150 meter.</p>
152+
<p>Aarhus Kommune har udarbejdet forslag til lokalplan for Vosnæs-området samt tillæg nr. 169 til <span class="glossary-term" data-glossary="kommuneplan">Kommuneplan 2017<button class="glossary-term__icon" aria-label="Forklaring af Kommuneplan 2017"><i class="fa-solid fa-circle-question" aria-hidden="true"></i></button><span class="glossary-term__tooltip"><button type="button" class="glossary-term__close" aria-label="Luk forklaring"><i class="fa-solid fa-xmark" aria-hidden="true"></i></button>Kommuneplanen er kommunens overordnede plan for arealanvendelse de næste 12 år. Den sætter rammerne for hvad der må bygges hvor. <a href="#">Læs mere om kommuneplanen</a></span></span>. Der er gennemført en samlet <span class="glossary-term" data-glossary="miljoevurdering">miljøvurdering<button class="glossary-term__icon" aria-label="Forklaring af miljøvurdering"><i class="fa-solid fa-circle-question" aria-hidden="true"></i></button><span class="glossary-term__tooltip"><button type="button" class="glossary-term__close" aria-label="Luk forklaring"><i class="fa-solid fa-xmark" aria-hidden="true"></i></button>En miljøvurdering er en systematisk vurdering af, hvordan et planforslag eller projekt påvirker miljøet — fx natur, støj, landskab og menneskers sundhed. Den er lovpligtig ved væsentlig miljøpåvirkning. <a href="#">Læs mere om miljøvurdering</a></span></span> for alle planer og projekter i området.</p>
153+
<p>Planerne kan ses på Aarhus Lokalplanportal samt fysisk på Dokk1 Hovedbibliotek fra den 5. juni 2025. Lokalplanen udlægger området til <span class="glossary-term" data-glossary="tekniske-anlaeg">tekniske anlæg<button class="glossary-term__icon" aria-label="Forklaring af tekniske anlæg"><i class="fa-solid fa-circle-question" aria-hidden="true"></i></button><span class="glossary-term__tooltip"><button type="button" class="glossary-term__close" aria-label="Luk forklaring"><i class="fa-solid fa-xmark" aria-hidden="true"></i></button>Tekniske anlæg dækker over installationer som vindmøller, solcelleanlæg, transformerstationer og lignende infrastruktur, der er nødvendig for energiforsyning og teknisk drift. <a href="#">Læs mere om tekniske anlæg</a></span></span> og muliggør opstilling af tre vindmøller med en totalhøjde på op til 150 meter.</p>
154154
</div>
155155

156156
<div class="body-section__dates">

docs/public/projects/deltag-aarhus/mocks/js/glossary.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,31 @@ DM.initGlossary = function() {
2323
});
2424
});
2525

26+
// Mock video player — reveal a "this is a mock" note under the poster.
27+
// The poster stays in place; clicking play does not close the tooltip.
28+
document.querySelectorAll(".glossary-video").forEach(function(player) {
29+
player.addEventListener("click", function(e) {
30+
e.stopPropagation();
31+
var term = player.closest(".glossary-term");
32+
term.classList.add("glossary-term--video-played");
33+
});
34+
});
35+
36+
// Close (X) button inside a tooltip
37+
document.querySelectorAll(".glossary-term__close").forEach(function(btn) {
38+
btn.addEventListener("click", function(e) {
39+
e.stopPropagation();
40+
var term = btn.closest(".glossary-term");
41+
term.classList.remove("glossary-term--open");
42+
term.classList.remove("glossary-term--video-played");
43+
});
44+
});
45+
2646
// Close tooltips on outside click
2747
document.addEventListener("click", function() {
2848
document.querySelectorAll(".glossary-term--open").forEach(function(t) {
2949
t.classList.remove("glossary-term--open");
50+
t.classList.remove("glossary-term--video-played");
3051
});
3152
});
3253
};

0 commit comments

Comments
 (0)