@bebranded/bb-contents 1.0.142 → 1.0.143

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 +15 -6
  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.142
4
+ * @version 1.0.143
5
5
  * @author BeBranded
6
6
  * @license MIT
7
7
  * @website https://www.bebranded.xyz
@@ -32,11 +32,11 @@
32
32
  window._bbContentsInitialized = true;
33
33
 
34
34
  // Log de démarrage simple (une seule fois)
35
- console.log('bb-contents | v1.0.142');
35
+ console.log('bb-contents | v1.0.143');
36
36
 
37
37
  // Configuration
38
38
  const config = {
39
- version: '1.0.142',
39
+ version: '1.0.143',
40
40
  debug: false, // Debug désactivé pour rendu propre
41
41
  prefix: 'bb-', // utilisé pour générer les sélecteurs (data-bb-*)
42
42
  youtubeEndpoint: null, // URL du worker YouTube (à définir par l'utilisateur)
@@ -780,11 +780,13 @@
780
780
  }
781
781
 
782
782
  // Position initiale optimisée pour Safari
783
+ // Pour direction left, commencer à -(finalContentSize + gapSize) pour que repeatBlock1 soit déjà visible
783
784
  let currentPosition;
784
785
  if (direction === (isVertical ? 'bottom' : 'right')) {
785
786
  currentPosition = -(finalContentSize + gapSize);
786
- } else {
787
- currentPosition = 0;
787
+ } else {
788
+ // Commencer avec repeatBlock1 déjà visible pour éviter la saccade
789
+ currentPosition = -(finalContentSize + gapSize);
788
790
  }
789
791
 
790
792
  // Forcer la position initiale pour éviter l'invisibilité
@@ -861,11 +863,14 @@
861
863
  let isPaused = false;
862
864
 
863
865
  // Position initiale
866
+ // Pour direction left, commencer à -(contentSize + gapSize) pour que repeatBlock1 soit déjà visible
867
+ // Cela évite la saccade au premier cycle
864
868
  let currentPosition;
865
869
  if (direction === (isVertical ? 'bottom' : 'right')) {
866
870
  currentPosition = -(contentSize + gapSize);
867
871
  } else {
868
- currentPosition = 0;
872
+ // Commencer avec repeatBlock1 déjà visible pour éviter la saccade
873
+ currentPosition = -(contentSize + gapSize);
869
874
  }
870
875
 
871
876
  // Ajuster la taille du conteneur
@@ -888,11 +893,15 @@
888
893
 
889
894
  if (direction === (isVertical ? 'bottom' : 'right')) {
890
895
  currentPosition += step * clampedDelta;
896
+ // Reset AVANT que le bloc ne sorte complètement pour éviter la saccade
891
897
  if (currentPosition >= 0) {
892
898
  currentPosition = -(contentSize + gapSize);
893
899
  }
894
900
  } else {
895
901
  currentPosition -= step * clampedDelta;
902
+ // Reset AVANT que le bloc ne sorte complètement
903
+ // Reset quand on arrive à -(2 * (contentSize + gapSize)) pour que repeatBlock2 soit déjà visible
904
+ // Mais on reset à -(contentSize + gapSize) pour que repeatBlock1 soit déjà visible
896
905
  if (currentPosition <= -(2 * (contentSize + gapSize))) {
897
906
  currentPosition = -(contentSize + gapSize);
898
907
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bebranded/bb-contents",
3
- "version": "1.0.142",
3
+ "version": "1.0.143",
4
4
  "description": "Contenus additionnels français pour Webflow",
5
5
  "main": "bb-contents.js",
6
6
  "scripts": {