@asd20/ui 3.2.943 → 3.2.945
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/organisms/Asd20SchoolHomepageVideoHeader/index.vue +63 -1
- package/src/components/organisms/Asd20VideoHeader/index.vue +57 -0
- package/src/components/templates/Asd20DetailAlternateTemplate/index.vue +50 -0
- package/src/components/templates/Asd20DetailImageFullTemplate/index.vue +50 -0
- package/src/components/templates/Asd20DetailImageTemplate/index.vue +50 -0
- package/src/components/templates/Asd20DetailTemplate/index.vue +50 -1
package/package.json
CHANGED
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
>
|
|
16
16
|
<video
|
|
17
17
|
v-if="videoUrl"
|
|
18
|
+
ref="backgroundVideo"
|
|
18
19
|
class="background-video"
|
|
20
|
+
role="presentation"
|
|
19
21
|
aria-hidden="true"
|
|
20
22
|
autoplay
|
|
21
23
|
loop
|
|
@@ -26,6 +28,17 @@
|
|
|
26
28
|
>
|
|
27
29
|
<source :src="videoUrl" type="video/mp4" />
|
|
28
30
|
</video>
|
|
31
|
+
<button
|
|
32
|
+
v-if="videoUrl"
|
|
33
|
+
class="video-toggle-btn"
|
|
34
|
+
@click="toggleVideo"
|
|
35
|
+
:aria-label="isPaused ? 'Play video' : 'Pause video'"
|
|
36
|
+
>
|
|
37
|
+
<!-- Play icon (▶) -->
|
|
38
|
+
<span v-if="isPaused">►</span>
|
|
39
|
+
<!-- Pause icon (⏸) -->
|
|
40
|
+
<span v-else>❙❙</span>
|
|
41
|
+
</button>
|
|
29
42
|
<img
|
|
30
43
|
:class="videoUrl ? 'hide-background-image' : 'background-image'"
|
|
31
44
|
:src="imageUrl"
|
|
@@ -91,6 +104,11 @@ export default {
|
|
|
91
104
|
primaryMessages: { type: Array, default: () => [] },
|
|
92
105
|
secondaryMessages: { type: Array, default: () => [] },
|
|
93
106
|
},
|
|
107
|
+
data() {
|
|
108
|
+
return {
|
|
109
|
+
isPaused: false,
|
|
110
|
+
}
|
|
111
|
+
},
|
|
94
112
|
computed: {
|
|
95
113
|
mq() {
|
|
96
114
|
return this.$mq || 'sm'
|
|
@@ -111,6 +129,20 @@ export default {
|
|
|
111
129
|
)
|
|
112
130
|
},
|
|
113
131
|
},
|
|
132
|
+
methods: {
|
|
133
|
+
toggleVideo() {
|
|
134
|
+
const video = this.$refs.backgroundVideo
|
|
135
|
+
if (video) {
|
|
136
|
+
if (video.paused) {
|
|
137
|
+
video.play()
|
|
138
|
+
this.isPaused = false
|
|
139
|
+
} else {
|
|
140
|
+
video.pause()
|
|
141
|
+
this.isPaused = true
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
},
|
|
114
146
|
}
|
|
115
147
|
</script>
|
|
116
148
|
|
|
@@ -272,7 +304,12 @@ export default {
|
|
|
272
304
|
);
|
|
273
305
|
::before {
|
|
274
306
|
width: 25px; /* Arrow grows on hover */
|
|
275
|
-
background-color: rgba(
|
|
307
|
+
background-color: rgba(
|
|
308
|
+
255,
|
|
309
|
+
255,
|
|
310
|
+
255,
|
|
311
|
+
0.3
|
|
312
|
+
); /* Darker arrow on hover */
|
|
276
313
|
z-index: 0;
|
|
277
314
|
}
|
|
278
315
|
}
|
|
@@ -682,5 +719,30 @@ $max: 4rem;
|
|
|
682
719
|
display: block;
|
|
683
720
|
}
|
|
684
721
|
}
|
|
722
|
+
.video-toggle-btn {
|
|
723
|
+
position: absolute;
|
|
724
|
+
bottom: 0.5rem;
|
|
725
|
+
right: 0.5rem;
|
|
726
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
727
|
+
color: lightgray;
|
|
728
|
+
border: none;
|
|
729
|
+
width: 45px;
|
|
730
|
+
height: 45px;
|
|
731
|
+
border-radius: 50%;
|
|
732
|
+
display: flex;
|
|
733
|
+
align-items: center;
|
|
734
|
+
justify-content: center;
|
|
735
|
+
font-size: 18px;
|
|
736
|
+
cursor: pointer;
|
|
737
|
+
transition: background-color 0.3s ease-in-out;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.video-toggle-btn:hover {
|
|
741
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
.video-toggle-btn span {
|
|
745
|
+
line-height: 1;
|
|
746
|
+
}
|
|
685
747
|
}
|
|
686
748
|
</style>
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
|
|
12
12
|
<video
|
|
13
13
|
v-if="videoUrl"
|
|
14
|
+
ref="backgroundVideo"
|
|
14
15
|
class="background-video"
|
|
16
|
+
role="presentation"
|
|
15
17
|
aria-hidden="true"
|
|
16
18
|
autoplay
|
|
17
19
|
loop
|
|
@@ -22,6 +24,17 @@
|
|
|
22
24
|
>
|
|
23
25
|
<source :src="videoUrl" type="video/mp4" />
|
|
24
26
|
</video>
|
|
27
|
+
<button
|
|
28
|
+
v-if="videoUrl"
|
|
29
|
+
class="video-toggle-btn"
|
|
30
|
+
@click="toggleVideo"
|
|
31
|
+
:aria-label="isPaused ? 'Play video' : 'Pause video'"
|
|
32
|
+
>
|
|
33
|
+
<!-- Play icon (▶) -->
|
|
34
|
+
<span v-if="isPaused">►</span>
|
|
35
|
+
<!-- Pause icon (⏸) -->
|
|
36
|
+
<span v-else>❙❙</span>
|
|
37
|
+
</button>
|
|
25
38
|
|
|
26
39
|
<img
|
|
27
40
|
:class="videoUrl ? 'hide-background-image' : 'background-image'"
|
|
@@ -54,6 +67,11 @@ export default {
|
|
|
54
67
|
primaryMessages: { type: Array, default: () => [] },
|
|
55
68
|
secondaryMessages: { type: Array, default: () => [] },
|
|
56
69
|
},
|
|
70
|
+
data() {
|
|
71
|
+
return {
|
|
72
|
+
isPaused: false,
|
|
73
|
+
}
|
|
74
|
+
},
|
|
57
75
|
computed: {
|
|
58
76
|
mq() {
|
|
59
77
|
return this.$mq || 'sm'
|
|
@@ -72,6 +90,20 @@ export default {
|
|
|
72
90
|
)
|
|
73
91
|
},
|
|
74
92
|
},
|
|
93
|
+
methods: {
|
|
94
|
+
toggleVideo() {
|
|
95
|
+
const video = this.$refs.backgroundVideo
|
|
96
|
+
if (video) {
|
|
97
|
+
if (video.paused) {
|
|
98
|
+
video.play()
|
|
99
|
+
this.isPaused = false
|
|
100
|
+
} else {
|
|
101
|
+
video.pause()
|
|
102
|
+
this.isPaused = true
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
},
|
|
75
107
|
}
|
|
76
108
|
</script>
|
|
77
109
|
|
|
@@ -281,5 +313,30 @@ export default {
|
|
|
281
313
|
display: block;
|
|
282
314
|
}
|
|
283
315
|
}
|
|
316
|
+
.video-toggle-btn {
|
|
317
|
+
position: absolute;
|
|
318
|
+
bottom: 2rem;
|
|
319
|
+
right: 0.5rem;
|
|
320
|
+
background-color: rgba(0, 0, 0, 0.5);
|
|
321
|
+
color: lightgray;
|
|
322
|
+
border: none;
|
|
323
|
+
width: 45px;
|
|
324
|
+
height: 45px;
|
|
325
|
+
border-radius: 50%;
|
|
326
|
+
display: flex;
|
|
327
|
+
align-items: center;
|
|
328
|
+
justify-content: center;
|
|
329
|
+
font-size: 18px;
|
|
330
|
+
cursor: pointer;
|
|
331
|
+
transition: background-color 0.3s ease-in-out;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.video-toggle-btn:hover {
|
|
335
|
+
background-color: rgba(0, 0, 0, 0.7);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.video-toggle-btn span {
|
|
339
|
+
line-height: 1;
|
|
340
|
+
}
|
|
284
341
|
}
|
|
285
342
|
</style>
|
|
@@ -180,6 +180,56 @@ export default {
|
|
|
180
180
|
Asd20QuicklinksMenu,
|
|
181
181
|
Asd20MediaSection,
|
|
182
182
|
},
|
|
183
|
+
mounted() {
|
|
184
|
+
// Allow accordions to be injected into the DOM via the SuperEditor in the CommCenter
|
|
185
|
+
this.$nextTick(() => {
|
|
186
|
+
const accordionButtons = document.querySelectorAll('.accordion-button')
|
|
187
|
+
|
|
188
|
+
accordionButtons.forEach(button => {
|
|
189
|
+
button.addEventListener('click', () => {
|
|
190
|
+
const contentId = button.getAttribute('aria-controls')
|
|
191
|
+
const content = document.getElementById(contentId)
|
|
192
|
+
const expanded = button.getAttribute('aria-expanded') === 'true'
|
|
193
|
+
|
|
194
|
+
button.setAttribute('aria-expanded', !expanded)
|
|
195
|
+
button.querySelector('.toggle-icon').textContent = expanded
|
|
196
|
+
? '+'
|
|
197
|
+
: '-'
|
|
198
|
+
|
|
199
|
+
if (!expanded) {
|
|
200
|
+
content.style.display = 'block'
|
|
201
|
+
|
|
202
|
+
// Reset maxHeight before calculating scrollHeight (force reflow)
|
|
203
|
+
content.style.maxHeight = '0'
|
|
204
|
+
content.style.padding = '0 var(--space-1, 1em)'
|
|
205
|
+
|
|
206
|
+
requestAnimationFrame(() => {
|
|
207
|
+
content.style.transition =
|
|
208
|
+
'max-height 0.4s ease, padding 0.4s ease'
|
|
209
|
+
content.style.maxHeight = content.scrollHeight + 'px'
|
|
210
|
+
content.style.padding = 'var(--space-1, 1em)'
|
|
211
|
+
})
|
|
212
|
+
} else {
|
|
213
|
+
content.style.maxHeight = content.scrollHeight + 'px' // Set to current height for smooth transition
|
|
214
|
+
|
|
215
|
+
requestAnimationFrame(() => {
|
|
216
|
+
content.style.transition =
|
|
217
|
+
'max-height 0.4s ease, padding 0.4s ease'
|
|
218
|
+
content.style.maxHeight = '0'
|
|
219
|
+
content.style.padding = '0 var(--space-1, 1em)'
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
// Optionally hide the content after animation
|
|
223
|
+
setTimeout(() => {
|
|
224
|
+
if (content.style.maxHeight === '0px') {
|
|
225
|
+
content.style.display = 'none'
|
|
226
|
+
}
|
|
227
|
+
}, 400) // Match transition duration
|
|
228
|
+
}
|
|
229
|
+
})
|
|
230
|
+
})
|
|
231
|
+
})
|
|
232
|
+
},
|
|
183
233
|
}
|
|
184
234
|
</script>
|
|
185
235
|
|
|
@@ -172,6 +172,56 @@ export default {
|
|
|
172
172
|
Asd20QuicklinksMenu,
|
|
173
173
|
Asd20MediaSection,
|
|
174
174
|
},
|
|
175
|
+
mounted() {
|
|
176
|
+
// Allow accordions to be injected into the DOM via the SuperEditor in the CommCenter
|
|
177
|
+
this.$nextTick(() => {
|
|
178
|
+
const accordionButtons = document.querySelectorAll('.accordion-button')
|
|
179
|
+
|
|
180
|
+
accordionButtons.forEach(button => {
|
|
181
|
+
button.addEventListener('click', () => {
|
|
182
|
+
const contentId = button.getAttribute('aria-controls')
|
|
183
|
+
const content = document.getElementById(contentId)
|
|
184
|
+
const expanded = button.getAttribute('aria-expanded') === 'true'
|
|
185
|
+
|
|
186
|
+
button.setAttribute('aria-expanded', !expanded)
|
|
187
|
+
button.querySelector('.toggle-icon').textContent = expanded
|
|
188
|
+
? '+'
|
|
189
|
+
: '-'
|
|
190
|
+
|
|
191
|
+
if (!expanded) {
|
|
192
|
+
content.style.display = 'block'
|
|
193
|
+
|
|
194
|
+
// Reset maxHeight before calculating scrollHeight (force reflow)
|
|
195
|
+
content.style.maxHeight = '0'
|
|
196
|
+
content.style.padding = '0 var(--space-1, 1em)'
|
|
197
|
+
|
|
198
|
+
requestAnimationFrame(() => {
|
|
199
|
+
content.style.transition =
|
|
200
|
+
'max-height 0.4s ease, padding 0.4s ease'
|
|
201
|
+
content.style.maxHeight = content.scrollHeight + 'px'
|
|
202
|
+
content.style.padding = 'var(--space-1, 1em)'
|
|
203
|
+
})
|
|
204
|
+
} else {
|
|
205
|
+
content.style.maxHeight = content.scrollHeight + 'px' // Set to current height for smooth transition
|
|
206
|
+
|
|
207
|
+
requestAnimationFrame(() => {
|
|
208
|
+
content.style.transition =
|
|
209
|
+
'max-height 0.4s ease, padding 0.4s ease'
|
|
210
|
+
content.style.maxHeight = '0'
|
|
211
|
+
content.style.padding = '0 var(--space-1, 1em)'
|
|
212
|
+
})
|
|
213
|
+
|
|
214
|
+
// Optionally hide the content after animation
|
|
215
|
+
setTimeout(() => {
|
|
216
|
+
if (content.style.maxHeight === '0px') {
|
|
217
|
+
content.style.display = 'none'
|
|
218
|
+
}
|
|
219
|
+
}, 400) // Match transition duration
|
|
220
|
+
}
|
|
221
|
+
})
|
|
222
|
+
})
|
|
223
|
+
})
|
|
224
|
+
},
|
|
175
225
|
}
|
|
176
226
|
</script>
|
|
177
227
|
|
|
@@ -165,6 +165,56 @@ export default {
|
|
|
165
165
|
Asd20QuicklinksMenu,
|
|
166
166
|
Asd20MediaSection,
|
|
167
167
|
},
|
|
168
|
+
mounted() {
|
|
169
|
+
// Allow accordions to be injected into the DOM via the SuperEditor in the CommCenter
|
|
170
|
+
this.$nextTick(() => {
|
|
171
|
+
const accordionButtons = document.querySelectorAll('.accordion-button')
|
|
172
|
+
|
|
173
|
+
accordionButtons.forEach(button => {
|
|
174
|
+
button.addEventListener('click', () => {
|
|
175
|
+
const contentId = button.getAttribute('aria-controls')
|
|
176
|
+
const content = document.getElementById(contentId)
|
|
177
|
+
const expanded = button.getAttribute('aria-expanded') === 'true'
|
|
178
|
+
|
|
179
|
+
button.setAttribute('aria-expanded', !expanded)
|
|
180
|
+
button.querySelector('.toggle-icon').textContent = expanded
|
|
181
|
+
? '+'
|
|
182
|
+
: '-'
|
|
183
|
+
|
|
184
|
+
if (!expanded) {
|
|
185
|
+
content.style.display = 'block'
|
|
186
|
+
|
|
187
|
+
// Reset maxHeight before calculating scrollHeight (force reflow)
|
|
188
|
+
content.style.maxHeight = '0'
|
|
189
|
+
content.style.padding = '0 var(--space-1, 1em)'
|
|
190
|
+
|
|
191
|
+
requestAnimationFrame(() => {
|
|
192
|
+
content.style.transition =
|
|
193
|
+
'max-height 0.4s ease, padding 0.4s ease'
|
|
194
|
+
content.style.maxHeight = content.scrollHeight + 'px'
|
|
195
|
+
content.style.padding = 'var(--space-1, 1em)'
|
|
196
|
+
})
|
|
197
|
+
} else {
|
|
198
|
+
content.style.maxHeight = content.scrollHeight + 'px' // Set to current height for smooth transition
|
|
199
|
+
|
|
200
|
+
requestAnimationFrame(() => {
|
|
201
|
+
content.style.transition =
|
|
202
|
+
'max-height 0.4s ease, padding 0.4s ease'
|
|
203
|
+
content.style.maxHeight = '0'
|
|
204
|
+
content.style.padding = '0 var(--space-1, 1em)'
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
// Optionally hide the content after animation
|
|
208
|
+
setTimeout(() => {
|
|
209
|
+
if (content.style.maxHeight === '0px') {
|
|
210
|
+
content.style.display = 'none'
|
|
211
|
+
}
|
|
212
|
+
}, 400) // Match transition duration
|
|
213
|
+
}
|
|
214
|
+
})
|
|
215
|
+
})
|
|
216
|
+
})
|
|
217
|
+
},
|
|
168
218
|
}
|
|
169
219
|
</script>
|
|
170
220
|
|
|
@@ -168,6 +168,56 @@ export default {
|
|
|
168
168
|
props: {
|
|
169
169
|
languageCode: { type: String, default: 'en' },
|
|
170
170
|
},
|
|
171
|
+
mounted() {
|
|
172
|
+
// Allow accordions to be injected into the DOM via the SuperEditor in the CommCenter
|
|
173
|
+
this.$nextTick(() => {
|
|
174
|
+
const accordionButtons = document.querySelectorAll('.accordion-button')
|
|
175
|
+
|
|
176
|
+
accordionButtons.forEach(button => {
|
|
177
|
+
button.addEventListener('click', () => {
|
|
178
|
+
const contentId = button.getAttribute('aria-controls')
|
|
179
|
+
const content = document.getElementById(contentId)
|
|
180
|
+
const expanded = button.getAttribute('aria-expanded') === 'true'
|
|
181
|
+
|
|
182
|
+
button.setAttribute('aria-expanded', !expanded)
|
|
183
|
+
button.querySelector('.toggle-icon').textContent = expanded
|
|
184
|
+
? '+'
|
|
185
|
+
: '-'
|
|
186
|
+
|
|
187
|
+
if (!expanded) {
|
|
188
|
+
content.style.display = 'block'
|
|
189
|
+
|
|
190
|
+
// Reset maxHeight before calculating scrollHeight (force reflow)
|
|
191
|
+
content.style.maxHeight = '0'
|
|
192
|
+
content.style.padding = '0 var(--space-1, 1em)'
|
|
193
|
+
|
|
194
|
+
requestAnimationFrame(() => {
|
|
195
|
+
content.style.transition =
|
|
196
|
+
'max-height 0.4s ease, padding 0.4s ease'
|
|
197
|
+
content.style.maxHeight = content.scrollHeight + 'px'
|
|
198
|
+
content.style.padding = 'var(--space-1, 1em)'
|
|
199
|
+
})
|
|
200
|
+
} else {
|
|
201
|
+
content.style.maxHeight = content.scrollHeight + 'px' // Set to current height for smooth transition
|
|
202
|
+
|
|
203
|
+
requestAnimationFrame(() => {
|
|
204
|
+
content.style.transition =
|
|
205
|
+
'max-height 0.4s ease, padding 0.4s ease'
|
|
206
|
+
content.style.maxHeight = '0'
|
|
207
|
+
content.style.padding = '0 var(--space-1, 1em)'
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
// Optionally hide the content after animation
|
|
211
|
+
setTimeout(() => {
|
|
212
|
+
if (content.style.maxHeight === '0px') {
|
|
213
|
+
content.style.display = 'none'
|
|
214
|
+
}
|
|
215
|
+
}, 400) // Match transition duration
|
|
216
|
+
}
|
|
217
|
+
})
|
|
218
|
+
})
|
|
219
|
+
})
|
|
220
|
+
},
|
|
171
221
|
}
|
|
172
222
|
</script>
|
|
173
223
|
|
|
@@ -254,7 +304,6 @@ export default {
|
|
|
254
304
|
// max-width: 50vw;
|
|
255
305
|
}
|
|
256
306
|
}
|
|
257
|
-
|
|
258
307
|
}
|
|
259
308
|
}
|
|
260
309
|
</style>
|