@katajere/recap 1.0.13 → 2.0.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/dist/App.css +32 -12
- package/dist/LoginScreen.css +22 -21
- package/dist/OtpScreen.css +20 -17
- package/dist/RecapStory.css +148 -0
- package/dist/RecapStory.d.ts +2 -2
- package/dist/RecapStory.d.ts.map +1 -1
- package/dist/RecapStory.js +169 -81
- package/dist/StoryProgress.css +3 -3
- package/dist/StoryProgress.d.ts +3 -2
- package/dist/StoryProgress.d.ts.map +1 -1
- package/dist/StoryProgress.js +66 -12
- package/dist/assets/huxxle-login-blue-logo.svg +14 -0
- package/dist/assets/noisy-background.png +0 -0
- package/dist/assets/noisy-background.svg +23 -0
- package/dist/assets/search-icon.svg +4 -0
- package/dist/assets/share-button.svg +5 -0
- package/dist/assets/web-icon.png +0 -0
- package/dist/assets/web-icon.svg +14 -0
- package/dist/components/Header.css +12 -1
- package/dist/components/Header.js +2 -2
- package/dist/data/mock.d.ts +1 -1
- package/dist/data/mock.d.ts.map +1 -1
- package/dist/data/mock.js +36 -23
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/slides/Slide10Final.css +73 -35
- package/dist/slides/Slide1Intro.css +204 -56
- package/dist/slides/Slide1Intro.d.ts +2 -1
- package/dist/slides/Slide1Intro.d.ts.map +1 -1
- package/dist/slides/Slide1Intro.js +41 -47
- package/dist/slides/Slide2Days.css +121 -34
- package/dist/slides/Slide2Days.d.ts +2 -1
- package/dist/slides/Slide2Days.d.ts.map +1 -1
- package/dist/slides/Slide2Days.js +45 -4
- package/dist/slides/Slide3Revenue.css +80 -38
- package/dist/slides/Slide3Revenue.d.ts.map +1 -1
- package/dist/slides/Slide3Revenue.js +31 -3
- package/dist/slides/Slide4Orders.css +93 -34
- package/dist/slides/Slide4Orders.d.ts +2 -1
- package/dist/slides/Slide4Orders.d.ts.map +1 -1
- package/dist/slides/Slide4Orders.js +45 -3
- package/dist/slides/Slide5Buyers.css +124 -67
- package/dist/slides/Slide5Buyers.d.ts +2 -1
- package/dist/slides/Slide5Buyers.d.ts.map +1 -1
- package/dist/slides/Slide5Buyers.js +43 -3
- package/dist/slides/Slide6Customer.css +294 -52
- package/dist/slides/Slide6Customer.d.ts +6 -3
- package/dist/slides/Slide6Customer.d.ts.map +1 -1
- package/dist/slides/Slide6Customer.js +25 -4
- package/dist/slides/Slide7Products.css +8 -7
- package/dist/slides/Slide7Products.js +3 -3
- package/dist/slides/Slide8Months.css +6 -6
- package/dist/slides/Slide9Year.css +4 -2
- package/dist/slides/Slide9Year.d.ts +2 -1
- package/dist/slides/Slide9Year.d.ts.map +1 -1
- package/dist/slides/Slide9Year.js +23 -2
- package/dist/types.d.ts +7 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/slideScreenshot.d.ts +27 -0
- package/dist/utils/slideScreenshot.d.ts.map +1 -0
- package/dist/utils/slideScreenshot.js +274 -0
- package/package.json +2 -1
- package/src/App.css +32 -12
- package/src/LoginScreen.css +22 -21
- package/src/LoginScreen.tsx +1 -1
- package/src/OtpScreen.css +20 -17
- package/src/OtpScreen.tsx +1 -1
- package/src/RecapStory.css +148 -0
- package/src/RecapStory.tsx +249 -118
- package/src/StoryProgress.css +3 -3
- package/src/StoryProgress.tsx +96 -21
- package/src/components/Header.css +12 -1
- package/src/components/Header.tsx +2 -2
- package/src/data/mock.ts +44 -24
- package/src/index.ts +0 -1
- package/src/slides/Slide10Final.css +73 -35
- package/src/slides/Slide1Intro.css +204 -56
- package/src/slides/Slide1Intro.tsx +89 -81
- package/src/slides/Slide2Days.css +121 -34
- package/src/slides/Slide2Days.tsx +67 -19
- package/src/slides/Slide3Revenue.css +80 -38
- package/src/slides/Slide3Revenue.tsx +43 -6
- package/src/slides/Slide4Orders.css +93 -34
- package/src/slides/Slide4Orders.tsx +71 -10
- package/src/slides/Slide5Buyers.css +124 -67
- package/src/slides/Slide5Buyers.tsx +97 -38
- package/src/slides/Slide6Customer.css +294 -52
- package/src/slides/Slide6Customer.tsx +68 -10
- package/src/slides/Slide7Products.css +8 -7
- package/src/slides/Slide7Products.tsx +3 -3
- package/src/slides/Slide8Months.css +6 -6
- package/src/slides/Slide9Year.css +4 -2
- package/src/slides/Slide9Year.tsx +35 -7
- package/src/types.ts +7 -0
- package/src/utils/slideScreenshot.ts +324 -0
- package/dist/FloatingFrames.css +0 -55
- package/dist/FloatingFrames.d.ts +0 -11
- package/dist/FloatingFrames.d.ts.map +0 -1
- package/dist/FloatingFrames.js +0 -12
- package/src/FloatingFrames.css +0 -55
- package/src/FloatingFrames.tsx +0 -27
|
@@ -1,71 +1,130 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { motion } from 'framer-motion';
|
|
2
|
+
import { motion, useMotionValue, useTransform, animate } from 'framer-motion';
|
|
3
3
|
import './Slide5Buyers.css';
|
|
4
4
|
|
|
5
5
|
interface Slide5BuyersProps {
|
|
6
6
|
firstTimeBuyers: number;
|
|
7
7
|
repeatBuyers: number;
|
|
8
|
+
frameImages?: string[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Custom hook for number counter animation
|
|
13
|
+
*/
|
|
14
|
+
function useCountAnimation(target: number, duration: number = 2, delay: number = 0) {
|
|
15
|
+
const count = useMotionValue(0);
|
|
16
|
+
const rounded = useTransform(count, (latest) => Math.round(latest));
|
|
17
|
+
|
|
18
|
+
React.useEffect(() => {
|
|
19
|
+
const controls = animate(count, target, {
|
|
20
|
+
duration,
|
|
21
|
+
delay,
|
|
22
|
+
ease: 'easeOut',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
return controls.stop;
|
|
26
|
+
}, [count, target, duration, delay]);
|
|
27
|
+
|
|
28
|
+
return rounded;
|
|
8
29
|
}
|
|
9
30
|
|
|
10
31
|
/**
|
|
11
32
|
* Slide5Buyers - Displays first-time and returning buyer counts with vertical animated columns
|
|
12
33
|
*/
|
|
13
|
-
function Slide5Buyers({ firstTimeBuyers, repeatBuyers }: Slide5BuyersProps) {
|
|
34
|
+
function Slide5Buyers({ firstTimeBuyers, repeatBuyers, frameImages }: Slide5BuyersProps) {
|
|
35
|
+
const firstTimeBuyersCount = useCountAnimation(firstTimeBuyers, 1.7, 0.3); // 1.7s + 0.3s delay = 2s total
|
|
36
|
+
const repeatBuyersCount = useCountAnimation(repeatBuyers, 1.2, 0.8); // 1.2s + 0.8s delay = 2s total
|
|
14
37
|
const leftRects = ['l1', 'l2', 'l3', 'l4', 'l5', 'l6'];
|
|
15
38
|
const rightRects = ['r1', 'r2', 'r3', 'r4', 'r5', 'r6'];
|
|
16
39
|
|
|
40
|
+
const frameImagePool = React.useMemo(() => {
|
|
41
|
+
return frameImages && frameImages.length > 0 ? frameImages : [];
|
|
42
|
+
}, [frameImages]);
|
|
43
|
+
|
|
44
|
+
const totalRects = leftRects.length + rightRects.length;
|
|
45
|
+
const rectSources = React.useMemo(() => {
|
|
46
|
+
if (!frameImagePool.length) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return Array.from({ length: totalRects }, () =>
|
|
51
|
+
frameImagePool[Math.floor(Math.random() * frameImagePool.length)]
|
|
52
|
+
);
|
|
53
|
+
}, [frameImagePool, totalRects]);
|
|
54
|
+
|
|
55
|
+
const getRectStyle = (index: number) => {
|
|
56
|
+
const image = rectSources[index];
|
|
57
|
+
if (!image) {
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
backgroundImage: `url('${image}')`,
|
|
63
|
+
backgroundSize: 'cover',
|
|
64
|
+
backgroundPosition: 'center',
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
17
68
|
return (
|
|
18
69
|
<div className="slide5-buyers">
|
|
19
70
|
<div className="slide5-buyers__grid" aria-hidden="true">
|
|
20
71
|
<div className="column column-left">
|
|
21
72
|
<div className="column-inner">
|
|
22
|
-
{leftRects.map(rect => (
|
|
23
|
-
<span key={rect} className={`rect ${rect}`} />
|
|
73
|
+
{leftRects.map((rect, index) => (
|
|
74
|
+
<span key={rect} className={`rect ${rect}`} style={getRectStyle(index)} />
|
|
24
75
|
))}
|
|
25
76
|
</div>
|
|
26
77
|
</div>
|
|
27
78
|
<div className="column column-right">
|
|
28
79
|
<div className="column-inner">
|
|
29
|
-
{rightRects.map(rect => (
|
|
30
|
-
<span
|
|
80
|
+
{rightRects.map((rect, index) => (
|
|
81
|
+
<span
|
|
82
|
+
key={rect}
|
|
83
|
+
className={`rect ${rect}`}
|
|
84
|
+
style={getRectStyle(leftRects.length + index)}
|
|
85
|
+
/>
|
|
31
86
|
))}
|
|
32
87
|
</div>
|
|
33
88
|
</div>
|
|
34
89
|
</div>
|
|
35
90
|
|
|
36
91
|
<div className="slide5-buyers__content">
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
92
|
+
<div className="slide5-buyers__section">
|
|
93
|
+
<motion.div
|
|
94
|
+
className="slide5-buyers__number"
|
|
95
|
+
initial={{ opacity: 0, y: 20 }}
|
|
96
|
+
animate={{ opacity: 1, y: 0 }}
|
|
97
|
+
transition={{ duration: 0.6 }}
|
|
98
|
+
>
|
|
99
|
+
<motion.span>{firstTimeBuyersCount}</motion.span>
|
|
100
|
+
</motion.div>
|
|
101
|
+
<motion.p
|
|
102
|
+
className="slide5-buyers__label"
|
|
103
|
+
initial={{ opacity: 0, y: 20 }}
|
|
104
|
+
animate={{ opacity: 1, y: 0 }}
|
|
105
|
+
transition={{ duration: 0.6, delay: 0.2 }}
|
|
106
|
+
>
|
|
107
|
+
people don buy from you
|
|
108
|
+
</motion.p>
|
|
109
|
+
</div>
|
|
110
|
+
<div className="slide5-buyers__section">
|
|
111
|
+
<motion.div
|
|
112
|
+
className="slide5-buyers__number slide5-buyers__number--secondary"
|
|
113
|
+
initial={{ opacity: 0, y: 20 }}
|
|
114
|
+
animate={{ opacity: 1, y: 0 }}
|
|
115
|
+
transition={{ duration: 0.6, delay: 0.4 }}
|
|
116
|
+
>
|
|
117
|
+
<motion.span>{repeatBuyersCount}</motion.span>
|
|
118
|
+
</motion.div>
|
|
119
|
+
<motion.p
|
|
120
|
+
className="slide5-buyers__label"
|
|
121
|
+
initial={{ opacity: 0, y: 20 }}
|
|
122
|
+
animate={{ opacity: 1, y: 0 }}
|
|
123
|
+
transition={{ duration: 0.6, delay: 0.6 }}
|
|
124
|
+
>
|
|
125
|
+
people come buy again
|
|
126
|
+
</motion.p>
|
|
127
|
+
</div>
|
|
69
128
|
</div>
|
|
70
129
|
</div>
|
|
71
130
|
);
|
|
@@ -1,92 +1,334 @@
|
|
|
1
|
+
/* Slide6Customer - Website visits design with blue/purple scheme */
|
|
2
|
+
|
|
1
3
|
.slide6-customer {
|
|
2
4
|
position: relative;
|
|
3
5
|
width: 100%;
|
|
4
6
|
height: 100%;
|
|
5
7
|
overflow: hidden;
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
align-items: center;
|
|
6
11
|
}
|
|
7
12
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
.slide6-customer__inner-rect {
|
|
15
|
-
height: 38%;
|
|
16
|
-
top: 28%;
|
|
17
|
-
}
|
|
13
|
+
/* Decorative rectangles with opposite animations */
|
|
14
|
+
.slide6-customer__rect {
|
|
15
|
+
position: absolute;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
border: 1px solid #817FE3;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
.slide6-customer__rect--1 {
|
|
21
|
+
width: calc(100% - 32px);
|
|
22
|
+
max-width: 366px;
|
|
23
|
+
left: 50%;
|
|
24
|
+
top: 16px;
|
|
25
|
+
transform: translateX(-50%);
|
|
26
|
+
/* Height calculated: from 16px top to 16px below link bar (link bar is at ~312px, height 36px) */
|
|
27
|
+
height: clamp(280px, 41vh, 348px);
|
|
28
|
+
animation: rectBounce1 3s ease-in-out infinite;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
|
-
.slide6-
|
|
26
|
-
|
|
27
|
-
width:
|
|
28
|
-
|
|
29
|
-
top:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
.slide6-customer__rect--2 {
|
|
32
|
+
width: calc(100% - 64px);
|
|
33
|
+
max-width: 334px;
|
|
34
|
+
left: 50%;
|
|
35
|
+
top: clamp(80px, 12vh, 108px);
|
|
36
|
+
transform: translateX(-50%);
|
|
37
|
+
/* Height calculated: from 108px top to 32px below link bar */
|
|
38
|
+
height: clamp(220px, 32vh, 272px);
|
|
39
|
+
animation: rectBounce2 3s ease-in-out infinite;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* Opposite bounce animations */
|
|
43
|
+
@keyframes rectBounce1 {
|
|
44
|
+
0%, 100% { transform: translateX(-50%) translateY(0); }
|
|
45
|
+
50% { transform: translateX(-50%) translateY(12px); }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@keyframes rectBounce2 {
|
|
49
|
+
0%, 100% { transform: translateX(-50%) translateY(0); }
|
|
50
|
+
50% { transform: translateX(-50%) translateY(-12px); }
|
|
33
51
|
}
|
|
34
52
|
|
|
35
|
-
|
|
53
|
+
/* Globe icon wrapper */
|
|
54
|
+
.slide6-customer__globe-wrapper {
|
|
36
55
|
position: absolute;
|
|
37
|
-
width:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
56
|
+
width: 24vw;
|
|
57
|
+
max-width: 94px;
|
|
58
|
+
min-width: 60px;
|
|
59
|
+
aspect-ratio: 94 / 100;
|
|
60
|
+
left: 50%;
|
|
61
|
+
top: 18.5vh;
|
|
62
|
+
transform: translateX(-50%);
|
|
43
63
|
display: flex;
|
|
44
64
|
align-items: center;
|
|
45
65
|
justify-content: center;
|
|
66
|
+
z-index: 1;
|
|
46
67
|
}
|
|
47
68
|
|
|
48
|
-
.slide6-
|
|
49
|
-
width:
|
|
50
|
-
|
|
69
|
+
.slide6-customer__globe {
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 100%;
|
|
51
72
|
object-fit: contain;
|
|
52
73
|
}
|
|
53
74
|
|
|
54
|
-
|
|
75
|
+
/* Website link bar */
|
|
76
|
+
.slide6-customer__link-bar {
|
|
55
77
|
position: absolute;
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
width: calc(100% - 64px);
|
|
79
|
+
max-width: 302px;
|
|
80
|
+
height: 36px;
|
|
81
|
+
left: 50%;
|
|
82
|
+
top: clamp(260px, 37vh, 312px);
|
|
83
|
+
transform: translateX(-50%);
|
|
59
84
|
display: flex;
|
|
60
|
-
flex-direction:
|
|
85
|
+
flex-direction: row;
|
|
61
86
|
align-items: center;
|
|
62
|
-
|
|
87
|
+
justify-content: space-evenly;
|
|
88
|
+
padding: 8px;
|
|
89
|
+
gap: 8px;
|
|
90
|
+
background: #FCFCFC;
|
|
91
|
+
border: 1px solid #CDCCF4;
|
|
92
|
+
box-sizing: border-box;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.slide6-customer__search-icon {
|
|
96
|
+
width: 20px;
|
|
97
|
+
height: 20px;
|
|
98
|
+
flex-shrink: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.slide6-customer__link-text {
|
|
102
|
+
font-family: 'Lora', serif;
|
|
103
|
+
font-style: normal;
|
|
104
|
+
font-weight: 600;
|
|
105
|
+
font-size: 12px;
|
|
106
|
+
line-height: 120%;
|
|
63
107
|
text-align: center;
|
|
108
|
+
color: #4F4CD8;
|
|
109
|
+
white-space: nowrap;
|
|
110
|
+
overflow: hidden;
|
|
111
|
+
text-overflow: ellipsis;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* Stats content */
|
|
115
|
+
.slide6-customer__content {
|
|
116
|
+
position: absolute;
|
|
117
|
+
z-index: 1;
|
|
118
|
+
width: calc(100% - 32px);
|
|
119
|
+
max-width: 358px;
|
|
120
|
+
display: flex;
|
|
121
|
+
flex-direction: column;
|
|
122
|
+
align-items: center;
|
|
123
|
+
gap: 48px;
|
|
124
|
+
left: 50%;
|
|
125
|
+
top: calc(50% + 130px);
|
|
126
|
+
transform: translate(-50%, -50%);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.slide6-customer__section {
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
align-items: center;
|
|
133
|
+
width: 100%;
|
|
134
|
+
gap: 8px;
|
|
64
135
|
}
|
|
65
136
|
|
|
66
|
-
.slide6-
|
|
67
|
-
.slide6-customer__text {
|
|
137
|
+
.slide6-customer__number {
|
|
68
138
|
width: 100%;
|
|
69
139
|
font-family: 'Lora', serif;
|
|
140
|
+
font-style: normal;
|
|
141
|
+
font-weight: 700;
|
|
142
|
+
font-size: clamp(60px, 10vh, 80px);
|
|
143
|
+
line-height: 1;
|
|
70
144
|
text-align: center;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
background-clip: text;
|
|
74
|
-
color: transparent;
|
|
145
|
+
color: #4F4CD8;
|
|
146
|
+
margin: 0;
|
|
75
147
|
}
|
|
76
148
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
font-size:
|
|
80
|
-
|
|
149
|
+
/* Secondary number styling - like repeat buyers in Slide5 */
|
|
150
|
+
.slide6-customer__number--secondary {
|
|
151
|
+
font-size: clamp(50px, 8vh, 70px);
|
|
152
|
+
color: #FFFFFF;
|
|
153
|
+
-webkit-text-stroke: 1.5px #4F4CD8;
|
|
154
|
+
paint-order: stroke fill;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.slide6-customer__label {
|
|
158
|
+
width: 100%;
|
|
159
|
+
font-family: 'Lora', serif;
|
|
160
|
+
font-style: normal;
|
|
161
|
+
font-weight: 400;
|
|
162
|
+
font-size: clamp(14px, 4.1vw, 16px);
|
|
163
|
+
line-height: 1.5;
|
|
164
|
+
text-align: center;
|
|
165
|
+
color: #3734D3;
|
|
166
|
+
margin: 0;
|
|
81
167
|
}
|
|
82
168
|
|
|
83
|
-
.slide6-
|
|
169
|
+
.slide6-customer__footer {
|
|
170
|
+
position: absolute;
|
|
171
|
+
width: calc(100% - 32px);
|
|
172
|
+
max-width: 358px;
|
|
173
|
+
left: 50%;
|
|
174
|
+
bottom: calc(100px + env(safe-area-inset-bottom));
|
|
175
|
+
transform: translateX(-50%);
|
|
176
|
+
font-family: 'Lora', serif;
|
|
177
|
+
font-style: normal;
|
|
84
178
|
font-weight: 400;
|
|
85
|
-
font-size:
|
|
179
|
+
font-size: clamp(14px, 4.1vw, 16px);
|
|
86
180
|
line-height: 1.5;
|
|
181
|
+
text-align: center;
|
|
182
|
+
color: #3734D3;
|
|
87
183
|
}
|
|
88
184
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
185
|
+
/* Media queries for landscape and short screens */
|
|
186
|
+
@media (max-height: 720px), (orientation: landscape) {
|
|
187
|
+
.slide6-customer__rect--1 {
|
|
188
|
+
height: 290px;
|
|
189
|
+
top: 14px;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.slide6-customer__rect--2 {
|
|
193
|
+
height: 230px;
|
|
194
|
+
top: 90px;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.slide6-customer__globe-wrapper {
|
|
198
|
+
width: 70px;
|
|
199
|
+
min-width: 70px;
|
|
200
|
+
top: 16vh;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.slide6-customer__link-bar {
|
|
204
|
+
top: 260px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.slide6-customer__content {
|
|
208
|
+
gap: 36px;
|
|
209
|
+
top: calc(50% + 100px);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.slide6-customer__number {
|
|
213
|
+
font-size: clamp(50px, 9dvh, 70px);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.slide6-customer__number--secondary {
|
|
217
|
+
font-size: clamp(42px, 7dvh, 60px);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* Small/Short screens - handles browser chrome taking space */
|
|
222
|
+
@media (max-height: 700px) {
|
|
223
|
+
.slide6-customer__rect--1 {
|
|
224
|
+
height: 250px;
|
|
225
|
+
top: 12px;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.slide6-customer__rect--2 {
|
|
229
|
+
height: 200px;
|
|
230
|
+
top: 76px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.slide6-customer__globe-wrapper {
|
|
234
|
+
width: 60px;
|
|
235
|
+
min-width: 60px;
|
|
236
|
+
top: 14vh;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.slide6-customer__link-bar {
|
|
240
|
+
height: 32px;
|
|
241
|
+
padding: 6px;
|
|
242
|
+
top: 220px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.slide6-customer__link-text {
|
|
246
|
+
font-size: 11px;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.slide6-customer__content {
|
|
250
|
+
gap: 28px;
|
|
251
|
+
top: calc(50% + 80px);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.slide6-customer__section {
|
|
255
|
+
gap: 6px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.slide6-customer__number {
|
|
259
|
+
font-size: clamp(44px, 8dvh, 60px);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.slide6-customer__number--secondary {
|
|
263
|
+
font-size: clamp(36px, 6dvh, 52px);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.slide6-customer__label {
|
|
267
|
+
font-size: clamp(12px, 3.5vw, 14px);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.slide6-customer__footer {
|
|
271
|
+
bottom: calc(90px + env(safe-area-inset-bottom));
|
|
272
|
+
font-size: clamp(12px, 3.5vw, 14px);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/* Extra short screens (under 600px) - more aggressive adjustments */
|
|
277
|
+
@media (max-height: 600px) {
|
|
278
|
+
.slide6-customer__rect--1 {
|
|
279
|
+
height: 210px;
|
|
280
|
+
top: 10px;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.slide6-customer__rect--2 {
|
|
284
|
+
height: 170px;
|
|
285
|
+
top: 60px;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.slide6-customer__globe-wrapper {
|
|
289
|
+
width: 50px;
|
|
290
|
+
min-width: 50px;
|
|
291
|
+
top: 12vh;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.slide6-customer__link-bar {
|
|
295
|
+
height: 28px;
|
|
296
|
+
padding: 4px 6px;
|
|
297
|
+
top: 180px;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.slide6-customer__link-text {
|
|
301
|
+
font-size: 10px;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.slide6-customer__search-icon {
|
|
305
|
+
width: 16px;
|
|
306
|
+
height: 16px;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.slide6-customer__content {
|
|
310
|
+
gap: 20px;
|
|
311
|
+
top: calc(50% + 60px);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.slide6-customer__section {
|
|
315
|
+
gap: 4px;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.slide6-customer__number {
|
|
319
|
+
font-size: clamp(38px, 7dvh, 52px);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.slide6-customer__number--secondary {
|
|
323
|
+
font-size: clamp(30px, 5dvh, 44px);
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.slide6-customer__label {
|
|
327
|
+
font-size: clamp(11px, 3vw, 13px);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.slide6-customer__footer {
|
|
331
|
+
bottom: calc(80px + env(safe-area-inset-bottom));
|
|
332
|
+
font-size: clamp(11px, 3vw, 13px);
|
|
333
|
+
}
|
|
92
334
|
}
|
|
@@ -1,25 +1,83 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { useMotionValue, useTransform, animate } from 'framer-motion';
|
|
3
|
+
import { motion } from 'framer-motion';
|
|
2
4
|
import './Slide6Customer.css';
|
|
3
|
-
import
|
|
5
|
+
import webIcon from '../assets/web-icon.png';
|
|
6
|
+
import searchIcon from '../assets/search-icon.svg';
|
|
7
|
+
|
|
8
|
+
// Counter animation hook with optional comma formatting
|
|
9
|
+
function useCountAnimation(target: number, duration: number = 2, delay: number = 0, formatWithCommas: boolean = false) {
|
|
10
|
+
const count = useMotionValue(0);
|
|
11
|
+
const formatted = useTransform(count, (v) => {
|
|
12
|
+
const rounded = Math.round(v);
|
|
13
|
+
return formatWithCommas ? rounded.toLocaleString() : rounded.toString();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
const timeout = setTimeout(() => {
|
|
18
|
+
animate(count, target, { duration, ease: 'easeOut' });
|
|
19
|
+
}, delay * 1000);
|
|
20
|
+
return () => clearTimeout(timeout);
|
|
21
|
+
}, [count, target, duration, delay]);
|
|
22
|
+
|
|
23
|
+
return formatted;
|
|
24
|
+
}
|
|
4
25
|
|
|
5
26
|
interface Slide6CustomerProps {
|
|
6
|
-
|
|
27
|
+
websiteLink?: string;
|
|
28
|
+
websiteVisits?: number;
|
|
29
|
+
mostViewedProduct?: string;
|
|
30
|
+
mostViewedProductCount?: number;
|
|
7
31
|
}
|
|
8
32
|
|
|
9
33
|
/**
|
|
10
|
-
* Slide6Customer -
|
|
34
|
+
* Slide6Customer - Website visits and most viewed product slide
|
|
11
35
|
*/
|
|
12
|
-
function Slide6Customer({
|
|
36
|
+
function Slide6Customer({
|
|
37
|
+
websiteLink = "",
|
|
38
|
+
websiteVisits = 0,
|
|
39
|
+
mostViewedProduct = "",
|
|
40
|
+
mostViewedProductCount = 0
|
|
41
|
+
}: Slide6CustomerProps) {
|
|
42
|
+
const visitsCount = useCountAnimation(websiteVisits, 1.7, 0.3, true); // 1.7s + 0.3s delay = 2s total
|
|
43
|
+
const productCount = useCountAnimation(mostViewedProductCount, 1.5, 0.5, true); // 1.5s + 0.5s delay = 2s total
|
|
44
|
+
|
|
13
45
|
return (
|
|
14
46
|
<div className="slide6-customer">
|
|
15
|
-
|
|
16
|
-
<div className="slide6-
|
|
17
|
-
|
|
47
|
+
{/* Decorative rectangles with opposite animations */}
|
|
48
|
+
<div className="slide6-customer__rect slide6-customer__rect--1" aria-hidden="true" />
|
|
49
|
+
<div className="slide6-customer__rect slide6-customer__rect--2" aria-hidden="true" />
|
|
50
|
+
|
|
51
|
+
{/* Globe icon with gradient */}
|
|
52
|
+
<div className="slide6-customer__globe-wrapper">
|
|
53
|
+
<img src={webIcon} alt="Website" className="slide6-customer__globe" />
|
|
18
54
|
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
55
|
+
|
|
56
|
+
{/* Website link bar */}
|
|
57
|
+
<div className="slide6-customer__link-bar">
|
|
58
|
+
<img src={searchIcon} alt="" className="slide6-customer__search-icon" />
|
|
59
|
+
<span className="slide6-customer__link-text">{websiteLink}</span>
|
|
22
60
|
</div>
|
|
61
|
+
|
|
62
|
+
{/* Content sections */}
|
|
63
|
+
<div className="slide6-customer__content">
|
|
64
|
+
{/* Website visits section */}
|
|
65
|
+
<div className="slide6-customer__section">
|
|
66
|
+
<motion.span className="slide6-customer__number">{visitsCount}</motion.span>
|
|
67
|
+
<span className="slide6-customer__label">times dem visit your website,</span>
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
{/* Most viewed product count section - styled like repeat buyers */}
|
|
71
|
+
<div className="slide6-customer__section">
|
|
72
|
+
<motion.span className="slide6-customer__number slide6-customer__number--secondary">{productCount}</motion.span>
|
|
73
|
+
<span className="slide6-customer__label">
|
|
74
|
+
times wey people check "{mostViewedProduct}"
|
|
75
|
+
</span>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
{/* Footer text */}
|
|
80
|
+
<p className="slide6-customer__footer">even your enemy visit am 😎</p>
|
|
23
81
|
</div>
|
|
24
82
|
);
|
|
25
83
|
}
|