@bebranded/bb-contents 1.0.20-beta → 1.0.21-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 +10 -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.20-beta
4
+ * @version 1.0.21-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.20-beta',
20
+ version: '1.0.21-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: {
@@ -325,7 +325,7 @@
325
325
  element.bbProcessed = true;
326
326
 
327
327
  // Récupérer les options
328
- const speed = bbContents._getAttr(element, 'bb-marquee-speed') || '100';
328
+ const speed = bbContents._getAttr(element, 'bb-marquee-speed') || '3000';
329
329
  const direction = bbContents._getAttr(element, 'bb-marquee-direction') || 'left';
330
330
  const pause = bbContents._getAttr(element, 'bb-marquee-pause') || 'true';
331
331
  const gap = bbContents._getAttr(element, 'bb-marquee-gap') || '50';
@@ -379,14 +379,17 @@
379
379
  if (!startTime) startTime = timestamp;
380
380
  const elapsed = timestamp - startTime;
381
381
 
382
- // Vitesse en millisecondes
382
+ // Vitesse en millisecondes (plus lente pour une transition fluide)
383
383
  const speedMs = parseInt(speed);
384
384
  const progress = (elapsed % speedMs) / speedMs;
385
385
 
386
- // Calculer la taille du contenu
386
+ // Calculer la taille du contenu avec une transition plus douce
387
387
  const contentSize = isVertical ? scrollContainer.scrollHeight / 2 : scrollContainer.scrollWidth / 2;
388
388
  currentPosition = -progress * contentSize;
389
389
 
390
+ // Appliquer une transition CSS pour plus de fluidité
391
+ scrollContainer.style.transition = 'transform 0.1s ease-out';
392
+
390
393
  // Appliquer la transformation
391
394
  scrollContainer.style.transform = isVertical
392
395
  ? `translateY(${currentPosition}px)`
@@ -395,10 +398,10 @@
395
398
  animationId = requestAnimationFrame(animate);
396
399
  };
397
400
 
398
- // Démarrer l'animation
401
+ // Démarrer l'animation avec un délai pour laisser le DOM se stabiliser
399
402
  setTimeout(() => {
400
403
  animationId = requestAnimationFrame(animate);
401
- }, 100);
404
+ }, 200);
402
405
 
403
406
  // Pause au survol
404
407
  if (pause === 'true') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bebranded/bb-contents",
3
- "version": "1.0.20-beta",
3
+ "version": "1.0.21-beta",
4
4
  "description": "Contenus additionnels français pour Webflow",
5
5
  "main": "bb-contents.js",
6
6
  "scripts": {