@bebranded/bb-contents 1.0.73-beta → 1.0.75-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.
Files changed (2) hide show
  1. package/bb-contents.js +26 -8
  2. 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.73-beta
4
+ * @version 1.0.75-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.73-beta',
44
+ version: '1.0.75-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,8 +391,26 @@
391
391
 
392
392
  console.log(`🔍 [MARQUEE] Safari Animation - direction: ${direction}, isVertical: ${isVertical}, contentSize: ${contentSize}`);
393
393
 
394
- // Solution Safari hybride : JavaScript avec optimisations Safari
395
- const totalSize = contentSize * 3 + gapSize * 2;
394
+ // SOLUTION SAFARI SIMPLIFIÉE : Utiliser la taille du conteneur parent
395
+ let finalContentSize = contentSize;
396
+ if (contentSize < 200) {
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
+ }
410
+ }
411
+
412
+ // Solution Safari simplifiée
413
+ const totalSize = finalContentSize * 3 + gapSize * 2;
396
414
  const step = (parseFloat(speed) * (isVertical ? 1.5 : 0.8)) / 60;
397
415
  let isPaused = false;
398
416
 
@@ -406,7 +424,7 @@
406
424
  // Position initiale optimisée pour Safari
407
425
  let currentPosition;
408
426
  if (direction === (isVertical ? 'bottom' : 'right')) {
409
- currentPosition = -(contentSize + gapSize);
427
+ currentPosition = -(finalContentSize + gapSize);
410
428
  } else {
411
429
  currentPosition = 0;
412
430
  }
@@ -426,13 +444,13 @@
426
444
  currentPosition += step;
427
445
  // Reset standard pour direction bottom/right - 3 copies
428
446
  if (currentPosition >= 0) {
429
- currentPosition = -(contentSize + gapSize);
447
+ currentPosition = -(finalContentSize + gapSize);
430
448
  }
431
449
  } else {
432
450
  currentPosition -= step;
433
451
  // Reset standard pour direction top/left - 3 copies
434
- if (currentPosition <= -(2 * (contentSize + gapSize))) {
435
- currentPosition = -(contentSize + gapSize);
452
+ if (currentPosition <= -(2 * (finalContentSize + gapSize))) {
453
+ currentPosition = -(finalContentSize + gapSize);
436
454
  }
437
455
  }
438
456
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bebranded/bb-contents",
3
- "version": "1.0.73-beta",
3
+ "version": "1.0.75-beta",
4
4
  "description": "Contenus additionnels français pour Webflow",
5
5
  "main": "bb-contents.js",
6
6
  "scripts": {