@bebranded/bb-contents 1.0.74-beta → 1.0.76-beta
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/bb-contents.js +28 -21
- package/package.json +1 -1
package/bb-contents.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* BeBranded Contents
|
|
3
3
|
* Contenus additionnels français pour Webflow
|
|
4
|
-
* @version 1.0.
|
|
4
|
+
* @version 1.0.76-beta
|
|
5
5
|
* @author BeBranded
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @website https://www.bebranded.xyz
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
// Configuration
|
|
43
43
|
const config = {
|
|
44
|
-
version: '1.0.
|
|
44
|
+
version: '1.0.76-beta',
|
|
45
45
|
debug: true, // Debug activé pour diagnostic
|
|
46
46
|
prefix: 'bb-', // utilisé pour générer les sélecteurs (data-bb-*)
|
|
47
47
|
youtubeEndpoint: null, // URL du worker YouTube (à définir par l'utilisateur)
|
|
@@ -391,26 +391,25 @@
|
|
|
391
391
|
|
|
392
392
|
console.log(`🔍 [MARQUEE] Safari Animation - direction: ${direction}, isVertical: ${isVertical}, contentSize: ${contentSize}`);
|
|
393
393
|
|
|
394
|
-
//
|
|
394
|
+
// SOLUTION SAFARI SIMPLIFIÉE : Utiliser la taille du conteneur parent
|
|
395
395
|
let finalContentSize = contentSize;
|
|
396
396
|
if (contentSize < 200) {
|
|
397
|
-
console.log(`⚠️ [MARQUEE]
|
|
398
|
-
//
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}, 100);
|
|
397
|
+
console.log(`⚠️ [MARQUEE] Safari - ContentSize incorrect, utilisation taille parent`);
|
|
398
|
+
// Utiliser la taille du conteneur parent comme fallback
|
|
399
|
+
const parentElement = element.parentElement;
|
|
400
|
+
if (parentElement) {
|
|
401
|
+
finalContentSize = isVertical ? parentElement.offsetHeight : parentElement.offsetWidth;
|
|
402
|
+
console.log(`🔍 [MARQUEE] Safari - Taille parent: ${finalContentSize}px`);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// Si toujours trop petit, utiliser une valeur par défaut
|
|
406
|
+
if (finalContentSize < 200) {
|
|
407
|
+
finalContentSize = isVertical ? 400 : 800; // Valeurs par défaut
|
|
408
|
+
console.log(`🔍 [MARQUEE] Safari - Utilisation valeur par défaut: ${finalContentSize}px`);
|
|
409
|
+
}
|
|
411
410
|
}
|
|
412
411
|
|
|
413
|
-
// Solution Safari
|
|
412
|
+
// Solution Safari simplifiée
|
|
414
413
|
const totalSize = finalContentSize * 3 + gapSize * 2;
|
|
415
414
|
const step = (parseFloat(speed) * (isVertical ? 1.5 : 0.8)) / 60;
|
|
416
415
|
let isPaused = false;
|
|
@@ -438,23 +437,31 @@
|
|
|
438
437
|
|
|
439
438
|
console.log(`🔍 [MARQUEE] Safari - Position initiale: ${currentPosition}px, transform: ${initialTransform}`);
|
|
440
439
|
|
|
441
|
-
// Fonction d'animation Safari avec
|
|
440
|
+
// Fonction d'animation Safari avec debug des resets
|
|
441
|
+
let frameCount = 0;
|
|
442
442
|
const animate = () => {
|
|
443
443
|
if (!isPaused) {
|
|
444
|
+
frameCount++;
|
|
445
|
+
|
|
444
446
|
if (direction === (isVertical ? 'bottom' : 'right')) {
|
|
445
447
|
currentPosition += step;
|
|
446
|
-
// Reset standard pour direction bottom/right - 3 copies
|
|
447
448
|
if (currentPosition >= 0) {
|
|
449
|
+
console.log(`🔄 [MARQUEE] Safari RESET bottom/right: ${currentPosition} → ${-(finalContentSize + gapSize)}`);
|
|
448
450
|
currentPosition = -(finalContentSize + gapSize);
|
|
449
451
|
}
|
|
450
452
|
} else {
|
|
451
453
|
currentPosition -= step;
|
|
452
|
-
// Reset standard pour direction top/left - 3 copies
|
|
453
454
|
if (currentPosition <= -(2 * (finalContentSize + gapSize))) {
|
|
455
|
+
console.log(`🔄 [MARQUEE] Safari RESET top/left: ${currentPosition} → ${-(finalContentSize + gapSize)}`);
|
|
454
456
|
currentPosition = -(finalContentSize + gapSize);
|
|
455
457
|
}
|
|
456
458
|
}
|
|
457
459
|
|
|
460
|
+
// Log toutes les 60 frames (1 seconde)
|
|
461
|
+
if (frameCount % 60 === 0) {
|
|
462
|
+
console.log(`📍 [MARQUEE] Safari position: ${currentPosition}px (frame ${frameCount})`);
|
|
463
|
+
}
|
|
464
|
+
|
|
458
465
|
// ARRONDI pour éviter les erreurs de précision JavaScript
|
|
459
466
|
currentPosition = Math.round(currentPosition * 100) / 100;
|
|
460
467
|
|