@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.
Files changed (46) hide show
  1. package/dist/App.css +10 -10
  2. package/dist/RecapStory.d.ts +2 -2
  3. package/dist/RecapStory.d.ts.map +1 -1
  4. package/dist/RecapStory.js +121 -66
  5. package/dist/StoryProgress.d.ts +3 -2
  6. package/dist/StoryProgress.d.ts.map +1 -1
  7. package/dist/StoryProgress.js +66 -12
  8. package/dist/components/Header.d.ts +2 -1
  9. package/dist/components/Header.d.ts.map +1 -1
  10. package/dist/components/Header.js +3 -2
  11. package/dist/data/mock.d.ts +1 -1
  12. package/dist/data/mock.d.ts.map +1 -1
  13. package/dist/data/mock.js +24 -19
  14. package/dist/data/recapCopy.js +1 -1
  15. package/dist/slides/Slide10Final.d.ts +2 -1
  16. package/dist/slides/Slide10Final.d.ts.map +1 -1
  17. package/dist/slides/Slide10Final.js +8 -7
  18. package/dist/slides/Slide1Intro.css +44 -0
  19. package/dist/slides/Slide1Intro.d.ts +3 -1
  20. package/dist/slides/Slide1Intro.d.ts.map +1 -1
  21. package/dist/slides/Slide1Intro.js +11 -4
  22. package/dist/slides/Slide3Revenue.d.ts +2 -1
  23. package/dist/slides/Slide3Revenue.d.ts.map +1 -1
  24. package/dist/slides/Slide3Revenue.js +2 -2
  25. package/dist/slides/Slide9Year.d.ts +2 -1
  26. package/dist/slides/Slide9Year.d.ts.map +1 -1
  27. package/dist/slides/Slide9Year.js +4 -2
  28. package/dist/types.d.ts +6 -0
  29. package/dist/types.d.ts.map +1 -1
  30. package/dist/utils/format.d.ts +5 -2
  31. package/dist/utils/format.d.ts.map +1 -1
  32. package/dist/utils/format.js +7 -4
  33. package/package.json +1 -1
  34. package/src/App.css +10 -10
  35. package/src/RecapStory.tsx +157 -89
  36. package/src/StoryProgress.tsx +96 -21
  37. package/src/components/Header.tsx +4 -2
  38. package/src/data/mock.ts +32 -20
  39. package/src/data/recapCopy.ts +1 -1
  40. package/src/slides/Slide10Final.tsx +9 -6
  41. package/src/slides/Slide1Intro.css +44 -0
  42. package/src/slides/Slide1Intro.tsx +27 -4
  43. package/src/slides/Slide3Revenue.tsx +3 -2
  44. package/src/slides/Slide9Year.tsx +5 -2
  45. package/src/types.ts +6 -0
  46. package/src/utils/format.ts +7 -4
@@ -5,9 +5,12 @@ interface Slide10FinalProps {
5
5
  videoUrl: string;
6
6
  downloadUrl: string;
7
7
  onReplay: () => void;
8
+ year?: number;
8
9
  }
9
10
 
10
- function Slide10Final({ videoUrl, downloadUrl, onReplay }: Slide10FinalProps) {
11
+ function Slide10Final({ videoUrl, downloadUrl, onReplay, year }: Slide10FinalProps) {
12
+ const displayYear = year ?? 2025;
13
+
11
14
  const handleShare = async () => {
12
15
  try {
13
16
  // Fetch the media as a blob
@@ -17,7 +20,7 @@ function Slide10Final({ videoUrl, downloadUrl, onReplay }: Slide10FinalProps) {
17
20
  // Determine the file type (video/image)
18
21
  const fileExtension = videoUrl.split('.').pop()?.toLowerCase() || 'mp4';
19
22
  const mimeType = fileExtension === 'mp4' ? 'video/mp4' : 'image/jpeg';
20
- const fileName = `huxxle-wrapped-2025.${fileExtension}`;
23
+ const fileName = `huxxle-wrapped-${displayYear}.${fileExtension}`;
21
24
 
22
25
  // Create a File object (required for WhatsApp Status)
23
26
  const file = new File([blob], fileName, {
@@ -36,7 +39,7 @@ function Slide10Final({ videoUrl, downloadUrl, onReplay }: Slide10FinalProps) {
36
39
  await navigator.share({
37
40
  files: [file],
38
41
  title: 'My Huxxle Recap',
39
- text: 'Check out my Wrapped 2025 highlights! 🎉'
42
+ text: `Check out my Wrapped ${displayYear} highlights! 🎉`
40
43
  });
41
44
  return;
42
45
  }
@@ -45,7 +48,7 @@ function Slide10Final({ videoUrl, downloadUrl, onReplay }: Slide10FinalProps) {
45
48
  if (typeof navigator !== 'undefined' && navigator.share) {
46
49
  await navigator.share({
47
50
  title: 'My Huxxle Recap',
48
- text: 'Check out my Wrapped 2025 highlights! 🎉',
51
+ text: `Check out my Wrapped ${displayYear} highlights! 🎉`,
49
52
  url: videoUrl
50
53
  });
51
54
  return;
@@ -68,7 +71,7 @@ function Slide10Final({ videoUrl, downloadUrl, onReplay }: Slide10FinalProps) {
68
71
  const handleDownload = () => {
69
72
  const anchor = document.createElement('a');
70
73
  anchor.href = downloadUrl;
71
- anchor.download = 'huxxle-wrapped-2025.mp4';
74
+ anchor.download = `huxxle-wrapped-${displayYear}.mp4`;
72
75
  anchor.target = '_blank';
73
76
  document.body.appendChild(anchor);
74
77
  anchor.click();
@@ -81,7 +84,7 @@ function Slide10Final({ videoUrl, downloadUrl, onReplay }: Slide10FinalProps) {
81
84
 
82
85
  return (
83
86
  <div className="slide10-final">
84
- <div className="slide10-final__badge">WRAPPED 2025</div>
87
+ <div className="slide10-final__badge">WRAPPED {displayYear}</div>
85
88
  <div className="slide10-final__title">Your#1 AI Business Assistant</div>
86
89
 
87
90
  <div className="slide10-final__button-group">
@@ -233,3 +233,47 @@
233
233
  top: clamp(420px, 70dvh, 520px);
234
234
  } */
235
235
  }
236
+
237
+ /* New User CTA Button */
238
+ .slide1-intro__cta-button {
239
+ position: absolute;
240
+ left: 0;
241
+ right: 0;
242
+ bottom: calc(32px + env(safe-area-inset-bottom));
243
+ margin: 0 auto;
244
+ width: min(320px, calc(100% - 32px));
245
+ padding: 14px 20px;
246
+ text-align: center;
247
+ background: linear-gradient(90deg, #4F4CD8 0%, #3F3DAD 100%);
248
+ border: none;
249
+ /* border-radius: 12px; */
250
+ font-family: 'Lora', serif;
251
+ font-weight: 600;
252
+ font-size: clamp(16px, 4.1vw, 18px);
253
+ color: #FFFFFF;
254
+ cursor: pointer;
255
+ z-index: 10;
256
+ box-shadow: 0 4px 12px rgba(63, 61, 173, 0.3);
257
+ transition: all 0.3s ease;
258
+ white-space: nowrap;
259
+ }
260
+
261
+ .slide1-intro__cta-button:hover {
262
+ transform: translateX(-50%) translateY(-2px);
263
+ box-shadow: 0 6px 16px rgba(63, 61, 173, 0.4);
264
+ }
265
+
266
+ .slide1-intro__cta-button:active {
267
+ transform: translateX(-50%) translateY(0);
268
+ box-shadow: 0 2px 8px rgba(63, 61, 173, 0.3);
269
+ }
270
+
271
+ .slide1-intro--new-user .slide1-intro__cta-button {
272
+ background: linear-gradient(90deg, #E6E5F9 0%, #CDCCF4 100%);
273
+ color: #2A2872;
274
+ box-shadow: 0 4px 12px rgba(230, 229, 249, 0.3);
275
+ }
276
+
277
+ .slide1-intro--new-user .slide1-intro__cta-button:hover {
278
+ box-shadow: 0 6px 16px rgba(230, 229, 249, 0.4);
279
+ }
@@ -8,16 +8,19 @@ import './Slide1Intro.css';
8
8
  interface Slide1IntroProps {
9
9
  businessName: string;
10
10
  businessCategory: BusinessCategory;
11
+ introHeadline?: string;
12
+ introSubtitle?: string;
11
13
  onDurationCalculated?: (duration: number) => void;
12
14
  }
13
15
 
14
16
  /**
15
17
  * Slide1Intro - Identity slide with business name and category-based messaging
16
18
  */
17
- function Slide1Intro({ businessName, businessCategory, onDurationCalculated }: Slide1IntroProps) {
18
- // Dynamic messaging based on category
19
+ function Slide1Intro({ businessName, businessCategory, introHeadline, introSubtitle, onDurationCalculated }: Slide1IntroProps) {
20
+ // Dynamic messaging: use props if provided, otherwise fall back to recapCopy
19
21
  const copy = recapCopy[businessCategory] ?? recapCopy[BUSINESS_CATEGORIES.THRIVING];
20
- const headline = copy.introHeadline;
22
+ const headline = introHeadline ?? copy.introHeadline;
23
+ const subtitle = introSubtitle ?? copy.introSubtitle;
21
24
  const [brandWidth, setBrandWidth] = useState(0);
22
25
  const [headlineWidth, setHeadlineWidth] = useState(0);
23
26
  const brandRef = useRef<HTMLDivElement | null>(null);
@@ -76,6 +79,13 @@ function Slide1Intro({ businessName, businessCategory, onDurationCalculated }: S
76
79
  }, [dynamicSlideDuration, brandWidth, headlineWidth, onDurationCalculated]);
77
80
 
78
81
  const slideClass = `slide1-intro slide1-intro--${copy.introVariant}`;
82
+ const isNewUser = businessCategory === BUSINESS_CATEGORIES.NEW_USER;
83
+
84
+ const handleContinue = () => {
85
+ if (typeof window !== 'undefined') {
86
+ window.location.href = 'https://vendor.huxxle.com';
87
+ }
88
+ };
79
89
 
80
90
  return (
81
91
  <div className={slideClass}>
@@ -121,7 +131,7 @@ function Slide1Intro({ businessName, businessCategory, onDurationCalculated }: S
121
131
  >
122
132
  {headline}
123
133
  </motion.h2>
124
- <p className="slide1-intro__subtitle">{copy.introSubtitle}</p>
134
+ <p className="slide1-intro__subtitle">{subtitle}</p>
125
135
  </motion.div>
126
136
 
127
137
  {/* Bottom floating frames (slow horizontal drift) */}
@@ -134,6 +144,19 @@ function Slide1Intro({ businessName, businessCategory, onDurationCalculated }: S
134
144
  <div className="frame-rect" />
135
145
  <div className="frame-rect" />
136
146
  </motion.div>
147
+
148
+ {/* New User CTA Button - Animated from bottom */}
149
+ {isNewUser && (
150
+ <motion.button
151
+ className="slide1-intro__cta-button"
152
+ onClick={handleContinue}
153
+ initial={{ y: 100, opacity: 0 }}
154
+ animate={{ y: 0, opacity: 1 }}
155
+ transition={{ duration: 0.8, delay: 2.0, ease: 'easeOut' }}
156
+ >
157
+ Continue on Huxxle
158
+ </motion.button>
159
+ )}
137
160
  </div>
138
161
  );
139
162
  }
@@ -10,12 +10,13 @@ import moneyRainGif from '../assets/raining-money.gif';
10
10
  interface Slide3RevenueProps {
11
11
  revenue: number;
12
12
  businessCategory: BusinessCategory;
13
+ currency?: string;
13
14
  }
14
15
 
15
16
  /**
16
17
  * Slide3Revenue - Revenue display with money rain overlay
17
18
  */
18
- function Slide3Revenue({ revenue, businessCategory }: Slide3RevenueProps) {
19
+ function Slide3Revenue({ revenue, businessCategory, currency }: Slide3RevenueProps) {
19
20
  const copy = recapCopy[businessCategory] ?? recapCopy[BUSINESS_CATEGORIES.THRIVING];
20
21
  const footerText = copy.revenueFooter;
21
22
 
@@ -46,7 +47,7 @@ function Slide3Revenue({ revenue, businessCategory }: Slide3RevenueProps) {
46
47
  animate={{ opacity: 1, scale: 1 }}
47
48
  transition={{ duration: 0.8, delay: 0.3 }}
48
49
  >
49
- {formatCurrency(revenue)}
50
+ {formatCurrency(revenue, currency)}
50
51
  </motion.div>
51
52
 
52
53
  {/* Subline */}
@@ -6,15 +6,18 @@ import type { BusinessCategory } from '../types';
6
6
 
7
7
  interface Slide9YearProps {
8
8
  businessCategory: BusinessCategory;
9
+ year?: number;
9
10
  }
10
11
 
11
- function Slide9Year({ businessCategory }: Slide9YearProps) {
12
+ function Slide9Year({ businessCategory, year }: Slide9YearProps) {
12
13
  const copy = recapCopy[businessCategory] ?? recapCopy[BUSINESS_CATEGORIES.THRIVING];
14
+ const baseYear = year ?? 2025;
15
+ const nextYear = baseYear + 1;
13
16
 
14
17
  return (
15
18
  <div className="slide9-year">
16
19
  <div className="slide9-year__message">{copy.yearHeadline}</div>
17
- <div className="slide9-year__title">2026 na your year</div>
20
+ <div className="slide9-year__title">{nextYear} na your year</div>
18
21
  <div className="slide9-year__crown">👑</div>
19
22
 
20
23
  <div className="slide9-year__rect-layer slide9-year__rect-layer--top">
package/src/types.ts CHANGED
@@ -18,6 +18,12 @@ export interface RecapData {
18
18
  busiestMonth: string;
19
19
  videoUrl: string;
20
20
  downloadUrl: string;
21
+ currency?: string; // e.g., 'NGN', 'USD'
22
+ year?: number; // e.g., 2025
23
+ introHeadline?: string; // Custom intro headline from backend
24
+ introSubtitle?: string; // Custom intro subtitle from backend
25
+ slideDurations?: Record<string, number>; // Optional per-slide durations
26
+ isVideo?: boolean; // If true, hide sound icon (video has own audio)
21
27
  }
22
28
 
23
29
  export interface ProductSummary {
@@ -1,10 +1,13 @@
1
1
  /**
2
- * Format a number as Nigerian Naira currency
2
+ * Format a number as currency
3
+ * @param amount - The amount to format
4
+ * @param currency - Currency code (default: 'NGN')
5
+ * @param locale - Locale string (default: 'en-NG')
3
6
  */
4
- export function formatCurrency(amount: number): string {
5
- return new Intl.NumberFormat('en-NG', {
7
+ export function formatCurrency(amount: number, currency: string = 'NGN', locale: string = 'en-NG'): string {
8
+ return new Intl.NumberFormat(locale, {
6
9
  style: 'currency',
7
- currency: 'NGN',
10
+ currency: currency,
8
11
  minimumFractionDigits: 0,
9
12
  maximumFractionDigits: 0
10
13
  }).format(amount);