lighteningcards 2.2.2 → 2.2.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lighteningcards",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
4
4
  "description": "",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -45,7 +45,7 @@ const LightningCardHTML = ({
45
45
 
46
46
  // Get device class - memoize to prevent unnecessary re-renders
47
47
  const [isDesktop, setIsDesktop] = useState(() => window.innerWidth >= 768);
48
-
48
+
49
49
  useEffect(() => {
50
50
  const handleResize = () => {
51
51
  setIsDesktop(window.innerWidth >= 768);
@@ -53,7 +53,7 @@ const LightningCardHTML = ({
53
53
  window.addEventListener("resize", handleResize, { passive: true });
54
54
  return () => window.removeEventListener("resize", handleResize);
55
55
  }, []);
56
-
56
+
57
57
  const deviceClass = isDesktop ? "desktop--36d4c" : "mobile--4607f";
58
58
 
59
59
  // Generate shell background SVG (from the HTML)
@@ -131,11 +131,11 @@ const LightningCardHTML = ({
131
131
  const { canvas } = animateThunderSprite(img, 3, 10, true, 0.25);
132
132
  if (canvas) {
133
133
  canvas.style.position = "absolute";
134
- canvas.style.left = isDesktop
135
- ? "calc(50% - 40px)"
136
- : "calc(50% + 75px)";
134
+ canvas.style.left = isDesktop ? "calc(50% - 40px)" : "25%";
137
135
  canvas.style.top = "calc(50% + 15px)";
138
- canvas.style.transform = "translate(-50%, -50%) scale(0.3)";
136
+ canvas.style.transform = isDesktop
137
+ ? "translate(-50%, -50%) scale(0.3)"
138
+ : "translate(-50%, -50%) scale(0.22)";
139
139
  canvas.style.zIndex = "1";
140
140
  thunderLeftRef.current.appendChild(canvas);
141
141
  }
@@ -152,11 +152,11 @@ const LightningCardHTML = ({
152
152
  const { canvas } = animateThunderSprite(img, 3, 10, true, 0.25);
153
153
  if (canvas) {
154
154
  canvas.style.position = "absolute";
155
- canvas.style.right = isDesktop
156
- ? "calc(50% - 40px)"
157
- : "calc(50% - 75px)";
155
+ canvas.style.right = isDesktop ? "calc(50% - 40px)" : "25%";
158
156
  canvas.style.top = "calc(50% + 15px)";
159
- canvas.style.transform = "translate(50%, -50%) scale(0.3)";
157
+ canvas.style.transform = isDesktop
158
+ ? "translate(50%, -50%) scale(0.3)"
159
+ : "translate(50%, -50%) scale(0.22)";
160
160
  canvas.style.zIndex = "1";
161
161
  thunderRightRef.current.appendChild(canvas);
162
162
  }
@@ -280,10 +280,10 @@ const LightningCardHTML = ({
280
280
  width: "100%",
281
281
  height: "100%",
282
282
  position: "relative",
283
- overflow: "hidden",
283
+ overflow: isDesktop ? "hidden" : "visible",
284
284
  }}
285
285
  >
286
- {/* Thunder animations - positioned absolutely */}
286
+ {/* Thunder animations - positioned absolutely; on mobile allow overflow so full thunder shows */}
287
287
  <div
288
288
  ref={thunderLeftRef}
289
289
  style={{
@@ -291,6 +291,7 @@ const LightningCardHTML = ({
291
291
  width: "100%",
292
292
  height: "100%",
293
293
  pointerEvents: "none",
294
+ overflow: "visible",
294
295
  }}
295
296
  ></div>
296
297
  <div
@@ -300,6 +301,7 @@ const LightningCardHTML = ({
300
301
  width: "100%",
301
302
  height: "100%",
302
303
  pointerEvents: "none",
304
+ overflow: "visible",
303
305
  }}
304
306
  ></div>
305
307
  <div
@@ -363,7 +365,7 @@ const LightningCardHTML = ({
363
365
  {multiplier !== null && multiplier !== undefined && (
364
366
  <div
365
367
  className="multiplier--22733"
366
- style={ { fontSize: "15px" } }
368
+ style={{ fontSize: "15px" }}
367
369
  >
368
370
  <div className="multiplier--fe086">
369
371
  <span
@@ -475,7 +477,7 @@ const LightningCardHTML = ({
475
477
  {multiplier !== null && multiplier !== undefined && (
476
478
  <div
477
479
  className="multiplier--22733"
478
- style={ { fontSize: "15px" } }
480
+ style={{ fontSize: "15px" }}
479
481
  >
480
482
  <div className="multiplier--fe086">
481
483
  <span