@katajere/recap 1.0.14 → 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 +22 -2
- package/dist/LoginScreen.css +22 -21
- package/dist/OtpScreen.css +20 -17
- package/dist/RecapStory.css +148 -0
- package/dist/RecapStory.d.ts.map +1 -1
- package/dist/RecapStory.js +61 -28
- package/dist/StoryProgress.css +3 -3
- 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.map +1 -1
- package/dist/data/mock.js +19 -7
- 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 +5 -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 +22 -2
- 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 +131 -57
- package/src/StoryProgress.css +3 -3
- package/src/components/Header.css +12 -1
- package/src/components/Header.tsx +2 -2
- package/src/data/mock.ts +19 -7
- 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 +5 -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
package/src/RecapStory.css
CHANGED
|
@@ -103,3 +103,151 @@
|
|
|
103
103
|
width: 100%;
|
|
104
104
|
height: 100%;
|
|
105
105
|
}
|
|
106
|
+
|
|
107
|
+
/* Base button style for floating buttons */
|
|
108
|
+
.recap-story__floating-btn {
|
|
109
|
+
position: absolute;
|
|
110
|
+
bottom: calc(32px + env(safe-area-inset-bottom));
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: row;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
align-items: center;
|
|
115
|
+
padding: 8px;
|
|
116
|
+
gap: 8px;
|
|
117
|
+
background: #FCFCFC url('./assets/noisy-background.png') repeat;
|
|
118
|
+
background-size: 390px 844px;
|
|
119
|
+
border: 1px solid var(--border-line);
|
|
120
|
+
box-shadow: 0px 4px 100px rgba(0, 0, 0, 0.24);
|
|
121
|
+
cursor: pointer;
|
|
122
|
+
z-index: 10;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.recap-story__floating-btn:hover {
|
|
126
|
+
box-shadow: 0px 6px 120px rgba(0, 0, 0, 0.32);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.recap-story__floating-btn:active {
|
|
130
|
+
box-shadow: 0px 2px 80px rgba(0, 0, 0, 0.24);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/* Sound button - positioned left, always visible */
|
|
134
|
+
.recap-story__sound-btn {
|
|
135
|
+
left: calc(16px + env(safe-area-inset-left));
|
|
136
|
+
width: 36px;
|
|
137
|
+
height: 36px;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.recap-story__sound-btn svg {
|
|
141
|
+
width: 20px;
|
|
142
|
+
height: 20px;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Share button - positioned right, hidden initially */
|
|
146
|
+
.recap-story__share-btn {
|
|
147
|
+
right: calc(16px + env(safe-area-inset-right));
|
|
148
|
+
height: 36px;
|
|
149
|
+
padding: 8px 12px;
|
|
150
|
+
gap: 4px;
|
|
151
|
+
/* Hidden by default until counter animations complete */
|
|
152
|
+
opacity: 0;
|
|
153
|
+
pointer-events: none;
|
|
154
|
+
/* Transition must be on base state for smooth animation */
|
|
155
|
+
transition: opacity 0.4s ease-out;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/* Show share button when ready */
|
|
159
|
+
.recap-story__share-btn--visible {
|
|
160
|
+
opacity: 1;
|
|
161
|
+
pointer-events: auto;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.recap-story__share-btn svg {
|
|
165
|
+
width: 20px;
|
|
166
|
+
height: 20px;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.recap-story__share-text {
|
|
170
|
+
font-family: 'Lora', serif;
|
|
171
|
+
font-weight: 600;
|
|
172
|
+
font-size: 12px;
|
|
173
|
+
line-height: 120%;
|
|
174
|
+
color: #4F4CD8;
|
|
175
|
+
white-space: nowrap;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/* Screenshot mode - prepares the slide for clean capture */
|
|
179
|
+
/* Note: Buttons are excluded via html2canvas ignoreElements option, not CSS */
|
|
180
|
+
.recap-story.screenshot-mode .recap-story__progress-wrap {
|
|
181
|
+
display: none !important;
|
|
182
|
+
visibility: hidden !important;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/* Force elements to be visible (in case animations are mid-flight) */
|
|
186
|
+
.recap-story.screenshot-mode [style*="opacity"] {
|
|
187
|
+
opacity: 1 !important;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/*
|
|
191
|
+
* Fix gradient text for html2canvas - background-clip:text not supported.
|
|
192
|
+
* We remove the gradient background and use solid color fallback.
|
|
193
|
+
* This targets all known gradient text elements.
|
|
194
|
+
*/
|
|
195
|
+
.recap-story.screenshot-mode .header__badge,
|
|
196
|
+
.recap-story.screenshot-mode .slide1-intro__brand,
|
|
197
|
+
.recap-story.screenshot-mode .slide1-intro__bg-text,
|
|
198
|
+
.recap-story.screenshot-mode .stats-number,
|
|
199
|
+
.recap-story.screenshot-mode .stats-label,
|
|
200
|
+
.recap-story.screenshot-mode .stats-sublabel,
|
|
201
|
+
.recap-story.screenshot-mode .streak-number,
|
|
202
|
+
.recap-story.screenshot-mode .streak-label,
|
|
203
|
+
.recap-story.screenshot-mode .slide3-revenue__amount,
|
|
204
|
+
.recap-story.screenshot-mode .slide3-revenue__currency,
|
|
205
|
+
.recap-story.screenshot-mode .slide4-orders__number,
|
|
206
|
+
.recap-story.screenshot-mode .slide5-buyers__number,
|
|
207
|
+
.recap-story.screenshot-mode .slide5-buyers__label,
|
|
208
|
+
.recap-story.screenshot-mode .slide6-customer__number,
|
|
209
|
+
.recap-story.screenshot-mode .slide6-customer__label,
|
|
210
|
+
.recap-story.screenshot-mode .slide7-products__lead,
|
|
211
|
+
.recap-story.screenshot-mode .slide7-products__rank,
|
|
212
|
+
.recap-story.screenshot-mode .slide7-products__title,
|
|
213
|
+
.recap-story.screenshot-mode .slide7-products__subtitle,
|
|
214
|
+
.recap-story.screenshot-mode .slide8-months__message,
|
|
215
|
+
.recap-story.screenshot-mode .slide8-months__entry,
|
|
216
|
+
.recap-story.screenshot-mode .slide9-year__message,
|
|
217
|
+
.recap-story.screenshot-mode .slide9-year__title,
|
|
218
|
+
.recap-story.screenshot-mode .slide10-final__badge,
|
|
219
|
+
.recap-story.screenshot-mode .slide10-final__title {
|
|
220
|
+
background: none !important;
|
|
221
|
+
-webkit-background-clip: unset !important;
|
|
222
|
+
background-clip: unset !important;
|
|
223
|
+
-webkit-text-fill-color: #4F4CD8 !important;
|
|
224
|
+
color: #4F4CD8 !important;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Fix outline text (stroke) for screenshot - keep stroke styling but fix fill color */
|
|
228
|
+
.recap-story.screenshot-mode .streak-number {
|
|
229
|
+
background: none !important;
|
|
230
|
+
-webkit-background-clip: unset !important;
|
|
231
|
+
background-clip: unset !important;
|
|
232
|
+
color: #FFFFFF !important;
|
|
233
|
+
-webkit-text-fill-color: #FFFFFF !important;
|
|
234
|
+
-webkit-text-stroke: 1.5px #4F4CD8 !important;
|
|
235
|
+
paint-order: stroke fill !important;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.recap-story.screenshot-mode .slide5-buyers__number--secondary,
|
|
239
|
+
.recap-story.screenshot-mode .slide6-customer__number--secondary {
|
|
240
|
+
background: none !important;
|
|
241
|
+
-webkit-background-clip: unset !important;
|
|
242
|
+
background-clip: unset !important;
|
|
243
|
+
color: #FFFFFF !important;
|
|
244
|
+
-webkit-text-fill-color: #FFFFFF !important;
|
|
245
|
+
-webkit-text-stroke: 1.5px #4F4CD8 !important;
|
|
246
|
+
paint-order: stroke fill !important;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/* Fix overflow issues for grids/decorative elements that may be clipped */
|
|
250
|
+
.recap-story.screenshot-mode .slide4-orders__grid,
|
|
251
|
+
.recap-story.screenshot-mode .slide7-products__frames {
|
|
252
|
+
overflow: visible !important;
|
|
253
|
+
}
|
package/src/RecapStory.tsx
CHANGED
|
@@ -13,11 +13,10 @@ import Slide8Months from "./slides/Slide8Months";
|
|
|
13
13
|
import Slide9Year from "./slides/Slide9Year";
|
|
14
14
|
import Slide10Final from "./slides/Slide10Final";
|
|
15
15
|
import { slideVariants } from "./utils";
|
|
16
|
+
import { captureAndShareSlide, preCaptureSlide, clearScreenshotCache } from "./utils/slideScreenshot";
|
|
16
17
|
import { slideDurations as defaultDurations } from "./data/mock";
|
|
17
18
|
import { BUSINESS_CATEGORIES, RecapData } from "./types";
|
|
18
19
|
import { useBackgroundMusic } from "./hooks/useBackgroundMusic";
|
|
19
|
-
import soundOnIcon from "./assets/sound-on.svg";
|
|
20
|
-
import soundOffIcon from "./assets/sound-off.svg";
|
|
21
20
|
import recapMusic from "./assets/recap-music.mp3";
|
|
22
21
|
import "./RecapStory.css";
|
|
23
22
|
|
|
@@ -31,14 +30,11 @@ interface RecapStoryProps {
|
|
|
31
30
|
function RecapStory({ recapData }: RecapStoryProps) {
|
|
32
31
|
const [activeIndex, setActiveIndex] = useState<number>(0);
|
|
33
32
|
const durations = recapData.slideDurations || defaultDurations;
|
|
34
|
-
const [introDuration, setIntroDuration] = useState<number>(
|
|
35
|
-
durations.intro
|
|
36
|
-
);
|
|
37
|
-
const [isIntroDurationReady, setIsIntroDurationReady] =
|
|
38
|
-
useState<boolean>(false);
|
|
39
33
|
const [isPaused, setIsPaused] = useState<boolean>(false);
|
|
34
|
+
const [isShareVisible, setIsShareVisible] = useState<boolean>(false);
|
|
40
35
|
const holdTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
41
36
|
const isHoldingRef = useRef<boolean>(false);
|
|
37
|
+
const slidesContainerRef = useRef<HTMLDivElement>(null);
|
|
42
38
|
|
|
43
39
|
// Cleanup on unmount to prevent memory leaks
|
|
44
40
|
React.useEffect(() => {
|
|
@@ -46,8 +42,11 @@ function RecapStory({ recapData }: RecapStoryProps) {
|
|
|
46
42
|
if (holdTimerRef.current) {
|
|
47
43
|
clearTimeout(holdTimerRef.current);
|
|
48
44
|
}
|
|
45
|
+
// Clear screenshot cache on unmount
|
|
46
|
+
clearScreenshotCache();
|
|
49
47
|
};
|
|
50
48
|
}, []);
|
|
49
|
+
|
|
51
50
|
const { isMuted, isPlaying, toggleMute, play, stop } = useBackgroundMusic({
|
|
52
51
|
src: recapMusic,
|
|
53
52
|
volume: 0.6,
|
|
@@ -55,24 +54,11 @@ function RecapStory({ recapData }: RecapStoryProps) {
|
|
|
55
54
|
loop: false,
|
|
56
55
|
});
|
|
57
56
|
|
|
58
|
-
// Handle intro duration updates
|
|
59
|
-
const handleIntroDurationCalculated = (duration: number) => {
|
|
60
|
-
setIntroDuration(duration);
|
|
61
|
-
setIsIntroDurationReady(true);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// Reset ready state when returning to intro slide
|
|
65
|
-
React.useEffect(() => {
|
|
66
|
-
if (activeIndex === 0) {
|
|
67
|
-
setIsIntroDurationReady(false);
|
|
68
|
-
}
|
|
69
|
-
}, [activeIndex]);
|
|
70
|
-
|
|
71
57
|
const isNewUser = recapData.businessCategory === BUSINESS_CATEGORIES.NEW_USER;
|
|
72
58
|
|
|
73
59
|
// Define slides with their durations (new-user only sees the intro)
|
|
74
60
|
const fullSlideSet = [
|
|
75
|
-
{ id: "intro", duration:
|
|
61
|
+
{ id: "intro", duration: durations.intro },
|
|
76
62
|
{ id: "days", duration: durations.days },
|
|
77
63
|
{ id: "revenue", duration: durations.revenue },
|
|
78
64
|
{ id: "orders", duration: durations.orders },
|
|
@@ -84,12 +70,52 @@ function RecapStory({ recapData }: RecapStoryProps) {
|
|
|
84
70
|
{ id: "final", duration: durations.final },
|
|
85
71
|
];
|
|
86
72
|
const slides = isNewUser
|
|
87
|
-
? [{ id: "intro", duration:
|
|
73
|
+
? [{ id: "intro", duration: durations.intro }]
|
|
88
74
|
: fullSlideSet;
|
|
89
75
|
|
|
90
76
|
const currentSlide = slides[activeIndex];
|
|
91
77
|
const isFinalSlide = currentSlide.id === "final";
|
|
92
78
|
|
|
79
|
+
// Pre-capture screenshot and show share button when ready
|
|
80
|
+
React.useEffect(() => {
|
|
81
|
+
// Hide share button immediately on slide change
|
|
82
|
+
setIsShareVisible(false);
|
|
83
|
+
|
|
84
|
+
if (isFinalSlide || !slidesContainerRef.current) return;
|
|
85
|
+
|
|
86
|
+
let isMounted = true;
|
|
87
|
+
|
|
88
|
+
// Wait for animations to complete, then pre-capture
|
|
89
|
+
const timer = setTimeout(async () => {
|
|
90
|
+
if (!isMounted || !slidesContainerRef.current) return;
|
|
91
|
+
|
|
92
|
+
try {
|
|
93
|
+
// Pre-capture the screenshot
|
|
94
|
+
await preCaptureSlide(slidesContainerRef.current, {
|
|
95
|
+
slideId: currentSlide.id,
|
|
96
|
+
businessName: recapData.businessName,
|
|
97
|
+
year: recapData.year ?? 2025,
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// Only show share button AFTER pre-capture is complete
|
|
101
|
+
if (isMounted) {
|
|
102
|
+
setIsShareVisible(true);
|
|
103
|
+
}
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.error('[RecapStory] Pre-capture failed:', error);
|
|
106
|
+
// Still show share button even if pre-capture fails (will fall back to download)
|
|
107
|
+
if (isMounted) {
|
|
108
|
+
setIsShareVisible(true);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}, 2500); // Wait 2.5s for all animations to complete
|
|
112
|
+
|
|
113
|
+
return () => {
|
|
114
|
+
isMounted = false;
|
|
115
|
+
clearTimeout(timer);
|
|
116
|
+
};
|
|
117
|
+
}, [activeIndex, currentSlide.id, recapData.businessName, recapData.year, isFinalSlide]);
|
|
118
|
+
|
|
93
119
|
// Ensure music plays only on slides 1-9 and stops immediately on the final slide
|
|
94
120
|
React.useEffect(() => {
|
|
95
121
|
if (isFinalSlide) {
|
|
@@ -97,10 +123,10 @@ function RecapStory({ recapData }: RecapStoryProps) {
|
|
|
97
123
|
return;
|
|
98
124
|
}
|
|
99
125
|
|
|
100
|
-
if (
|
|
126
|
+
if (!isPlaying) {
|
|
101
127
|
play();
|
|
102
128
|
}
|
|
103
|
-
}, [isFinalSlide,
|
|
129
|
+
}, [isFinalSlide, isPlaying, play, stop]);
|
|
104
130
|
|
|
105
131
|
// Stop music when reaching the final slide (safety net)
|
|
106
132
|
React.useEffect(() => {
|
|
@@ -122,7 +148,6 @@ function RecapStory({ recapData }: RecapStoryProps) {
|
|
|
122
148
|
|
|
123
149
|
const handleReplay = () => {
|
|
124
150
|
setActiveIndex(0);
|
|
125
|
-
setIsIntroDurationReady(false);
|
|
126
151
|
setIsPaused(false);
|
|
127
152
|
};
|
|
128
153
|
|
|
@@ -213,11 +238,17 @@ function RecapStory({ recapData }: RecapStoryProps) {
|
|
|
213
238
|
businessCategory={recapData.businessCategory}
|
|
214
239
|
introHeadline={recapData.introHeadline}
|
|
215
240
|
introSubtitle={recapData.introSubtitle}
|
|
216
|
-
|
|
241
|
+
frameImages={recapData.productImages}
|
|
217
242
|
/>
|
|
218
243
|
);
|
|
219
244
|
case "days":
|
|
220
|
-
return
|
|
245
|
+
return (
|
|
246
|
+
<Slide2Days
|
|
247
|
+
days={recapData.days}
|
|
248
|
+
streak={recapData.streak}
|
|
249
|
+
frameImages={recapData.productImages}
|
|
250
|
+
/>
|
|
251
|
+
);
|
|
221
252
|
case "revenue":
|
|
222
253
|
return (
|
|
223
254
|
<Slide3Revenue
|
|
@@ -227,16 +258,29 @@ function RecapStory({ recapData }: RecapStoryProps) {
|
|
|
227
258
|
/>
|
|
228
259
|
);
|
|
229
260
|
case "orders":
|
|
230
|
-
return
|
|
261
|
+
return (
|
|
262
|
+
<Slide4Orders
|
|
263
|
+
orders={recapData.orders}
|
|
264
|
+
frameImages={recapData.productImages}
|
|
265
|
+
/>
|
|
266
|
+
);
|
|
231
267
|
case "buyers":
|
|
232
268
|
return (
|
|
233
269
|
<Slide5Buyers
|
|
234
270
|
firstTimeBuyers={recapData.firstTimeBuyers}
|
|
235
271
|
repeatBuyers={recapData.repeatBuyers}
|
|
272
|
+
frameImages={recapData.productImages}
|
|
236
273
|
/>
|
|
237
274
|
);
|
|
238
275
|
case "customer":
|
|
239
|
-
return
|
|
276
|
+
return (
|
|
277
|
+
<Slide6Customer
|
|
278
|
+
websiteLink={recapData.websiteLink ?? ""}
|
|
279
|
+
websiteVisits={recapData.websiteVisits ?? 0}
|
|
280
|
+
mostViewedProduct={recapData.mostViewedProduct ?? ""}
|
|
281
|
+
mostViewedProductCount={recapData.mostViewedProductCount ?? 0}
|
|
282
|
+
/>
|
|
283
|
+
);
|
|
240
284
|
case "products":
|
|
241
285
|
return <Slide7Products products={recapData.topProducts} />;
|
|
242
286
|
case "months":
|
|
@@ -246,6 +290,7 @@ function RecapStory({ recapData }: RecapStoryProps) {
|
|
|
246
290
|
<Slide9Year
|
|
247
291
|
businessCategory={recapData.businessCategory}
|
|
248
292
|
year={recapData.year}
|
|
293
|
+
frameImages={recapData.productImages}
|
|
249
294
|
/>
|
|
250
295
|
);
|
|
251
296
|
case "final":
|
|
@@ -275,43 +320,26 @@ function RecapStory({ recapData }: RecapStoryProps) {
|
|
|
275
320
|
/>
|
|
276
321
|
</div>
|
|
277
322
|
|
|
278
|
-
{/* Progress bars
|
|
323
|
+
{/* Progress bars */}
|
|
279
324
|
<div className="recap-story__progress-wrap">
|
|
280
325
|
<div className="recap-story__progress">
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
/>
|
|
291
|
-
)}
|
|
326
|
+
<StoryProgress
|
|
327
|
+
total={slides.length}
|
|
328
|
+
active={activeIndex}
|
|
329
|
+
duration={currentSlide.duration}
|
|
330
|
+
onComplete={handleProgressComplete}
|
|
331
|
+
onBarClick={handleBarClick}
|
|
332
|
+
hideBorder={isFinalSlide}
|
|
333
|
+
isPaused={isPaused}
|
|
334
|
+
/>
|
|
292
335
|
</div>
|
|
293
|
-
|
|
294
|
-
{!isFinalSlide && recapData.isVideo !== true && (
|
|
295
|
-
<button
|
|
296
|
-
type="button"
|
|
297
|
-
className="recap-story__sound-toggle"
|
|
298
|
-
onClick={toggleMute}
|
|
299
|
-
aria-label={isMuted ? "Unmute sound" : "Mute sound"}
|
|
300
|
-
>
|
|
301
|
-
<img
|
|
302
|
-
src={isMuted ? soundOffIcon : soundOnIcon}
|
|
303
|
-
alt={isMuted ? "Unmute sound" : "Mute sound"}
|
|
304
|
-
className="recap-story__sound-icon"
|
|
305
|
-
draggable={false}
|
|
306
|
-
/>
|
|
307
|
-
</button>
|
|
308
|
-
)}
|
|
309
336
|
</div>
|
|
310
337
|
</div>
|
|
311
338
|
|
|
312
339
|
{/* Slide content with transitions */}
|
|
313
340
|
<div
|
|
314
341
|
className="recap-story__slides"
|
|
342
|
+
ref={slidesContainerRef}
|
|
315
343
|
onPointerDown={handlePointerDown}
|
|
316
344
|
onPointerUp={handlePointerUp}
|
|
317
345
|
onPointerLeave={handlePointerLeave}
|
|
@@ -330,6 +358,52 @@ function RecapStory({ recapData }: RecapStoryProps) {
|
|
|
330
358
|
</motion.div>
|
|
331
359
|
</AnimatePresence>
|
|
332
360
|
</div>
|
|
361
|
+
|
|
362
|
+
{/* Floating buttons - Sound and Share (only on slides 1-9, hidden for video and new users) */}
|
|
363
|
+
{!isFinalSlide && !recapData.isVideo && (
|
|
364
|
+
<>
|
|
365
|
+
{/* Sound button - always visible, independent of share state */}
|
|
366
|
+
<button
|
|
367
|
+
className="recap-story__floating-btn recap-story__sound-btn"
|
|
368
|
+
onClick={toggleMute}
|
|
369
|
+
aria-label={isMuted ? "Unmute" : "Mute"}
|
|
370
|
+
>
|
|
371
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
372
|
+
<path d="M1.66675 8.83333V11.1667C1.66675 13 2.50008 13.8333 4.33341 13.8333H5.51675C5.82508 13.8333 6.12508 13.9417 6.36675 14.1333L8.68341 16.0167C10.3167 17.4 12.5001 16.325 12.5001 14.2333V5.76667C12.5001 3.66667 10.3167 2.6 8.68341 3.98333L6.36675 5.86667C6.12508 6.05833 5.82508 6.16667 5.51675 6.16667H4.33341C2.50008 6.16667 1.66675 7 1.66675 8.83333Z" stroke="#4F4CD8" strokeWidth="1.5"/>
|
|
373
|
+
{!isMuted && (
|
|
374
|
+
<>
|
|
375
|
+
<path d="M15 6.66667C16.3834 8.30834 16.3834 11.7 15 13.3333" stroke="#4F4CD8" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
376
|
+
<path d="M16.825 4.58334C19.3917 7.59168 19.3917 12.4167 16.825 15.4167" stroke="#4F4CD8" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
|
|
377
|
+
</>
|
|
378
|
+
)}
|
|
379
|
+
</svg>
|
|
380
|
+
</button>
|
|
381
|
+
|
|
382
|
+
{/* Share button - fades in after counter animations (hidden for new users) */}
|
|
383
|
+
{!isNewUser && (
|
|
384
|
+
<button
|
|
385
|
+
className={`recap-story__floating-btn recap-story__share-btn ${isShareVisible ? 'recap-story__share-btn--visible' : ''}`}
|
|
386
|
+
onClick={() => {
|
|
387
|
+
// Call without await - the function handles sharing internally
|
|
388
|
+
// This preserves the user gesture chain for mobile Web Share API
|
|
389
|
+
captureAndShareSlide(slidesContainerRef.current, {
|
|
390
|
+
slideId: currentSlide.id,
|
|
391
|
+
businessName: recapData.businessName,
|
|
392
|
+
year: recapData.year ?? new Date().getFullYear(),
|
|
393
|
+
});
|
|
394
|
+
}}
|
|
395
|
+
aria-label="Share"
|
|
396
|
+
>
|
|
397
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
398
|
+
<path d="M13.7 7.4165C16.7 7.67484 17.925 9.2165 17.925 12.5915V12.6998C17.925 16.4248 16.4333 17.9165 12.7083 17.9165H7.28332C3.55832 17.9165 2.06665 16.4248 2.06665 12.6998V12.5915C2.06665 9.2415 3.27498 7.69984 6.22498 7.42484" stroke="#4F4CD8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
399
|
+
<path d="M10 12.4999V3.0166" stroke="#4F4CD8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
400
|
+
<path d="M12.7916 4.87516L9.99998 2.0835L7.20831 4.87516" stroke="#4F4CD8" strokeLinecap="round" strokeLinejoin="round"/>
|
|
401
|
+
</svg>
|
|
402
|
+
<span className="recap-story__share-text">Share</span>
|
|
403
|
+
</button>
|
|
404
|
+
)}
|
|
405
|
+
</>
|
|
406
|
+
)}
|
|
333
407
|
</div>
|
|
334
408
|
);
|
|
335
409
|
}
|
package/src/StoryProgress.css
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
width: 100%;
|
|
20
20
|
height: 100%;
|
|
21
21
|
background: transparent;
|
|
22
|
-
border: 0.5px solid rgba(
|
|
22
|
+
border: 0.5px solid rgba(55, 52, 211, 1);
|
|
23
23
|
border-radius: 2px;
|
|
24
24
|
overflow: hidden;
|
|
25
25
|
position: relative;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
.story-progress__bar.completed {
|
|
34
|
-
background: linear-gradient(90deg, #
|
|
34
|
+
background: linear-gradient(90deg, #4F4CD8 0%, #2A2872 100%);
|
|
35
35
|
border: none;
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
left: 0;
|
|
42
42
|
width: 100%;
|
|
43
43
|
height: 100%;
|
|
44
|
-
background: linear-gradient(90deg, #
|
|
44
|
+
background: linear-gradient(90deg, #4F4CD8 0%, #2A2872 100%);
|
|
45
45
|
transform-origin: left;
|
|
46
46
|
transform: scaleX(0);
|
|
47
47
|
}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
font-weight: 700;
|
|
24
24
|
font-size: clamp(14px, 5.13vw, 20px);
|
|
25
25
|
line-height: 1.2;
|
|
26
|
-
background-image: linear-gradient(90deg, #
|
|
26
|
+
background-image: linear-gradient(90deg, #2724A7 0%, #4F4CD8 100%);
|
|
27
27
|
-webkit-background-clip: text;
|
|
28
28
|
-webkit-text-fill-color: transparent;
|
|
29
29
|
background-clip: text;
|
|
@@ -44,3 +44,14 @@
|
|
|
44
44
|
background-size: 100%;
|
|
45
45
|
background-position: 0;
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
/* Screenshot mode - solid color fallback for gradient text */
|
|
49
|
+
.screenshot-mode .header__badge {
|
|
50
|
+
-webkit-text-fill-color: #4F4CD8 !important;
|
|
51
|
+
color: #4F4CD8 !important;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.screenshot-mode .header--new-user .header__badge {
|
|
55
|
+
-webkit-text-fill-color: #FF9900 !important;
|
|
56
|
+
color: #FF9900 !important;
|
|
57
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './Header.css';
|
|
3
|
-
import loginLogo from '../assets/login-logo.svg';
|
|
4
|
-
import slideLogo from '../assets/
|
|
3
|
+
import loginLogo from '../assets/huxxle-login-blue-logo.svg';
|
|
4
|
+
import slideLogo from '../assets/huxxle-blue-logo.svg';
|
|
5
5
|
import huxxleBlueLogo from '../assets/huxxle-blue-logo.svg';
|
|
6
6
|
|
|
7
7
|
interface HeaderProps {
|
package/src/data/mock.ts
CHANGED
|
@@ -9,15 +9,15 @@ export const mockRecapData: RecapData = {
|
|
|
9
9
|
businessName: "RICHYO ENTERPRISES",
|
|
10
10
|
days: 259,
|
|
11
11
|
streak: 47,
|
|
12
|
-
revenue:
|
|
12
|
+
revenue: 22594000,
|
|
13
13
|
orders: 487,
|
|
14
14
|
firstTimeBuyers: 234,
|
|
15
15
|
repeatBuyers: 65,
|
|
16
16
|
topCustomerName: "Micheal Scoffy",
|
|
17
|
-
currency: "
|
|
17
|
+
currency: "NGN",
|
|
18
18
|
year: 2025,
|
|
19
|
-
introHeadline: "You
|
|
20
|
-
introSubtitle: "
|
|
19
|
+
introHeadline: "This Year You Carry Your Hustle For Head",
|
|
20
|
+
introSubtitle: "Make we look the numbers 🔥",
|
|
21
21
|
topProducts: [
|
|
22
22
|
{
|
|
23
23
|
name: "Vanilla Yoghurt",
|
|
@@ -50,13 +50,25 @@ export const mockRecapData: RecapData = {
|
|
|
50
50
|
"https://images.unsplash.com/photo-1447078806655-40579c2520d6?auto=format&fit=crop&w=400&q=80",
|
|
51
51
|
},
|
|
52
52
|
],
|
|
53
|
+
productImages: [
|
|
54
|
+
"https://images.unsplash.com/photo-1447078806655-40579c2520d6?auto=format&fit=crop&w=400&q=80",
|
|
55
|
+
"https://images.unsplash.com/photo-1504674900247-0877df9cc836?auto=format&fit=crop&w=400&q=80",
|
|
56
|
+
"https://images.unsplash.com/photo-1506084868230-bb9d95c24759?auto=format&fit=crop&w=400&q=80",
|
|
57
|
+
"https://images.unsplash.com/photo-1447078806655-40579c2520d6?auto=format&fit=crop&w=400&q=80",
|
|
58
|
+
"https://images.unsplash.com/photo-1498837167922-ddd27525d352?auto=format&fit=crop&w=400&q=80",
|
|
59
|
+
"https://images.unsplash.com/photo-1470337458703-46ad1756a187?auto=format&fit=crop&w=400&q=80",
|
|
60
|
+
],
|
|
53
61
|
businessCategory: BUSINESS_CATEGORIES.THRIVING,
|
|
54
62
|
busiestMonth: "Oct",
|
|
55
63
|
videoUrl:
|
|
56
|
-
"https://katajereassets.blob.core.windows.net/sp-list-assets/
|
|
64
|
+
"https://katajereassets.blob.core.windows.net/sp-list-assets/recap_4e5f6a7b-8c9d-0e1f-2a3b-4c5d6e7f8a9b_b5aac4492a8b453fbdbdbc8ed96f04f0.mp4",
|
|
57
65
|
downloadUrl:
|
|
58
|
-
"https://api.huxxle.com/api/download?fileUrl=https://katajereassets.blob.core.windows.net/sp-list-assets/
|
|
59
|
-
isVideo:
|
|
66
|
+
"https://api.huxxle.com/api/download?fileUrl=https://katajereassets.blob.core.windows.net/sp-list-assets/recap_4e5f6a7b-8c9d-0e1f-2a3b-4c5d6e7f8a9b_b5aac4492a8b453fbdbdbc8ed96f04f0.mp4",
|
|
67
|
+
isVideo: false,
|
|
68
|
+
websiteLink: "https://vendor.huxxle.com",
|
|
69
|
+
websiteVisits: 123400,
|
|
70
|
+
mostViewedProduct: "Vanilla Yoghurt",
|
|
71
|
+
mostViewedProductCount: 567,
|
|
60
72
|
};
|
|
61
73
|
|
|
62
74
|
// Slide durations in seconds - each slide can have its own timing
|
package/src/index.ts
CHANGED
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
export { default as RecapApp } from './RecapApp';
|
|
16
16
|
export { default as RecapStory } from './RecapStory';
|
|
17
17
|
export { default as StoryProgress } from './StoryProgress';
|
|
18
|
-
export { default as FloatingFrames } from './FloatingFrames';
|
|
19
18
|
export { default as Header } from './components/Header';
|
|
20
19
|
|
|
21
20
|
// ============================================================================
|