@internetstiftelsen/styleguide 2.22.3 → 2.23.1
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/anchorScroll.js +16 -0
- package/dist/assets/js/objToQuery.js +2 -2
- package/dist/assets/js/offset.js +26 -0
- package/dist/assets/js/parallax.js +17 -0
- package/dist/assets/js/youtube.js +38 -9
- package/dist/components.js +2 -0
- package/dist/molecules/continue-video-guide/continue-video-guide.js +91 -0
- package/dist/molecules/glider/glider-course.js +7 -7
- package/dist/molecules/glider/glider-hero.js +46 -0
- package/dist/organisms/timeline/timeline.js +155 -0
- package/dist/organisms/video-guide/video-guide.js +312 -0
- package/package.json +7 -3
- package/src/app.scss +3 -2
- package/src/assets/js/anchorScroll.js +10 -0
- package/src/assets/js/objToQuery.js +2 -2
- package/src/assets/js/offset.js +22 -0
- package/src/assets/js/parallax.js +15 -0
- package/src/assets/js/youtube.js +34 -9
- package/src/assets/video/Internets-Historia-HEVC-h265-HEVC-h265.mov +0 -0
- package/src/assets/video/Internets-Historia-HEVC-h265-vp9-chrome.webm +0 -0
- package/src/assets/video/chapters.vtt +25 -0
- package/src/assets/video/metadata.vtt +28 -0
- package/src/assets/video/movie-webm.webm +0 -0
- package/src/assets/video/videoplayer.vtt +25 -0
- package/src/atoms/button/_button.scss +6 -9
- package/src/atoms/icon/_all-icons.zip +0 -0
- package/src/atoms/icon/spinner-white.svg +1 -9
- package/src/atoms/icon/spinner.svg +1 -9
- package/src/atoms/icon/sprite.svg +17 -0
- package/src/atoms/icon/step-backwards.svg +1 -0
- package/src/atoms/icon/step-forwards.svg +1 -0
- package/src/atoms/icon/subtitles.svg +1 -0
- package/src/atoms/meta/meta.config.js +1 -1
- package/src/atoms/tag/_tag.scss +2 -2
- package/src/base/_normalize.scss +1 -1
- package/src/base/fonts/_fonts.scss +8 -8
- package/src/components.js +1 -0
- package/src/configurations/_extends.scss +5 -1
- package/src/configurations/_variables.scss +3 -3
- package/src/configurations/colors/_colors-functions.scss +2 -3
- package/src/configurations/grid/_grid.scss +26 -7
- package/src/configurations/icons.json +1 -1
- package/src/configurations/typography/_typography.scss +61 -7
- package/src/molecules/glider/_glider-course.scss +121 -0
- package/src/molecules/glider/_glider-hero.scss +327 -0
- package/src/molecules/glider/_glider.scss +3 -116
- package/src/molecules/glider/glider-course.js +7 -7
- package/src/molecules/glider/glider-hero.js +40 -0
- package/src/molecules/glider/glider.config.js +7 -0
- package/src/organisms/hero/_hero--dynamic-headline.scss +168 -0
- package/src/organisms/hero/_hero.scss +16 -0
- package/src/organisms/hero/hero.config.js +10 -1
- package/src/structures/_article.scss +3 -3
- package/src/utilities/_hide.scss +4 -0
- package/src/utilities/_links.scss +11 -0
- package/dist/.DS_Store +0 -0
- package/src/.DS_Store +0 -0
- package/src/assets/.DS_Store +0 -0
- package/src/assets/css/footer/isolated-footer.css +0 -7367
- package/src/assets/css/footer/isolated-footer.css.map +0 -1
- package/src/assets/css/footer/isolated-footer.min.css +0 -2
- package/src/assets/video/.DS_Store +0 -0
- package/src/atoms/.DS_Store +0 -0
- package/src/brandbook/internetstiftelsen/bildman/303/251r/bildman/303/251r.config.js +0 -5
- package/src/brandbook/internetstiftelsen/tonalitet och spr/303/245kbruk/tonalitet och spr/303/245kbruk.config.js" +0 -5
- package/src/molecules/.DS_Store +0 -0
- package/src/pages/timeline/timeline.config.js +0 -19
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
|
|
3
|
+
// NOTE: this compnent is dependant on the glider.scss component
|
|
4
|
+
// The Glider components is dependant on JS-classes and is therefore not namespaced
|
|
5
|
+
|
|
6
|
+
.glider-hero-contain {
|
|
7
|
+
display: flex;
|
|
8
|
+
position: relative;
|
|
9
|
+
align-items: center;
|
|
10
|
+
margin: 0;
|
|
11
|
+
|
|
12
|
+
@include e(text) {
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: rhythm(2);
|
|
15
|
+
left: rhythm(2);
|
|
16
|
+
z-index: z_index(background);
|
|
17
|
+
padding-right: rhythm(2);
|
|
18
|
+
max-width: 95%;
|
|
19
|
+
|
|
20
|
+
@include bp-up(sm-xs) {
|
|
21
|
+
top: rhythm(3);
|
|
22
|
+
left: rhythm(3);
|
|
23
|
+
padding-right: rhythm(3);
|
|
24
|
+
max-width: 90%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@include bp-up(sm) {
|
|
29
|
+
top: rhythm(4);
|
|
30
|
+
left: rhythm(4);
|
|
31
|
+
padding-right: rhythm(4);
|
|
32
|
+
max-width: 80%;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@include bp-up(md) {
|
|
36
|
+
top: rhythm(6);
|
|
37
|
+
left: rhythm(6);
|
|
38
|
+
padding-right: rhythm(6);
|
|
39
|
+
max-width: 70%;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@include bp-up(lg) {
|
|
43
|
+
top: rhythm(7);
|
|
44
|
+
left: rhythm(7);
|
|
45
|
+
padding-right: 0;
|
|
46
|
+
max-width: 60%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@include bp-up(xl) {
|
|
50
|
+
top: rhythm(8);
|
|
51
|
+
left: rhythm(8);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
> h1 {
|
|
55
|
+
color: $color-snow;
|
|
56
|
+
|
|
57
|
+
> span {
|
|
58
|
+
background-color: rgba(0,0,0,0.6);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@include plumber(
|
|
62
|
+
$font-size: 2,
|
|
63
|
+
$line-height: 3,
|
|
64
|
+
$leading-bottom: 1
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
@include bp-up(sm) {
|
|
68
|
+
@include plumber(
|
|
69
|
+
$font-size: 2.3,
|
|
70
|
+
$line-height: 3,
|
|
71
|
+
$leading-bottom: 1
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@include bp-up(md) {
|
|
76
|
+
@include plumber(
|
|
77
|
+
$font-size: 3,
|
|
78
|
+
$line-height: 4,
|
|
79
|
+
$leading-bottom: 2
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@include bp-up(lg) {
|
|
84
|
+
@include plumber(
|
|
85
|
+
$font-size: 4,
|
|
86
|
+
$line-height: 5,
|
|
87
|
+
$leading-bottom: 2
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@include bp-up(xl) {
|
|
92
|
+
@include plumber(
|
|
93
|
+
$font-size: 5,
|
|
94
|
+
$line-height: 6,
|
|
95
|
+
$leading-bottom: 3
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
> p {
|
|
101
|
+
color: $color-snow;
|
|
102
|
+
|
|
103
|
+
> span {
|
|
104
|
+
background-color: rgba(0,0,0,0.6);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@include plumber(
|
|
108
|
+
$font-size: 1.5,
|
|
109
|
+
$line-height: 2,
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
@include bp-up(sm) {
|
|
113
|
+
@include plumber(
|
|
114
|
+
$font-size: 2,
|
|
115
|
+
$line-height: 3,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@include bp-up(lg) {
|
|
120
|
+
@include plumber(
|
|
121
|
+
$font-size: 2.5,
|
|
122
|
+
$line-height: 3,
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@include bp-up(xl) {
|
|
127
|
+
@include plumber(
|
|
128
|
+
$font-size: 3,
|
|
129
|
+
$line-height: 4,
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.glider-slide {
|
|
137
|
+
width: 100vw;
|
|
138
|
+
|
|
139
|
+
@include m(hero) {
|
|
140
|
+
margin: 0;
|
|
141
|
+
padding: 0;
|
|
142
|
+
position: relative;
|
|
143
|
+
|
|
144
|
+
&::after {
|
|
145
|
+
content: '';
|
|
146
|
+
display: block;
|
|
147
|
+
position: absolute;
|
|
148
|
+
top: 0;
|
|
149
|
+
right: 0;
|
|
150
|
+
bottom: 0;
|
|
151
|
+
left: 0;
|
|
152
|
+
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba($color-black, 0) 35%, rgba($color-black, 1) 100%);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
@include e(image) {
|
|
156
|
+
display: block;
|
|
157
|
+
object-fit: cover;
|
|
158
|
+
object-position: 50% 50%;
|
|
159
|
+
width: 100%;
|
|
160
|
+
height: 100%;
|
|
161
|
+
|
|
162
|
+
@include bp-up(sm) {
|
|
163
|
+
min-height: rem(500px);
|
|
164
|
+
max-height: 75vh;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@include e(text) {
|
|
169
|
+
position: absolute;
|
|
170
|
+
z-index: 1;
|
|
171
|
+
bottom: rhythm(2);
|
|
172
|
+
left: rhythm(2);
|
|
173
|
+
padding-right: rhythm(2);
|
|
174
|
+
color: $color-snow;
|
|
175
|
+
font-family: $font-family-bold;
|
|
176
|
+
max-width: 95%;
|
|
177
|
+
|
|
178
|
+
> span {
|
|
179
|
+
//text-shadow: 0 0 20px rgba(0,0,0,0.8);
|
|
180
|
+
|
|
181
|
+
> a {
|
|
182
|
+
position: relative;
|
|
183
|
+
z-index: 1;
|
|
184
|
+
|
|
185
|
+
&:hover {
|
|
186
|
+
text-decoration: none;
|
|
187
|
+
color: $color-cyberspace !important;
|
|
188
|
+
text-shadow: none;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&::before {
|
|
192
|
+
content: '';
|
|
193
|
+
position: absolute;
|
|
194
|
+
z-index: -1;
|
|
195
|
+
width: 100%;
|
|
196
|
+
height: 100%;
|
|
197
|
+
background-color: $color-snow;
|
|
198
|
+
bottom: 0;
|
|
199
|
+
left: 0;
|
|
200
|
+
transform-origin: right;
|
|
201
|
+
transform: scaleX(0);
|
|
202
|
+
transition: transform .3s ease-in-out;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
&:hover::before {
|
|
206
|
+
transform-origin: left;
|
|
207
|
+
transform: scaleX(1);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
@include plumber(
|
|
213
|
+
$font-size: 2.3,
|
|
214
|
+
$line-height: 3,
|
|
215
|
+
$leading-bottom: 0,
|
|
216
|
+
$baseline: $headings-baseline
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
@include bp-up(sm-xs) {
|
|
220
|
+
bottom: rhythm(3);
|
|
221
|
+
left: rhythm(3);
|
|
222
|
+
padding-right: rhythm(3);
|
|
223
|
+
max-width: 90%;
|
|
224
|
+
|
|
225
|
+
@include plumber(
|
|
226
|
+
$font-size: 3,
|
|
227
|
+
$line-height: 4,
|
|
228
|
+
$leading-bottom: 0
|
|
229
|
+
);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
@include bp-up(sm) {
|
|
234
|
+
bottom: rhythm(4);
|
|
235
|
+
left: rhythm(4);
|
|
236
|
+
padding-right: rhythm(4);
|
|
237
|
+
max-width: 80%;
|
|
238
|
+
|
|
239
|
+
@include plumber(
|
|
240
|
+
$font-size: 4,
|
|
241
|
+
$line-height: 5,
|
|
242
|
+
$leading-bottom: 0
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
@include bp-up(md) {
|
|
247
|
+
bottom: rhythm(6);
|
|
248
|
+
left: rhythm(6);
|
|
249
|
+
padding-right: rhythm(6);
|
|
250
|
+
max-width: 70%;
|
|
251
|
+
|
|
252
|
+
@include plumber(
|
|
253
|
+
$font-size: 5,
|
|
254
|
+
$line-height: 6,
|
|
255
|
+
$leading-bottom: 0
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@include bp-up(lg) {
|
|
260
|
+
bottom: rhythm(7);
|
|
261
|
+
left: rhythm(7);
|
|
262
|
+
padding-right: 0;
|
|
263
|
+
max-width: 60%;
|
|
264
|
+
|
|
265
|
+
@include plumber(
|
|
266
|
+
$font-size: 6,
|
|
267
|
+
$line-height: 8,
|
|
268
|
+
$leading-bottom: 0
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
@include bp-up(xl) {
|
|
273
|
+
bottom: rhythm(8);
|
|
274
|
+
left: rhythm(8);
|
|
275
|
+
max-width: 50%;
|
|
276
|
+
|
|
277
|
+
@include plumber(
|
|
278
|
+
$font-size: 7,
|
|
279
|
+
$line-height: 9,
|
|
280
|
+
$leading-bottom: 0
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
@include bp-up(xxl) {
|
|
285
|
+
max-width: 45%;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.glider-nav {
|
|
292
|
+
transform: scale(0.7) translateY(-100%);
|
|
293
|
+
|
|
294
|
+
@include bp-up(md) {
|
|
295
|
+
transform: scale(1) translateY(0);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@include m(hero) {
|
|
299
|
+
&.disabled {
|
|
300
|
+
display: none;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&.glider-prev {
|
|
304
|
+
left: 0;
|
|
305
|
+
|
|
306
|
+
@include bp-up(md) {
|
|
307
|
+
left: rhythm(1);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
@include bp-up(lg) {
|
|
311
|
+
left: rhythm(2);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
&.glider-next {
|
|
316
|
+
right: 0;
|
|
317
|
+
|
|
318
|
+
@include bp-up(md) {
|
|
319
|
+
right: rhythm(1);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
@include bp-up(lg) {
|
|
323
|
+
right: rhythm(2);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
@charset "UTF-8";
|
|
2
2
|
|
|
3
|
-
// The Glider
|
|
3
|
+
// The Glider components is dependant on JS-classes and is therefore not namespaced
|
|
4
4
|
|
|
5
5
|
.glider-contain {
|
|
6
6
|
display: flex;
|
|
@@ -12,16 +12,6 @@
|
|
|
12
12
|
padding-left: rhythm(8);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.glider-contain-course {
|
|
16
|
-
display: flex;
|
|
17
|
-
position: relative;
|
|
18
|
-
align-items: center;
|
|
19
|
-
margin-top: 0;
|
|
20
|
-
margin-bottom: rhythm(2);
|
|
21
|
-
padding-left: 0;
|
|
22
|
-
padding-right: 0;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
15
|
.glider {
|
|
26
16
|
position: relative;
|
|
27
17
|
margin: 0 auto;
|
|
@@ -101,120 +91,17 @@
|
|
|
101
91
|
}
|
|
102
92
|
}
|
|
103
93
|
}
|
|
104
|
-
|
|
105
|
-
@include m(course) {
|
|
106
|
-
margin-left: 0;
|
|
107
|
-
padding-left: 0;
|
|
108
|
-
padding-right: 0;
|
|
109
|
-
|
|
110
|
-
&::after {
|
|
111
|
-
display: none;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
@include e(navigation) {
|
|
115
|
-
display: flex;
|
|
116
|
-
justify-content: space-between;
|
|
117
|
-
|
|
118
|
-
@include bp-up(lg) {
|
|
119
|
-
justify-content: flex-start;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
@include e(media) {
|
|
124
|
-
|
|
125
|
-
&.zoom {
|
|
126
|
-
pointer-events: none;
|
|
127
|
-
|
|
128
|
-
@include bp-up(lg) {
|
|
129
|
-
pointer-events: auto;
|
|
130
|
-
cursor: zoom-in;
|
|
131
|
-
transition: all 0.15s ease-out;
|
|
132
|
-
position: relative;
|
|
133
|
-
|
|
134
|
-
&::after {
|
|
135
|
-
content: 'Förstora bilden';
|
|
136
|
-
color: $color-snow;
|
|
137
|
-
padding: rhythm(1) rhythm(2) rhythm(1) rhythm(4);
|
|
138
|
-
display: block;
|
|
139
|
-
position: absolute;
|
|
140
|
-
top: 0;
|
|
141
|
-
left: 0;
|
|
142
|
-
border-top-left-radius: $border-radius;
|
|
143
|
-
border-bottom-right-radius: $border-radius;
|
|
144
|
-
width: auto;
|
|
145
|
-
line-height: 1;
|
|
146
|
-
height: $icon-size-large * 1.4;
|
|
147
|
-
background-color: rgba($color-cyberspace, 0.8);
|
|
148
|
-
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' id='icon-search' viewbox='0 0 32 32' width='32' height='32' fill='%23ffffff'%3E%3Cpath d='M24,21.8l8,8L29.9,32l-8-8c-5.9,4.6-14.3,3.6-19-2.2S-0.7,7.6,5.1,2.9S19.3-0.7,24,5.1C27.9,10,27.9,16.9,24,21.8L24,21.8z M13.4,23.9c5.8,0,10.5-4.7,10.5-10.5S19.2,3,13.4,3S3,7.7,3,13.4S7.7,23.9,13.4,23.9z'/%3E%3C/svg%3E");
|
|
149
|
-
background-position: rhythm(1) center;
|
|
150
|
-
background-size: $icon-size-medium $icon-size-medium;
|
|
151
|
-
background-repeat: no-repeat;
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
img {
|
|
156
|
-
transition: all 0.25s ease-out;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
// Image zooming
|
|
160
|
-
&.is-zoomed {
|
|
161
|
-
cursor: zoom-out !important;
|
|
162
|
-
position: fixed;
|
|
163
|
-
left: 0;
|
|
164
|
-
right: 0;
|
|
165
|
-
top: 0;
|
|
166
|
-
bottom: 0;
|
|
167
|
-
z-index: z_index(foreground);
|
|
168
|
-
display: flex;
|
|
169
|
-
align-items: center;
|
|
170
|
-
justify-content: center;
|
|
171
|
-
background-color: rgba($color-cyberspace, 0.8);
|
|
172
|
-
flex-direction: column;
|
|
173
|
-
|
|
174
|
-
&::after {
|
|
175
|
-
display: none;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
img {
|
|
179
|
-
cursor: zoom-out;
|
|
180
|
-
max-width: 100%;
|
|
181
|
-
max-height: 100vh;
|
|
182
|
-
padding: rhythm(1);
|
|
183
|
-
height: auto;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
figcaption {
|
|
187
|
-
max-width: rem(612px);
|
|
188
|
-
text-align: center;
|
|
189
|
-
color: $color-snow;
|
|
190
|
-
padding-left: rhythm(2);
|
|
191
|
-
padding-right: rhythm(2);
|
|
192
|
-
margin-bottom: 0 !important;
|
|
193
|
-
padding-bottom: 0 !important;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
figcaption {
|
|
200
|
-
margin-top: rhythm(1);
|
|
201
|
-
}
|
|
202
|
-
@include bp-up(lg) {
|
|
203
|
-
display: flex;
|
|
204
|
-
flex-direction: column-reverse;
|
|
205
|
-
margin-top: 0;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
94
|
}
|
|
210
95
|
|
|
211
96
|
.glider-nav {
|
|
212
97
|
position: absolute;
|
|
213
98
|
top: 50%;
|
|
214
99
|
left: 0;
|
|
100
|
+
z-index: z_index(middleground);
|
|
215
101
|
transform: translateY(-50%);
|
|
216
102
|
transition: background-color 0.25s ease-out;
|
|
217
103
|
user-select: none;
|
|
104
|
+
cursor: pointer;
|
|
218
105
|
|
|
219
106
|
&:focus {
|
|
220
107
|
background-color: $color-snow;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import Glider from 'glider-js';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const gliderElementCourse = document.querySelector('.js-glider-course');
|
|
4
4
|
|
|
5
|
-
if (
|
|
6
|
-
const
|
|
5
|
+
if (gliderElementCourse) {
|
|
6
|
+
const GliderCourse = new Glider(gliderElementCourse, {
|
|
7
7
|
scrollLock: true,
|
|
8
8
|
slidesToShow: 1,
|
|
9
9
|
slidesToScroll: 1,
|
|
@@ -13,7 +13,7 @@ if (gliderElementSingle) {
|
|
|
13
13
|
const prevBtns = document.querySelectorAll('.js-glider-prev');
|
|
14
14
|
const siteMain = document.querySelector('#siteMain');
|
|
15
15
|
const zoomImages = document.querySelectorAll('.js-zoom.zoom');
|
|
16
|
-
let slideIndex =
|
|
16
|
+
let slideIndex = GliderCourse.getCurrentSlide();
|
|
17
17
|
let bounding = 0;
|
|
18
18
|
|
|
19
19
|
const scrollTop = () => {
|
|
@@ -23,7 +23,7 @@ if (gliderElementSingle) {
|
|
|
23
23
|
if (nextBtns) {
|
|
24
24
|
[].forEach.call(nextBtns, (nextBtn) => {
|
|
25
25
|
nextBtn.addEventListener('click', () => {
|
|
26
|
-
|
|
26
|
+
GliderCourse.scrollItem(slideIndex += 1, true);
|
|
27
27
|
|
|
28
28
|
if (siteMain) {
|
|
29
29
|
bounding = siteMain.getBoundingClientRect();
|
|
@@ -38,7 +38,7 @@ if (gliderElementSingle) {
|
|
|
38
38
|
if (prevBtns) {
|
|
39
39
|
[].forEach.call(prevBtns, (prevBtn) => {
|
|
40
40
|
prevBtn.addEventListener('click', () => {
|
|
41
|
-
|
|
41
|
+
GliderCourse.scrollItem(slideIndex -= 1, true);
|
|
42
42
|
|
|
43
43
|
if (siteMain) {
|
|
44
44
|
bounding = siteMain.getBoundingClientRect();
|
|
@@ -58,5 +58,5 @@ if (gliderElementSingle) {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
module.exports =
|
|
61
|
+
module.exports = GliderCourse;
|
|
62
62
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Glider from 'glider-js';
|
|
2
|
+
|
|
3
|
+
const gliderElementHero = document.querySelector('.js-glider-hero');
|
|
4
|
+
|
|
5
|
+
if (gliderElementHero) {
|
|
6
|
+
const GliderHero = new Glider(gliderElementHero, {
|
|
7
|
+
scrollLock: true,
|
|
8
|
+
slidesToShow: 1,
|
|
9
|
+
slidesToScroll: 1,
|
|
10
|
+
arrows: {
|
|
11
|
+
prev: '.js-glider-prev',
|
|
12
|
+
next: '.js-glider-next',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
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
|
+
|
|
39
|
+
module.exports = GliderHero;
|
|
40
|
+
}
|