@katajere/recap 1.0.12 → 1.0.14
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 +10 -10
- package/dist/RecapStory.d.ts +2 -2
- package/dist/RecapStory.d.ts.map +1 -1
- package/dist/RecapStory.js +121 -66
- package/dist/StoryProgress.d.ts +3 -2
- package/dist/StoryProgress.d.ts.map +1 -1
- package/dist/StoryProgress.js +66 -12
- package/dist/components/Header.d.ts +2 -1
- package/dist/components/Header.d.ts.map +1 -1
- package/dist/components/Header.js +3 -2
- package/dist/data/mock.d.ts +1 -1
- package/dist/data/mock.d.ts.map +1 -1
- package/dist/data/mock.js +24 -19
- package/dist/data/recapCopy.js +1 -1
- package/dist/slides/Slide10Final.d.ts +2 -1
- package/dist/slides/Slide10Final.d.ts.map +1 -1
- package/dist/slides/Slide10Final.js +8 -7
- package/dist/slides/Slide1Intro.css +44 -0
- package/dist/slides/Slide1Intro.d.ts +3 -1
- package/dist/slides/Slide1Intro.d.ts.map +1 -1
- package/dist/slides/Slide1Intro.js +11 -4
- package/dist/slides/Slide3Revenue.d.ts +2 -1
- package/dist/slides/Slide3Revenue.d.ts.map +1 -1
- package/dist/slides/Slide3Revenue.js +2 -2
- package/dist/slides/Slide9Year.d.ts +2 -1
- package/dist/slides/Slide9Year.d.ts.map +1 -1
- package/dist/slides/Slide9Year.js +4 -2
- package/dist/types.d.ts +6 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/format.d.ts +5 -2
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/format.js +7 -4
- package/package.json +1 -1
- package/src/App.css +10 -10
- package/src/RecapStory.tsx +157 -89
- package/src/StoryProgress.tsx +96 -21
- package/src/components/Header.tsx +4 -2
- package/src/data/mock.ts +32 -20
- package/src/data/recapCopy.ts +1 -1
- package/src/slides/Slide10Final.tsx +9 -6
- package/src/slides/Slide1Intro.css +44 -0
- package/src/slides/Slide1Intro.tsx +27 -4
- package/src/slides/Slide3Revenue.tsx +3 -2
- package/src/slides/Slide9Year.tsx +5 -2
- package/src/types.ts +6 -0
- package/src/utils/format.ts +7 -4
package/dist/App.css
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
:root {
|
|
4
4
|
--frame-ar-num: 9;
|
|
5
|
-
--frame-ar-den:
|
|
6
|
-
--frame-ar: 9 /
|
|
5
|
+
--frame-ar-den: 16;
|
|
6
|
+
--frame-ar: 9 / 16;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
* {
|
|
@@ -60,8 +60,8 @@ body {
|
|
|
60
60
|
aspect-ratio: var(--frame-ar);
|
|
61
61
|
width: min(100%, calc(100dvh * var(--frame-ar-num) / var(--frame-ar-den)));
|
|
62
62
|
height: min(100dvh, calc(100vw * var(--frame-ar-den) / var(--frame-ar-num)));
|
|
63
|
-
max-width:
|
|
64
|
-
max-height:
|
|
63
|
+
max-width: 1080px;
|
|
64
|
+
max-height: 1920px;
|
|
65
65
|
background: linear-gradient(180deg, #3F3DAD 0%, #CC6240 100%);
|
|
66
66
|
/* border-radius: clamp(0px, 2vw, 24px); */
|
|
67
67
|
overflow: hidden;
|
|
@@ -72,14 +72,14 @@ body {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/* Fallback for browsers without aspect-ratio support */
|
|
75
|
-
@supports not (aspect-ratio: 9 /
|
|
75
|
+
@supports not (aspect-ratio: 9 / 16) {
|
|
76
76
|
.app__shell {
|
|
77
77
|
width: 100vw;
|
|
78
78
|
height: calc(100vw * var(--frame-ar-den) / var(--frame-ar-num));
|
|
79
79
|
max-height: 100dvh;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
@media (min-aspect-ratio: 9/
|
|
82
|
+
@media (min-aspect-ratio: 9/16) {
|
|
83
83
|
.app__shell {
|
|
84
84
|
width: calc(100dvh * var(--frame-ar-num) / var(--frame-ar-den));
|
|
85
85
|
height: 100dvh;
|
|
@@ -88,7 +88,7 @@ body {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
/* Mobile - remove border radius and shadow */
|
|
91
|
-
@media (max-width:
|
|
91
|
+
@media (max-width: 600px) {
|
|
92
92
|
.app {
|
|
93
93
|
background: linear-gradient(180deg, #3F3DAD 0%, #CC6240 100%);
|
|
94
94
|
padding: 0;
|
|
@@ -101,10 +101,10 @@ body {
|
|
|
101
101
|
.app__shell {
|
|
102
102
|
/* border-radius: 0; */
|
|
103
103
|
box-shadow: none;
|
|
104
|
-
width:
|
|
104
|
+
width: 100vw;
|
|
105
105
|
height: 100dvh;
|
|
106
|
-
max-width:
|
|
107
|
-
max-height:
|
|
106
|
+
max-width: 100vw;
|
|
107
|
+
max-height: 100dvh;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
package/dist/RecapStory.d.ts
CHANGED
package/dist/RecapStory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RecapStory.d.ts","sourceRoot":"","sources":["../src/RecapStory.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAuB,SAAS,EAAE,MAAM,SAAS,CAAC;AAKzD,OAAO,kBAAkB,CAAC;AAE1B,UAAU,eAAe;IACvB,SAAS,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"RecapStory.d.ts","sourceRoot":"","sources":["../src/RecapStory.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAAuB,SAAS,EAAE,MAAM,SAAS,CAAC;AAKzD,OAAO,kBAAkB,CAAC;AAE1B,UAAU,eAAe;IACvB,SAAS,EAAE,SAAS,CAAC;CACtB;AAED;;GAEG;AACH,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,EAAE,eAAe,2CAgTjD;AAED,eAAe,UAAU,CAAC"}
|
package/dist/RecapStory.js
CHANGED
|
@@ -1,38 +1,50 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { useState } from
|
|
3
|
-
import { AnimatePresence, motion } from
|
|
4
|
-
import StoryProgress from
|
|
5
|
-
import Header from
|
|
6
|
-
import Slide1Intro from
|
|
7
|
-
import Slide2Days from
|
|
8
|
-
import Slide3Revenue from
|
|
9
|
-
import Slide4Orders from
|
|
10
|
-
import Slide5Buyers from
|
|
11
|
-
import Slide6Customer from
|
|
12
|
-
import Slide7Products from
|
|
13
|
-
import Slide8Months from
|
|
14
|
-
import Slide9Year from
|
|
15
|
-
import Slide10Final from
|
|
16
|
-
import { slideVariants } from
|
|
17
|
-
import { slideDurations } from
|
|
18
|
-
import { BUSINESS_CATEGORIES } from
|
|
19
|
-
import { useBackgroundMusic } from
|
|
20
|
-
import soundOnIcon from
|
|
21
|
-
import soundOffIcon from
|
|
22
|
-
import recapMusic from
|
|
23
|
-
import
|
|
2
|
+
import React, { useState, useRef } from "react";
|
|
3
|
+
import { AnimatePresence, motion } from "framer-motion";
|
|
4
|
+
import StoryProgress from "./StoryProgress";
|
|
5
|
+
import Header from "./components/Header";
|
|
6
|
+
import Slide1Intro from "./slides/Slide1Intro";
|
|
7
|
+
import Slide2Days from "./slides/Slide2Days";
|
|
8
|
+
import Slide3Revenue from "./slides/Slide3Revenue";
|
|
9
|
+
import Slide4Orders from "./slides/Slide4Orders";
|
|
10
|
+
import Slide5Buyers from "./slides/Slide5Buyers";
|
|
11
|
+
import Slide6Customer from "./slides/Slide6Customer";
|
|
12
|
+
import Slide7Products from "./slides/Slide7Products";
|
|
13
|
+
import Slide8Months from "./slides/Slide8Months";
|
|
14
|
+
import Slide9Year from "./slides/Slide9Year";
|
|
15
|
+
import Slide10Final from "./slides/Slide10Final";
|
|
16
|
+
import { slideVariants } from "./utils";
|
|
17
|
+
import { slideDurations as defaultDurations } from "./data/mock";
|
|
18
|
+
import { BUSINESS_CATEGORIES } from "./types";
|
|
19
|
+
import { useBackgroundMusic } from "./hooks/useBackgroundMusic";
|
|
20
|
+
import soundOnIcon from "./assets/sound-on.svg";
|
|
21
|
+
import soundOffIcon from "./assets/sound-off.svg";
|
|
22
|
+
import recapMusic from "./assets/recap-music.mp3";
|
|
23
|
+
import "./RecapStory.css";
|
|
24
24
|
/**
|
|
25
25
|
* RecapStory - Story container with header, progress bars, and slide transitions
|
|
26
26
|
*/
|
|
27
27
|
function RecapStory({ recapData }) {
|
|
28
28
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
29
|
-
const
|
|
29
|
+
const durations = recapData.slideDurations || defaultDurations;
|
|
30
|
+
const [introDuration, setIntroDuration] = useState(durations.intro);
|
|
30
31
|
const [isIntroDurationReady, setIsIntroDurationReady] = useState(false);
|
|
32
|
+
const [isPaused, setIsPaused] = useState(false);
|
|
33
|
+
const holdTimerRef = useRef(null);
|
|
34
|
+
const isHoldingRef = useRef(false);
|
|
35
|
+
// Cleanup on unmount to prevent memory leaks
|
|
36
|
+
React.useEffect(() => {
|
|
37
|
+
return () => {
|
|
38
|
+
if (holdTimerRef.current) {
|
|
39
|
+
clearTimeout(holdTimerRef.current);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
31
43
|
const { isMuted, isPlaying, toggleMute, play, stop } = useBackgroundMusic({
|
|
32
44
|
src: recapMusic,
|
|
33
45
|
volume: 0.6,
|
|
34
46
|
autoPlay: true,
|
|
35
|
-
loop: false
|
|
47
|
+
loop: false,
|
|
36
48
|
});
|
|
37
49
|
// Handle intro duration updates
|
|
38
50
|
const handleIntroDurationCalculated = (duration) => {
|
|
@@ -48,20 +60,22 @@ function RecapStory({ recapData }) {
|
|
|
48
60
|
const isNewUser = recapData.businessCategory === BUSINESS_CATEGORIES.NEW_USER;
|
|
49
61
|
// Define slides with their durations (new-user only sees the intro)
|
|
50
62
|
const fullSlideSet = [
|
|
51
|
-
{ id:
|
|
52
|
-
{ id:
|
|
53
|
-
{ id:
|
|
54
|
-
{ id:
|
|
55
|
-
{ id:
|
|
56
|
-
{ id:
|
|
57
|
-
{ id:
|
|
58
|
-
{ id:
|
|
59
|
-
{ id:
|
|
60
|
-
{ id:
|
|
63
|
+
{ id: "intro", duration: introDuration },
|
|
64
|
+
{ id: "days", duration: durations.days },
|
|
65
|
+
{ id: "revenue", duration: durations.revenue },
|
|
66
|
+
{ id: "orders", duration: durations.orders },
|
|
67
|
+
{ id: "buyers", duration: durations.buyers },
|
|
68
|
+
{ id: "customer", duration: durations.customer },
|
|
69
|
+
{ id: "products", duration: durations.products },
|
|
70
|
+
{ id: "months", duration: durations.months },
|
|
71
|
+
{ id: "year", duration: durations.year },
|
|
72
|
+
{ id: "final", duration: durations.final },
|
|
61
73
|
];
|
|
62
|
-
const slides = isNewUser
|
|
74
|
+
const slides = isNewUser
|
|
75
|
+
? [{ id: "intro", duration: introDuration }]
|
|
76
|
+
: fullSlideSet;
|
|
63
77
|
const currentSlide = slides[activeIndex];
|
|
64
|
-
const isFinalSlide = currentSlide.id ===
|
|
78
|
+
const isFinalSlide = currentSlide.id === "final";
|
|
65
79
|
// Ensure music plays only on slides 1-9 and stops immediately on the final slide
|
|
66
80
|
React.useEffect(() => {
|
|
67
81
|
if (isFinalSlide) {
|
|
@@ -83,68 +97,109 @@ function RecapStory({ recapData }) {
|
|
|
83
97
|
return;
|
|
84
98
|
}
|
|
85
99
|
if (activeIndex < slides.length - 1) {
|
|
86
|
-
setActiveIndex(prev => prev + 1);
|
|
100
|
+
setActiveIndex((prev) => prev + 1);
|
|
101
|
+
setIsPaused(false);
|
|
87
102
|
}
|
|
88
103
|
};
|
|
89
104
|
const handleReplay = () => {
|
|
90
105
|
setActiveIndex(0);
|
|
91
106
|
setIsIntroDurationReady(false);
|
|
107
|
+
setIsPaused(false);
|
|
92
108
|
};
|
|
93
109
|
// Jump to specific slide when bar is clicked
|
|
94
110
|
const handleBarClick = (index) => {
|
|
95
111
|
setActiveIndex(index);
|
|
112
|
+
setIsPaused(false);
|
|
113
|
+
};
|
|
114
|
+
// Handle hold to pause
|
|
115
|
+
const handlePointerDown = (event) => {
|
|
116
|
+
// Ignore if on interactive elements
|
|
117
|
+
const target = event.target;
|
|
118
|
+
if (target.tagName === "BUTTON" || target.closest("button")) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
isHoldingRef.current = false;
|
|
122
|
+
// Start hold timer - pause after 150ms of holding
|
|
123
|
+
holdTimerRef.current = setTimeout(() => {
|
|
124
|
+
isHoldingRef.current = true;
|
|
125
|
+
setIsPaused(true);
|
|
126
|
+
}, 150);
|
|
96
127
|
};
|
|
97
|
-
|
|
98
|
-
|
|
128
|
+
const handlePointerUp = (event) => {
|
|
129
|
+
// Clear hold timer
|
|
130
|
+
if (holdTimerRef.current) {
|
|
131
|
+
clearTimeout(holdTimerRef.current);
|
|
132
|
+
holdTimerRef.current = null;
|
|
133
|
+
}
|
|
134
|
+
// If was holding, just unpause and don't navigate
|
|
135
|
+
if (isHoldingRef.current) {
|
|
136
|
+
isHoldingRef.current = false;
|
|
137
|
+
setIsPaused(false);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
99
140
|
// Ignore clicks on interactive elements
|
|
100
141
|
const target = event.target;
|
|
101
|
-
if (target.tagName ===
|
|
142
|
+
if (target.tagName === "BUTTON" || target.closest("button")) {
|
|
102
143
|
return;
|
|
103
144
|
}
|
|
104
145
|
const container = event.currentTarget;
|
|
105
146
|
const rect = container.getBoundingClientRect();
|
|
106
147
|
const tapX = event.clientX - rect.left;
|
|
107
148
|
const screenWidth = rect.width;
|
|
108
|
-
// Left
|
|
109
|
-
if (tapX < screenWidth
|
|
149
|
+
// Left 20% of screen = previous slide
|
|
150
|
+
if (tapX < screenWidth * 0.2) {
|
|
110
151
|
if (activeIndex > 0) {
|
|
111
|
-
setActiveIndex(prev => prev - 1);
|
|
152
|
+
setActiveIndex((prev) => prev - 1);
|
|
153
|
+
setIsPaused(false);
|
|
112
154
|
}
|
|
113
155
|
}
|
|
114
|
-
// Right
|
|
115
|
-
else {
|
|
156
|
+
// Right 20% of screen = next slide
|
|
157
|
+
else if (tapX > screenWidth * 0.8) {
|
|
116
158
|
if (!isFinalSlide && activeIndex < slides.length - 1) {
|
|
117
|
-
setActiveIndex(prev => prev + 1);
|
|
159
|
+
setActiveIndex((prev) => prev + 1);
|
|
160
|
+
setIsPaused(false);
|
|
118
161
|
}
|
|
119
162
|
}
|
|
163
|
+
// Middle 60% = no navigation, just tap (already handled by hold logic)
|
|
164
|
+
};
|
|
165
|
+
const handlePointerLeave = () => {
|
|
166
|
+
// Clear hold timer and unpause if leaving
|
|
167
|
+
if (holdTimerRef.current) {
|
|
168
|
+
clearTimeout(holdTimerRef.current);
|
|
169
|
+
holdTimerRef.current = null;
|
|
170
|
+
}
|
|
171
|
+
if (isHoldingRef.current) {
|
|
172
|
+
isHoldingRef.current = false;
|
|
173
|
+
setIsPaused(false);
|
|
174
|
+
}
|
|
120
175
|
};
|
|
121
176
|
// Render current slide content
|
|
122
177
|
const renderSlide = () => {
|
|
123
178
|
switch (currentSlide.id) {
|
|
124
|
-
case
|
|
125
|
-
return (_jsx(Slide1Intro, { businessName: recapData.businessName, businessCategory: recapData.businessCategory, onDurationCalculated: handleIntroDurationCalculated }));
|
|
126
|
-
case
|
|
127
|
-
return
|
|
128
|
-
case
|
|
129
|
-
return (_jsx(Slide3Revenue, { revenue: recapData.revenue, businessCategory: recapData.businessCategory }));
|
|
130
|
-
case
|
|
131
|
-
return
|
|
132
|
-
case
|
|
179
|
+
case "intro":
|
|
180
|
+
return (_jsx(Slide1Intro, { businessName: recapData.businessName, businessCategory: recapData.businessCategory, introHeadline: recapData.introHeadline, introSubtitle: recapData.introSubtitle, onDurationCalculated: handleIntroDurationCalculated }));
|
|
181
|
+
case "days":
|
|
182
|
+
return _jsx(Slide2Days, { days: recapData.days, streak: recapData.streak });
|
|
183
|
+
case "revenue":
|
|
184
|
+
return (_jsx(Slide3Revenue, { revenue: recapData.revenue, currency: recapData.currency, businessCategory: recapData.businessCategory }));
|
|
185
|
+
case "orders":
|
|
186
|
+
return _jsx(Slide4Orders, { orders: recapData.orders });
|
|
187
|
+
case "buyers":
|
|
133
188
|
return (_jsx(Slide5Buyers, { firstTimeBuyers: recapData.firstTimeBuyers, repeatBuyers: recapData.repeatBuyers }));
|
|
134
|
-
case
|
|
135
|
-
return
|
|
136
|
-
case
|
|
137
|
-
return
|
|
138
|
-
case
|
|
139
|
-
return
|
|
140
|
-
case
|
|
141
|
-
return (_jsx(Slide9Year, { businessCategory: recapData.businessCategory }));
|
|
142
|
-
case
|
|
143
|
-
return (_jsx(Slide10Final, { videoUrl: recapData.videoUrl, downloadUrl: recapData.downloadUrl, onReplay: handleReplay }));
|
|
189
|
+
case "customer":
|
|
190
|
+
return _jsx(Slide6Customer, { customerName: recapData.topCustomerName });
|
|
191
|
+
case "products":
|
|
192
|
+
return _jsx(Slide7Products, { products: recapData.topProducts });
|
|
193
|
+
case "months":
|
|
194
|
+
return _jsx(Slide8Months, { busiestMonth: recapData.busiestMonth });
|
|
195
|
+
case "year":
|
|
196
|
+
return (_jsx(Slide9Year, { businessCategory: recapData.businessCategory, year: recapData.year }));
|
|
197
|
+
case "final":
|
|
198
|
+
return (_jsx(Slide10Final, { videoUrl: recapData.videoUrl, downloadUrl: recapData.downloadUrl, year: recapData.year, onReplay: handleReplay }));
|
|
144
199
|
default:
|
|
145
200
|
return null;
|
|
146
201
|
}
|
|
147
202
|
};
|
|
148
|
-
return (_jsxs("div", { className: "recap-story", children: [_jsxs("div", { className: "recap-story__top-group", children: [_jsx("div", { className: "recap-story__header-wrapper", children: _jsx(Header, { showRecapBadge: true, badgeVariant: isNewUser ?
|
|
203
|
+
return (_jsxs("div", { className: "recap-story", children: [_jsxs("div", { className: "recap-story__top-group", children: [_jsx("div", { className: "recap-story__header-wrapper", children: _jsx(Header, { showRecapBadge: true, badgeVariant: isNewUser ? "new-user" : "default", year: recapData.year }) }), _jsxs("div", { className: "recap-story__progress-wrap", children: [_jsx("div", { className: "recap-story__progress", children: (activeIndex !== 0 || isIntroDurationReady) && (_jsx(StoryProgress, { total: slides.length, active: activeIndex, duration: currentSlide.duration, onComplete: handleProgressComplete, onBarClick: handleBarClick, hideBorder: isFinalSlide, isPaused: isPaused })) }), !isFinalSlide && recapData.isVideo !== true && (_jsx("button", { type: "button", className: "recap-story__sound-toggle", onClick: toggleMute, "aria-label": isMuted ? "Unmute sound" : "Mute sound", children: _jsx("img", { src: isMuted ? soundOffIcon : soundOnIcon, alt: isMuted ? "Unmute sound" : "Mute sound", className: "recap-story__sound-icon", draggable: false }) }))] })] }), _jsx("div", { className: "recap-story__slides", onPointerDown: handlePointerDown, onPointerUp: handlePointerUp, onPointerLeave: handlePointerLeave, onPointerCancel: handlePointerLeave, children: _jsx(AnimatePresence, { mode: "wait", children: _jsx(motion.div, { variants: slideVariants, initial: "initial", animate: "animate", exit: "exit", className: "recap-story__slide", children: renderSlide() }, currentSlide.id) }) })] }));
|
|
149
204
|
}
|
|
150
205
|
export default RecapStory;
|
package/dist/StoryProgress.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./StoryProgress.css";
|
|
2
2
|
interface StoryProgressProps {
|
|
3
3
|
total: number;
|
|
4
4
|
active: number;
|
|
@@ -6,10 +6,11 @@ interface StoryProgressProps {
|
|
|
6
6
|
onComplete: () => void;
|
|
7
7
|
onBarClick: (index: number) => void;
|
|
8
8
|
hideBorder?: boolean;
|
|
9
|
+
isPaused?: boolean;
|
|
9
10
|
}
|
|
10
11
|
/**
|
|
11
12
|
* StoryProgress - Story-style progress bars at the top
|
|
12
13
|
*/
|
|
13
|
-
declare function StoryProgress({ total, active, duration, onComplete, onBarClick, hideBorder }: StoryProgressProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function StoryProgress({ total, active, duration, onComplete, onBarClick, hideBorder, isPaused, }: StoryProgressProps): import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export default StoryProgress;
|
|
15
16
|
//# sourceMappingURL=StoryProgress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoryProgress.d.ts","sourceRoot":"","sources":["../src/StoryProgress.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StoryProgress.d.ts","sourceRoot":"","sources":["../src/StoryProgress.tsx"],"names":[],"mappings":"AACA,OAAO,qBAAqB,CAAC;AAE7B,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,iBAAS,aAAa,CAAC,EACrB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,QAAQ,GACT,EAAE,kBAAkB,2CA4GpB;AAED,eAAe,aAAa,CAAC"}
|
package/dist/StoryProgress.js
CHANGED
|
@@ -1,23 +1,77 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from
|
|
3
|
-
import
|
|
4
|
-
import './StoryProgress.css';
|
|
2
|
+
import { useEffect, useState, useRef } from "react";
|
|
3
|
+
import "./StoryProgress.css";
|
|
5
4
|
/**
|
|
6
5
|
* StoryProgress - Story-style progress bars at the top
|
|
7
6
|
*/
|
|
8
|
-
function StoryProgress({ total, active, duration, onComplete, onBarClick, hideBorder }) {
|
|
9
|
-
const [
|
|
10
|
-
|
|
7
|
+
function StoryProgress({ total, active, duration, onComplete, onBarClick, hideBorder, isPaused, }) {
|
|
8
|
+
const [progress, setProgress] = useState(0);
|
|
9
|
+
const progressRef = useRef(0);
|
|
10
|
+
const startTimeRef = useRef(0);
|
|
11
|
+
const pausedProgressRef = useRef(0);
|
|
12
|
+
const animationFrameRef = useRef(null);
|
|
13
|
+
const onCompleteRef = useRef(onComplete);
|
|
14
|
+
// Keep onComplete ref up to date
|
|
11
15
|
useEffect(() => {
|
|
12
|
-
|
|
16
|
+
onCompleteRef.current = onComplete;
|
|
17
|
+
}, [onComplete]);
|
|
18
|
+
// Reset progress when active slide changes
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setProgress(0);
|
|
21
|
+
progressRef.current = 0;
|
|
22
|
+
pausedProgressRef.current = 0;
|
|
23
|
+
startTimeRef.current = performance.now();
|
|
13
24
|
}, [active]);
|
|
14
|
-
|
|
25
|
+
// Animation loop with pause support
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (isPaused) {
|
|
28
|
+
// Save current progress when pausing
|
|
29
|
+
pausedProgressRef.current = progressRef.current;
|
|
30
|
+
if (animationFrameRef.current) {
|
|
31
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
32
|
+
animationFrameRef.current = null;
|
|
33
|
+
}
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// Resume from paused progress
|
|
37
|
+
startTimeRef.current = performance.now();
|
|
38
|
+
const startProgress = pausedProgressRef.current;
|
|
39
|
+
if (startProgress >= 1) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (startProgress >= 1) {
|
|
43
|
+
setProgress(1);
|
|
44
|
+
onCompleteRef.current();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const remainingDuration = duration * (1 - startProgress) * 1000;
|
|
48
|
+
const animate = (currentTime) => {
|
|
49
|
+
const elapsed = currentTime - startTimeRef.current;
|
|
50
|
+
const newProgress = startProgress + (elapsed / remainingDuration) * (1 - startProgress);
|
|
51
|
+
if (newProgress >= 1) {
|
|
52
|
+
progressRef.current = 1;
|
|
53
|
+
setProgress(1);
|
|
54
|
+
onCompleteRef.current();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
progressRef.current = newProgress;
|
|
58
|
+
setProgress(newProgress);
|
|
59
|
+
animationFrameRef.current = requestAnimationFrame(animate);
|
|
60
|
+
};
|
|
61
|
+
animationFrameRef.current = requestAnimationFrame(animate);
|
|
62
|
+
return () => {
|
|
63
|
+
if (animationFrameRef.current) {
|
|
64
|
+
cancelAnimationFrame(animationFrameRef.current);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}, [isPaused, duration, active]);
|
|
68
|
+
return (_jsx("div", { className: `story-progress${hideBorder ? " story-progress--no-border" : ""}`, children: Array.from({ length: total }).map((_, index) => {
|
|
15
69
|
const isActive = index === active;
|
|
16
70
|
const isCompleted = index < active;
|
|
17
|
-
return (_jsx("div", { className: "story-progress__bar-container", onClick: () => onBarClick(index), children: _jsx("div", { className: `story-progress__bar ${isCompleted ?
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
71
|
+
return (_jsx("div", { className: "story-progress__bar-container", onClick: () => onBarClick(index), children: _jsx("div", { className: `story-progress__bar ${isCompleted ? "completed" : ""}`, children: isActive && (_jsx("div", { className: "story-progress__bar-fill", style: {
|
|
72
|
+
transform: `scaleX(${progress})`,
|
|
73
|
+
transformOrigin: "left",
|
|
74
|
+
} })) }) }, index));
|
|
21
75
|
}) }));
|
|
22
76
|
}
|
|
23
77
|
export default StoryProgress;
|
|
@@ -2,11 +2,12 @@ import './Header.css';
|
|
|
2
2
|
interface HeaderProps {
|
|
3
3
|
showRecapBadge?: boolean;
|
|
4
4
|
badgeVariant?: 'default' | 'new-user';
|
|
5
|
+
year?: number;
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
8
|
* Header - Top navigation with logo and optional Recap 25' badge
|
|
8
9
|
* Uses different logos for login/OTP screens vs recap slides
|
|
9
10
|
*/
|
|
10
|
-
declare function Header({ showRecapBadge, badgeVariant }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function Header({ showRecapBadge, badgeVariant, year }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export default Header;
|
|
12
13
|
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAKtB,UAAU,WAAW;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AACA,OAAO,cAAc,CAAC;AAKtB,UAAU,WAAW;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,iBAAS,MAAM,CAAC,EAAE,cAAsB,EAAE,YAAwB,EAAE,IAAW,EAAE,EAAE,WAAW,2CAwB7F;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -7,12 +7,13 @@ import huxxleBlueLogo from '../assets/huxxle-blue-logo.svg';
|
|
|
7
7
|
* Header - Top navigation with logo and optional Recap 25' badge
|
|
8
8
|
* Uses different logos for login/OTP screens vs recap slides
|
|
9
9
|
*/
|
|
10
|
-
function Header({ showRecapBadge = false, badgeVariant = 'default' }) {
|
|
10
|
+
function Header({ showRecapBadge = false, badgeVariant = 'default', year = 2025 }) {
|
|
11
11
|
const logoSrc = showRecapBadge
|
|
12
12
|
? badgeVariant === 'new-user'
|
|
13
13
|
? huxxleBlueLogo
|
|
14
14
|
: slideLogo
|
|
15
15
|
: loginLogo;
|
|
16
|
+
const shortYear = year.toString().slice(-2);
|
|
16
17
|
const headerClasses = ['header'];
|
|
17
18
|
if (showRecapBadge) {
|
|
18
19
|
headerClasses.push('header--with-badge');
|
|
@@ -20,6 +21,6 @@ function Header({ showRecapBadge = false, badgeVariant = 'default' }) {
|
|
|
20
21
|
if (badgeVariant === 'new-user') {
|
|
21
22
|
headerClasses.push('header--new-user');
|
|
22
23
|
}
|
|
23
|
-
return (_jsxs("header", { className: headerClasses.join(' '), children: [_jsx("img", { src: logoSrc, alt: "Huxxle", className: "header__logo" }), showRecapBadge && (
|
|
24
|
+
return (_jsxs("header", { className: headerClasses.join(' '), children: [_jsx("img", { src: logoSrc, alt: "Huxxle", className: "header__logo" }), showRecapBadge && (_jsxs("div", { className: "header__badge", children: ["Recap ", shortYear, "'"] }))] }));
|
|
24
25
|
}
|
|
25
26
|
export default Header;
|
package/dist/data/mock.d.ts
CHANGED
package/dist/data/mock.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"mock.d.ts","sourceRoot":"","sources":["../../src/data/mock.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,SAoD3B,CAAC;AAGF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAWjD,CAAC"}
|
package/dist/data/mock.js
CHANGED
|
@@ -1,48 +1,53 @@
|
|
|
1
|
-
import { BUSINESS_CATEGORIES } from
|
|
1
|
+
import { BUSINESS_CATEGORIES } from "../types";
|
|
2
2
|
/**
|
|
3
3
|
* Mock data for the recap experience
|
|
4
4
|
* This will be replaced with real API data later
|
|
5
5
|
*/
|
|
6
6
|
export const mockRecapData = {
|
|
7
|
-
businessName:
|
|
7
|
+
businessName: "RICHYO ENTERPRISES",
|
|
8
8
|
days: 259,
|
|
9
9
|
streak: 47,
|
|
10
|
-
revenue:
|
|
10
|
+
revenue: 22594,
|
|
11
11
|
orders: 487,
|
|
12
12
|
firstTimeBuyers: 234,
|
|
13
13
|
repeatBuyers: 65,
|
|
14
|
-
topCustomerName:
|
|
14
|
+
topCustomerName: "Micheal Scoffy",
|
|
15
|
+
currency: "GBP",
|
|
16
|
+
year: 2025,
|
|
17
|
+
introHeadline: "You Be New Face OOO....",
|
|
18
|
+
introSubtitle: "Come back for 6 days time, we dey for you 😉",
|
|
15
19
|
topProducts: [
|
|
16
20
|
{
|
|
17
|
-
name:
|
|
21
|
+
name: "Vanilla Yoghurt",
|
|
18
22
|
units: 45,
|
|
19
|
-
productImage:
|
|
23
|
+
productImage: "https://images.unsplash.com/photo-1447078806655-40579c2520d6?auto=format&fit=crop&w=400&q=80",
|
|
20
24
|
},
|
|
21
25
|
{
|
|
22
|
-
name:
|
|
26
|
+
name: "Cocoa Milkshake",
|
|
23
27
|
units: 38,
|
|
24
|
-
productImage:
|
|
28
|
+
productImage: "https://images.unsplash.com/photo-1504674900247-0877df9cc836?auto=format&fit=crop&w=400&q=80",
|
|
25
29
|
},
|
|
26
30
|
{
|
|
27
|
-
name:
|
|
31
|
+
name: "Spicy Crunch",
|
|
28
32
|
units: 33,
|
|
29
|
-
productImage:
|
|
33
|
+
productImage: "https://images.unsplash.com/photo-1447078806655-40579c2520d6?auto=format&fit=crop&w=400&q=80",
|
|
30
34
|
},
|
|
31
35
|
{
|
|
32
|
-
name:
|
|
36
|
+
name: "Fresh Plantain Chips",
|
|
33
37
|
units: 29,
|
|
34
|
-
productImage:
|
|
38
|
+
productImage: "https://images.unsplash.com/photo-1506084868230-bb9d95c24759?auto=format&fit=crop&w=400&q=80",
|
|
35
39
|
},
|
|
36
40
|
{
|
|
37
|
-
name:
|
|
41
|
+
name: "Mango Juice",
|
|
38
42
|
units: 27,
|
|
39
|
-
productImage:
|
|
40
|
-
}
|
|
43
|
+
productImage: "https://images.unsplash.com/photo-1447078806655-40579c2520d6?auto=format&fit=crop&w=400&q=80",
|
|
44
|
+
},
|
|
41
45
|
],
|
|
42
46
|
businessCategory: BUSINESS_CATEGORIES.THRIVING,
|
|
43
|
-
busiestMonth:
|
|
44
|
-
videoUrl:
|
|
45
|
-
downloadUrl:
|
|
47
|
+
busiestMonth: "Oct",
|
|
48
|
+
videoUrl: "https://katajereassets.blob.core.windows.net/sp-list-assets/mocksite_walkthrough_a75c98dd-47ef-4f2c-a97c-ab2b3c3c97a5_2315a6b2d671d142f34e08cad43929c5.mp4",
|
|
49
|
+
downloadUrl: "https://api.huxxle.com/api/download?fileUrl=https://katajereassets.blob.core.windows.net/sp-list-assets/mocksite_walkthrough_a75c98dd-47ef-4f2c-a97c-ab2b3c3c97a5_2315a6b2d671d142f34e08cad43929c5.mp4",
|
|
50
|
+
isVideo: true
|
|
46
51
|
};
|
|
47
52
|
// Slide durations in seconds - each slide can have its own timing
|
|
48
53
|
export const slideDurations = {
|
|
@@ -55,5 +60,5 @@ export const slideDurations = {
|
|
|
55
60
|
products: 8,
|
|
56
61
|
months: 8,
|
|
57
62
|
year: 8,
|
|
58
|
-
final: 8
|
|
63
|
+
final: 8,
|
|
59
64
|
};
|
package/dist/data/recapCopy.js
CHANGED
|
@@ -9,7 +9,7 @@ export const recapCopy = {
|
|
|
9
9
|
not_thriving: {
|
|
10
10
|
introHeadline: 'Omoor! We See Your Hustle, But….',
|
|
11
11
|
introSubtitle: 'Make we talk small 🤫',
|
|
12
|
-
introVariant: '
|
|
12
|
+
introVariant: 'default',
|
|
13
13
|
revenueFooter: 'Consistency go pay, we dey your back.',
|
|
14
14
|
yearHeadline: 'This year rough, but you are the real MVP'
|
|
15
15
|
},
|
|
@@ -3,7 +3,8 @@ interface Slide10FinalProps {
|
|
|
3
3
|
videoUrl: string;
|
|
4
4
|
downloadUrl: string;
|
|
5
5
|
onReplay: () => void;
|
|
6
|
+
year?: number;
|
|
6
7
|
}
|
|
7
|
-
declare function Slide10Final({ videoUrl, downloadUrl, onReplay }: Slide10FinalProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function Slide10Final({ videoUrl, downloadUrl, onReplay, year }: Slide10FinalProps): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export default Slide10Final;
|
|
9
10
|
//# sourceMappingURL=Slide10Final.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Slide10Final.d.ts","sourceRoot":"","sources":["../../src/slides/Slide10Final.tsx"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAE5B,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"Slide10Final.d.ts","sourceRoot":"","sources":["../../src/slides/Slide10Final.tsx"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAE5B,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,iBAAS,YAAY,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,iBAAiB,2CA+FjF;AAED,eAAe,YAAY,CAAC"}
|