@bebranded/bb-contents 1.0.95 → 1.0.96

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 +9 -8
  2. package/package.json +1 -1
package/bb-contents.js CHANGED
@@ -398,14 +398,14 @@
398
398
  const originalWidth = computedStyle.width;
399
399
  const originalHeight = computedStyle.height;
400
400
 
401
- // OPTIMISATION MOBILE : Améliorer le rendu des images sur mobile
401
+ // OPTIMISATION MOBILE : Améliorer le rendu des images sur mobile (sans transform sur l'image)
402
402
  if (isMobile) {
403
- // Forcer le rendu haute qualité sur mobile
404
- img.style.imageRendering = 'auto';
403
+ // Forcer le rendu haute qualité sur mobile sans transform (évite conflit avec translate3d du parent)
405
404
  img.style.backfaceVisibility = 'hidden';
406
405
  img.style.webkitBackfaceVisibility = 'hidden';
407
- img.style.transform = 'translateZ(0)';
408
- img.style.webkitTransform = 'translateZ(0)';
406
+ // Ne PAS mettre transform sur l'image car le parent utilise translate3d
407
+ // Cela évite les problèmes de flou causés par les transformations multiples
408
+ img.style.willChange = 'auto'; // Éviter will-change qui peut causer du flou
409
409
  }
410
410
 
411
411
  // Charger l'image si nécessaire
@@ -417,9 +417,9 @@
417
417
  img.src = img.dataset.src;
418
418
  }
419
419
 
420
- // OPTIMISATION MOBILE : Utiliser lazy loading natif au lieu de eager sur mobile
420
+ // OPTIMISATION MOBILE : Utiliser eager sur mobile pour éviter le flou de lazy loading
421
421
  if (!img.loading) {
422
- img.loading = isMobile ? 'lazy' : 'eager';
422
+ img.loading = isMobile ? 'eager' : 'lazy'; // eager sur mobile pour meilleur rendu
423
423
  }
424
424
 
425
425
  img.onload = () => {
@@ -437,7 +437,8 @@
437
437
 
438
438
  // Forcer le recalcul pour mobile (important pour le rendu)
439
439
  if (isMobile) {
440
- img.offsetHeight; // Force reflow pour meilleur rendu
440
+ // Force reflow pour meilleur rendu sans ajouter de transform
441
+ void img.offsetHeight;
441
442
  }
442
443
 
443
444
  imagesLoaded++;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bebranded/bb-contents",
3
- "version": "1.0.95",
3
+ "version": "1.0.96",
4
4
  "description": "Contenus additionnels français pour Webflow",
5
5
  "main": "bb-contents.js",
6
6
  "scripts": {