@internetstiftelsen/styleguide 2.22.3-beta.0.16 → 2.22.3-beta.0.17

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "2.22.3-beta.0.16",
3
+ "version": "2.22.3-beta.0.17",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
Binary file
@@ -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
 
@@ -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,
@@ -203,7 +203,7 @@ html {
203
203
  @extend %preamble;
204
204
  }
205
205
 
206
- .wp-block-iis-card {
206
+ .wp-block-iis-timeline-post {
207
207
  margin-left: auto;
208
208
  margin-right: auto;
209
209
 
@@ -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,11 +1,18 @@
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
+
7
12
  > figure {
8
13
  display: flex;
14
+ overflow: hidden;
15
+ position: relative;
9
16
  }
10
17
 
11
18
  @include e(video-container) {
@@ -33,13 +40,14 @@
33
40
  bottom: 0;
34
41
  z-index: 1;
35
42
  justify-content: center;
36
- display: none;
43
+ opacity: 0;
44
+ transition: opacity 0.25s ease-out;
37
45
  margin: 0;
38
46
  padding: 0;
39
47
 
40
48
  &:first-child,
41
49
  &.is-current {
42
- display: flex;
50
+ opacity: 1;
43
51
  }
44
52
 
45
53
  img {
@@ -53,8 +61,8 @@
53
61
  @include e(text) {
54
62
  position: absolute;
55
63
  top: 50%;
56
- left: auto;
57
- right: auto;
64
+ left: 0;
65
+ right: 0;
58
66
  text-align: center;
59
67
  padding-left: rhythm(2);
60
68
  padding-right: rhythm(2);
@@ -74,16 +82,38 @@
74
82
  @include bp-up(xl) {
75
83
  left: rhythm(8);
76
84
  width: calc(100% - rhythm(16));
77
- max-width: 70%;
78
85
  text-align: left;
79
86
  }
80
87
 
81
- > h2 {
88
+ @include e(headline) {
82
89
  font-family: $font-family-bold;
83
90
  color: $color-snow;
84
91
  text-shadow: 0 0 rem(50px) rgba($color-black, 1),
85
92
  0 0 rem(10px) rgba($color-black, 1),
86
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
+ }
87
117
  }
88
118
 
89
119
  > a {
@@ -165,10 +195,7 @@
165
195
  display: flex;
166
196
  align-items: center;
167
197
  justify-content: space-between;
168
- padding-top: rhythm(2);
169
- padding-bottom: rhythm(2);
170
- padding-left: rhythm(1);
171
- padding-right: rhythm(1);
198
+ padding: rhythm(2);
172
199
  flex-direction: column-reverse;
173
200
  overflow: hidden;
174
201
 
@@ -179,8 +206,6 @@
179
206
  @include bp-up(md) {
180
207
  align-items: stretch;
181
208
  flex-direction: row;
182
- padding-left: rhythm(2);
183
- padding-right: rhythm(2);
184
209
  }
185
210
  }
186
211
 
@@ -226,14 +251,113 @@
226
251
 
227
252
  @include e(timelineposts) {
228
253
  z-index: 2;
229
- width: 100%;
230
- max-width: 200px;
254
+ width: 250px;
255
+ min-width: 250px;
231
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
+ }
232
357
  }
233
358
 
234
359
  @include e(buttons) {
235
360
  display: flex;
236
- width: 100%;
237
361
  }
238
362
 
239
363
  @include e(button) {
@@ -342,8 +466,15 @@
342
466
  }
343
467
 
344
468
  @include e(button-abort) {
345
- align-self: center;
346
- margin-left: auto;
469
+ position: absolute;
470
+ top: rhythm(1);
471
+ left: rhythm(1);
347
472
  flex-grow: 0;
473
+ z-index: 2;
474
+ font-size: $size-small;
475
+
476
+ @include bp-up(md) {
477
+ font-size: initial;
478
+ }
348
479
  }
349
480
  }
@@ -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;
@@ -114,6 +116,13 @@ if (sourceElement) {
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() {
@@ -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;