@internetstiftelsen/styleguide 2.22.3-beta.0.26 → 2.22.3-beta.0.29
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.
|
@@ -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-timeline-post'),
|
|
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
|
+
*/
|
package/package.json
CHANGED
package/src/components.js
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
+
@keyframes smoothscroll1 {
|
|
4
|
+
from, to { scroll-behavior: smooth; }
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@keyframes smoothscroll2 {
|
|
8
|
+
from, to { scroll-behavior: smooth; }
|
|
9
|
+
}
|
|
10
|
+
|
|
3
11
|
html {
|
|
12
|
+
animation: smoothscroll1 1s;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
html:focus-within {
|
|
16
|
+
animation-name: smoothscroll2;
|
|
4
17
|
scroll-behavior: smooth;
|
|
5
18
|
}
|
|
6
19
|
|
|
@@ -193,7 +206,8 @@ html {
|
|
|
193
206
|
a,
|
|
194
207
|
li,
|
|
195
208
|
dt,
|
|
196
|
-
dd
|
|
209
|
+
dd,
|
|
210
|
+
:not(div) a {
|
|
197
211
|
color: $color-snow;
|
|
198
212
|
}
|
|
199
213
|
|
|
@@ -95,6 +95,7 @@ if (progressBar) {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
// DUMMY TIMELINE ITEM OPEN/CLOSE
|
|
98
|
+
/*
|
|
98
99
|
function wrap(el, wrapper) {
|
|
99
100
|
el.parentNode.insertBefore(wrapper, el);
|
|
100
101
|
wrapper.classList.add('wrapper');
|
|
@@ -118,7 +119,8 @@ let timeLineItemScrollPosition = 0;
|
|
|
118
119
|
timeLineItem.closest('.row').classList.add('row-has-open-child');
|
|
119
120
|
|
|
120
121
|
// Wrap open timeline item
|
|
121
|
-
wrap(timeLineItem.querySelector('.wp-block-iis-timeline-post'),
|
|
122
|
+
wrap(timeLineItem.querySelector('.wp-block-iis-timeline-post'),
|
|
123
|
+
document.createElement('div'));
|
|
122
124
|
}
|
|
123
125
|
});
|
|
124
126
|
|
|
@@ -144,3 +146,4 @@ let timeLineItemScrollPosition = 0;
|
|
|
144
146
|
timeLineItemClose.click();
|
|
145
147
|
});
|
|
146
148
|
});
|
|
149
|
+
*/
|