@internetstiftelsen/styleguide 2.22.3-beta.0.9 → 2.22.5
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/assets/js/objToQuery.js +2 -2
- package/dist/assets/js/youtube.js +38 -9
- package/dist/components.js +1 -7
- package/dist/molecules/continue-video-guide/continue-video-guide.js +6 -6
- package/dist/molecules/glider/glider-hero.js +24 -0
- package/dist/organisms/timeline/timeline.js +17 -16
- package/dist/organisms/video-guide/video-guide.js +32 -18
- package/package.json +2 -4
- package/src/.DS_Store +0 -0
- package/src/app.scss +0 -3
- package/src/assets/js/objToQuery.js +2 -2
- package/src/assets/js/youtube.js +34 -9
- package/src/assets/video/chapters.vtt +8 -8
- package/src/assets/video/metadata.vtt +4 -1
- package/src/atoms/tag/_tag.scss +2 -2
- package/src/{assets/video → brandbook}/.DS_Store +0 -0
- package/src/brandbook/internetstiftelsen/bildman/303/251r/bildman/303/251r.config.js +5 -0
- package/src/brandbook/internetstiftelsen/tonalitet och spr/303/245kbruk/tonalitet och spr/303/245kbruk.config.js" +5 -0
- package/src/components.js +0 -3
- package/src/configurations/_wordpress.scss +9 -0
- package/src/configurations/grid/_grid.scss +9 -5
- package/src/configurations/typography/_typography.scss +9 -8
- package/src/molecules/glider/_glider-hero.scss +2 -0
- package/src/molecules/glider/glider-hero.js +24 -0
- package/src/organisms/hero/_hero--dynamic-headline.scss +0 -1
- package/src/structures/_article.scss +2 -4
- package/src/utilities/_hide.scss +4 -0
- package/dist/.DS_Store +0 -0
- package/src/assets/.DS_Store +0 -0
- package/src/atoms/.DS_Store +0 -0
- package/src/molecules/.DS_Store +0 -0
- package/src/molecules/continue-video-guide/continue-video-guide.config.js +0 -7
- package/src/molecules/continue-video-guide/continue-video-guide.js +0 -84
- package/src/molecules/continue-video-guide/continue-video-guide.scss +0 -104
- package/src/molecules/continue-video-guide/readme.md +0 -3
- package/src/organisms/timeline/_timeline.scss +0 -292
- package/src/organisms/timeline/timeline.config.js +0 -7
- package/src/organisms/timeline/timeline.js +0 -146
- package/src/organisms/video-guide/_video-guide.scss +0 -337
- package/src/organisms/video-guide/video-guide.config.js +0 -17
- package/src/organisms/video-guide/video-guide.js +0 -293
|
@@ -27,12 +27,12 @@ var objToQuery = function objToQuery(obj) {
|
|
|
27
27
|
|
|
28
28
|
if (Array.isArray(value)) {
|
|
29
29
|
value.forEach(function (subValue) {
|
|
30
|
-
return query.push(queryKey + '[]=' + subValue);
|
|
30
|
+
return query.push(queryKey + '[]=' + encodeURIComponent(subValue));
|
|
31
31
|
});
|
|
32
32
|
} else if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object') {
|
|
33
33
|
query.push(objToQuery(value, exclude, queryKey));
|
|
34
34
|
} else {
|
|
35
|
-
query.push(queryKey + '=' + value);
|
|
35
|
+
query.push(queryKey + '=' + encodeURIComponent(value));
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setupPlayers = setupPlayers;
|
|
3
7
|
function loadYoutubeAPI() {
|
|
4
8
|
var tag = document.createElement('script');
|
|
5
9
|
var firstScript = document.getElementsByTagName('script')[0];
|
|
@@ -9,10 +13,8 @@ function loadYoutubeAPI() {
|
|
|
9
13
|
firstScript.parentNode.insertBefore(tag, firstScript);
|
|
10
14
|
}
|
|
11
15
|
|
|
12
|
-
function onPlayerReady(el
|
|
13
|
-
el.
|
|
14
|
-
e.target.playVideo();
|
|
15
|
-
});
|
|
16
|
+
function onPlayerReady(el) {
|
|
17
|
+
el.setAttribute('data-youtube-ready', 'true');
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
function onPlayerStateChange(el, e) {
|
|
@@ -32,16 +34,28 @@ function createCover(el, id) {
|
|
|
32
34
|
}
|
|
33
35
|
|
|
34
36
|
function setupYoutubePlayer(el) {
|
|
35
|
-
var playerEl =
|
|
37
|
+
var playerEl = void 0;
|
|
36
38
|
var id = el.getAttribute('data-youtube');
|
|
37
39
|
|
|
40
|
+
if (el.youtube) {
|
|
41
|
+
playerEl = el.querySelector('[data-youtube-container]');
|
|
42
|
+
|
|
43
|
+
playerEl.parentNode.removeChild(playerEl);
|
|
44
|
+
el.youtube.destroy();
|
|
45
|
+
el.youtube = null;
|
|
46
|
+
el.removeAttribute('data-youtube-ready');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
playerEl = document.createElement('div');
|
|
50
|
+
|
|
38
51
|
if (!el.getElementsByTagName('img').length) {
|
|
39
52
|
createCover(el, id);
|
|
40
53
|
}
|
|
41
54
|
|
|
55
|
+
playerEl.setAttribute('data-youtube-container', true);
|
|
42
56
|
el.appendChild(playerEl);
|
|
43
57
|
|
|
44
|
-
|
|
58
|
+
el.youtube = new YT.Player(playerEl, {
|
|
45
59
|
height: '100%',
|
|
46
60
|
width: '100%',
|
|
47
61
|
videoId: id,
|
|
@@ -59,18 +73,33 @@ function setupYoutubePlayer(el) {
|
|
|
59
73
|
}
|
|
60
74
|
}
|
|
61
75
|
});
|
|
76
|
+
}
|
|
62
77
|
|
|
63
|
-
|
|
78
|
+
function delegateClick(e) {
|
|
79
|
+
var el = e.target.closest('[data-youtube]');
|
|
80
|
+
|
|
81
|
+
if (!el || !el.youtube) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
el.youtube.playVideo();
|
|
64
86
|
}
|
|
65
87
|
|
|
66
|
-
|
|
67
|
-
|
|
88
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
89
|
+
function setupPlayers(container) {
|
|
90
|
+
var players = container.querySelectorAll('[data-youtube]');
|
|
68
91
|
|
|
69
92
|
if (!players.length) {
|
|
70
93
|
return;
|
|
71
94
|
}
|
|
72
95
|
|
|
73
96
|
[].forEach.call(players, setupYoutubePlayer);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
window.onYouTubeIframeAPIReady = function () {
|
|
100
|
+
setupPlayers(document);
|
|
101
|
+
|
|
102
|
+
document.body.addEventListener('click', delegateClick);
|
|
74
103
|
};
|
|
75
104
|
|
|
76
105
|
loadYoutubeAPI();
|
package/dist/components.js
CHANGED
|
@@ -50,10 +50,4 @@ require('./molecules/glider/glider-hero');
|
|
|
50
50
|
|
|
51
51
|
require('./molecules/context-menu/context-menu');
|
|
52
52
|
|
|
53
|
-
require('./molecules/alert/alert');
|
|
54
|
-
|
|
55
|
-
require('./molecules/continue-video-guide/continue-video-guide');
|
|
56
|
-
|
|
57
|
-
require('./organisms/video-guide/video-guide');
|
|
58
|
-
|
|
59
|
-
require('./organisms/timeline/timeline');
|
|
53
|
+
require('./molecules/alert/alert');
|
|
@@ -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;
|
|
@@ -13,11 +13,35 @@ if (gliderElementHero) {
|
|
|
13
13
|
scrollLock: true,
|
|
14
14
|
slidesToShow: 1,
|
|
15
15
|
slidesToScroll: 1,
|
|
16
|
+
rewind: true,
|
|
16
17
|
arrows: {
|
|
17
18
|
prev: '.js-glider-prev',
|
|
18
19
|
next: '.js-glider-next'
|
|
19
20
|
}
|
|
20
21
|
});
|
|
21
22
|
|
|
23
|
+
var autoplayDelay = gliderElementHero.dataset.timeout;
|
|
24
|
+
|
|
25
|
+
if (autoplayDelay) {
|
|
26
|
+
var autoplay = setInterval(function () {
|
|
27
|
+
GliderHero.scrollItem('next');
|
|
28
|
+
}, autoplayDelay);
|
|
29
|
+
|
|
30
|
+
gliderElementHero.addEventListener('mouseover', function () {
|
|
31
|
+
if (autoplay !== null) {
|
|
32
|
+
clearInterval(autoplay);
|
|
33
|
+
autoplay = null;
|
|
34
|
+
}
|
|
35
|
+
}, 0);
|
|
36
|
+
|
|
37
|
+
gliderElementHero.addEventListener('mouseout', function () {
|
|
38
|
+
if (autoplay === null) {
|
|
39
|
+
autoplay = setInterval(function () {
|
|
40
|
+
GliderHero.scrollItem('next');
|
|
41
|
+
}, autoplayDelay);
|
|
42
|
+
}
|
|
43
|
+
}, 0);
|
|
44
|
+
}
|
|
45
|
+
|
|
22
46
|
module.exports = GliderHero;
|
|
23
47
|
}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
require('../../assets/js/parallax');
|
|
4
4
|
|
|
5
|
-
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
6
|
-
|
|
7
5
|
var _require = require('../../assets/js/offset'),
|
|
8
6
|
offsetTop = _require.offsetTop,
|
|
9
7
|
offsetBottom = _require.offsetBottom,
|
|
@@ -103,21 +101,22 @@ if (progressBar) {
|
|
|
103
101
|
}
|
|
104
102
|
|
|
105
103
|
// DUMMY TIMELINE ITEM OPEN/CLOSE
|
|
104
|
+
/*
|
|
106
105
|
function wrap(el, wrapper) {
|
|
107
106
|
el.parentNode.insertBefore(wrapper, el);
|
|
108
107
|
wrapper.classList.add('wrapper');
|
|
109
108
|
wrapper.appendChild(el);
|
|
110
109
|
}
|
|
111
110
|
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
const timeLineItems = document.querySelectorAll('.js-timeline-item');
|
|
112
|
+
let timeLineItemScrollPosition = 0;
|
|
114
113
|
|
|
115
|
-
[].forEach.call(timeLineItems,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
[].forEach.call(timeLineItems, (timeLineItem) => {
|
|
115
|
+
const timeLineItemLink = timeLineItem.querySelector('a');
|
|
116
|
+
const timeLineItemClose = timeLineItem.querySelector('.js-timeline-item-close');
|
|
117
|
+
const timeLineItemBottomClose = timeLineItem.querySelector('.js-timeline-item-bottom-close');
|
|
119
118
|
|
|
120
|
-
timeLineItemLink.addEventListener('click',
|
|
119
|
+
timeLineItemLink.addEventListener('click', () => {
|
|
121
120
|
timeLineItemScrollPosition = window.pageYOffset;
|
|
122
121
|
sessionStorage.setItem('scroll-position', timeLineItemScrollPosition);
|
|
123
122
|
|
|
@@ -126,19 +125,20 @@ var timeLineItemScrollPosition = 0;
|
|
|
126
125
|
timeLineItem.closest('.row').classList.add('row-has-open-child');
|
|
127
126
|
|
|
128
127
|
// Wrap open timeline item
|
|
129
|
-
wrap(timeLineItem.querySelector('.wp-block-iis-
|
|
128
|
+
wrap(timeLineItem.querySelector('.wp-block-iis-timeline-post'),
|
|
129
|
+
document.createElement('div'));
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
-
timeLineItemClose.addEventListener('click',
|
|
133
|
+
timeLineItemClose.addEventListener('click', () => {
|
|
134
134
|
timeLineItem.classList.remove('is-open');
|
|
135
135
|
timeLineItem.closest('.row').classList.remove('row-has-open-child');
|
|
136
136
|
|
|
137
137
|
// Destroy generated wrapper
|
|
138
|
-
|
|
139
|
-
wrapper.replaceWith
|
|
138
|
+
const wrapper = timeLineItemClose.nextElementSibling;
|
|
139
|
+
wrapper.replaceWith(...wrapper.childNodes);
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
const top = sessionStorage.getItem('scroll-position');
|
|
142
142
|
if (top !== null) {
|
|
143
143
|
window.scrollTo(0, parseInt(top, 10));
|
|
144
144
|
}
|
|
@@ -148,7 +148,8 @@ var timeLineItemScrollPosition = 0;
|
|
|
148
148
|
window.dispatchEvent(new CustomEvent('scroll'));
|
|
149
149
|
});
|
|
150
150
|
|
|
151
|
-
timeLineItemBottomClose.addEventListener('click',
|
|
151
|
+
timeLineItemBottomClose.addEventListener('click', () => {
|
|
152
152
|
timeLineItemClose.click();
|
|
153
153
|
});
|
|
154
|
-
});
|
|
154
|
+
});
|
|
155
|
+
*/
|
|
@@ -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
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
|
50
|
-
if (
|
|
51
|
-
var videoCurrentTime =
|
|
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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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 (!
|
|
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.
|
|
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
|
+
"version": "2.22.5",
|
|
4
4
|
"main": "dist/components.js",
|
|
5
5
|
"ports": {
|
|
6
6
|
"fractal": "3000"
|
|
@@ -11,14 +11,13 @@
|
|
|
11
11
|
"build:fractal": "fractal build",
|
|
12
12
|
"scss": "sass src/app.scss public/assets/css/app.css",
|
|
13
13
|
"stylelint": "stylelint 'src/**/*.scss' '!**/vendor/**' '!**/colors/_colors-functions.scss' --fix --cache --cache-location '.stylelintcache'",
|
|
14
|
-
"autoprefixer": "postcss --use autoprefixer -b 'last 2 versions' public/assets/css/app.css -d public/assets/css/",
|
|
15
14
|
"cssmin": "postcss --use cssnano -b '' public/assets/css/app.css > public/assets/css/app.min.css",
|
|
16
15
|
"browserify": "browserify public/assets/js/cjs/app.js -o public/assets/js/scripts.js",
|
|
17
16
|
"babel": "npx babel src --out-dir public/assets/js/cjs --ignore src/**/*.config.js",
|
|
18
17
|
"eslint": "eslint --fix src",
|
|
19
18
|
"uglify": "uglifyjs -o public/assets/js/scripts.js public/assets/js/scripts.js",
|
|
20
19
|
"imagemin": "imagemin --out-dir=public/assets/img src/**/*.{png,jpg,gif}",
|
|
21
|
-
"build:css": "npm run stylelint && npm run scss && npm run
|
|
20
|
+
"build:css": "npm run stylelint && npm run scss && npm run cssmin",
|
|
22
21
|
"build:js": "npm run eslint && npm run babel && npm run browserify",
|
|
23
22
|
"build:img": "npm run imagemin",
|
|
24
23
|
"watch:css": "onchange 'src/**/*.scss' -- npm run build:css",
|
|
@@ -45,7 +44,6 @@
|
|
|
45
44
|
"@frctl/mandelbrot": "^1.9.2",
|
|
46
45
|
"@internetstiftelsen/eslint-config": "^0.0.5",
|
|
47
46
|
"@internetstiftelsen/stylelint-config": "^1.0.0",
|
|
48
|
-
"autoprefixer": "^10.2.6",
|
|
49
47
|
"babel-cli": "^6.26.0",
|
|
50
48
|
"babel-eslint": "^10.0.3",
|
|
51
49
|
"babel-plugin-syntax-dynamic-import": "^6.18.0",
|
package/src/.DS_Store
CHANGED
|
Binary file
|
package/src/app.scss
CHANGED
|
@@ -66,7 +66,6 @@ $namespace: '';
|
|
|
66
66
|
@import 'molecules/glider/glider';
|
|
67
67
|
@import 'molecules/glider/glider-course';
|
|
68
68
|
@import 'molecules/glider/glider-hero';
|
|
69
|
-
@import 'molecules/continue-video-guide/continue-video-guide';
|
|
70
69
|
|
|
71
70
|
// Organisms
|
|
72
71
|
@import 'organisms/header/header';
|
|
@@ -86,8 +85,6 @@ $namespace: '';
|
|
|
86
85
|
@import 'organisms/event-listing-item/event-listing-item';
|
|
87
86
|
@import 'organisms/podcast/podcast-episodes';
|
|
88
87
|
@import 'organisms/podcast/podcast-player';
|
|
89
|
-
@import 'organisms/video-guide/video-guide';
|
|
90
|
-
@import 'organisms/timeline/timeline';
|
|
91
88
|
|
|
92
89
|
// Structures
|
|
93
90
|
@import 'structures/manifest';
|
|
@@ -9,11 +9,11 @@ const objToQuery = (obj, exclude = [], parent = null) => {
|
|
|
9
9
|
const queryKey = (parent) ? `${parent}[${key}]` : key;
|
|
10
10
|
|
|
11
11
|
if (Array.isArray(value)) {
|
|
12
|
-
value.forEach((subValue) => query.push(`${queryKey}[]=${subValue}`));
|
|
12
|
+
value.forEach((subValue) => query.push(`${queryKey}[]=${encodeURIComponent(subValue)}`));
|
|
13
13
|
} else if (typeof value === 'object') {
|
|
14
14
|
query.push(objToQuery(value, exclude, queryKey));
|
|
15
15
|
} else {
|
|
16
|
-
query.push(`${queryKey}=${value}`);
|
|
16
|
+
query.push(`${queryKey}=${encodeURIComponent(value)}`);
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
|
package/src/assets/js/youtube.js
CHANGED
|
@@ -7,10 +7,8 @@ function loadYoutubeAPI() {
|
|
|
7
7
|
firstScript.parentNode.insertBefore(tag, firstScript);
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
function onPlayerReady(el
|
|
11
|
-
el.
|
|
12
|
-
e.target.playVideo();
|
|
13
|
-
});
|
|
10
|
+
function onPlayerReady(el) {
|
|
11
|
+
el.setAttribute('data-youtube-ready', 'true');
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
function onPlayerStateChange(el, e) {
|
|
@@ -30,16 +28,28 @@ function createCover(el, id) {
|
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
function setupYoutubePlayer(el) {
|
|
33
|
-
|
|
31
|
+
let playerEl;
|
|
34
32
|
const id = el.getAttribute('data-youtube');
|
|
35
33
|
|
|
34
|
+
if (el.youtube) {
|
|
35
|
+
playerEl = el.querySelector('[data-youtube-container]');
|
|
36
|
+
|
|
37
|
+
playerEl.parentNode.removeChild(playerEl);
|
|
38
|
+
el.youtube.destroy();
|
|
39
|
+
el.youtube = null;
|
|
40
|
+
el.removeAttribute('data-youtube-ready');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
playerEl = document.createElement('div');
|
|
44
|
+
|
|
36
45
|
if (!el.getElementsByTagName('img').length) {
|
|
37
46
|
createCover(el, id);
|
|
38
47
|
}
|
|
39
48
|
|
|
49
|
+
playerEl.setAttribute('data-youtube-container', true);
|
|
40
50
|
el.appendChild(playerEl);
|
|
41
51
|
|
|
42
|
-
|
|
52
|
+
el.youtube = new YT.Player(playerEl, {
|
|
43
53
|
height: '100%',
|
|
44
54
|
width: '100%',
|
|
45
55
|
videoId: id,
|
|
@@ -53,18 +63,33 @@ function setupYoutubePlayer(el) {
|
|
|
53
63
|
onStateChange: (e) => onPlayerStateChange(el, e),
|
|
54
64
|
},
|
|
55
65
|
});
|
|
66
|
+
}
|
|
56
67
|
|
|
57
|
-
|
|
68
|
+
function delegateClick(e) {
|
|
69
|
+
const el = e.target.closest('[data-youtube]');
|
|
70
|
+
|
|
71
|
+
if (!el || !el.youtube) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
el.youtube.playVideo();
|
|
58
76
|
}
|
|
59
77
|
|
|
60
|
-
|
|
61
|
-
|
|
78
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
79
|
+
export function setupPlayers(container) {
|
|
80
|
+
const players = container.querySelectorAll('[data-youtube]');
|
|
62
81
|
|
|
63
82
|
if (!players.length) {
|
|
64
83
|
return;
|
|
65
84
|
}
|
|
66
85
|
|
|
67
86
|
[].forEach.call(players, setupYoutubePlayer);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
window.onYouTubeIframeAPIReady = () => {
|
|
90
|
+
setupPlayers(document);
|
|
91
|
+
|
|
92
|
+
document.body.addEventListener('click', delegateClick);
|
|
68
93
|
};
|
|
69
94
|
|
|
70
95
|
loadYoutubeAPI();
|
|
@@ -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
|
package/src/atoms/tag/_tag.scss
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
z-index: z_index(middleground);
|
|
12
12
|
margin-right: rhythm(1);
|
|
13
13
|
margin-bottom: rhythm(1);
|
|
14
|
-
padding: rhythm(
|
|
14
|
+
padding: rhythm(1) rhythm(2);
|
|
15
15
|
font-size: $small-text;
|
|
16
|
-
line-height: 1
|
|
16
|
+
line-height: 1;
|
|
17
17
|
text-decoration: none;
|
|
18
18
|
text-transform: uppercase;
|
|
19
19
|
|
|
Binary file
|
package/src/components.js
CHANGED
|
@@ -24,6 +24,3 @@ import './molecules/glider/glider-course';
|
|
|
24
24
|
import './molecules/glider/glider-hero';
|
|
25
25
|
import './molecules/context-menu/context-menu';
|
|
26
26
|
import './molecules/alert/alert';
|
|
27
|
-
import './molecules/continue-video-guide/continue-video-guide';
|
|
28
|
-
import './organisms/video-guide/video-guide';
|
|
29
|
-
import './organisms/timeline/timeline';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
@charset 'UTF-8';
|
|
2
2
|
|
|
3
|
+
@use "sass:math";
|
|
4
|
+
|
|
3
5
|
// Grid only
|
|
4
6
|
//
|
|
5
7
|
// Includes relevant variables and mixins for the flexbox grid
|
|
@@ -83,15 +85,15 @@
|
|
|
83
85
|
}
|
|
84
86
|
|
|
85
87
|
@include bp-up(sm) {
|
|
86
|
-
$bp-gap: $gap * 1.25;
|
|
87
|
-
|
|
88
88
|
margin: rhythm($margin * 1.25) 0 0;
|
|
89
89
|
|
|
90
90
|
&:not(.asymmetric-reversed) {
|
|
91
|
+
$bp-gap: $gap * 1.25;
|
|
91
92
|
@include make-asymmetric-cols($bp-gap);
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
&.asymmetric-reversed {
|
|
96
|
+
$bp-gap: math.div($gap, 2);
|
|
95
97
|
@include make-asymmetric-cols($bp-gap, true);
|
|
96
98
|
}
|
|
97
99
|
}
|
|
@@ -103,30 +105,32 @@
|
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
@include bp-up(lg) {
|
|
106
|
-
|
|
108
|
+
|
|
107
109
|
|
|
108
110
|
margin: rhythm($margin * 1.5) 0 0;
|
|
109
111
|
|
|
110
112
|
&:not(.asymmetric-reversed) {
|
|
113
|
+
$bp-gap: $gap * 1.5;
|
|
111
114
|
@include make-asymmetric-cols($bp-gap);
|
|
112
115
|
}
|
|
113
116
|
|
|
114
117
|
&.asymmetric-reversed {
|
|
118
|
+
$bp-gap: $gap;
|
|
115
119
|
@include make-asymmetric-cols($bp-gap, true);
|
|
116
120
|
margin-bottom: calc(180px);
|
|
117
121
|
}
|
|
118
122
|
}
|
|
119
123
|
|
|
120
124
|
@include bp-up(xl) {
|
|
121
|
-
$bp-gap: $gap * 2;
|
|
122
|
-
|
|
123
125
|
margin: rhythm($margin * 2) 0 0;
|
|
124
126
|
|
|
125
127
|
&:not(.asymmetric-reversed) {
|
|
128
|
+
$bp-gap: $gap * 2;
|
|
126
129
|
@include make-asymmetric-cols($bp-gap);
|
|
127
130
|
}
|
|
128
131
|
|
|
129
132
|
&.asymmetric-reversed {
|
|
133
|
+
$bp-gap: $gap;
|
|
130
134
|
@include make-asymmetric-cols($bp-gap, true);
|
|
131
135
|
margin-bottom: calc(216px);
|
|
132
136
|
}
|