@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/types.ts
CHANGED
|
@@ -24,6 +24,11 @@ export interface RecapData {
|
|
|
24
24
|
introSubtitle?: string; // Custom intro subtitle from backend
|
|
25
25
|
slideDurations?: Record<string, number>; // Optional per-slide durations
|
|
26
26
|
isVideo?: boolean; // If true, hide sound icon (video has own audio)
|
|
27
|
+
productImages?: string[]; // Optional image pool for background frames
|
|
28
|
+
websiteLink?: string;
|
|
29
|
+
websiteVisits?: number;
|
|
30
|
+
mostViewedProduct?: string;
|
|
31
|
+
mostViewedProductCount?: number;
|
|
27
32
|
}
|
|
28
33
|
|
|
29
34
|
export interface ProductSummary {
|
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import html2canvas from 'html2canvas';
|
|
2
|
+
|
|
3
|
+
export interface ScreenshotOptions {
|
|
4
|
+
slideId: string;
|
|
5
|
+
businessName: string;
|
|
6
|
+
year: number;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// Cache for pre-captured screenshots
|
|
10
|
+
const screenshotCache = new Map<string, File>();
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Detects if the device is mobile
|
|
14
|
+
*/
|
|
15
|
+
function isMobileDevice(): boolean {
|
|
16
|
+
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ||
|
|
17
|
+
(navigator.maxTouchPoints > 0 && window.innerWidth < 768);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Pre-captures a screenshot of the slide and caches it.
|
|
22
|
+
* Call this when a slide becomes active so the image is ready for instant sharing.
|
|
23
|
+
*/
|
|
24
|
+
export async function preCaptureSlide(
|
|
25
|
+
containerRef: HTMLElement | null,
|
|
26
|
+
options: ScreenshotOptions
|
|
27
|
+
): Promise<void> {
|
|
28
|
+
if (!containerRef) return;
|
|
29
|
+
|
|
30
|
+
const { slideId, businessName, year } = options;
|
|
31
|
+
const cacheKey = `${businessName}-${year}-${slideId}`;
|
|
32
|
+
|
|
33
|
+
// Skip if already cached
|
|
34
|
+
if (screenshotCache.has(cacheKey)) {
|
|
35
|
+
console.log('[Screenshot] Using cached screenshot for:', cacheKey);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const storyContainer = containerRef.closest('.recap-story') as HTMLElement;
|
|
40
|
+
if (!storyContainer) return;
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
console.log('[Screenshot] Pre-capturing slide:', slideId);
|
|
44
|
+
|
|
45
|
+
const canvas = await html2canvas(storyContainer, {
|
|
46
|
+
scale: 3, // Higher scale for better image quality
|
|
47
|
+
useCORS: true,
|
|
48
|
+
allowTaint: true,
|
|
49
|
+
backgroundColor: '#FCFCFC',
|
|
50
|
+
logging: false,
|
|
51
|
+
windowWidth: storyContainer.scrollWidth,
|
|
52
|
+
windowHeight: storyContainer.scrollHeight,
|
|
53
|
+
ignoreElements: (element) => {
|
|
54
|
+
// Ignore buttons and progress bar - they're excluded from screenshot
|
|
55
|
+
return element.classList.contains('recap-story__sound-btn') ||
|
|
56
|
+
element.classList.contains('recap-story__share-btn') ||
|
|
57
|
+
element.classList.contains('recap-story__progress-wrap');
|
|
58
|
+
},
|
|
59
|
+
// Apply screenshot-mode to cloned DOM only (not visible to user)
|
|
60
|
+
onclone: (clonedDoc) => {
|
|
61
|
+
const clonedContainer = clonedDoc.querySelector('.recap-story');
|
|
62
|
+
if (clonedContainer) {
|
|
63
|
+
clonedContainer.classList.add('screenshot-mode');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const blob = await new Promise<Blob>((resolve, reject) => {
|
|
69
|
+
canvas.toBlob(
|
|
70
|
+
(b) => {
|
|
71
|
+
if (b) resolve(b);
|
|
72
|
+
else reject(new Error('Failed to create blob'));
|
|
73
|
+
},
|
|
74
|
+
'image/png',
|
|
75
|
+
1.0
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const mimeType = 'image/png';
|
|
80
|
+
const fileName = `${businessName.replace(/\s+/g, '-')}-recap-${year}-${slideId}.png`;
|
|
81
|
+
const file = new File([blob], fileName, {
|
|
82
|
+
type: mimeType,
|
|
83
|
+
lastModified: Date.now()
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
screenshotCache.set(cacheKey, file);
|
|
87
|
+
console.log('[Screenshot] Pre-capture complete:', cacheKey, file.size, 'bytes');
|
|
88
|
+
|
|
89
|
+
} catch (error) {
|
|
90
|
+
console.error('[Screenshot] Pre-capture failed:', error);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Clears the screenshot cache (call when leaving recap)
|
|
96
|
+
*/
|
|
97
|
+
export function clearScreenshotCache(): void {
|
|
98
|
+
screenshotCache.clear();
|
|
99
|
+
console.log('[Screenshot] Cache cleared');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Check if a screenshot is cached for a specific slide
|
|
104
|
+
*/
|
|
105
|
+
export function isScreenshotCached(options: ScreenshotOptions): boolean {
|
|
106
|
+
const { slideId, businessName, year } = options;
|
|
107
|
+
const cacheKey = `${businessName}-${year}-${slideId}`;
|
|
108
|
+
return screenshotCache.has(cacheKey);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Shares or downloads a slide screenshot.
|
|
113
|
+
* Uses cached screenshot if available (instant share), otherwise captures fresh.
|
|
114
|
+
*
|
|
115
|
+
* - Desktop: Downloads the image directly
|
|
116
|
+
* - Mobile: Uses Web Share API with file (same as Slide10Final)
|
|
117
|
+
*/
|
|
118
|
+
export async function captureAndShareSlide(
|
|
119
|
+
containerRef: HTMLElement | null,
|
|
120
|
+
options: ScreenshotOptions
|
|
121
|
+
): Promise<void> {
|
|
122
|
+
if (!containerRef) {
|
|
123
|
+
console.error('[Screenshot] No container element provided');
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const { slideId, businessName, year } = options;
|
|
128
|
+
const cacheKey = `${businessName}-${year}-${slideId}`;
|
|
129
|
+
const isMobile = isMobileDevice();
|
|
130
|
+
|
|
131
|
+
console.log('[Screenshot] Device type:', isMobile ? 'mobile' : 'desktop');
|
|
132
|
+
console.log('[Screenshot] Cache key:', cacheKey);
|
|
133
|
+
|
|
134
|
+
// Check for cached screenshot (enables instant sharing on mobile)
|
|
135
|
+
const cachedFile = screenshotCache.get(cacheKey);
|
|
136
|
+
console.log('[Screenshot] Cache available:', !!cachedFile);
|
|
137
|
+
|
|
138
|
+
// MOBILE: Must use cached file for instant share (user gesture chain)
|
|
139
|
+
if (isMobile) {
|
|
140
|
+
if (cachedFile) {
|
|
141
|
+
console.log('[Screenshot] Using cached file for instant share');
|
|
142
|
+
// CRITICAL: Call navigator.share() directly without any await before it
|
|
143
|
+
// to maintain the user gesture chain on mobile browsers (especially Edge)
|
|
144
|
+
const canShareFiles = navigator.canShare && navigator.canShare({ files: [cachedFile] });
|
|
145
|
+
console.log('[Screenshot] Can share files:', canShareFiles);
|
|
146
|
+
|
|
147
|
+
if (canShareFiles) {
|
|
148
|
+
// Call share synchronously - no try/catch wrapper that could break gesture chain
|
|
149
|
+
navigator.share({
|
|
150
|
+
files: [cachedFile],
|
|
151
|
+
title: 'My Huxxle Recap',
|
|
152
|
+
text: `Check out ${businessName}'s Wrapped ${year} highlights! 🎉`
|
|
153
|
+
}).then(() => {
|
|
154
|
+
console.log('[Screenshot] Share successful!');
|
|
155
|
+
}).catch((err) => {
|
|
156
|
+
console.error('[Screenshot] Share failed:', err);
|
|
157
|
+
// If user cancelled (AbortError), don't download
|
|
158
|
+
if (err.name !== 'AbortError') {
|
|
159
|
+
// Fallback to download on share failure
|
|
160
|
+
const blob = new Blob([cachedFile], { type: cachedFile.type });
|
|
161
|
+
downloadImage(blob, cachedFile.name);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Mobile browser doesn't support file sharing - download instead
|
|
168
|
+
console.log('[Screenshot] File sharing not supported, downloading...');
|
|
169
|
+
const blob = new Blob([cachedFile], { type: cachedFile.type });
|
|
170
|
+
downloadImage(blob, cachedFile.name);
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// No cache on mobile - this shouldn't happen if timing is correct
|
|
175
|
+
// Fall back to capturing and downloading (share won't work due to gesture chain)
|
|
176
|
+
console.warn('[Screenshot] No cache on mobile - falling back to capture + download');
|
|
177
|
+
// Continue to fresh capture below, but it will download instead of share
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// DESKTOP or MOBILE-FALLBACK: Capture fresh screenshot
|
|
181
|
+
const storyContainer = containerRef.closest('.recap-story') as HTMLElement;
|
|
182
|
+
if (!storyContainer) {
|
|
183
|
+
console.error('[Screenshot] Could not find .recap-story container');
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
try {
|
|
188
|
+
console.log('[Screenshot] Starting capture...');
|
|
189
|
+
|
|
190
|
+
const canvas = await html2canvas(storyContainer, {
|
|
191
|
+
scale: 3, // Higher scale for better image quality
|
|
192
|
+
useCORS: true,
|
|
193
|
+
allowTaint: true,
|
|
194
|
+
backgroundColor: '#FCFCFC',
|
|
195
|
+
logging: false,
|
|
196
|
+
windowWidth: storyContainer.scrollWidth,
|
|
197
|
+
windowHeight: storyContainer.scrollHeight,
|
|
198
|
+
ignoreElements: (element) => {
|
|
199
|
+
// Ignore buttons and progress bar - they're excluded from screenshot
|
|
200
|
+
return element.classList.contains('recap-story__sound-btn') ||
|
|
201
|
+
element.classList.contains('recap-story__share-btn') ||
|
|
202
|
+
element.classList.contains('recap-story__progress-wrap');
|
|
203
|
+
},
|
|
204
|
+
// Apply screenshot-mode to cloned DOM only (not visible to user)
|
|
205
|
+
onclone: (clonedDoc) => {
|
|
206
|
+
const clonedContainer = clonedDoc.querySelector('.recap-story');
|
|
207
|
+
if (clonedContainer) {
|
|
208
|
+
clonedContainer.classList.add('screenshot-mode');
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
console.log('[Screenshot] Canvas created:', canvas.width, 'x', canvas.height);
|
|
214
|
+
|
|
215
|
+
const blob = await new Promise<Blob>((resolve, reject) => {
|
|
216
|
+
canvas.toBlob(
|
|
217
|
+
(b) => {
|
|
218
|
+
if (b) resolve(b);
|
|
219
|
+
else reject(new Error('Failed to create blob'));
|
|
220
|
+
},
|
|
221
|
+
'image/png',
|
|
222
|
+
1.0
|
|
223
|
+
);
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
console.log('[Screenshot] Blob created:', blob.size, 'bytes');
|
|
227
|
+
|
|
228
|
+
const mimeType = 'image/png';
|
|
229
|
+
const fileName = `${businessName.replace(/\s+/g, '-')}-recap-${year}-${slideId}.png`;
|
|
230
|
+
|
|
231
|
+
// DESKTOP: Always download
|
|
232
|
+
if (!isMobile) {
|
|
233
|
+
console.log('[Screenshot] Desktop - downloading...');
|
|
234
|
+
downloadImage(blob, fileName);
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// MOBILE (no cache): Try to share, likely will fail due to user gesture timing
|
|
239
|
+
const file = new File([blob], fileName, {
|
|
240
|
+
type: mimeType,
|
|
241
|
+
lastModified: Date.now()
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
// Cache for next time
|
|
245
|
+
screenshotCache.set(cacheKey, file);
|
|
246
|
+
|
|
247
|
+
await shareFile(file, businessName, year);
|
|
248
|
+
|
|
249
|
+
} catch (error) {
|
|
250
|
+
console.error('[Screenshot] Capture failed:', error);
|
|
251
|
+
} finally {
|
|
252
|
+
storyContainer.classList.remove('screenshot-mode');
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Shares a file using Web Share API with fallbacks
|
|
258
|
+
*/
|
|
259
|
+
async function shareFile(file: File, businessName: string, year: number): Promise<void> {
|
|
260
|
+
console.log('[Screenshot] File to share:', file.name, file.type, file.size, 'bytes');
|
|
261
|
+
|
|
262
|
+
// Validate file size (WhatsApp limit: 5MB for images)
|
|
263
|
+
const maxSize = 5 * 1024 * 1024;
|
|
264
|
+
if (file.size > maxSize) {
|
|
265
|
+
alert('File is too large. Maximum size is 5MB');
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Check if Web Share API with files is supported
|
|
270
|
+
const canShareFiles = navigator.canShare && navigator.canShare({ files: [file] });
|
|
271
|
+
console.log('[Screenshot] Can share files:', canShareFiles);
|
|
272
|
+
|
|
273
|
+
// Try sharing with file
|
|
274
|
+
if (canShareFiles) {
|
|
275
|
+
console.log('[Screenshot] Sharing file...');
|
|
276
|
+
try {
|
|
277
|
+
await navigator.share({
|
|
278
|
+
files: [file],
|
|
279
|
+
title: 'My Huxxle Recap',
|
|
280
|
+
text: `Check out ${businessName}'s Wrapped ${year} highlights! 🎉`
|
|
281
|
+
});
|
|
282
|
+
console.log('[Screenshot] Share successful!');
|
|
283
|
+
return;
|
|
284
|
+
} catch (shareError) {
|
|
285
|
+
console.error('[Screenshot] File share failed:', shareError);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// Fallback: share URL only
|
|
290
|
+
if (navigator.share) {
|
|
291
|
+
console.log('[Screenshot] Sharing URL fallback...');
|
|
292
|
+
try {
|
|
293
|
+
await navigator.share({
|
|
294
|
+
title: 'My Huxxle Recap',
|
|
295
|
+
text: `Check out ${businessName}'s Wrapped ${year} highlights! 🎉`,
|
|
296
|
+
url: window.location.href
|
|
297
|
+
});
|
|
298
|
+
return;
|
|
299
|
+
} catch (urlShareError) {
|
|
300
|
+
console.error('[Screenshot] URL share failed:', urlShareError);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Final fallback: download
|
|
305
|
+
console.log('[Screenshot] Download fallback...');
|
|
306
|
+
const blob = new Blob([await file.arrayBuffer()], { type: file.type });
|
|
307
|
+
downloadImage(blob, file.name);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Downloads an image blob
|
|
312
|
+
*/
|
|
313
|
+
function downloadImage(blob: Blob, fileName: string): void {
|
|
314
|
+
console.log('[Screenshot] Downloading:', fileName);
|
|
315
|
+
const url = URL.createObjectURL(blob);
|
|
316
|
+
const a = document.createElement('a');
|
|
317
|
+
a.href = url;
|
|
318
|
+
a.download = fileName;
|
|
319
|
+
document.body.appendChild(a);
|
|
320
|
+
a.click();
|
|
321
|
+
document.body.removeChild(a);
|
|
322
|
+
URL.revokeObjectURL(url);
|
|
323
|
+
console.log('[Screenshot] Download complete');
|
|
324
|
+
}
|
package/dist/FloatingFrames.css
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
.floating-frames {
|
|
2
|
-
position: absolute;
|
|
3
|
-
display: flex;
|
|
4
|
-
gap: clamp(6px, 2vw, 8px);
|
|
5
|
-
left: 50%;
|
|
6
|
-
transform: translateX(-50%);
|
|
7
|
-
z-index: 1;
|
|
8
|
-
pointer-events: none;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.floating-frames--top {
|
|
12
|
-
top: clamp(80px, 16.5dvh, 140px);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.floating-frames--bottom {
|
|
16
|
-
bottom: clamp(100px, 21.3dvh, 180px);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.floating-frame {
|
|
20
|
-
width: clamp(70px, 28.2vw, 110px);
|
|
21
|
-
height: clamp(280px, 52.1dvh, 440px);
|
|
22
|
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
23
|
-
border-radius: 4px;
|
|
24
|
-
background: transparent;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@media (max-width: 420px) {
|
|
28
|
-
.floating-frame {
|
|
29
|
-
width: clamp(70px, 23vw, 90px);
|
|
30
|
-
height: clamp(280px, 45dvh, 380px);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.floating-frames--top {
|
|
34
|
-
top: clamp(80px, 14.2dvh, 120px);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.floating-frames--bottom {
|
|
38
|
-
bottom: clamp(100px, 18.9dvh, 160px);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@media (max-height: 720px), (orientation: landscape) {
|
|
43
|
-
.floating-frames--top {
|
|
44
|
-
top: clamp(60px, 10dvh, 100px);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.floating-frames--bottom {
|
|
48
|
-
bottom: clamp(80px, 12dvh, 120px);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.floating-frame {
|
|
52
|
-
width: clamp(60px, 20vw, 90px);
|
|
53
|
-
height: clamp(200px, 35dvh, 320px);
|
|
54
|
-
}
|
|
55
|
-
}
|
package/dist/FloatingFrames.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import './FloatingFrames.css';
|
|
2
|
-
interface FloatingFramesProps {
|
|
3
|
-
variant?: 'top' | 'bottom';
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* FloatingFrames - Decorative animated rectangles
|
|
7
|
-
* Displays 3 vertical rectangles with gentle horizontal motion
|
|
8
|
-
*/
|
|
9
|
-
declare function FloatingFrames({ variant }: FloatingFramesProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export default FloatingFrames;
|
|
11
|
-
//# sourceMappingURL=FloatingFrames.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FloatingFrames.d.ts","sourceRoot":"","sources":["../src/FloatingFrames.tsx"],"names":[],"mappings":"AAGA,OAAO,sBAAsB,CAAC;AAE9B,UAAU,mBAAmB;IAC3B,OAAO,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;CAC5B;AAED;;;GAGG;AACH,iBAAS,cAAc,CAAC,EAAE,OAAe,EAAE,EAAE,mBAAmB,2CAW/D;AAED,eAAe,cAAc,CAAC"}
|
package/dist/FloatingFrames.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { motion } from 'framer-motion';
|
|
3
|
-
import { floatingAnimation } from './utils';
|
|
4
|
-
import './FloatingFrames.css';
|
|
5
|
-
/**
|
|
6
|
-
* FloatingFrames - Decorative animated rectangles
|
|
7
|
-
* Displays 3 vertical rectangles with gentle horizontal motion
|
|
8
|
-
*/
|
|
9
|
-
function FloatingFrames({ variant = 'top' }) {
|
|
10
|
-
return (_jsxs(motion.div, { className: `floating-frames floating-frames--${variant}`, animate: floatingAnimation, children: [_jsx("div", { className: "floating-frame" }), _jsx("div", { className: "floating-frame" }), _jsx("div", { className: "floating-frame" })] }));
|
|
11
|
-
}
|
|
12
|
-
export default FloatingFrames;
|
package/src/FloatingFrames.css
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
.floating-frames {
|
|
2
|
-
position: absolute;
|
|
3
|
-
display: flex;
|
|
4
|
-
gap: clamp(6px, 2vw, 8px);
|
|
5
|
-
left: 50%;
|
|
6
|
-
transform: translateX(-50%);
|
|
7
|
-
z-index: 1;
|
|
8
|
-
pointer-events: none;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.floating-frames--top {
|
|
12
|
-
top: clamp(80px, 16.5dvh, 140px);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.floating-frames--bottom {
|
|
16
|
-
bottom: clamp(100px, 21.3dvh, 180px);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.floating-frame {
|
|
20
|
-
width: clamp(70px, 28.2vw, 110px);
|
|
21
|
-
height: clamp(280px, 52.1dvh, 440px);
|
|
22
|
-
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
23
|
-
border-radius: 4px;
|
|
24
|
-
background: transparent;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@media (max-width: 420px) {
|
|
28
|
-
.floating-frame {
|
|
29
|
-
width: clamp(70px, 23vw, 90px);
|
|
30
|
-
height: clamp(280px, 45dvh, 380px);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.floating-frames--top {
|
|
34
|
-
top: clamp(80px, 14.2dvh, 120px);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.floating-frames--bottom {
|
|
38
|
-
bottom: clamp(100px, 18.9dvh, 160px);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@media (max-height: 720px), (orientation: landscape) {
|
|
43
|
-
.floating-frames--top {
|
|
44
|
-
top: clamp(60px, 10dvh, 100px);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.floating-frames--bottom {
|
|
48
|
-
bottom: clamp(80px, 12dvh, 120px);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.floating-frame {
|
|
52
|
-
width: clamp(60px, 20vw, 90px);
|
|
53
|
-
height: clamp(200px, 35dvh, 320px);
|
|
54
|
-
}
|
|
55
|
-
}
|
package/src/FloatingFrames.tsx
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { motion } from 'framer-motion';
|
|
3
|
-
import { floatingAnimation } from './utils';
|
|
4
|
-
import './FloatingFrames.css';
|
|
5
|
-
|
|
6
|
-
interface FloatingFramesProps {
|
|
7
|
-
variant?: 'top' | 'bottom';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* FloatingFrames - Decorative animated rectangles
|
|
12
|
-
* Displays 3 vertical rectangles with gentle horizontal motion
|
|
13
|
-
*/
|
|
14
|
-
function FloatingFrames({ variant = 'top' }: FloatingFramesProps) {
|
|
15
|
-
return (
|
|
16
|
-
<motion.div
|
|
17
|
-
className={`floating-frames floating-frames--${variant}`}
|
|
18
|
-
animate={floatingAnimation}
|
|
19
|
-
>
|
|
20
|
-
<div className="floating-frame" />
|
|
21
|
-
<div className="floating-frame" />
|
|
22
|
-
<div className="floating-frame" />
|
|
23
|
-
</motion.div>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default FloatingFrames;
|