@bebranded/bb-contents 1.0.55-beta → 1.0.56-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.
- package/bb-contents.js +16 -16
- 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.
|
|
4
|
+
* @version 1.0.56-beta
|
|
5
5
|
* @author BeBranded
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @website https://www.bebranded.xyz
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
// Configuration
|
|
30
30
|
const config = {
|
|
31
|
-
version: '1.0.
|
|
31
|
+
version: '1.0.56-beta',
|
|
32
32
|
debug: false, // Debug désactivé
|
|
33
33
|
prefix: 'bb-', // utilisé pour générer les sélecteurs (data-bb-*)
|
|
34
34
|
youtubeEndpoint: null, // URL du worker YouTube (à définir par l'utilisateur)
|
|
@@ -456,7 +456,7 @@
|
|
|
456
456
|
console.log(`[bb-contents] Marquee ${index + 1}: INITIALISATION DE L'ANIMATION`);
|
|
457
457
|
|
|
458
458
|
if (isVertical) {
|
|
459
|
-
// Animation JavaScript pour le vertical -
|
|
459
|
+
// Animation JavaScript pour le vertical - logique simple et efficace
|
|
460
460
|
const contentSize = finalHeight;
|
|
461
461
|
const gapSize = parseInt(gap);
|
|
462
462
|
const totalSize = contentSize * 4 + gapSize * 3; // 4 copies
|
|
@@ -466,25 +466,25 @@
|
|
|
466
466
|
scrollContainer.style.height = totalSize + 'px';
|
|
467
467
|
}
|
|
468
468
|
|
|
469
|
-
// Position initiale
|
|
469
|
+
// Position initiale simple
|
|
470
470
|
let currentPosition = direction === 'bottom' ? -(contentSize + gapSize) : 0;
|
|
471
471
|
const step = (parseFloat(speed) * 2) / 60;
|
|
472
472
|
let isPaused = false;
|
|
473
473
|
|
|
474
|
-
// Fonction d'animation JavaScript
|
|
474
|
+
// Fonction d'animation JavaScript - logique simple
|
|
475
475
|
const animate = () => {
|
|
476
476
|
if (!isPaused) {
|
|
477
477
|
if (direction === 'bottom') {
|
|
478
478
|
currentPosition += step;
|
|
479
|
-
// Reset quand on arrive au début
|
|
479
|
+
// Reset simple : quand on arrive au début, on repart du début
|
|
480
480
|
if (currentPosition >= 0) {
|
|
481
481
|
currentPosition = -(contentSize + gapSize);
|
|
482
482
|
}
|
|
483
483
|
} else {
|
|
484
484
|
currentPosition -= step;
|
|
485
|
-
// Reset quand on arrive
|
|
486
|
-
if (currentPosition <= -(
|
|
487
|
-
currentPosition =
|
|
485
|
+
// Reset simple : quand on arrive à la fin, on repart du début
|
|
486
|
+
if (currentPosition <= -(contentSize + gapSize)) {
|
|
487
|
+
currentPosition = 0;
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
490
|
|
|
@@ -506,31 +506,31 @@
|
|
|
506
506
|
|
|
507
507
|
// Marquee vertical créé avec animation JS
|
|
508
508
|
} else {
|
|
509
|
-
// Animation JavaScript pour l'horizontal -
|
|
509
|
+
// Animation JavaScript pour l'horizontal - logique simple et efficace
|
|
510
510
|
const contentSize = finalWidth;
|
|
511
511
|
const gapSize = parseInt(gap);
|
|
512
512
|
const totalSize = contentSize * 4 + gapSize * 3; // 4 copies
|
|
513
513
|
scrollContainer.style.width = totalSize + 'px';
|
|
514
514
|
|
|
515
|
-
// Position initiale
|
|
515
|
+
// Position initiale simple
|
|
516
516
|
let currentPosition = direction === 'right' ? -(contentSize + gapSize) : 0;
|
|
517
517
|
const step = (parseFloat(speed) * 0.5) / 60; // Vitesse réduite pour l'horizontal
|
|
518
518
|
let isPaused = false;
|
|
519
519
|
|
|
520
|
-
// Fonction d'animation JavaScript
|
|
520
|
+
// Fonction d'animation JavaScript - logique simple
|
|
521
521
|
const animate = () => {
|
|
522
522
|
if (!isPaused) {
|
|
523
523
|
if (direction === 'right') {
|
|
524
524
|
currentPosition += step;
|
|
525
|
-
// Reset quand on arrive au début
|
|
525
|
+
// Reset simple : quand on arrive au début, on repart du début
|
|
526
526
|
if (currentPosition >= 0) {
|
|
527
527
|
currentPosition = -(contentSize + gapSize);
|
|
528
528
|
}
|
|
529
529
|
} else {
|
|
530
530
|
currentPosition -= step;
|
|
531
|
-
// Reset quand on arrive
|
|
532
|
-
if (currentPosition <= -(
|
|
533
|
-
currentPosition =
|
|
531
|
+
// Reset simple : quand on arrive à la fin, on repart du début
|
|
532
|
+
if (currentPosition <= -(contentSize + gapSize)) {
|
|
533
|
+
currentPosition = 0;
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
536
|
|