oddsgate-ds 1.0.115 → 1.0.117
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/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/ProductCard/ProductCard.component.tsx +1 -1
- package/src/components/organisms/ProductsSlider/ProductsSlider.component.tsx +5 -14
- package/src/components/organisms/ProductsSlider/ProductsSlider.stories.tsx +0 -1
- package/src/components/organisms/ProductsSlider/ProductsSlider.theme.ts +21 -13
package/package.json
CHANGED
|
@@ -45,7 +45,7 @@ const ProductCard = ({
|
|
|
45
45
|
{secondRowTitle}
|
|
46
46
|
</Heading>
|
|
47
47
|
</StyledProductCardWrapper>
|
|
48
|
-
{description && <RichText tag='p' className='color-secondary50 mt-
|
|
48
|
+
{description && <RichText tag='p' className='color-secondary50 mt-4'>{description}</RichText>}
|
|
49
49
|
|
|
50
50
|
{linkElement}
|
|
51
51
|
</StyledProductCard>
|
|
@@ -26,15 +26,6 @@ const ProductsSlider = ({
|
|
|
26
26
|
const contentHolder = useRef<HTMLDivElement>();
|
|
27
27
|
const isMobile = useMediaMatch();
|
|
28
28
|
|
|
29
|
-
//force 12 items
|
|
30
|
-
if (content && content.length < 26) {
|
|
31
|
-
let counter = 0;
|
|
32
|
-
for (let i = content.length; i <= 26; i++) {
|
|
33
|
-
content[i] = content[counter];
|
|
34
|
-
counter++;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
29
|
useEffect(() => {
|
|
39
30
|
if (!slidesHolder.current) return //bail out;
|
|
40
31
|
|
|
@@ -55,25 +46,25 @@ const ProductsSlider = ({
|
|
|
55
46
|
let x = r * Math.cos(stepAngle * i - Math.PI / 2),
|
|
56
47
|
y = r * Math.sin(stepAngle * i - Math.PI / 2);
|
|
57
48
|
|
|
58
|
-
slides[i].style.transform = 'translate( ' + x + 'px, ' + y + 'px ) rotate( ' + (((stepAngle * 180 / Math.PI * i) + 90)) + 'deg )';
|
|
49
|
+
slides[i].style.transform = 'translate( ' + x + 'px, ' + y + 'px ) rotate( ' + (((stepAngle * 180 / Math.PI * i) + 90) - 90) + 'deg )';
|
|
59
50
|
// slides[i].style.transform = 'translate( ' + x + 'px, ' + y + 'px )';
|
|
60
51
|
};
|
|
61
52
|
}
|
|
62
53
|
const setSize = (radius: number) => {
|
|
63
54
|
if (!wrapper.current || !slidesHolder.current || isMobile) return //bail out;
|
|
64
55
|
|
|
65
|
-
const slideSize = 0.
|
|
56
|
+
const slideSize = 0.11;
|
|
66
57
|
|
|
67
58
|
wrapper.current.style.width = 2 * radius + 'px';
|
|
68
59
|
// wrapper.current.style.height = 2 * radius + 'px';
|
|
69
|
-
wrapper.current.style.height = '
|
|
60
|
+
wrapper.current.style.height = '680px';
|
|
70
61
|
|
|
71
62
|
let r = 2 * radius * (1 - slideSize);
|
|
72
63
|
slidesHolder.current.style.width = r + 'px'
|
|
73
64
|
slidesHolder.current.style.height = r + 'px';
|
|
74
65
|
slidesRepositioning(r / 2);
|
|
75
66
|
|
|
76
|
-
slidesSize = Math.min(2 * radius * slideSize, stepAngle * radius * (1 - slideSize) -
|
|
67
|
+
slidesSize = Math.min(2 * radius * slideSize, stepAngle * radius * (1 - slideSize) - 20);
|
|
77
68
|
slidesHolder.current.style.marginTop = slidesSize + 'px';
|
|
78
69
|
|
|
79
70
|
|
|
@@ -91,7 +82,7 @@ const ProductsSlider = ({
|
|
|
91
82
|
w = slider?.current ? slider?.current?.getBoundingClientRect().width : 0,
|
|
92
83
|
h = slider?.current ? slider?.current.getBoundingClientRect().height : 0;
|
|
93
84
|
|
|
94
|
-
|
|
85
|
+
radius = (w / 2) * sliderSize
|
|
95
86
|
|
|
96
87
|
setSize(Math.round(radius));
|
|
97
88
|
}, 250)
|
|
@@ -6,36 +6,45 @@ import styled from 'styled-components';
|
|
|
6
6
|
export const StyledProductsSlider = styled.div<IProductsSlider>`
|
|
7
7
|
position: relative;
|
|
8
8
|
width: 100%;
|
|
9
|
-
|
|
9
|
+
contain: paint;
|
|
10
10
|
`;
|
|
11
11
|
|
|
12
12
|
export const StyledProductsSliderWrapper = styled.div<IProductsSlider>`
|
|
13
13
|
position: relative;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
|
|
16
16
|
@media only screen and (min-width: ${responsiveMedia}) {
|
|
17
|
-
|
|
18
|
-
margin-right: 0;
|
|
19
|
-
transform: translate(-30%, 0%);
|
|
17
|
+
transform: translateX(-25%);
|
|
20
18
|
}
|
|
21
19
|
`;
|
|
22
20
|
|
|
23
21
|
export const StyledProductsSliderSlides = styled.div<IProductsSlider>`
|
|
22
|
+
position: relative;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-flow: row wrap;
|
|
25
|
+
|
|
24
26
|
@media only screen and (min-width: ${responsiveMedia}) {
|
|
25
|
-
transform-origin: center;
|
|
26
|
-
display: flex;
|
|
27
27
|
justify-content: center;
|
|
28
28
|
align-items: center;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
transform: rotate(0deg);
|
|
29
|
+
|
|
30
|
+
transform-origin: center;
|
|
32
31
|
transition: all 0.6s;
|
|
32
|
+
transform: rotate(0deg);
|
|
33
|
+
z-index: 100;
|
|
33
34
|
}
|
|
34
35
|
`;
|
|
35
36
|
export const StyledProductsSliderSlide = styled.div<IProductsSlider>`
|
|
37
|
+
width: 100%;
|
|
38
|
+
padding: 0.5rem;
|
|
39
|
+
margin-bottom: 4rem;
|
|
40
|
+
|
|
41
|
+
@media only screen and (min-width: 560px) {
|
|
42
|
+
width: 50%;
|
|
43
|
+
}
|
|
36
44
|
@media only screen and (min-width: ${responsiveMedia}) {
|
|
37
45
|
position: absolute;
|
|
38
46
|
width: 26rem;
|
|
47
|
+
margin-bottom: 0;
|
|
39
48
|
transform-origin: center;
|
|
40
49
|
opacity: 0.4;
|
|
41
50
|
transition: .3s linear all;
|
|
@@ -45,7 +54,6 @@ export const StyledProductsSliderSlide = styled.div<IProductsSlider>`
|
|
|
45
54
|
width: 100%;
|
|
46
55
|
height: 100%;
|
|
47
56
|
pointer-events:none;
|
|
48
|
-
transform: rotate(-90deg);
|
|
49
57
|
}
|
|
50
58
|
|
|
51
59
|
&.active{
|
|
@@ -61,6 +69,6 @@ export const StyledProductsSliderContent = styled.div<IProductsSlider>`
|
|
|
61
69
|
border-radius: ${radius.md};
|
|
62
70
|
padding: 2rem;
|
|
63
71
|
margin: auto;
|
|
64
|
-
transform: translateY(
|
|
72
|
+
transform: translateY(-10vw);
|
|
65
73
|
`;
|
|
66
74
|
|