@bebranded/bb-contents 1.0.78-beta → 1.0.79-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 +21 -3
- 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.79-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.79-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)
|
|
@@ -408,6 +408,10 @@
|
|
|
408
408
|
imagesLoaded++;
|
|
409
409
|
console.log(`🖼️ [MARQUEE] Safari - Image ${imagesLoaded}/${totalImages} chargée`);
|
|
410
410
|
};
|
|
411
|
+
img.onerror = () => {
|
|
412
|
+
imagesLoaded++;
|
|
413
|
+
console.log(`❌ [MARQUEE] Safari - Image ${imagesLoaded}/${totalImages} erreur de chargement`);
|
|
414
|
+
};
|
|
411
415
|
});
|
|
412
416
|
|
|
413
417
|
// Attendre que les images se chargent avec timeout adapté mobile
|
|
@@ -422,7 +426,12 @@
|
|
|
422
426
|
|
|
423
427
|
if (imagesLoaded >= totalImages || imagesLoaded === 0 || waitTimeout >= maxWaitTime) {
|
|
424
428
|
console.log(`✅ [MARQUEE] Safari - Images chargées: ${imagesLoaded}/${totalImages} (timeout: ${waitTimeout}ms)`);
|
|
425
|
-
|
|
429
|
+
|
|
430
|
+
// Attendre encore un peu pour que les images se rendent visuellement
|
|
431
|
+
setTimeout(() => {
|
|
432
|
+
console.log(`🖼️ [MARQUEE] Safari - Attente rendu visuel des images...`);
|
|
433
|
+
startSafariAnimation();
|
|
434
|
+
}, isMobile ? 500 : 200); // Plus de temps sur mobile
|
|
426
435
|
} else {
|
|
427
436
|
setTimeout(waitForImages, 100);
|
|
428
437
|
}
|
|
@@ -440,6 +449,15 @@
|
|
|
440
449
|
});
|
|
441
450
|
}
|
|
442
451
|
|
|
452
|
+
// Vérifier que les images ont une taille visible
|
|
453
|
+
let imagesWithSize = 0;
|
|
454
|
+
images.forEach(img => {
|
|
455
|
+
if (img.offsetWidth > 0 && img.offsetHeight > 0) {
|
|
456
|
+
imagesWithSize++;
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
console.log(`🖼️ [MARQUEE] Safari - Images avec taille visible: ${imagesWithSize}/${totalImages}`);
|
|
460
|
+
|
|
443
461
|
// Recalculer la taille après chargement des images
|
|
444
462
|
const newContentSize = isVertical ? mainBlock.offsetHeight : mainBlock.offsetWidth;
|
|
445
463
|
console.log(`🔍 [MARQUEE] Safari - Nouvelle taille après images: ${newContentSize}px`);
|