@internetstiftelsen/styleguide 2.22.3-beta.0.12 → 2.22.3-beta.0.15
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/dist/molecules/continue-video-guide/continue-video-guide.js +6 -6
- package/dist/molecules/glider/glider-hero.js +23 -0
- package/dist/organisms/video-guide/video-guide.js +17 -17
- package/package.json +1 -1
- package/src/assets/video/chapters.vtt +8 -8
- package/src/molecules/glider/glider-hero.js +23 -0
- package/src/organisms/hero/_hero--dynamic-headline.scss +0 -1
- package/src/organisms/video-guide/_video-guide.scss +12 -0
|
@@ -66,15 +66,15 @@ var ProgressRing = function (_CustomElement2) {
|
|
|
66
66
|
|
|
67
67
|
window.customElements.define('progress-ring', ProgressRing);
|
|
68
68
|
|
|
69
|
-
// Get value from
|
|
70
|
-
if (
|
|
71
|
-
var videoCurrentTime =
|
|
72
|
-
var videoDuration =
|
|
69
|
+
// Get value from localStorage if present
|
|
70
|
+
if (localStorage.getItem('InmsCurrentTime')) {
|
|
71
|
+
var videoCurrentTime = localStorage.getItem('InmsCurrentTime');
|
|
72
|
+
var videoDuration = localStorage.getItem('InmsDuration');
|
|
73
73
|
var continueElement = document.querySelector('.js-guide-continue');
|
|
74
74
|
var progressRing = document.querySelector('progress-ring');
|
|
75
75
|
var continueLink = document.querySelector('.js-guide-continue-link');
|
|
76
|
-
var guideURL =
|
|
77
|
-
var guideImage =
|
|
76
|
+
var guideURL = localStorage.getItem('InmsCurrentGuideURL');
|
|
77
|
+
var guideImage = localStorage.getItem('InmsCurrentGuideImage');
|
|
78
78
|
|
|
79
79
|
if (videoCurrentTime > 0 && progressRing && continueElement && guideImage && continueLink) {
|
|
80
80
|
var alternativeText = continueLink.dataset.altText;
|
|
@@ -19,5 +19,28 @@ if (gliderElementHero) {
|
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
+
var autoplayDelay = gliderElementHero.dataset.timeout;
|
|
23
|
+
|
|
24
|
+
if (autoplayDelay) {
|
|
25
|
+
var autoplay = setInterval(function () {
|
|
26
|
+
GliderHero.scrollItem('next');
|
|
27
|
+
}, autoplayDelay);
|
|
28
|
+
|
|
29
|
+
gliderElementHero.addEventListener('mouseover', function () {
|
|
30
|
+
if (autoplay !== null) {
|
|
31
|
+
clearInterval(autoplay);
|
|
32
|
+
autoplay = null;
|
|
33
|
+
}
|
|
34
|
+
}, 0);
|
|
35
|
+
|
|
36
|
+
gliderElementHero.addEventListener('mouseout', function () {
|
|
37
|
+
if (autoplay === null) {
|
|
38
|
+
autoplay = setInterval(function () {
|
|
39
|
+
GliderHero.scrollItem('next');
|
|
40
|
+
}, autoplayDelay);
|
|
41
|
+
}
|
|
42
|
+
}, 0);
|
|
43
|
+
}
|
|
44
|
+
|
|
22
45
|
module.exports = GliderHero;
|
|
23
46
|
}
|
|
@@ -35,20 +35,20 @@ if (sourceElement) {
|
|
|
35
35
|
|
|
36
36
|
// Store current time in on page reload
|
|
37
37
|
window.addEventListener('unload', function () {
|
|
38
|
-
// Set
|
|
38
|
+
// Set localStorage if video has started playing
|
|
39
39
|
if (video.currentTime > 0) {
|
|
40
40
|
var currentGuideURL = window.location.href;
|
|
41
41
|
var currentGuideImage = document.querySelector('.js-guide-continue-image').src;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
localStorage.setItem('InmsCurrentTime', video.currentTime);
|
|
43
|
+
localStorage.setItem('InmsDuration', video.duration); // Get totalt duration of video
|
|
44
|
+
localStorage.setItem('InmsCurrentGuideURL', currentGuideURL);
|
|
45
|
+
localStorage.setItem('InmsCurrentGuideImage', currentGuideImage);
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
// Get value from
|
|
50
|
-
if (
|
|
51
|
-
var videoCurrentTime =
|
|
49
|
+
// Get value from localStorage in present
|
|
50
|
+
if (localStorage.getItem('InmsCurrentTime')) {
|
|
51
|
+
var videoCurrentTime = localStorage.getItem('InmsCurrentTime');
|
|
52
52
|
|
|
53
53
|
if (videoCurrentTime > 0) {
|
|
54
54
|
video.currentTime = videoCurrentTime;
|
|
@@ -93,10 +93,10 @@ if (sourceElement) {
|
|
|
93
93
|
manualStep = false;
|
|
94
94
|
forwardsButton.removeAttribute('disabled');
|
|
95
95
|
subtitlesContainer.innerHTML = '';
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
localStorage.removeItem('InmsCurrentTime');
|
|
97
|
+
localStorage.removeItem('InmsDuration');
|
|
98
|
+
localStorage.removeItem('InmsCurrentGuideURL');
|
|
99
|
+
localStorage.removeItem('InmsCurrentGuideImage');
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -109,10 +109,10 @@ if (sourceElement) {
|
|
|
109
109
|
forwardsButton.removeAttribute('disabled');
|
|
110
110
|
currentChapter = 1;
|
|
111
111
|
manualStep = false;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
localStorage.removeItem('InmsCurrentTime');
|
|
113
|
+
localStorage.removeItem('InmsDuration');
|
|
114
|
+
localStorage.removeItem('InmsCurrentGuideURL');
|
|
115
|
+
localStorage.removeItem('InmsCurrentGuideImage');
|
|
116
116
|
window.location.href = urlTarget;
|
|
117
117
|
});
|
|
118
118
|
}
|
|
@@ -153,7 +153,7 @@ function displayChapters() {
|
|
|
153
153
|
});
|
|
154
154
|
|
|
155
155
|
// If not set in sessionStorgare, set first cue on forward button on page load
|
|
156
|
-
if (!
|
|
156
|
+
if (!localStorage.getItem('InmsCurrentTime')) {
|
|
157
157
|
forwardsButton.setAttribute('data-id', chapterTrack.cues[0].endTime);
|
|
158
158
|
}
|
|
159
159
|
}, 100);
|
package/package.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
WEBVTT
|
|
2
2
|
|
|
3
3
|
00:00:00.000 --> 00:00:39.000
|
|
4
|
-
1 / 8: Introduktion
|
|
4
|
+
Kapitel 1 / 8: Introduktion
|
|
5
5
|
|
|
6
6
|
00:00:39.000 --> 00:01:51.500
|
|
7
|
-
2 / 8: Idén om internet
|
|
7
|
+
Kapitel 2 / 8: Idén om internet
|
|
8
8
|
|
|
9
9
|
00:01:51.500 --> 00:02:53.000
|
|
10
|
-
3 / 8: Arpanet blir till
|
|
10
|
+
Kapitel 3 / 8: Arpanet blir till
|
|
11
11
|
|
|
12
12
|
00:02:53.000 --> 00:03:27.000
|
|
13
|
-
4 / 8: TCP/IP uppfinns
|
|
13
|
+
Kapitel 4 / 8: TCP/IP uppfinns
|
|
14
14
|
|
|
15
15
|
00:03:27.000 --> 00:03:56.500
|
|
16
|
-
5 / 8: Sveriges första internetnod
|
|
16
|
+
Kapitel 5 / 8: Sveriges första internetnod
|
|
17
17
|
|
|
18
18
|
00:03:56.500 --> 00:04:34.000
|
|
19
|
-
6 / 8: Toppdomänen .se registreras
|
|
19
|
+
Kapitel 6 / 8: Toppdomänen .se registreras
|
|
20
20
|
|
|
21
21
|
00:04:34.000 --> 00:05:17.000
|
|
22
|
-
7 / 8: World Wide Web
|
|
22
|
+
Kapitel 7 / 8: World Wide Web
|
|
23
23
|
|
|
24
24
|
00:05:17.000 --> 00:06:28.000
|
|
25
|
-
8 / 8: Mosaic - den grafiska webbläsaren
|
|
25
|
+
Kapitel 8 / 8: Mosaic - den grafiska webbläsaren
|
|
@@ -13,5 +13,28 @@ if (gliderElementHero) {
|
|
|
13
13
|
},
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
+
const autoplayDelay = gliderElementHero.dataset.timeout;
|
|
17
|
+
|
|
18
|
+
if (autoplayDelay) {
|
|
19
|
+
let autoplay = setInterval(() => {
|
|
20
|
+
GliderHero.scrollItem('next');
|
|
21
|
+
}, autoplayDelay);
|
|
22
|
+
|
|
23
|
+
gliderElementHero.addEventListener('mouseover', () => {
|
|
24
|
+
if (autoplay !== null) {
|
|
25
|
+
clearInterval(autoplay);
|
|
26
|
+
autoplay = null;
|
|
27
|
+
}
|
|
28
|
+
}, 0);
|
|
29
|
+
|
|
30
|
+
gliderElementHero.addEventListener('mouseout', () => {
|
|
31
|
+
if (autoplay === null) {
|
|
32
|
+
autoplay = setInterval(() => {
|
|
33
|
+
GliderHero.scrollItem('next');
|
|
34
|
+
}, autoplayDelay);
|
|
35
|
+
}
|
|
36
|
+
}, 0);
|
|
37
|
+
}
|
|
38
|
+
|
|
16
39
|
module.exports = GliderHero;
|
|
17
40
|
}
|
|
@@ -4,11 +4,16 @@
|
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
background-color: $color-snow;
|
|
6
6
|
|
|
7
|
+
> figure {
|
|
8
|
+
display: flex;
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
@include e(video-container) {
|
|
8
12
|
position: relative;
|
|
9
13
|
padding-top: 70vh;
|
|
10
14
|
width: 100%;
|
|
11
15
|
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
12
17
|
justify-content: center;
|
|
13
18
|
|
|
14
19
|
@include bp-up(sm) {
|
|
@@ -219,6 +224,13 @@
|
|
|
219
224
|
}
|
|
220
225
|
}
|
|
221
226
|
|
|
227
|
+
@include e(timelineposts) {
|
|
228
|
+
z-index: 2;
|
|
229
|
+
width: 100%;
|
|
230
|
+
max-width: 200px;
|
|
231
|
+
background-color: $color-cyberspace;
|
|
232
|
+
}
|
|
233
|
+
|
|
222
234
|
@include e(buttons) {
|
|
223
235
|
display: flex;
|
|
224
236
|
width: 100%;
|