@morphika/andami 0.2.3 → 0.2.4

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.
@@ -250,7 +250,13 @@ export default function ProjectGridBlockRenderer({
250
250
  observer.disconnect();
251
251
  }
252
252
  },
253
- { threshold: 0.05 },
253
+ {
254
+ threshold: 0.01,
255
+ // Trigger 200px before the grid scrolls into view so cards
256
+ // start animating just before the user sees them (especially
257
+ // on mobile where the grid may sit just below the fold).
258
+ rootMargin: "200px 0px",
259
+ },
254
260
  );
255
261
 
256
262
  observer.observe(el);
@@ -438,9 +444,12 @@ const ProjectCard = memo(function ProjectCard({
438
444
  const handlePlay = useCallback(() => setIsPlaying(true), []);
439
445
  const handlePause = useCallback(() => setIsPlaying(false), []);
440
446
 
441
- // Scale transform
442
- const scaleTransform =
443
- hoverEffect === "scale" && hovered ? "scale(1.03)" : "scale(1)";
447
+ // Scale hover: applied to an inner content wrapper so the zoom is
448
+ // visible inside the card's borderRadius + overflow:hidden boundary
449
+ // (the parent masonry cell also clips, so scaling the card wrapper
450
+ // itself would be invisible).
451
+ const contentScale =
452
+ hoverEffect === "scale" && hovered ? "scale(1.05)" : "scale(1)";
444
453
 
445
454
  return (
446
455
  <Link
@@ -459,15 +468,22 @@ const ProjectCard = memo(function ProjectCard({
459
468
  height: "100%",
460
469
  overflow: "hidden",
461
470
  borderRadius: radius,
471
+ // 3D tilt: applied on the card wrapper (set via handleMouseMove)
462
472
  transition:
463
473
  hoverEffect === "3d"
464
474
  ? "transform 100ms ease-out"
465
- : hoverEffect === "scale"
466
- ? "transform 300ms ease"
467
- : undefined,
468
- transform: hoverEffect === "scale" ? scaleTransform : undefined,
475
+ : undefined,
469
476
  }}
470
477
  >
478
+ {/* Inner content wrapper — receives scale hover transform */}
479
+ <div
480
+ style={{
481
+ position: "absolute",
482
+ inset: 0,
483
+ transition: hoverEffect === "scale" ? "transform 300ms ease" : undefined,
484
+ transform: hoverEffect === "scale" ? contentScale : undefined,
485
+ }}
486
+ >
471
487
  {/* Thumbnail image */}
472
488
  {imgSrc ? (
473
489
  <img
@@ -532,7 +548,9 @@ const ProjectCard = memo(function ProjectCard({
532
548
  />
533
549
  )}
534
550
 
535
- {/* Subtitle overlay */}
551
+ </div>{/* end inner content wrapper */}
552
+
553
+ {/* Subtitle overlay — outside the scale wrapper so text stays crisp */}
536
554
  {showSubtitle && (
537
555
  <div
538
556
  style={{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morphika/andami",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Visual Page Builder — core library. A reusable website builder with visual editing, CMS integration, and asset management.",
5
5
  "type": "module",
6
6
  "license": "MIT",