@everymatrix/casino-slider 0.0.367 → 0.0.369
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/README.md +30 -30
- package/dist/casino-slider.js.map +1 -1
- package/index.html +37 -37
- package/index.js +1 -1
- package/package.json +2 -2
- package/public/reset.css +47 -47
- package/rollup.config.js +67 -67
- package/src/CasinoSlider.svelte +310 -310
- package/src/i18n.js +27 -27
- package/src/index.ts +4 -4
- package/src/translations.js +51 -51
- package/stories/CasinoSlider.stories.js +13 -13
- package/tsconfig.json +6 -6
package/src/CasinoSlider.svelte
CHANGED
@@ -1,310 +1,310 @@
|
|
1
|
-
<svelte:options tag={null} />
|
2
|
-
|
3
|
-
<script lang="ts">
|
4
|
-
import { onMount } from 'svelte';
|
5
|
-
import { getDevice } from 'rvhelper';
|
6
|
-
|
7
|
-
import { _, addNewMessages, setLocale, setupI18n } from './i18n';
|
8
|
-
import { CasinoSlider } from './translations';
|
9
|
-
|
10
|
-
export let onclickeventname:string = 'defaultEvent';
|
11
|
-
export let actionevent:string = 'defaultEvent';
|
12
|
-
export let favoritesnumber:string = '0';
|
13
|
-
export let location:string = '';
|
14
|
-
export let clientstyling:string = '';
|
15
|
-
export let clientstylingurl:string = '';
|
16
|
-
export let identity:string = '';
|
17
|
-
export let containermaxwidth:string = '';
|
18
|
-
export let isprimarymenu:boolean = false;
|
19
|
-
export let issecondarymenu:boolean = false;
|
20
|
-
export let lang:string = '';
|
21
|
-
export let activeindex:string = '0';
|
22
|
-
export let showsubgroups:string = '';
|
23
|
-
|
24
|
-
setupI18n({ withLocale: 'en', translations: {}});
|
25
|
-
|
26
|
-
Object.keys(CasinoSlider).forEach((item:any) => {
|
27
|
-
addNewMessages(item, CasinoSlider[item]);
|
28
|
-
});
|
29
|
-
|
30
|
-
let userAgent:string = window.navigator.userAgent;
|
31
|
-
let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
|
32
|
-
|
33
|
-
let carousel:any;
|
34
|
-
let activeIndex:number;
|
35
|
-
let prevIndex:number;
|
36
|
-
let customStylingContainer:HTMLElement;
|
37
|
-
let sliderdata:Array<any> = [];
|
38
|
-
|
39
|
-
// Clicking on the slider item will trigger this method and send a postmessage on window
|
40
|
-
// @TODO itemId type fix
|
41
|
-
let handleClick = (item:any, index:number):void => {
|
42
|
-
activeIndex = index;
|
43
|
-
activeIndex = activeIndex;
|
44
|
-
prevIndex = activeIndex;
|
45
|
-
|
46
|
-
window.postMessage({ type: actionevent, itemId: item.id, index, item }, window.location.href);
|
47
|
-
};
|
48
|
-
|
49
|
-
let scrollLeft = ():void => {
|
50
|
-
carousel.scrollBy({
|
51
|
-
left: -250,
|
52
|
-
behavior: 'smooth'
|
53
|
-
});
|
54
|
-
}
|
55
|
-
|
56
|
-
let scrollRight = ():void => {
|
57
|
-
carousel.scrollBy({
|
58
|
-
left: +250,
|
59
|
-
behavior: 'smooth'
|
60
|
-
});
|
61
|
-
}
|
62
|
-
|
63
|
-
const setActiveIndex = ():void => {
|
64
|
-
activeIndex = parseInt(activeindex, 10);
|
65
|
-
if (!prevIndex) {
|
66
|
-
prevIndex = activeIndex;
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
const setClientStyling = ():void => {
|
71
|
-
let sheet = document.createElement('style');
|
72
|
-
sheet.innerHTML = clientstyling;
|
73
|
-
setTimeout(() => { customStylingContainer.appendChild(sheet); });
|
74
|
-
}
|
75
|
-
|
76
|
-
const setClientStylingURL = ():void => {
|
77
|
-
let cssFile = document.createElement('style');
|
78
|
-
let url:URL = new URL(clientstylingurl);
|
79
|
-
|
80
|
-
if (clientstylingurl) {
|
81
|
-
fetch(url.href)
|
82
|
-
.then((res:any) => res.text())
|
83
|
-
.then((data:any) => {
|
84
|
-
cssFile.innerHTML = data
|
85
|
-
|
86
|
-
setTimeout(() => { customStylingContainer.appendChild(cssFile); }, 1);
|
87
|
-
});
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
const messageHandler = (e:any):void => {
|
92
|
-
if (e.data.type == 'SliderData' && e.data.identity == identity) {
|
93
|
-
sliderdata = e.data.data;
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
const setActiveLanguage = ():void => {
|
98
|
-
setLocale(lang);
|
99
|
-
}
|
100
|
-
|
101
|
-
onMount(() => {
|
102
|
-
window.addEventListener('message', messageHandler, false);
|
103
|
-
|
104
|
-
return () => {
|
105
|
-
window.removeEventListener('message', messageHandler);
|
106
|
-
}
|
107
|
-
})
|
108
|
-
|
109
|
-
$: activeindex && setActiveIndex();
|
110
|
-
$: clientstyling && setClientStyling();
|
111
|
-
$: clientstylingurl && setClientStylingURL();
|
112
|
-
$: lang && setActiveLanguage();
|
113
|
-
</script>
|
114
|
-
|
115
|
-
<div class="CarouselWrapper { (location === 'headerMain') ? 'CarouselWrapperHeaderMain' : '' }" part="CarouselWrapper { (location === 'headerMain') ? 'CarouselWrapperHeaderMain' : '' }" bind:this={customStylingContainer}>
|
116
|
-
<div class="CarouselContainer {isMobile ? 'CarouselContainerMobile' : ''} { (location === 'headerMain') ? 'CarouselContainerHeaderMain' : '' }" part="CarouselContainer {isMobile ? 'CarouselContainerMobile' : ''} { (location === 'headerMain') ? 'CarouselContainerHeaderMain' : '' }" style="{ (location === 'headerMain') ? 'max-width: auto' : `max-width: ${containermaxwidth}px` }">
|
117
|
-
<div class="CarouselLeftArrow" part="CarouselLeftArrow" on:click="{() => scrollLeft()}">
|
118
|
-
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
119
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
|
120
|
-
</svg>
|
121
|
-
</div>
|
122
|
-
|
123
|
-
<ul class="CarouselItems" part="CarouselItems" bind:this={carousel}>
|
124
|
-
{#if sliderdata.length > 0}
|
125
|
-
{#each sliderdata as category, index (category.id)}
|
126
|
-
<li class="CarouselItem {activeIndex == index || prevIndex == index ? 'active': ''}" part="CarouselItem" on:click={e => handleClick(category, index)}
|
127
|
-
>
|
128
|
-
{#if location === 'headerMain'}
|
129
|
-
<a>{category.label}</a>
|
130
|
-
{:else}
|
131
|
-
{category.name} {category.id === "FAVORITES" ? "(" + favoritesnumber + ")" : ''}
|
132
|
-
{/if}
|
133
|
-
|
134
|
-
{#if category?.subGroups && showsubgroups == 'true'}
|
135
|
-
<div class="DropdownContent">
|
136
|
-
{#each category?.subGroups?.items as subCategory}
|
137
|
-
<a>{subCategory?.name}</a>
|
138
|
-
{/each}
|
139
|
-
</div>
|
140
|
-
{/if}
|
141
|
-
</li>
|
142
|
-
{/each}
|
143
|
-
{/if}
|
144
|
-
</ul>
|
145
|
-
|
146
|
-
<div class="CarouselRightArrow" part="CarouselRightArrow" on:click="{() => scrollRight()}">
|
147
|
-
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
148
|
-
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
|
149
|
-
</svg>
|
150
|
-
</div>
|
151
|
-
</div>
|
152
|
-
</div>
|
153
|
-
|
154
|
-
<style lang="scss">
|
155
|
-
|
156
|
-
:host {
|
157
|
-
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
158
|
-
}
|
159
|
-
|
160
|
-
*, *::before, *::after {
|
161
|
-
margin: 0;
|
162
|
-
padding: 0;
|
163
|
-
box-sizing: border-box;
|
164
|
-
}
|
165
|
-
|
166
|
-
.CarouselWrapper {
|
167
|
-
background: var(--emfe-w-color-primary, #D0046C); /* fallback for old browsers */
|
168
|
-
background: -webkit-linear-gradient(to left, var(--emfe-w-color-secondary, #FD2839), var(--emfe-w-color-primary, #D0046C)); /* Chrome 10-25, Safari 5.1-6 */
|
169
|
-
background: linear-gradient(to left, var(--emfe-w-color-secondary, #FD2839), var(--emfe-w-color-primary, #D0046C)); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
|
170
|
-
&.CarouselWrapperHeaderMain {
|
171
|
-
background: transparent;
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
.CarouselContainer {
|
176
|
-
display: flex;
|
177
|
-
flex-direction: row;
|
178
|
-
flex-wrap: nowrap;
|
179
|
-
justify-content: space-between;
|
180
|
-
width: 100%;
|
181
|
-
color: var(--emfe-w-color-white, #FFFFFF);
|
182
|
-
margin: 0 auto;
|
183
|
-
&.CarouselContainerMobile {
|
184
|
-
padding: 0;
|
185
|
-
}
|
186
|
-
|
187
|
-
.CarouselItems {
|
188
|
-
position: relative;
|
189
|
-
display: flex;
|
190
|
-
flex-direction: row;
|
191
|
-
flex-wrap: nowrap;
|
192
|
-
align-items: center;
|
193
|
-
overflow-y: scroll;
|
194
|
-
list-style-type: none;
|
195
|
-
-ms-overflow-style: none;
|
196
|
-
scrollbar-width: none;
|
197
|
-
|
198
|
-
&::-webkit-scrollbar {
|
199
|
-
display: none;
|
200
|
-
}
|
201
|
-
|
202
|
-
.CarouselItem {
|
203
|
-
position: relative;
|
204
|
-
display: flex;
|
205
|
-
height: 100%;
|
206
|
-
align-items: center;
|
207
|
-
padding: 13px 11px;
|
208
|
-
font-size: 15px;
|
209
|
-
font-weight: 500;
|
210
|
-
text-align: center;
|
211
|
-
line-height: 26px;
|
212
|
-
transition: all 150ms ease-in-out;
|
213
|
-
white-space: nowrap;
|
214
|
-
|
215
|
-
&:hover,
|
216
|
-
&.active {
|
217
|
-
background: var(--emfe-w-color-contrast, #07072A);
|
218
|
-
cursor: pointer;
|
219
|
-
}
|
220
|
-
}
|
221
|
-
}
|
222
|
-
|
223
|
-
.DropdownContent {
|
224
|
-
position: absolute;
|
225
|
-
transition: all 1s ease-in;
|
226
|
-
display: none;
|
227
|
-
min-width: 100px;
|
228
|
-
top: 52px;
|
229
|
-
left: 0;
|
230
|
-
padding: 10px 11px;
|
231
|
-
background: var(--emfe-w-color-contrast, #07072A); /* fallback for old browsers */
|
232
|
-
background: -webkit-linear-gradient(var(--emfe-w-color-contrast, #07072A), var(--emfe-w-color-primary, #D0046C)); /* Chrome 10-25, Safari 5.1-6 */
|
233
|
-
background: linear-gradient(var(--emfe-w-color-contrast, #07072A), var(--emfe-w-color-primary, #D0046C)); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
|
234
|
-
& a {
|
235
|
-
display: block;
|
236
|
-
font-weight: 400;
|
237
|
-
line-height: 30px;
|
238
|
-
text-align: left;
|
239
|
-
}
|
240
|
-
}
|
241
|
-
|
242
|
-
.CarouselItem {
|
243
|
-
&:hover {
|
244
|
-
.DropdownContent {
|
245
|
-
display: block;
|
246
|
-
}
|
247
|
-
}
|
248
|
-
}
|
249
|
-
|
250
|
-
.CarouselLeftArrow,
|
251
|
-
.CarouselRightArrow {
|
252
|
-
display: flex;
|
253
|
-
align-items: center;
|
254
|
-
justify-content: center;
|
255
|
-
width: 50%;
|
256
|
-
max-width: 64px;
|
257
|
-
background: rgba(255,255,255,.3);
|
258
|
-
|
259
|
-
svg {
|
260
|
-
width: 100%;
|
261
|
-
max-width: 39px;
|
262
|
-
}
|
263
|
-
|
264
|
-
&:hover {
|
265
|
-
cursor: pointer;
|
266
|
-
}
|
267
|
-
}
|
268
|
-
}
|
269
|
-
|
270
|
-
.CarouselContainerHeaderMain {
|
271
|
-
.CarouselItems .CarouselItem {
|
272
|
-
&:hover, &.active {
|
273
|
-
background: transparent;
|
274
|
-
a {
|
275
|
-
border-bottom: 1px solid var(--emfe-w-color-primary, #D0046C);
|
276
|
-
line-height: 84px;
|
277
|
-
color: var(--emfe-w-color-primary, #D0046C);
|
278
|
-
}
|
279
|
-
}
|
280
|
-
span {
|
281
|
-
border-top: 1px solid transparent;
|
282
|
-
padding-top: 5px;
|
283
|
-
transition-duration: 0.3s;
|
284
|
-
}
|
285
|
-
}
|
286
|
-
}
|
287
|
-
|
288
|
-
.CarouselContainerHeaderMain {
|
289
|
-
background: transparent;
|
290
|
-
margin: 0;
|
291
|
-
padding: 0;
|
292
|
-
.CarouselLeftArrow, .CarouselRightArrow {
|
293
|
-
background: transparent;
|
294
|
-
width: unset;
|
295
|
-
display: none;
|
296
|
-
}
|
297
|
-
.CarouselItem a {
|
298
|
-
color: var(--emfe-w-color-white, #FFFFFF);
|
299
|
-
text-decoration: none;
|
300
|
-
}
|
301
|
-
}
|
302
|
-
|
303
|
-
@media only screen and (max-width: 1024px) {
|
304
|
-
.CarouselContainerHeaderMain {
|
305
|
-
.CarouselLeftArrow, .CarouselRightArrow {
|
306
|
-
display: flex;
|
307
|
-
}
|
308
|
-
}
|
309
|
-
}
|
310
|
-
</style>
|
1
|
+
<svelte:options tag={null} />
|
2
|
+
|
3
|
+
<script lang="ts">
|
4
|
+
import { onMount } from 'svelte';
|
5
|
+
import { getDevice } from 'rvhelper';
|
6
|
+
|
7
|
+
import { _, addNewMessages, setLocale, setupI18n } from './i18n';
|
8
|
+
import { CasinoSlider } from './translations';
|
9
|
+
|
10
|
+
export let onclickeventname:string = 'defaultEvent';
|
11
|
+
export let actionevent:string = 'defaultEvent';
|
12
|
+
export let favoritesnumber:string = '0';
|
13
|
+
export let location:string = '';
|
14
|
+
export let clientstyling:string = '';
|
15
|
+
export let clientstylingurl:string = '';
|
16
|
+
export let identity:string = '';
|
17
|
+
export let containermaxwidth:string = '';
|
18
|
+
export let isprimarymenu:boolean = false;
|
19
|
+
export let issecondarymenu:boolean = false;
|
20
|
+
export let lang:string = '';
|
21
|
+
export let activeindex:string = '0';
|
22
|
+
export let showsubgroups:string = '';
|
23
|
+
|
24
|
+
setupI18n({ withLocale: 'en', translations: {}});
|
25
|
+
|
26
|
+
Object.keys(CasinoSlider).forEach((item:any) => {
|
27
|
+
addNewMessages(item, CasinoSlider[item]);
|
28
|
+
});
|
29
|
+
|
30
|
+
let userAgent:string = window.navigator.userAgent;
|
31
|
+
let isMobile:boolean = (getDevice(userAgent) === 'PC') ? false : true;
|
32
|
+
|
33
|
+
let carousel:any;
|
34
|
+
let activeIndex:number;
|
35
|
+
let prevIndex:number;
|
36
|
+
let customStylingContainer:HTMLElement;
|
37
|
+
let sliderdata:Array<any> = [];
|
38
|
+
|
39
|
+
// Clicking on the slider item will trigger this method and send a postmessage on window
|
40
|
+
// @TODO itemId type fix
|
41
|
+
let handleClick = (item:any, index:number):void => {
|
42
|
+
activeIndex = index;
|
43
|
+
activeIndex = activeIndex;
|
44
|
+
prevIndex = activeIndex;
|
45
|
+
|
46
|
+
window.postMessage({ type: actionevent, itemId: item.id, index, item }, window.location.href);
|
47
|
+
};
|
48
|
+
|
49
|
+
let scrollLeft = ():void => {
|
50
|
+
carousel.scrollBy({
|
51
|
+
left: -250,
|
52
|
+
behavior: 'smooth'
|
53
|
+
});
|
54
|
+
}
|
55
|
+
|
56
|
+
let scrollRight = ():void => {
|
57
|
+
carousel.scrollBy({
|
58
|
+
left: +250,
|
59
|
+
behavior: 'smooth'
|
60
|
+
});
|
61
|
+
}
|
62
|
+
|
63
|
+
const setActiveIndex = ():void => {
|
64
|
+
activeIndex = parseInt(activeindex, 10);
|
65
|
+
if (!prevIndex) {
|
66
|
+
prevIndex = activeIndex;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
const setClientStyling = ():void => {
|
71
|
+
let sheet = document.createElement('style');
|
72
|
+
sheet.innerHTML = clientstyling;
|
73
|
+
setTimeout(() => { customStylingContainer.appendChild(sheet); });
|
74
|
+
}
|
75
|
+
|
76
|
+
const setClientStylingURL = ():void => {
|
77
|
+
let cssFile = document.createElement('style');
|
78
|
+
let url:URL = new URL(clientstylingurl);
|
79
|
+
|
80
|
+
if (clientstylingurl) {
|
81
|
+
fetch(url.href)
|
82
|
+
.then((res:any) => res.text())
|
83
|
+
.then((data:any) => {
|
84
|
+
cssFile.innerHTML = data
|
85
|
+
|
86
|
+
setTimeout(() => { customStylingContainer.appendChild(cssFile); }, 1);
|
87
|
+
});
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
const messageHandler = (e:any):void => {
|
92
|
+
if (e.data.type == 'SliderData' && e.data.identity == identity) {
|
93
|
+
sliderdata = e.data.data;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
const setActiveLanguage = ():void => {
|
98
|
+
setLocale(lang);
|
99
|
+
}
|
100
|
+
|
101
|
+
onMount(() => {
|
102
|
+
window.addEventListener('message', messageHandler, false);
|
103
|
+
|
104
|
+
return () => {
|
105
|
+
window.removeEventListener('message', messageHandler);
|
106
|
+
}
|
107
|
+
})
|
108
|
+
|
109
|
+
$: activeindex && setActiveIndex();
|
110
|
+
$: clientstyling && setClientStyling();
|
111
|
+
$: clientstylingurl && setClientStylingURL();
|
112
|
+
$: lang && setActiveLanguage();
|
113
|
+
</script>
|
114
|
+
|
115
|
+
<div class="CarouselWrapper { (location === 'headerMain') ? 'CarouselWrapperHeaderMain' : '' }" part="CarouselWrapper { (location === 'headerMain') ? 'CarouselWrapperHeaderMain' : '' }" bind:this={customStylingContainer}>
|
116
|
+
<div class="CarouselContainer {isMobile ? 'CarouselContainerMobile' : ''} { (location === 'headerMain') ? 'CarouselContainerHeaderMain' : '' }" part="CarouselContainer {isMobile ? 'CarouselContainerMobile' : ''} { (location === 'headerMain') ? 'CarouselContainerHeaderMain' : '' }" style="{ (location === 'headerMain') ? 'max-width: auto' : `max-width: ${containermaxwidth}px` }">
|
117
|
+
<div class="CarouselLeftArrow" part="CarouselLeftArrow" on:click="{() => scrollLeft()}">
|
118
|
+
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
119
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
|
120
|
+
</svg>
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<ul class="CarouselItems" part="CarouselItems" bind:this={carousel}>
|
124
|
+
{#if sliderdata.length > 0}
|
125
|
+
{#each sliderdata as category, index (category.id)}
|
126
|
+
<li class="CarouselItem {activeIndex == index || prevIndex == index ? 'active': ''}" part="CarouselItem" on:click={e => handleClick(category, index)}
|
127
|
+
>
|
128
|
+
{#if location === 'headerMain'}
|
129
|
+
<a>{category.label}</a>
|
130
|
+
{:else}
|
131
|
+
{category.name} {category.id === "FAVORITES" ? "(" + favoritesnumber + ")" : ''}
|
132
|
+
{/if}
|
133
|
+
|
134
|
+
{#if category?.subGroups && showsubgroups == 'true'}
|
135
|
+
<div class="DropdownContent">
|
136
|
+
{#each category?.subGroups?.items as subCategory}
|
137
|
+
<a>{subCategory?.name}</a>
|
138
|
+
{/each}
|
139
|
+
</div>
|
140
|
+
{/if}
|
141
|
+
</li>
|
142
|
+
{/each}
|
143
|
+
{/if}
|
144
|
+
</ul>
|
145
|
+
|
146
|
+
<div class="CarouselRightArrow" part="CarouselRightArrow" on:click="{() => scrollRight()}">
|
147
|
+
<svg fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
148
|
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
|
149
|
+
</svg>
|
150
|
+
</div>
|
151
|
+
</div>
|
152
|
+
</div>
|
153
|
+
|
154
|
+
<style lang="scss">
|
155
|
+
|
156
|
+
:host {
|
157
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
|
158
|
+
}
|
159
|
+
|
160
|
+
*, *::before, *::after {
|
161
|
+
margin: 0;
|
162
|
+
padding: 0;
|
163
|
+
box-sizing: border-box;
|
164
|
+
}
|
165
|
+
|
166
|
+
.CarouselWrapper {
|
167
|
+
background: var(--emfe-w-color-primary, #D0046C); /* fallback for old browsers */
|
168
|
+
background: -webkit-linear-gradient(to left, var(--emfe-w-color-secondary, #FD2839), var(--emfe-w-color-primary, #D0046C)); /* Chrome 10-25, Safari 5.1-6 */
|
169
|
+
background: linear-gradient(to left, var(--emfe-w-color-secondary, #FD2839), var(--emfe-w-color-primary, #D0046C)); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
|
170
|
+
&.CarouselWrapperHeaderMain {
|
171
|
+
background: transparent;
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
175
|
+
.CarouselContainer {
|
176
|
+
display: flex;
|
177
|
+
flex-direction: row;
|
178
|
+
flex-wrap: nowrap;
|
179
|
+
justify-content: space-between;
|
180
|
+
width: 100%;
|
181
|
+
color: var(--emfe-w-color-white, #FFFFFF);
|
182
|
+
margin: 0 auto;
|
183
|
+
&.CarouselContainerMobile {
|
184
|
+
padding: 0;
|
185
|
+
}
|
186
|
+
|
187
|
+
.CarouselItems {
|
188
|
+
position: relative;
|
189
|
+
display: flex;
|
190
|
+
flex-direction: row;
|
191
|
+
flex-wrap: nowrap;
|
192
|
+
align-items: center;
|
193
|
+
overflow-y: scroll;
|
194
|
+
list-style-type: none;
|
195
|
+
-ms-overflow-style: none;
|
196
|
+
scrollbar-width: none;
|
197
|
+
|
198
|
+
&::-webkit-scrollbar {
|
199
|
+
display: none;
|
200
|
+
}
|
201
|
+
|
202
|
+
.CarouselItem {
|
203
|
+
position: relative;
|
204
|
+
display: flex;
|
205
|
+
height: 100%;
|
206
|
+
align-items: center;
|
207
|
+
padding: 13px 11px;
|
208
|
+
font-size: 15px;
|
209
|
+
font-weight: 500;
|
210
|
+
text-align: center;
|
211
|
+
line-height: 26px;
|
212
|
+
transition: all 150ms ease-in-out;
|
213
|
+
white-space: nowrap;
|
214
|
+
|
215
|
+
&:hover,
|
216
|
+
&.active {
|
217
|
+
background: var(--emfe-w-color-contrast, #07072A);
|
218
|
+
cursor: pointer;
|
219
|
+
}
|
220
|
+
}
|
221
|
+
}
|
222
|
+
|
223
|
+
.DropdownContent {
|
224
|
+
position: absolute;
|
225
|
+
transition: all 1s ease-in;
|
226
|
+
display: none;
|
227
|
+
min-width: 100px;
|
228
|
+
top: 52px;
|
229
|
+
left: 0;
|
230
|
+
padding: 10px 11px;
|
231
|
+
background: var(--emfe-w-color-contrast, #07072A); /* fallback for old browsers */
|
232
|
+
background: -webkit-linear-gradient(var(--emfe-w-color-contrast, #07072A), var(--emfe-w-color-primary, #D0046C)); /* Chrome 10-25, Safari 5.1-6 */
|
233
|
+
background: linear-gradient(var(--emfe-w-color-contrast, #07072A), var(--emfe-w-color-primary, #D0046C)); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
|
234
|
+
& a {
|
235
|
+
display: block;
|
236
|
+
font-weight: 400;
|
237
|
+
line-height: 30px;
|
238
|
+
text-align: left;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
|
242
|
+
.CarouselItem {
|
243
|
+
&:hover {
|
244
|
+
.DropdownContent {
|
245
|
+
display: block;
|
246
|
+
}
|
247
|
+
}
|
248
|
+
}
|
249
|
+
|
250
|
+
.CarouselLeftArrow,
|
251
|
+
.CarouselRightArrow {
|
252
|
+
display: flex;
|
253
|
+
align-items: center;
|
254
|
+
justify-content: center;
|
255
|
+
width: 50%;
|
256
|
+
max-width: 64px;
|
257
|
+
background: rgba(255,255,255,.3);
|
258
|
+
|
259
|
+
svg {
|
260
|
+
width: 100%;
|
261
|
+
max-width: 39px;
|
262
|
+
}
|
263
|
+
|
264
|
+
&:hover {
|
265
|
+
cursor: pointer;
|
266
|
+
}
|
267
|
+
}
|
268
|
+
}
|
269
|
+
|
270
|
+
.CarouselContainerHeaderMain {
|
271
|
+
.CarouselItems .CarouselItem {
|
272
|
+
&:hover, &.active {
|
273
|
+
background: transparent;
|
274
|
+
a {
|
275
|
+
border-bottom: 1px solid var(--emfe-w-color-primary, #D0046C);
|
276
|
+
line-height: 84px;
|
277
|
+
color: var(--emfe-w-color-primary, #D0046C);
|
278
|
+
}
|
279
|
+
}
|
280
|
+
span {
|
281
|
+
border-top: 1px solid transparent;
|
282
|
+
padding-top: 5px;
|
283
|
+
transition-duration: 0.3s;
|
284
|
+
}
|
285
|
+
}
|
286
|
+
}
|
287
|
+
|
288
|
+
.CarouselContainerHeaderMain {
|
289
|
+
background: transparent;
|
290
|
+
margin: 0;
|
291
|
+
padding: 0;
|
292
|
+
.CarouselLeftArrow, .CarouselRightArrow {
|
293
|
+
background: transparent;
|
294
|
+
width: unset;
|
295
|
+
display: none;
|
296
|
+
}
|
297
|
+
.CarouselItem a {
|
298
|
+
color: var(--emfe-w-color-white, #FFFFFF);
|
299
|
+
text-decoration: none;
|
300
|
+
}
|
301
|
+
}
|
302
|
+
|
303
|
+
@media only screen and (max-width: 1024px) {
|
304
|
+
.CarouselContainerHeaderMain {
|
305
|
+
.CarouselLeftArrow, .CarouselRightArrow {
|
306
|
+
display: flex;
|
307
|
+
}
|
308
|
+
}
|
309
|
+
}
|
310
|
+
</style>
|
package/src/i18n.js
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
import {
|
2
|
-
dictionary,
|
3
|
-
locale,
|
4
|
-
addMessages,
|
5
|
-
_
|
6
|
-
} from 'svelte-i18n';
|
7
|
-
|
8
|
-
function setupI18n({ withLocale: _locale, translations }) {
|
9
|
-
locale.subscribe((data) => {
|
10
|
-
if (data == null) {
|
11
|
-
dictionary.set(translations);
|
12
|
-
locale.set(_locale);
|
13
|
-
}
|
14
|
-
}); // maybe we will need this to make sure that the i18n is set up only once
|
15
|
-
/*dictionary.set(translations);
|
16
|
-
locale.set(_locale);*/
|
17
|
-
}
|
18
|
-
|
19
|
-
function addNewMessages(lang, dict) {
|
20
|
-
addMessages(lang, dict);
|
21
|
-
}
|
22
|
-
|
23
|
-
function setLocale(_locale) {
|
24
|
-
locale.set(_locale);
|
25
|
-
}
|
26
|
-
|
27
|
-
export { _, setupI18n, addNewMessages, setLocale };
|
1
|
+
import {
|
2
|
+
dictionary,
|
3
|
+
locale,
|
4
|
+
addMessages,
|
5
|
+
_
|
6
|
+
} from 'svelte-i18n';
|
7
|
+
|
8
|
+
function setupI18n({ withLocale: _locale, translations }) {
|
9
|
+
locale.subscribe((data) => {
|
10
|
+
if (data == null) {
|
11
|
+
dictionary.set(translations);
|
12
|
+
locale.set(_locale);
|
13
|
+
}
|
14
|
+
}); // maybe we will need this to make sure that the i18n is set up only once
|
15
|
+
/*dictionary.set(translations);
|
16
|
+
locale.set(_locale);*/
|
17
|
+
}
|
18
|
+
|
19
|
+
function addNewMessages(lang, dict) {
|
20
|
+
addMessages(lang, dict);
|
21
|
+
}
|
22
|
+
|
23
|
+
function setLocale(_locale) {
|
24
|
+
locale.set(_locale);
|
25
|
+
}
|
26
|
+
|
27
|
+
export { _, setupI18n, addNewMessages, setLocale };
|