@bebranded/bb-contents 1.0.73-beta → 1.0.74-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 -7
  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.74-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.74-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,27 @@
391
391
 
392
392
  console.log(`🔍 [MARQUEE] Safari Animation - direction: ${direction}, isVertical: ${isVertical}, contentSize: ${contentSize}`);
393
393
 
394
+ // Recalculer la taille si elle semble incorrecte (trop petite)
395
+ let finalContentSize = contentSize;
396
+ if (contentSize < 200) {
397
+ console.log(`⚠️ [MARQUEE] ContentSize trop petit (${contentSize}px), recalcul...`);
398
+ // Attendre un peu et recalculer
399
+ setTimeout(() => {
400
+ const newContentSize = isVertical ? mainBlock.offsetHeight : mainBlock.offsetWidth;
401
+ console.log(`🔍 [MARQUEE] Nouveau contentSize: ${newContentSize}px`);
402
+ if (newContentSize > contentSize) {
403
+ // Relancer l'animation avec la bonne taille
404
+ this.initSafariAnimation(element, scrollContainer, mainBlock, {
405
+ ...options,
406
+ contentSize: newContentSize
407
+ });
408
+ return;
409
+ }
410
+ }, 100);
411
+ }
412
+
394
413
  // Solution Safari hybride : JavaScript avec optimisations Safari
395
- const totalSize = contentSize * 3 + gapSize * 2;
414
+ const totalSize = finalContentSize * 3 + gapSize * 2;
396
415
  const step = (parseFloat(speed) * (isVertical ? 1.5 : 0.8)) / 60;
397
416
  let isPaused = false;
398
417
 
@@ -406,7 +425,7 @@
406
425
  // Position initiale optimisée pour Safari
407
426
  let currentPosition;
408
427
  if (direction === (isVertical ? 'bottom' : 'right')) {
409
- currentPosition = -(contentSize + gapSize);
428
+ currentPosition = -(finalContentSize + gapSize);
410
429
  } else {
411
430
  currentPosition = 0;
412
431
  }
@@ -426,13 +445,13 @@
426
445
  currentPosition += step;
427
446
  // Reset standard pour direction bottom/right - 3 copies
428
447
  if (currentPosition >= 0) {
429
- currentPosition = -(contentSize + gapSize);
448
+ currentPosition = -(finalContentSize + gapSize);
430
449
  }
431
450
  } else {
432
451
  currentPosition -= step;
433
452
  // Reset standard pour direction top/left - 3 copies
434
- if (currentPosition <= -(2 * (contentSize + gapSize))) {
435
- currentPosition = -(contentSize + gapSize);
453
+ if (currentPosition <= -(2 * (finalContentSize + gapSize))) {
454
+ currentPosition = -(finalContentSize + gapSize);
436
455
  }
437
456
  }
438
457
 
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.74-beta",
4
4
  "description": "Contenus additionnels français pour Webflow",
5
5
  "main": "bb-contents.js",
6
6
  "scripts": {