@bebranded/bb-contents 1.0.27-beta → 1.0.28-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 +11 -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.27-beta
4
+ * @version 1.0.28-beta
5
5
  * @author BeBranded
6
6
  * @license MIT
7
7
  * @website https://www.bebranded.xyz
@@ -17,7 +17,7 @@
17
17
 
18
18
  // Configuration
19
19
  const config = {
20
- version: '1.0.27-beta',
20
+ version: '1.0.28-beta',
21
21
  debug: window.location.hostname === 'localhost' || window.location.hostname.includes('webflow.io'),
22
22
  prefix: 'bb-', // utilisé pour générer les sélecteurs (data-bb-*)
23
23
  i18n: {
@@ -339,6 +339,8 @@
339
339
  // Créer le conteneur principal
340
340
  const mainContainer = document.createElement('div');
341
341
  const isVertical = orientation === 'vertical';
342
+ const useAutoHeight = isVertical && height === 'auto';
343
+
342
344
  mainContainer.style.cssText = `
343
345
  position: relative;
344
346
  width: 100%;
@@ -351,11 +353,9 @@
351
353
  // Créer le conteneur de défilement
352
354
  const scrollContainer = document.createElement('div');
353
355
  scrollContainer.style.cssText = `
354
- position: absolute;
356
+ ${useAutoHeight ? 'position: relative;' : 'position: absolute;'}
355
357
  will-change: transform;
356
- height: 100%;
357
- top: 0px;
358
- left: 0px;
358
+ ${useAutoHeight ? '' : 'height: 100%; top: 0px; left: 0px;'}
359
359
  display: flex;
360
360
  ${isVertical ? 'flex-direction: column;' : ''}
361
361
  align-items: center;
@@ -424,7 +424,11 @@
424
424
  // Animation JavaScript pour le vertical
425
425
  const contentSize = contentHeight;
426
426
  const totalSize = contentSize * 4 + parseInt(gap) * 3; // 4 copies au lieu de 3
427
- scrollContainer.style.height = totalSize + 'px';
427
+
428
+ // Ajuster la hauteur du scrollContainer seulement si pas en mode auto
429
+ if (!useAutoHeight) {
430
+ scrollContainer.style.height = totalSize + 'px';
431
+ }
428
432
 
429
433
  let currentPosition = direction === 'bottom' ? -contentSize - parseInt(gap) : 0;
430
434
  const step = (parseFloat(speed) * 2) / 60; // Vitesse différente
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bebranded/bb-contents",
3
- "version": "1.0.27-beta",
3
+ "version": "1.0.28-beta",
4
4
  "description": "Contenus additionnels français pour Webflow",
5
5
  "main": "bb-contents.js",
6
6
  "scripts": {