@internetstiftelsen/styleguide 2.22.3-beta.0.2 → 2.22.3-beta.0.20

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.
@@ -66,15 +66,15 @@ var ProgressRing = function (_CustomElement2) {
66
66
 
67
67
  window.customElements.define('progress-ring', ProgressRing);
68
68
 
69
- // Get value from sessionStorage if present
70
- if (sessionStorage.getItem('InmsCurrentTime')) {
71
- var videoCurrentTime = sessionStorage.getItem('InmsCurrentTime');
72
- var videoDuration = sessionStorage.getItem('InmsDuration');
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 = sessionStorage.getItem('InmsCurrentGuideURL');
77
- var guideImage = sessionStorage.getItem('InmsCurrentGuideImage');
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
  }
@@ -126,7 +126,7 @@ var timeLineItemScrollPosition = 0;
126
126
  timeLineItem.closest('.row').classList.add('row-has-open-child');
127
127
 
128
128
  // Wrap open timeline item
129
- wrap(timeLineItem.querySelector('.wp-block-iis-card'), document.createElement('div'));
129
+ wrap(timeLineItem.querySelector('.wp-block-iis-timeline-post'), document.createElement('div'));
130
130
  }
131
131
  });
132
132
 
@@ -17,6 +17,8 @@ var metadataTrack = trackMetadataElement === null ? '' : trackMetadataElement.tr
17
17
  var forwardsButton = document.querySelector('.js-next-chapter');
18
18
  var backwardsButton = document.querySelector('.js-previous-chapter');
19
19
  var timelinePosts = document.querySelectorAll('.js-timeline-post');
20
+ var navigationButton = document.querySelector('.js-show-timelineposts');
21
+ var timeLinePosts = document.querySelector('.js-timeline-posts');
20
22
  var currentChapter = 1;
21
23
  var manualStep = false;
22
24
  var sourceElement = null;
@@ -35,20 +37,20 @@ if (sourceElement) {
35
37
 
36
38
  // Store current time in on page reload
37
39
  window.addEventListener('unload', function () {
38
- // Set sessionStorage if video has started playing
40
+ // Set localStorage if video has started playing
39
41
  if (video.currentTime > 0) {
40
42
  var currentGuideURL = window.location.href;
41
43
  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);
44
+ localStorage.setItem('InmsCurrentTime', video.currentTime);
45
+ localStorage.setItem('InmsDuration', video.duration); // Get totalt duration of video
46
+ localStorage.setItem('InmsCurrentGuideURL', currentGuideURL);
47
+ localStorage.setItem('InmsCurrentGuideImage', currentGuideImage);
46
48
  }
47
49
  });
48
50
 
49
- // Get value from sessionStorage in present
50
- if (sessionStorage.getItem('InmsCurrentTime')) {
51
- var videoCurrentTime = sessionStorage.getItem('InmsCurrentTime');
51
+ // Get value from localStorage in present
52
+ if (localStorage.getItem('InmsCurrentTime')) {
53
+ var videoCurrentTime = localStorage.getItem('InmsCurrentTime');
52
54
 
53
55
  if (videoCurrentTime > 0) {
54
56
  video.currentTime = videoCurrentTime;
@@ -93,10 +95,10 @@ if (sourceElement) {
93
95
  manualStep = false;
94
96
  forwardsButton.removeAttribute('disabled');
95
97
  subtitlesContainer.innerHTML = '';
96
- sessionStorage.removeItem('InmsCurrentTime');
97
- sessionStorage.removeItem('InmsDuration');
98
- sessionStorage.removeItem('InmsCurrentGuideURL');
99
- sessionStorage.removeItem('InmsCurrentGuideImage');
98
+ localStorage.removeItem('InmsCurrentTime');
99
+ localStorage.removeItem('InmsDuration');
100
+ localStorage.removeItem('InmsCurrentGuideURL');
101
+ localStorage.removeItem('InmsCurrentGuideImage');
100
102
  });
101
103
  }
102
104
 
@@ -109,13 +111,20 @@ if (sourceElement) {
109
111
  forwardsButton.removeAttribute('disabled');
110
112
  currentChapter = 1;
111
113
  manualStep = false;
112
- sessionStorage.removeItem('InmsCurrentTime');
113
- sessionStorage.removeItem('InmsDuration');
114
- sessionStorage.removeItem('InmsCurrentGuideURL');
115
- sessionStorage.removeItem('InmsCurrentGuideImage');
114
+ localStorage.removeItem('InmsCurrentTime');
115
+ localStorage.removeItem('InmsDuration');
116
+ localStorage.removeItem('InmsCurrentGuideURL');
117
+ localStorage.removeItem('InmsCurrentGuideImage');
116
118
  window.location.href = urlTarget;
117
119
  });
118
120
  }
121
+
122
+ if (navigationButton) {
123
+ navigationButton.addEventListener('click', function () {
124
+ navigationButton.classList.toggle('is-toggeled');
125
+ timeLinePosts.classList.toggle('is-visible');
126
+ });
127
+ }
119
128
  }
120
129
 
121
130
  function displayChapters() {
@@ -153,7 +162,7 @@ function displayChapters() {
153
162
  });
154
163
 
155
164
  // If not set in sessionStorgare, set first cue on forward button on page load
156
- if (!sessionStorage.getItem('InmsCurrentTime')) {
165
+ if (!localStorage.getItem('InmsCurrentTime')) {
157
166
  forwardsButton.setAttribute('data-id', chapterTrack.cues[0].endTime);
158
167
  }
159
168
  }, 100);
@@ -253,7 +262,12 @@ function displayChapters() {
253
262
  timelinePost.classList.remove('is-current');
254
263
  });
255
264
 
256
- document.querySelector('[data-id="' + metadataCueMatch + '"]').classList.add('is-current');
265
+ var idSelectors = document.querySelectorAll('[data-id="' + metadataCueMatch + '"]');
266
+
267
+ [].forEach.call(idSelectors, function (idSelector) {
268
+ idSelector.classList.add('is-current');
269
+ idSelector.focus();
270
+ });
257
271
 
258
272
  if (chapterCues) {
259
273
  var chapterStartTime = chapterCues.startTime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "2.22.3-beta.0.2",
3
+ "version": "2.22.3-beta.0.20",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
Binary file
@@ -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
@@ -1,8 +1,11 @@
1
1
  WEBVTT
2
2
 
3
- 00:00:00.000 --> 00:00:39.000
3
+ 00:00:00.000 --> 00:00:25.000
4
4
  6513
5
5
 
6
+ 00:00:25.000 --> 00:00:39.000
7
+ 5555
8
+
6
9
  00:00:39.000 --> 00:01:51.500
7
10
  1376
8
11
 
@@ -76,7 +76,7 @@ $colors: (
76
76
  @each $key, $value in $map {
77
77
  &#{if($key != $base, #{$separator}#{$key}, '')} {
78
78
  @if type-of($value) == 'map' {
79
- @include color_classes($value, $attribute, $prefix, $separator: '-', $element: $element);
79
+ @include color_classes($value, $attribute, $prefix: '.', $separator: '-', $element: $element);
80
80
  }
81
81
  @else {
82
82
  @if ($element != '') {
@@ -94,13 +94,12 @@ $colors: (
94
94
  }
95
95
 
96
96
  /// Generate wordpress color classes with attribute and value
97
- /// Generates this: .has-color-name{$suffix}
97
+ /// Generates this: .has-colorname-color
98
98
  /// @group Colors
99
99
  @mixin wordpress_color_classes($map, $attribute, $separator: '-', $suffix: '', $base: 'base') {
100
100
  @each $key, $value in $map {
101
101
  @if type-of($value) == 'map' {
102
102
  &#{if($key != $base, #{$separator}#{$key}, '')} {
103
- content: str-replace($key, 'color-', '');
104
103
  @include wordpress_color_classes($value, $attribute, $separator, '-color');
105
104
  }
106
105
  }
@@ -145,7 +145,8 @@ small {
145
145
  );
146
146
  }
147
147
 
148
- .supersize {
148
+ .supersize,
149
+ %supersize {
149
150
  @include plumber(
150
151
  $font-size: 3,
151
152
  $line-height: 4,
@@ -178,30 +179,30 @@ small {
178
179
  $leading-bottom: 0
179
180
  );
180
181
 
181
- line-height: 84px;
182
+ line-height: 79px;
182
183
  font-size: 120px;
183
184
  font-family: $font-family-bold;
184
185
  letter-spacing: -#{rem(5px)};
185
186
 
186
187
  @include bp-up(sm) {
187
- line-height: 105px;
188
+ line-height: 100px;
188
189
  font-size: 150px;
189
190
  }
190
191
 
191
192
  @include bp-up(md) {
192
- line-height: 139px;
193
+ line-height: 135px;
193
194
  font-size: 200px;
194
195
  letter-spacing: -#{rem(10px)};
195
196
  }
196
197
 
197
198
  @include bp-up(lg) {
198
- line-height: 207px;
199
+ line-height: 201px;
199
200
  font-size: 295px;
200
201
  letter-spacing: -#{rem(20px)};
201
202
  }
202
203
 
203
204
  @include bp-up(xl) {
204
- line-height: 251px;
205
+ line-height: 247px;
205
206
  font-size: 360px;
206
207
  }
207
208
 
@@ -225,8 +226,8 @@ small {
225
226
  %preamble {
226
227
 
227
228
  @include plumber(
228
- $font-size: 2.5,
229
- $line-height: 3,
229
+ $font-size: 2.55555,
230
+ $line-height: 4,
230
231
  $leading-bottom: 4
231
232
  );
232
233
 
@@ -55,15 +55,15 @@ class ProgressRing extends HTMLElement {
55
55
 
56
56
  window.customElements.define('progress-ring', ProgressRing);
57
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');
58
+ // Get value from localStorage if present
59
+ if (localStorage.getItem('InmsCurrentTime')) {
60
+ const videoCurrentTime = localStorage.getItem('InmsCurrentTime');
61
+ const videoDuration = localStorage.getItem('InmsDuration');
62
62
  const continueElement = document.querySelector('.js-guide-continue');
63
63
  const progressRing = document.querySelector('progress-ring');
64
64
  const continueLink = document.querySelector('.js-guide-continue-link');
65
- const guideURL = sessionStorage.getItem('InmsCurrentGuideURL');
66
- const guideImage = sessionStorage.getItem('InmsCurrentGuideImage');
65
+ const guideURL = localStorage.getItem('InmsCurrentGuideURL');
66
+ const guideImage = localStorage.getItem('InmsCurrentGuideImage');
67
67
 
68
68
  if ((videoCurrentTime > 0)
69
69
  && progressRing
@@ -134,6 +134,8 @@
134
134
  }
135
135
 
136
136
  .glider-slide {
137
+ width: 100vw;
138
+
137
139
  @include m(hero) {
138
140
  margin: 0;
139
141
  padding: 0;
@@ -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
  }
@@ -18,6 +18,10 @@
18
18
  right: 0;
19
19
  bottom: 0;
20
20
  z-index: -1;
21
+
22
+ @include bp-up(xxl) {
23
+ object-position: 50% 50%;
24
+ }
21
25
  }
22
26
 
23
27
  @include e(caption) {
@@ -32,7 +36,7 @@
32
36
 
33
37
  > h1 {
34
38
  --minFontSize: 22px;
35
- --maxFontSize: 300px;
39
+ --maxFontSize: 200px;
36
40
  --scaler: 10vw;
37
41
 
38
42
  font-size: clamp( var(--minFontSize), var(--scaler), var(--maxFontSize) );
@@ -40,6 +44,14 @@
40
44
  margin: 0;
41
45
  padding: 0;
42
46
  line-height: 1.2;
47
+
48
+ @include bp-up(md) {
49
+ line-height: 1.1;
50
+ }
51
+
52
+ @include bp-up(lg) {
53
+ line-height: 1;
54
+ }
43
55
  }
44
56
 
45
57
  @include bp-up(sm-xs) {
@@ -88,7 +100,6 @@
88
100
 
89
101
  @include bp-up(xxl) {
90
102
  font-size: 24px !important;
91
- margin-left: rhythm(2);
92
103
  }
93
104
  }
94
105
  }
@@ -126,29 +137,29 @@
126
137
 
127
138
  @keyframes pulse2 {
128
139
  0% {
129
- transform: translateY(-25%) scale(2);
140
+ transform: translateY(0) scale(2);
130
141
  }
131
142
 
132
143
  50% {
133
- transform: translateY(-50%) scale(2);
144
+ transform: translateY(-25%) scale(2);
134
145
  }
135
146
 
136
147
  100% {
137
- transform: translateY(-25%) scale(2);
148
+ transform: translateY(0) scale(2);
138
149
  }
139
150
  }
140
151
 
141
152
  @keyframes pulse3 {
142
153
  0% {
143
- transform: translateY(-50%) scale(3);
154
+ transform: translateY(0) scale(3);
144
155
  }
145
156
 
146
157
  50% {
147
- transform: translateY(-75%) scale(3);
158
+ transform: translateY(-25%) scale(3);
148
159
  }
149
160
 
150
161
  100% {
151
- transform: translateY(-50%) scale(3);
162
+ transform: translateY(0) scale(3);
152
163
  }
153
164
  }
154
165
 
@@ -119,7 +119,7 @@ module.exports = {
119
119
  context: {
120
120
  has_image: true,
121
121
  hero_image: '/assets/images/Reprogramming_ENIAC2.png',
122
- heading: 'Kvinnorna som digitaliserade världen',
122
+ heading: 'Datadamer - Kvinnorna som digitaliserade världen',
123
123
  }
124
124
  },
125
125
  ]
@@ -135,6 +135,15 @@ html {
135
135
  display: none;
136
136
  padding-bottom: 0;
137
137
  margin-top: 0;
138
+ min-height: 150px;
139
+ background-image: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='xMidYMid' class='lds-ring' style='background: none;'%3E%3Ccircle cx='50' cy='50' ng-attr-r='%7B%7Bconfig.radius%7D%7D' ng-attr-stroke='%7B%7Bconfig.base%7D%7D' ng-attr-stroke-width='%7B%7Bconfig.width%7D%7D' fill='none' r='43' stroke='%23a7d8fd' stroke-width='7'%3E%3C/circle%3E%3Ccircle cx='50' cy='50' ng-attr-r='%7B%7Bconfig.radius%7D%7D' ng-attr-stroke='%7B%7Bconfig.stroke%7D%7D' ng-attr-stroke-width='%7B%7Bconfig.innerWidth%7D%7D' ng-attr-stroke-linecap='%7B%7Bconfig.linecap%7D%7D' fill='none' r='43' stroke='%2350b2fc' stroke-width='7' stroke-linecap='square' transform='rotate(27.6965 50 50)'%3E%3CanimateTransform attributeName='transform' type='rotate' calcMode='linear' values='0 50 50;180 50 50;720 50 50' keyTimes='0;0.5;1' dur='2.5s' begin='0s' repeatCount='indefinite'%3E%3C/animateTransform%3E%3Canimate attributeName='stroke-dasharray' calcMode='linear' values='9.42477796076938 179.0707812546182;188.4955592153876 -2.842170943040401e-14;9.42477796076938 179.0707812546182' keyTimes='0;0.5;1' dur='2.5' begin='0s' repeatCount='indefinite'%3E%3C/animate%3E%3C/circle%3E%3C/svg%3E%0A");
140
+ background-repeat: no-repeat;
141
+ background-position: center center;
142
+ background-size: 30% 30%;
143
+
144
+ &[data-timeline-post-expanded-content="true"] {
145
+ background-image: none;
146
+ }
138
147
 
139
148
  @include e(meta) {
140
149
  @include e(related) {
@@ -181,6 +190,18 @@ html {
181
190
  color: $color-snow;
182
191
  }
183
192
 
193
+ p a,
194
+ li a,
195
+ h1 a,
196
+ h2 a,
197
+ h3 a,
198
+ h4 a {
199
+ &:hover,
200
+ &:focus {
201
+ color: $color-cyberspace;
202
+ }
203
+ }
204
+
184
205
  a[data-scroll-ignore] {
185
206
  pointer-events: none;
186
207
 
@@ -203,7 +224,7 @@ html {
203
224
  @extend %preamble;
204
225
  }
205
226
 
206
- .wp-block-iis-card {
227
+ .wp-block-iis-timeline-post {
207
228
  margin-left: auto;
208
229
  margin-right: auto;
209
230
 
@@ -118,7 +118,7 @@ let timeLineItemScrollPosition = 0;
118
118
  timeLineItem.closest('.row').classList.add('row-has-open-child');
119
119
 
120
120
  // Wrap open timeline item
121
- wrap(timeLineItem.querySelector('.wp-block-iis-card'), document.createElement('div'));
121
+ wrap(timeLineItem.querySelector('.wp-block-iis-timeline-post'), document.createElement('div'));
122
122
  }
123
123
  });
124
124
 
@@ -1,14 +1,26 @@
1
1
  @charset "UTF-8";
2
2
 
3
- @include molecule(video-guide) {
3
+ @include organism(video-guide) {
4
4
  flex-direction: column;
5
5
  background-color: $color-snow;
6
6
 
7
+ @include e(inner-wrapper) {
8
+ width: 100%;
9
+ position: relative;
10
+ }
11
+
12
+ > figure {
13
+ display: flex;
14
+ overflow: hidden;
15
+ position: relative;
16
+ }
17
+
7
18
  @include e(video-container) {
8
19
  position: relative;
9
20
  padding-top: 70vh;
10
21
  width: 100%;
11
22
  display: flex;
23
+ flex-direction: column;
12
24
  justify-content: center;
13
25
 
14
26
  @include bp-up(sm) {
@@ -28,13 +40,14 @@
28
40
  bottom: 0;
29
41
  z-index: 1;
30
42
  justify-content: center;
31
- display: none;
43
+ opacity: 0;
44
+ transition: opacity 0.25s ease-out;
32
45
  margin: 0;
33
46
  padding: 0;
34
47
 
35
48
  &:first-child,
36
49
  &.is-current {
37
- display: flex;
50
+ opacity: 1;
38
51
  }
39
52
 
40
53
  img {
@@ -48,8 +61,8 @@
48
61
  @include e(text) {
49
62
  position: absolute;
50
63
  top: 50%;
51
- left: auto;
52
- right: auto;
64
+ left: 0;
65
+ right: 0;
53
66
  text-align: center;
54
67
  padding-left: rhythm(2);
55
68
  padding-right: rhythm(2);
@@ -69,16 +82,38 @@
69
82
  @include bp-up(xl) {
70
83
  left: rhythm(8);
71
84
  width: calc(100% - rhythm(16));
72
- max-width: 70%;
73
85
  text-align: left;
74
86
  }
75
87
 
76
- > h2 {
88
+ @include e(headline) {
77
89
  font-family: $font-family-bold;
78
90
  color: $color-snow;
79
91
  text-shadow: 0 0 rem(50px) rgba($color-black, 1),
80
92
  0 0 rem(10px) rgba($color-black, 1),
81
93
  rem(1px) rem(1px) rem(2px) rgba($color-black, 0.6);
94
+
95
+ @include plumber(
96
+ $font-size: 3,
97
+ $line-height: 4,
98
+ $leading-bottom: 1,
99
+ $baseline: $headings-baseline
100
+ );
101
+
102
+ @include bp-up(sm) {
103
+ @include plumber(
104
+ $font-size: 4.5,
105
+ $line-height: 5,
106
+ $leading-bottom: 1
107
+ );
108
+ }
109
+
110
+ @include bp-up(lg) {
111
+ @include plumber(
112
+ $font-size: 7,
113
+ $line-height: 8,
114
+ $leading-bottom: 2
115
+ );
116
+ }
82
117
  }
83
118
 
84
119
  > a {
@@ -160,10 +195,7 @@
160
195
  display: flex;
161
196
  align-items: center;
162
197
  justify-content: space-between;
163
- padding-top: rhythm(2);
164
- padding-bottom: rhythm(2);
165
- padding-left: rhythm(1);
166
- padding-right: rhythm(1);
198
+ padding: rhythm(2);
167
199
  flex-direction: column-reverse;
168
200
  overflow: hidden;
169
201
 
@@ -174,8 +206,6 @@
174
206
  @include bp-up(md) {
175
207
  align-items: stretch;
176
208
  flex-direction: row;
177
- padding-left: rhythm(2);
178
- padding-right: rhythm(2);
179
209
  }
180
210
  }
181
211
 
@@ -219,9 +249,115 @@
219
249
  }
220
250
  }
221
251
 
252
+ @include e(timelineposts) {
253
+ z-index: 2;
254
+ width: 250px;
255
+ min-width: 250px;
256
+ background-color: $color-cyberspace;
257
+ position: relative;
258
+ transform: translateX(100%);
259
+ transition: transform 0.25s ease-out;
260
+ flex-shrink: 0;
261
+ position: absolute;
262
+ top: 0;
263
+ right: 0;
264
+ bottom: 0;
265
+
266
+ @include bp-up(md) {
267
+ transform: translateX(0);
268
+ position: relative;
269
+ top: auto;
270
+ right: auto;
271
+ bottom: auto;
272
+ }
273
+
274
+ @include bp-up(xl) {
275
+ width: 350px;
276
+ }
277
+
278
+ &.is-visible {
279
+ transform: translateX(0);
280
+ }
281
+
282
+ @include e(list) {
283
+ position: absolute;
284
+ top: 0;
285
+ left: 0;
286
+ right: 0;
287
+ bottom: 0;
288
+ overflow-y: auto;
289
+
290
+ dt {
291
+ color: $color-snow;
292
+ font-family: $font-family-headings;
293
+ padding: rhythm(1) rhythm(2);
294
+
295
+ @include bp-up(md) {
296
+ padding-top: rhythm(2);
297
+ padding-bottom: rhythm(2);
298
+ }
299
+ }
300
+
301
+ dd {
302
+ padding: 0;
303
+ margin: 0;
304
+ display: block;
305
+ border-top: 1px solid lighten($color-cyberspace, 10%);
306
+ }
307
+ }
308
+
309
+ @include e(link) {
310
+ display: flex;
311
+ padding: rhythm(1) rhythm(2);
312
+ color: $color-snow;
313
+ text-decoration: none;
314
+ font-size: $size-medium;
315
+ position: relative;
316
+ line-height: 1.5;
317
+
318
+ &:hover,
319
+ &:focus,
320
+ &.is-current {
321
+ background-color: lighten($color-cyberspace, 10%);
322
+
323
+ &::after {
324
+ content: attr(data-label);
325
+ display: block;
326
+ background-color: $color-peacock;
327
+ font-family: $font-family-headings;
328
+ padding: rhythm(1);
329
+ line-height: 1;
330
+ align-self: flex-end;
331
+ white-space: nowrap;
332
+ border-radius: $border-radius;
333
+ transform: translateX(rhythm(0.5));
334
+ margin-left: rhythm(1);
335
+ }
336
+ }
337
+
338
+ &.is-current {
339
+ font-family: $font-family-headings;
340
+ }
341
+ }
342
+
343
+ @include e(button-navigation) {
344
+ transform: translateX(-100%);
345
+
346
+ @include bp-up(md) {
347
+ display: none;
348
+ }
349
+
350
+ &.is-toggeled {
351
+ transform: translateX(0) scaleX(-1);
352
+ position: absolute;
353
+ right: rhythm(1);
354
+ z-index: 2;
355
+ }
356
+ }
357
+ }
358
+
222
359
  @include e(buttons) {
223
360
  display: flex;
224
- width: 100%;
225
361
  }
226
362
 
227
363
  @include e(button) {
@@ -284,6 +420,7 @@
284
420
  width: auto;
285
421
  position: absolute;
286
422
  bottom: rhythm(1);
423
+ right: rhythm(1);
287
424
  z-index: 3;
288
425
  font-family: $font-family-headings;
289
426
  min-width: 200px;
@@ -309,12 +446,16 @@
309
446
  @include bp-up(lg) {
310
447
  font-size: $size-base * 1.7;
311
448
  min-width: 500px;
312
- max-width: 800px;
449
+ max-width: 700px;
313
450
  bottom: rhythm(2);
314
451
  align-self: flex-end;
315
452
  right: rhythm(2);
316
453
  }
317
454
 
455
+ @include bp-up(xxl) {
456
+ max-width: 800px;
457
+ }
458
+
318
459
  &.is-visible {
319
460
  display: inline-block;
320
461
 
@@ -330,8 +471,15 @@
330
471
  }
331
472
 
332
473
  @include e(button-abort) {
333
- align-self: center;
334
- margin-left: auto;
474
+ position: absolute;
475
+ top: rhythm(1);
476
+ left: rhythm(1);
335
477
  flex-grow: 0;
478
+ z-index: 2;
479
+ font-size: $size-small;
480
+
481
+ @include bp-up(md) {
482
+ font-size: initial;
483
+ }
336
484
  }
337
485
  }
@@ -15,6 +15,8 @@ const metadataTrack = (trackMetadataElement === null) ? '' : trackMetadataElemen
15
15
  const forwardsButton = document.querySelector('.js-next-chapter');
16
16
  const backwardsButton = document.querySelector('.js-previous-chapter');
17
17
  const timelinePosts = document.querySelectorAll('.js-timeline-post');
18
+ const navigationButton = document.querySelector('.js-show-timelineposts');
19
+ const timeLinePosts = document.querySelector('.js-timeline-posts');
18
20
  let currentChapter = 1;
19
21
  let manualStep = false;
20
22
  let sourceElement = null;
@@ -33,20 +35,20 @@ if (sourceElement) {
33
35
 
34
36
  // Store current time in on page reload
35
37
  window.addEventListener('unload', () => {
36
- // Set sessionStorage if video has started playing
38
+ // Set localStorage if video has started playing
37
39
  if (video.currentTime > 0) {
38
40
  const currentGuideURL = window.location.href;
39
41
  const currentGuideImage = document.querySelector('.js-guide-continue-image').src;
40
- sessionStorage.setItem('InmsCurrentTime', video.currentTime);
41
- sessionStorage.setItem('InmsDuration', video.duration); // Get totalt duration of video
42
- sessionStorage.setItem('InmsCurrentGuideURL', currentGuideURL);
43
- sessionStorage.setItem('InmsCurrentGuideImage', currentGuideImage);
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);
44
46
  }
45
47
  });
46
48
 
47
- // Get value from sessionStorage in present
48
- if (sessionStorage.getItem('InmsCurrentTime')) {
49
- const videoCurrentTime = sessionStorage.getItem('InmsCurrentTime');
49
+ // Get value from localStorage in present
50
+ if (localStorage.getItem('InmsCurrentTime')) {
51
+ const videoCurrentTime = localStorage.getItem('InmsCurrentTime');
50
52
 
51
53
  if (videoCurrentTime > 0) {
52
54
  video.currentTime = videoCurrentTime;
@@ -91,10 +93,10 @@ if (sourceElement) {
91
93
  manualStep = false;
92
94
  forwardsButton.removeAttribute('disabled');
93
95
  subtitlesContainer.innerHTML = '';
94
- sessionStorage.removeItem('InmsCurrentTime');
95
- sessionStorage.removeItem('InmsDuration');
96
- sessionStorage.removeItem('InmsCurrentGuideURL');
97
- sessionStorage.removeItem('InmsCurrentGuideImage');
96
+ localStorage.removeItem('InmsCurrentTime');
97
+ localStorage.removeItem('InmsDuration');
98
+ localStorage.removeItem('InmsCurrentGuideURL');
99
+ localStorage.removeItem('InmsCurrentGuideImage');
98
100
  });
99
101
  }
100
102
 
@@ -107,13 +109,20 @@ if (sourceElement) {
107
109
  forwardsButton.removeAttribute('disabled');
108
110
  currentChapter = 1;
109
111
  manualStep = false;
110
- sessionStorage.removeItem('InmsCurrentTime');
111
- sessionStorage.removeItem('InmsDuration');
112
- sessionStorage.removeItem('InmsCurrentGuideURL');
113
- sessionStorage.removeItem('InmsCurrentGuideImage');
112
+ localStorage.removeItem('InmsCurrentTime');
113
+ localStorage.removeItem('InmsDuration');
114
+ localStorage.removeItem('InmsCurrentGuideURL');
115
+ localStorage.removeItem('InmsCurrentGuideImage');
114
116
  window.location.href = urlTarget;
115
117
  });
116
118
  }
119
+
120
+ if (navigationButton) {
121
+ navigationButton.addEventListener('click', () => {
122
+ navigationButton.classList.toggle('is-toggeled');
123
+ timeLinePosts.classList.toggle('is-visible');
124
+ });
125
+ }
117
126
  }
118
127
 
119
128
  function displayChapters() {
@@ -151,7 +160,7 @@ function displayChapters() {
151
160
  });
152
161
 
153
162
  // If not set in sessionStorgare, set first cue on forward button on page load
154
- if (!sessionStorage.getItem('InmsCurrentTime')) {
163
+ if (!localStorage.getItem('InmsCurrentTime')) {
155
164
  forwardsButton.setAttribute('data-id', chapterTrack.cues[0].endTime);
156
165
  }
157
166
  }, 100);
@@ -252,7 +261,12 @@ function displayChapters() {
252
261
  timelinePost.classList.remove('is-current');
253
262
  });
254
263
 
255
- document.querySelector(`[data-id="${metadataCueMatch}"]`).classList.add('is-current');
264
+ const idSelectors = document.querySelectorAll(`[data-id="${metadataCueMatch}"]`);
265
+
266
+ [].forEach.call(idSelectors, (idSelector) => {
267
+ idSelector.classList.add('is-current');
268
+ idSelector.focus();
269
+ });
256
270
 
257
271
  if (chapterCues) {
258
272
  const chapterStartTime = chapterCues.startTime;
@@ -38,9 +38,9 @@
38
38
  > ul,
39
39
  > ol,
40
40
  > div:not(.wp-block-iis-info):not(.wp-block-image):not(.wp-block-iis-hero):not(.wp-block-iis-grid):not([class*='accordion']),
41
+ > figure:not(.wp-block-iis-info):not(.wp-block-image):not(.wp-block-iis-hero):not(.wp-block-iis-grid):not([class*='accordion']),
41
42
  > .wp-block-iis-card,
42
43
  > .wp-block-image > figure,
43
- > figure,
44
44
  > blockquote {
45
45
  &:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide) {
46
46
  max-width: calc(#{rem(612px)} + #{($indent * 2)});
@@ -75,8 +75,8 @@
75
75
  > ul,
76
76
  > ol,
77
77
  > div:not(.wp-block-iis-info):not(.wp-block-image):not(.wp-block-iis-hero):not(.wp-block-iis-grid):not([class*='accordion']),
78
+ > figure:not(.wp-block-iis-info):not(.wp-block-image):not(.wp-block-iis-hero):not(.wp-block-iis-grid):not([class*='accordion']),
78
79
  > .wp-block-iis-card,
79
- > figure,
80
80
  > blockquote {
81
81
  &:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide) {
82
82
  max-width: 46.364%;
@@ -103,8 +103,8 @@
103
103
  > ul,
104
104
  > ol,
105
105
  > div:not(.wp-block-iis-info):not(.wp-block-image):not(.wp-block-iis-hero):not(.wp-block-iis-grid):not([class*='accordion']),
106
+ > figure:not(.wp-block-iis-info):not(.wp-block-image):not(.wp-block-iis-hero):not(.wp-block-iis-grid):not([class*='accordion']),
106
107
  > .wp-block-iis-card,
107
- > figure,
108
108
  > blockquote {
109
109
  &:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide) {
110
110
  margin-right: $grid-margin-right;
@@ -97,3 +97,7 @@
97
97
  .u-overflow-hidden {
98
98
  overflow: hidden !important;
99
99
  }
100
+
101
+ .u-overflow-visible {
102
+ overflow: visible !important;
103
+ }
@@ -79,3 +79,14 @@
79
79
  text-decoration: underline;
80
80
  }
81
81
  }
82
+
83
+ // Generate parent element link color classes e.g. .u-color-ruby a
84
+ /// @group Colors
85
+ .u-link-color {
86
+ @include color_classes (
87
+ $map: $colors,
88
+ $separator: '-',
89
+ $attribute: 'color',
90
+ $element: 'a'
91
+ );
92
+ }