@internetstiftelsen/styleguide 2.22.3-beta.0.7 → 2.22.4

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.
Files changed (71) hide show
  1. package/dist/assets/js/objToQuery.js +2 -2
  2. package/dist/components.js +1 -9
  3. package/dist/molecules/glider/glider-course.js +7 -7
  4. package/package.json +3 -7
  5. package/src/app.scss +2 -6
  6. package/src/assets/css/footer/isolated-footer.css +7367 -0
  7. package/src/assets/css/footer/isolated-footer.css.map +1 -0
  8. package/src/assets/css/footer/isolated-footer.min.css +2 -0
  9. package/src/assets/js/objToQuery.js +2 -2
  10. package/src/atoms/button/_button.scss +9 -6
  11. package/src/atoms/icon/_all-icons.zip +0 -0
  12. package/src/atoms/icon/spinner-white.svg +9 -1
  13. package/src/atoms/icon/spinner.svg +9 -1
  14. package/src/atoms/icon/sprite.svg +0 -17
  15. package/src/atoms/meta/meta.config.js +1 -1
  16. package/src/base/_normalize.scss +1 -1
  17. package/src/base/fonts/_fonts.scss +8 -8
  18. package/src/brandbook/internetstiftelsen/bildman/303/251r/bildman/303/251r.config.js +5 -0
  19. package/src/brandbook/internetstiftelsen/tonalitet och spr/303/245kbruk/tonalitet och spr/303/245kbruk.config.js" +5 -0
  20. package/src/components.js +0 -4
  21. package/src/configurations/_extends.scss +1 -5
  22. package/src/configurations/_variables.scss +3 -3
  23. package/src/configurations/grid/_grid.scss +2 -17
  24. package/src/configurations/icons.json +1 -1
  25. package/src/configurations/typography/_typography.scss +4 -57
  26. package/src/molecules/glider/_glider.scss +116 -3
  27. package/src/molecules/glider/glider-course.js +7 -7
  28. package/src/molecules/glider/glider.config.js +0 -7
  29. package/src/organisms/hero/_hero.scss +0 -16
  30. package/src/organisms/hero/hero.config.js +1 -10
  31. package/src/pages/timeline/timeline.config.js +19 -0
  32. package/src/structures/_article.scss +3 -3
  33. package/dist/.DS_Store +0 -0
  34. package/dist/assets/js/anchorScroll.js +0 -16
  35. package/dist/assets/js/offset.js +0 -26
  36. package/dist/assets/js/parallax.js +0 -17
  37. package/dist/molecules/continue-video-guide/continue-video-guide.js +0 -91
  38. package/dist/molecules/glider/glider-hero.js +0 -23
  39. package/dist/organisms/timeline/timeline.js +0 -154
  40. package/dist/organisms/video-guide/video-guide.js +0 -298
  41. package/src/.DS_Store +0 -0
  42. package/src/assets/.DS_Store +0 -0
  43. package/src/assets/js/anchorScroll.js +0 -10
  44. package/src/assets/js/offset.js +0 -22
  45. package/src/assets/js/parallax.js +0 -15
  46. package/src/assets/video/.DS_Store +0 -0
  47. package/src/assets/video/Internets-Historia-HEVC-h265-HEVC-h265.mov +0 -0
  48. package/src/assets/video/Internets-Historia-HEVC-h265-vp9-chrome.webm +0 -0
  49. package/src/assets/video/chapters.vtt +0 -25
  50. package/src/assets/video/metadata.vtt +0 -25
  51. package/src/assets/video/movie-webm.webm +0 -0
  52. package/src/assets/video/videoplayer.vtt +0 -25
  53. package/src/atoms/.DS_Store +0 -0
  54. package/src/atoms/icon/step-backwards.svg +0 -1
  55. package/src/atoms/icon/step-forwards.svg +0 -1
  56. package/src/atoms/icon/subtitles.svg +0 -1
  57. package/src/molecules/.DS_Store +0 -0
  58. package/src/molecules/continue-video-guide/continue-video-guide.config.js +0 -7
  59. package/src/molecules/continue-video-guide/continue-video-guide.js +0 -84
  60. package/src/molecules/continue-video-guide/continue-video-guide.scss +0 -104
  61. package/src/molecules/continue-video-guide/readme.md +0 -3
  62. package/src/molecules/glider/_glider-course.scss +0 -121
  63. package/src/molecules/glider/_glider-hero.scss +0 -325
  64. package/src/molecules/glider/glider-hero.js +0 -17
  65. package/src/organisms/hero/_hero--dynamic-headline.scss +0 -161
  66. package/src/organisms/timeline/_timeline.scss +0 -292
  67. package/src/organisms/timeline/timeline.config.js +0 -7
  68. package/src/organisms/timeline/timeline.js +0 -146
  69. package/src/organisms/video-guide/_video-guide.scss +0 -337
  70. package/src/organisms/video-guide/video-guide.config.js +0 -17
  71. package/src/organisms/video-guide/video-guide.js +0 -293
@@ -1,298 +0,0 @@
1
- 'use strict';
2
-
3
- var video = document.querySelector('.js-video-guide');
4
- var playBtn = document.querySelector('.js-play-btn');
5
- var playIcon = document.querySelector('.js-play-icon');
6
- var pauseIcon = document.querySelector('.js-pause-icon');
7
- var subtitlesBtn = document.querySelector('.js-subtitles-btn');
8
- var abortButton = document.querySelector('.js-abort-guide');
9
- var subtitlesElement = document.getElementById('video-subtitles');
10
- var subtitlesContainer = document.querySelector('.js-subtitles-container');
11
- var locationList = document.querySelector('.js-chapters');
12
- var chapterTrackElement = document.getElementById('video-chapters');
13
- var trackMetadataElement = document.getElementById('video-metadata');
14
- var subtitlesTrack = subtitlesElement === null ? '' : subtitlesElement.track;
15
- var chapterTrack = chapterTrackElement === null ? '' : chapterTrackElement.track;
16
- var metadataTrack = trackMetadataElement === null ? '' : trackMetadataElement.track;
17
- var forwardsButton = document.querySelector('.js-next-chapter');
18
- var backwardsButton = document.querySelector('.js-previous-chapter');
19
- var timelinePosts = document.querySelectorAll('.js-timeline-post');
20
- var currentChapter = 1;
21
- var manualStep = false;
22
- var sourceElement = null;
23
-
24
- // Has src attributes been set already?
25
- if (sourceElement) {
26
- document.location.reload();
27
- } else if (video) {
28
- var dataSrc = video.dataset.src;
29
-
30
- sourceElement = document.createElement('source');
31
- sourceElement.setAttribute('src', dataSrc);
32
- sourceElement.setAttribute('type', 'video/mp4');
33
-
34
- video.appendChild(sourceElement);
35
-
36
- // Store current time in on page reload
37
- window.addEventListener('unload', function () {
38
- // Set sessionStorage if video has started playing
39
- if (video.currentTime > 0) {
40
- var currentGuideURL = window.location.href;
41
- var currentGuideImage = document.querySelector('.js-guide-continue-image').src;
42
- sessionStorage.setItem('InmsCurrentTime', video.currentTime);
43
- sessionStorage.setItem('InmsDuration', video.duration); // Get totalt duration of video
44
- sessionStorage.setItem('InmsCurrentGuideURL', currentGuideURL);
45
- sessionStorage.setItem('InmsCurrentGuideImage', currentGuideImage);
46
- }
47
- });
48
-
49
- // Get value from sessionStorage in present
50
- if (sessionStorage.getItem('InmsCurrentTime')) {
51
- var videoCurrentTime = sessionStorage.getItem('InmsCurrentTime');
52
-
53
- if (videoCurrentTime > 0) {
54
- video.currentTime = videoCurrentTime;
55
- }
56
- }
57
-
58
- // Toggle subtitles
59
- if (subtitlesBtn) {
60
- subtitlesBtn.addEventListener('click', function () {
61
- subtitlesBtn.classList.toggle('is-active');
62
- subtitlesContainer.classList.toggle('is-visible');
63
- });
64
- }
65
-
66
- // Play / pause
67
- if (playBtn) {
68
- playBtn.addEventListener('click', function () {
69
- if (video.paused) {
70
- video.play();
71
- pauseIcon.classList.remove('is-hidden');
72
- playIcon.classList.add('is-hidden');
73
- manualStep = false;
74
- } else {
75
- video.pause();
76
- pauseIcon.classList.add('is-hidden');
77
- playIcon.classList.remove('is-hidden');
78
- manualStep = true;
79
- }
80
- });
81
-
82
- video.addEventListener('playing', function () {
83
- pauseIcon.classList.remove('is-hidden');
84
- playIcon.classList.add('is-hidden');
85
- manualStep = false;
86
- });
87
-
88
- video.addEventListener('ended', function () {
89
- pauseIcon.classList.add('is-hidden');
90
- playIcon.classList.remove('is-hidden');
91
- video.currentTime = 0;
92
- currentChapter = 1;
93
- manualStep = false;
94
- forwardsButton.removeAttribute('disabled');
95
- subtitlesContainer.innerHTML = '';
96
- sessionStorage.removeItem('InmsCurrentTime');
97
- sessionStorage.removeItem('InmsDuration');
98
- sessionStorage.removeItem('InmsCurrentGuideURL');
99
- sessionStorage.removeItem('InmsCurrentGuideImage');
100
- });
101
- }
102
-
103
- if (abortButton) {
104
- abortButton.addEventListener('click', function (e) {
105
- e.preventDefault();
106
- var urlTarget = abortButton.getAttribute('href');
107
- video.pause();
108
- video.currentTime = 0;
109
- forwardsButton.removeAttribute('disabled');
110
- currentChapter = 1;
111
- manualStep = false;
112
- sessionStorage.removeItem('InmsCurrentTime');
113
- sessionStorage.removeItem('InmsDuration');
114
- sessionStorage.removeItem('InmsCurrentGuideURL');
115
- sessionStorage.removeItem('InmsCurrentGuideImage');
116
- window.location.href = urlTarget;
117
- });
118
- }
119
- }
120
-
121
- function displayChapters() {
122
- if (chapterTrackElement && trackMetadataElement) {
123
- // Set all track elements to hidden mode to allow scripting
124
- [].forEach.call(video.textTracks, function (txtTrack) {
125
- txtTrack.mode = 'hidden';
126
- });
127
-
128
- if (chapterTrack.kind === 'chapters') {
129
- video.addEventListener('loadedmetadata', function () {
130
- // Loop through chapters and create chapter list
131
- // Let data load
132
- setTimeout(function () {
133
- video.classList.remove('is-loading');
134
- [].forEach.call(chapterTrack.cues, function (cues) {
135
- var chapterName = cues.text;
136
- var start = cues.startTime;
137
- var newLocale = document.createElement('li');
138
- var location = document.createElement('a');
139
-
140
- location.setAttribute('rel', start);
141
- newLocale.setAttribute('id', start);
142
- location.setAttribute('tabindex', '0');
143
-
144
- // Plain text from the chapter file into HTML text
145
- var localeDescription = chapterName;
146
- location.innerHTML = localeDescription;
147
- newLocale.appendChild(location);
148
- locationList.appendChild(newLocale);
149
-
150
- location.addEventListener('click', function () {
151
- video.currentTime = location.id;
152
- }, false);
153
- });
154
-
155
- // If not set in sessionStorgare, set first cue on forward button on page load
156
- if (!sessionStorage.getItem('InmsCurrentTime')) {
157
- forwardsButton.setAttribute('data-id', chapterTrack.cues[0].endTime);
158
- }
159
- }, 100);
160
- });
161
-
162
- forwardsButton.addEventListener('click', function () {
163
- var dataId = forwardsButton.dataset.id;
164
- var currentTime = parseInt(dataId, 10);
165
- manualStep = true;
166
- currentTime += 1;
167
- video.currentTime = currentTime;
168
- currentChapter += 1;
169
- });
170
-
171
- backwardsButton.addEventListener('click', function () {
172
- var dataId = backwardsButton.dataset.id;
173
- var lastTime = parseInt(dataId, 10);
174
- lastTime -= 1;
175
- video.currentTime = lastTime;
176
- forwardsButton.removeAttribute('disabled');
177
- manualStep = true;
178
- currentChapter -= 1;
179
-
180
- if (video.currentTime <= 0) {
181
- backwardsButton.removeAttribute('data-id');
182
- }
183
- });
184
-
185
- chapterTrack.addEventListener('cuechange', function () {
186
- // Fire this whenever the chapters changes
187
- var myCues = chapterTrack.activeCues;
188
- if (myCues.length > 0) {
189
- var currentLocation = chapterTrack.activeCues[0].startTime;
190
- var nextLocation = chapterTrack.activeCues[0].endTime;
191
- var cueMatch = chapterTrack.activeCues[0].text;
192
- var matchingCueArray = document.querySelectorAll('[rel="' + currentLocation + '"]');
193
-
194
- // Set Forward and backwards buttons timestamps
195
- forwardsButton.setAttribute('data-id', nextLocation);
196
- backwardsButton.setAttribute('data-id', currentLocation);
197
-
198
- // Add chapter stepping even when video is played
199
- if (manualStep === false) {
200
- currentChapter += 1;
201
- }
202
-
203
- // Disable forwardsbutton when on last chapter
204
- if (currentChapter >= chapterTrack.cues.length) {
205
- forwardsButton.setAttribute('disabled', 'disabled');
206
- }
207
-
208
- // Handle current and watched items
209
- [].forEach.call(matchingCueArray, function (matchingCue) {
210
- var thisChapter = matchingCue;
211
- if (thisChapter.innerHTML === cueMatch) {
212
- var chapter = thisChapter;
213
-
214
- if (chapter === thisChapter) {
215
- // get the chapter <li> elements based on the currentLocation
216
- var locations = [].slice.call(chapter.closest('figure').querySelectorAll('.js-chapters li'));
217
-
218
- var counter = 0;
219
-
220
- [].forEach.call(locations, function (location) {
221
- // remove current classes from all items on page refresh
222
- location.classList.remove('is-current-item');
223
- location.querySelector('a').classList.remove('is-current');
224
-
225
- if (location.classList.contains('is-current-item')) {
226
- counter += 1; // iterate counter when active chapter is reached
227
- }
228
- if (counter < 1) {
229
- // add watched class to everything before the current chapter to show progress
230
- location.classList.add('is-watched');
231
- } else {
232
- // remove watched on all other items
233
- location.classList.remove('is-watched');
234
- }
235
- });
236
- chapter.parentNode.classList.add('is-current-item');
237
- chapter.classList.add('is-current');
238
- }
239
- }
240
- });
241
- }
242
- }, false);
243
-
244
- // Get timeline post IDs from metadata.vtt
245
- metadataTrack.addEventListener('cuechange', function () {
246
- var metadataCues = metadataTrack.activeCues;
247
- var chapterCues = chapterTrack.activeCues[0];
248
-
249
- if (metadataCues.length > 0) {
250
- var metadataCueMatch = metadataTrack.activeCues[0].text;
251
-
252
- [].forEach.call(timelinePosts, function (timelinePost) {
253
- timelinePost.classList.remove('is-current');
254
- });
255
-
256
- document.querySelector('[data-id="' + metadataCueMatch + '"]').classList.add('is-current');
257
-
258
- if (chapterCues) {
259
- var chapterStartTime = chapterCues.startTime;
260
-
261
- // Let stuff load
262
- var listElement = void 0;
263
- var timeOut = null;
264
-
265
- setTimeout(function () {
266
- listElement = document.getElementById(chapterStartTime);
267
- }, 100);
268
-
269
- timeOut = function wait(condition, callback) {
270
- if (typeof condition() !== 'undefined' && listElement) {
271
- listElement.classList.add('is-current-item');
272
- } else {
273
- setTimeout(function () {
274
- wait(condition, callback);
275
- }, 0);
276
- }
277
- };
278
- timeOut(function () {
279
- return listElement;
280
- }, function () {});
281
- }
282
- }
283
- }, false);
284
-
285
- // Get subtitles cues from subtitles.vtt
286
- subtitlesTrack.addEventListener('cuechange', function () {
287
- var subtitlesCues = subtitlesTrack.activeCues;
288
-
289
- if (subtitlesCues.length > 0) {
290
- var subtitlesCuesMatch = subtitlesTrack.activeCues[0].text;
291
- subtitlesContainer.innerHTML = '<span>' + subtitlesCuesMatch + '</span>';
292
- }
293
- }, false);
294
- }
295
- }
296
- }
297
-
298
- displayChapters(chapterTrackElement);
package/src/.DS_Store DELETED
Binary file
Binary file
@@ -1,10 +0,0 @@
1
- import SmoothScroll from 'smooth-scroll';
2
-
3
- const anchorScroll = new SmoothScroll('a[href*="#"]', {
4
- speed: 1500,
5
- speedAsDuration: true,
6
- easing: 'easeOutCubic',
7
- ignore: '[data-scroll-ignore]',
8
- });
9
-
10
- module.exports = anchorScroll;
@@ -1,22 +0,0 @@
1
- module.exports = {
2
- // Get top of element relative to window
3
- offsetTop(el) {
4
- const rect = el.getBoundingClientRect();
5
- const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
6
- return rect.top + scrollTop;
7
- },
8
-
9
- // Get bottom of element relative to window
10
- offsetBottom(el) {
11
- const rect = el.getBoundingClientRect();
12
- const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
13
- return rect.bottom + scrollTop;
14
- },
15
-
16
- // Get left of element relative to window
17
- offsetLeft(el) {
18
- const rect = el.getBoundingClientRect();
19
- const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft;
20
- return rect.left + scrollLeft;
21
- },
22
- };
@@ -1,15 +0,0 @@
1
- function isInView(el) {
2
- const box = el.getBoundingClientRect();
3
- return box.top < window.innerHeight && box.bottom >= 0;
4
- }
5
-
6
- const parallaxes = document.querySelectorAll('.js-parallax');
7
-
8
- window.addEventListener('scroll', () => {
9
- [].forEach.call(parallaxes, (parallax) => {
10
- const visible = isInView(parallax);
11
- if (visible) {
12
- parallax.classList.add('animate');
13
- }
14
- });
15
- });
Binary file
@@ -1,25 +0,0 @@
1
- WEBVTT
2
-
3
- 00:00:00.000 --> 00:00:39.000
4
- 1 / 8: Introduktion
5
-
6
- 00:00:39.000 --> 00:01:51.500
7
- 2 / 8: Idén om internet
8
-
9
- 00:01:51.500 --> 00:02:53.000
10
- 3 / 8: Arpanet blir till
11
-
12
- 00:02:53.000 --> 00:03:27.000
13
- 4 / 8: TCP/IP uppfinns
14
-
15
- 00:03:27.000 --> 00:03:56.500
16
- 5 / 8: Sveriges första internetnod
17
-
18
- 00:03:56.500 --> 00:04:34.000
19
- 6 / 8: Toppdomänen .se registreras
20
-
21
- 00:04:34.000 --> 00:05:17.000
22
- 7 / 8: World Wide Web
23
-
24
- 00:05:17.000 --> 00:06:28.000
25
- 8 / 8: Mosaic - den grafiska webbläsaren
@@ -1,25 +0,0 @@
1
- WEBVTT
2
-
3
- 00:00:00.000 --> 00:00:39.000
4
- 6513
5
-
6
- 00:00:39.000 --> 00:01:51.500
7
- 1376
8
-
9
- 00:01:51.500 --> 00:02:23.000
10
- 666
11
-
12
- 00:02:23.000 --> 00:03:27.000
13
- 777
14
-
15
- 00:03:27.000 --> 00:03:56.500
16
- 888
17
-
18
- 00:03:56.500 --> 00:04:34.000
19
- 242
20
-
21
- 00:04:34.000 --> 00:05:17.000
22
- 1337
23
-
24
- 00:05:17.000 --> 00:06:28.000
25
- 1177
Binary file
@@ -1,25 +0,0 @@
1
- WEBVTT
2
-
3
- 1
4
- 00:00:00.500 --> 00:00:02.000
5
- Lorem ipsum dolor sit amet, consectetur adipiscing elit
6
-
7
- 2
8
- 00:00:02.100 --> 00:00:03.000
9
- Phasellus eget lorem dui
10
-
11
- 3
12
- 00:00:03.100 --> 00:00:04.500
13
- Morbi ac nisi ac purus maximus semper a vitae diam fusce sit amet libero non tortor
14
-
15
- 4
16
- 00:00:04.600 --> 00:00:05.500
17
- Ut scelerisque sagittis justo vitae viverra
18
-
19
- 5
20
- 00:00:05.600 --> 00:00:06.500
21
- unc blandit justo sed odio tempus ultrices. Pellentesque sollicitudin justo.
22
-
23
- 6
24
- 00:00:06.100 --> 00:00:08.000
25
- Etiam ut volutpat tortor. Nunc iaculis luctus sapien.
Binary file
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32" xml:space="preserve"><path d="m25.7 28.9-14.2-13 14.2-13v26zM9.753 28h-5V3h5z"/></svg>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" style="enable-background:new 0 0 32 32" xml:space="preserve"><path d="m4.8 2.9 14.2 13-14.2 13v-26zM20.7 3.1h5v25h-5z"/></svg>
@@ -1 +0,0 @@
1
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0" y="0" viewBox="0 0 32 32" width="32" height="32" xml:space="preserve"><path d="M27 10v12H5V10h22m3-3H2v18h28V7z"/><path class="st0" d="M25 19h-4"/><path d="M21 18h4v2h-4z"/><path class="st0" d="M19 19H7"/><path d="M7 18h12v2H7z"/><g><path class="st0" d="M7 15h4"/><path d="M7 14h4v2H7z"/></g><g><path class="st0" d="M13 15h12"/><path d="M13 14h12v2H13z"/></g></svg>
Binary file
@@ -1,7 +0,0 @@
1
- module.exports = {
2
- status: 'wip',
3
-
4
- context: {
5
- additional_classes: false
6
- }
7
- }
@@ -1,84 +0,0 @@
1
- import className from '../../assets/js/className';
2
-
3
- class ProgressRing extends HTMLElement {
4
- constructor() {
5
- super();
6
- const stroke = this.getAttribute('stroke');
7
- const radius = this.getAttribute('radius');
8
- const normalizedRadius = radius - stroke * 2;
9
- this.circumference = normalizedRadius * 2 * Math.PI;
10
-
11
- this.root = this.attachShadow({ mode: 'open' });
12
- this.root.innerHTML = `
13
- <svg
14
- height="${radius * 2}"
15
- width="${radius * 2}"
16
- >
17
- <circle
18
- stroke="white"
19
- stroke-dasharray="${this.circumference} ${this.circumference}"
20
- style="stroke-dashoffset:${this.circumference}"
21
- stroke-width="${stroke}"
22
- fill="transparent"
23
- r="${normalizedRadius}"
24
- cx="${radius}"
25
- cy="${radius}"
26
- />
27
- </svg>
28
-
29
- <style>
30
- circle {
31
- transition: stroke-dashoffset 0.35s;
32
- transform: rotate(-90deg);
33
- transform-origin: 50% 50%;
34
- }
35
- </style>
36
- `;
37
- }
38
-
39
- setProgress(percent) {
40
- const offset = this.circumference - ((percent / 100) * this.circumference);
41
- const circle = this.root.querySelector('circle');
42
- circle.style.strokeDashoffset = offset;
43
- }
44
-
45
- static get observedAttributes() {
46
- return ['progress'];
47
- }
48
-
49
- attributeChangedCallback(name, oldValue, newValue) {
50
- if (name === 'progress') {
51
- this.setProgress(newValue);
52
- }
53
- }
54
- }
55
-
56
- window.customElements.define('progress-ring', ProgressRing);
57
-
58
- // Get value from sessionStorage if present
59
- if (sessionStorage.getItem('InmsCurrentTime')) {
60
- const videoCurrentTime = sessionStorage.getItem('InmsCurrentTime');
61
- const videoDuration = sessionStorage.getItem('InmsDuration');
62
- const continueElement = document.querySelector('.js-guide-continue');
63
- const progressRing = document.querySelector('progress-ring');
64
- const continueLink = document.querySelector('.js-guide-continue-link');
65
- const guideURL = sessionStorage.getItem('InmsCurrentGuideURL');
66
- const guideImage = sessionStorage.getItem('InmsCurrentGuideImage');
67
-
68
- if ((videoCurrentTime > 0)
69
- && progressRing
70
- && continueElement
71
- && guideImage
72
- && continueLink) {
73
- const alternativeText = continueLink.dataset.altText;
74
- const currentProgress = videoCurrentTime / videoDuration;
75
- const currentGuideImage = document.querySelector('.js-guide-continue-image');
76
-
77
- continueElement.classList.add(className('m-continue-video-guide--has-progress'));
78
- continueLink.setAttribute('href', guideURL);
79
- currentGuideImage.src = guideImage;
80
- continueLink.querySelector('span').innerText = alternativeText;
81
- // Calculate percentage played
82
- progressRing.setAttribute('progress', Math.floor(currentProgress * 100));
83
- }
84
- }
@@ -1,104 +0,0 @@
1
- @charset "UTF-8";
2
-
3
- @include molecule(continue-video-guide) {
4
- position: fixed;
5
- bottom: 0;
6
- right: 0;
7
- z-index: z_index(middlegroundImportant);
8
- width: 100px;
9
- height: calc(100px + 23px + rhythm(1));
10
- transform: scale(0.7);
11
-
12
- @include bp-up(md) {
13
- transform: scale(1);
14
- bottom: rhythm(2);
15
- right: rhythm(2);
16
- }
17
-
18
- @include e(inner) {
19
- position: relative;
20
- }
21
-
22
- @include e(progressbar) {
23
- display: none;
24
- }
25
-
26
- @include e(continue) {
27
- position: absolute;
28
- z-index: 3;
29
- display: flex;
30
- align-items: center;
31
- justify-content: center;
32
- width: 100px;
33
- height: 100px;
34
- border-color: $color-snow;
35
-
36
- &::after {
37
- content: 'Guidad tur';
38
- display: block;
39
- position: absolute;
40
- left: auto;
41
- right: auto;
42
- bottom: 0;
43
- transform: translateY(calc(100% + rhythm(1)));
44
- text-align: center;
45
- background-color: $color-peacock-light;
46
- font-size: $size-medium;
47
- font-family: $font-family-headings;
48
- border-radius: $border-radius;
49
- color: $color-cyberspace;
50
- padding: rhythm(0.5) rhythm(1);
51
- line-height: 1;
52
- }
53
- }
54
-
55
- @include m(has-progress) {
56
- @include e(continue) {
57
- &::after {
58
- content: 'Fortsätt';
59
- }
60
-
61
- @include e(arrow) {
62
- width: 0;
63
- height: 0;
64
- border-style: solid;
65
- border-width: 15px 0 15px 20px;
66
- transition: border-width 0.25s ease-out;
67
- border-color: transparent transparent transparent inherit;
68
- }
69
-
70
- &:hover,
71
- &:focus {
72
- > div {
73
- border-width: 20px 0 20px 30px;
74
- }
75
- }
76
- }
77
-
78
- @include e(progressbar) {
79
- display: block;
80
- position: absolute;
81
- z-index: 2;
82
- border-radius: 50%;
83
-
84
- &::after {
85
- position: absolute;
86
- top: 6px;
87
- left: 6px;
88
- width: 88px;
89
- height: 88px;
90
- border-radius: 50%;
91
- content: '';
92
- display: block;
93
- border: 4px solid rgba($color-snow, 0.5);
94
- }
95
- }
96
- }
97
-
98
- @include e(image) {
99
- position: absolute;
100
- z-index: 1;
101
- width: 100px;
102
- height: 100px;
103
- }
104
- }
@@ -1,3 +0,0 @@
1
- # Continue Video Guide
2
-
3
- This component is dependent on the [Video Guide Component](/components/detail/video-guide). Continuing a guided tour is only possible if the video player has a saved timestamp in sessionStorage