@everymatrix/casino-collections-providers 1.43.3 → 1.44.0
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": "@everymatrix/casino-collections-providers",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.44.0",
|
4
4
|
"main": "index.js",
|
5
5
|
"svelte": "src/index.ts",
|
6
6
|
"scripts": {
|
@@ -35,5 +35,5 @@
|
|
35
35
|
"publishConfig": {
|
36
36
|
"access": "public"
|
37
37
|
},
|
38
|
-
"gitHead": "
|
38
|
+
"gitHead": "701410f2b76dfe1ee4038f799b1e8e340c85cdb5"
|
39
39
|
}
|
@@ -28,6 +28,7 @@
|
|
28
28
|
let customStylingContainer:HTMLElement;
|
29
29
|
let userAgent:string = window.navigator.userAgent;
|
30
30
|
let mobile:boolean;
|
31
|
+
let categoriesSliderWidth:number = 0;
|
31
32
|
|
32
33
|
const setTranslationUrl = ():void => {
|
33
34
|
let url:string = translationurl;
|
@@ -75,22 +76,21 @@
|
|
75
76
|
}
|
76
77
|
|
77
78
|
const positionSlides = (curSlide?):void => {
|
78
|
-
//store each slide HTML element in an array
|
79
|
+
// store each slide HTML element in an array
|
79
80
|
slides = [...categoriesSlider.children];
|
80
81
|
|
81
|
-
//iterate the array of elements and translate each of them by 100% times the index to create the slider
|
82
|
+
// iterate the array of elements and translate each of them by 100% times the index to create the slider
|
82
83
|
slides.forEach((slide: HTMLElement, index: number) => {
|
83
84
|
slide.style.transform = `translateX(${100 * (curSlide ? index - curSlide : index)}%)`;
|
84
85
|
});
|
85
86
|
|
86
|
-
|
87
|
-
slides.map(slide => slideWidth = slide.getBoundingClientRect().width)
|
87
|
+
slideWidth = slides[0].getBoundingClientRect().width;
|
88
88
|
setNumberOfVisibleSlides();
|
89
89
|
}
|
90
90
|
|
91
91
|
const setNumberOfVisibleSlides = ():void => {
|
92
92
|
//needed for finding the beginning and end of the slider
|
93
|
-
numberOfVisibleSlides = Math.floor(
|
93
|
+
numberOfVisibleSlides = Math.floor(categoriesSliderWidth / slideWidth);
|
94
94
|
}
|
95
95
|
|
96
96
|
const goToSlide = ():void => {
|
@@ -165,7 +165,7 @@
|
|
165
165
|
|
166
166
|
$: endpoint && datasource && lang && getGameCategories();
|
167
167
|
//making sure we have something to position, before trying to
|
168
|
-
$: gameCategories && categoriesSlider && positionSlides();
|
168
|
+
$: categoriesSliderWidth && gameCategories && categoriesSlider && positionSlides();
|
169
169
|
$: lang && setActiveLanguage();
|
170
170
|
$: clientstyling && customStylingContainer && setClientStyling();
|
171
171
|
$: clientstylingurl && customStylingContainer && setClientStylingURL();
|
@@ -195,7 +195,7 @@
|
|
195
195
|
{/if}
|
196
196
|
</div>
|
197
197
|
|
198
|
-
<div class="CategoriesSlider" bind:this={categoriesSlider}>
|
198
|
+
<div class="CategoriesSlider" bind:this={categoriesSlider} bind:clientWidth={categoriesSliderWidth}>
|
199
199
|
{#each gameCategories as category}
|
200
200
|
<div class="CategoriesSliderWrapper Animation">
|
201
201
|
<div class="CategorySlide {category?.flag[0] == 'vendor' ? 'CategorySlideNoHighlight' : ''}" style="background-image:url({category?.background}); background-size: cover;" on:click={() => openCategory(category.id)}>
|