@asd20/ui 3.2.942 → 3.2.944

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 CHANGED
@@ -5,7 +5,7 @@
5
5
  "*.scss",
6
6
  "*.vue"
7
7
  ],
8
- "version": "3.2.942",
8
+ "version": "3.2.944",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -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">&#9658;</span>
39
+ <!-- Pause icon (⏸) -->
40
+ <span v-else>&#10073;&#10073;</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(255, 255, 255, 0.3); /* Darker arrow on hover */
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
  }
@@ -473,7 +510,7 @@ $max: 4rem;
473
510
  width: 60%;
474
511
  min-width: space(15);
475
512
  height: min-content;
476
- background: rgba(0, 0, 0, 0.5);
513
+ background: rgba(0, 0, 0, 0.6);
477
514
  padding: space(1);
478
515
  border-radius: var(--website-shape__radius-m);
479
516
  border-left: space(0.5) solid var(--color__accent);
@@ -621,7 +658,7 @@ $max: 4rem;
621
658
  width: 30%;
622
659
  min-width: space(15);
623
660
  height: min-content;
624
- background: rgba(0, 0, 0, 0.5);
661
+ background: rgba(0, 0, 0, 0.6);
625
662
  padding: space(1);
626
663
  border-radius: var(--website-shape__radius-m);
627
664
  border-left: space(0.5) solid var(--color__accent);
@@ -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">&#9658;</span>
35
+ <!-- Pause icon (⏸) -->
36
+ <span v-else>&#10073;&#10073;</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>