@zenpatient-org/healthspan-marketing-ui 0.1.133 → 0.1.134
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),t=require("react"),C=require("react-dom"),p=require("./scienceHero.module.css.cjs.js");function L({children:
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),t=require("react"),C=require("react-dom"),p=require("./scienceHero.module.css.cjs.js");function L({children:s,backgroundImage:w,cursorLink:v}){const[i,x]=t.useState({x:0,y:0}),[h,m]=t.useState(0),[$,c]=t.useState(!1),[g,l]=t.useState(!1),[o,b]=t.useState(null),[r,M]=t.useState(!1);t.useEffect(()=>{l(!0);const e=()=>M(window.innerWidth<=768);return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e),l(!1)}},[]),t.useEffect(()=>{if(r)return;const e=f=>{x({x:f.clientX,y:f.clientY})},d=()=>{m(window.scrollY)};return window.addEventListener("mousemove",e),window.addEventListener("scroll",d),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("scroll",d)}},[r]);const S=e=>{r||(b(e.currentTarget.getBoundingClientRect()),c(!0))},y=()=>{r||c(!1)},E=()=>{window.location.href=v};if(typeof window>"u")return s;if(r)return n.jsx(n.Fragment,{children:s});const u=`circle(270px at ${i.x}px ${i.y}px)`,a=$&&o&&n.jsx("div",{className:p.default.cursorContainer,style:{position:"fixed",top:`${o.top}px`,left:`${o.left}px`,width:`${o.width}px`,height:`${o.height}px`,overflow:"hidden",cursor:"pointer"},children:n.jsx("div",{className:p.default.normalBackground,style:{position:"absolute",top:`${-o.top}px`,left:`${-o.left}px`,backgroundImage:`url(${w})`,clipPath:u,WebkitClipPath:u,backgroundPosition:`center ${-h}px`}})});return n.jsxs(n.Fragment,{children:[n.jsx("div",{"data-type":"hero",onMouseEnter:S,onMouseLeave:y,onClick:E,style:{cursor:"pointer"},children:s}),g&&a&&C.createPortal(a,document.body)]})}exports.ScienceHeroCursor=L;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r,
|
|
3
|
-
import { useState as o, useEffect as
|
|
2
|
+
import { jsx as r, Fragment as p, jsxs as P } from "react/jsx-runtime";
|
|
3
|
+
import { useState as o, useEffect as w } from "react";
|
|
4
4
|
import { createPortal as R } from "react-dom";
|
|
5
|
-
import
|
|
6
|
-
function z({ children: s, backgroundImage:
|
|
7
|
-
const [i,
|
|
8
|
-
|
|
5
|
+
import m from "./scienceHero.module.css.es.js";
|
|
6
|
+
function z({ children: s, backgroundImage: h, cursorLink: v }) {
|
|
7
|
+
const [i, x] = o({ x: 0, y: 0 }), [M, b] = o(0), [g, l] = o(!1), [y, c] = o(!1), [t, $] = o(null), [n, E] = o(!1);
|
|
8
|
+
w(() => {
|
|
9
9
|
c(!0);
|
|
10
|
-
const e = () =>
|
|
10
|
+
const e = () => E(window.innerWidth <= 768);
|
|
11
11
|
return e(), window.addEventListener("resize", e), () => {
|
|
12
12
|
window.removeEventListener("resize", e), c(!1);
|
|
13
13
|
};
|
|
14
|
-
}, []),
|
|
14
|
+
}, []), w(() => {
|
|
15
15
|
if (n) return;
|
|
16
16
|
const e = (f) => {
|
|
17
|
-
|
|
17
|
+
x({
|
|
18
18
|
x: f.clientX,
|
|
19
19
|
y: f.clientY
|
|
20
20
|
});
|
|
21
21
|
}, a = () => {
|
|
22
|
-
|
|
22
|
+
b(window.scrollY);
|
|
23
23
|
};
|
|
24
24
|
return window.addEventListener("mousemove", e), window.addEventListener("scroll", a), () => {
|
|
25
25
|
window.removeEventListener("mousemove", e), window.removeEventListener("scroll", a);
|
|
26
26
|
};
|
|
27
27
|
}, [n]);
|
|
28
|
-
const
|
|
29
|
-
n || (
|
|
30
|
-
}, C = () => {
|
|
31
|
-
n || l(!1);
|
|
28
|
+
const C = (e) => {
|
|
29
|
+
n || ($(e.currentTarget.getBoundingClientRect()), l(!0));
|
|
32
30
|
}, L = () => {
|
|
31
|
+
n || l(!1);
|
|
32
|
+
}, k = () => {
|
|
33
33
|
window.location.href = v;
|
|
34
34
|
};
|
|
35
35
|
if (typeof window > "u") return s;
|
|
36
36
|
if (n)
|
|
37
|
-
return /* @__PURE__ */ r(
|
|
38
|
-
const d = `circle(270px at ${i.x}px ${i.y}px)`, u =
|
|
37
|
+
return /* @__PURE__ */ r(p, { children: s });
|
|
38
|
+
const d = `circle(270px at ${i.x}px ${i.y}px)`, u = g && t && /* @__PURE__ */ r(
|
|
39
39
|
"div",
|
|
40
40
|
{
|
|
41
|
-
className:
|
|
41
|
+
className: m.cursorContainer,
|
|
42
42
|
style: {
|
|
43
43
|
position: "fixed",
|
|
44
44
|
top: `${t.top}px`,
|
|
@@ -51,33 +51,33 @@ function z({ children: s, backgroundImage: m, cursorLink: v }) {
|
|
|
51
51
|
children: /* @__PURE__ */ r(
|
|
52
52
|
"div",
|
|
53
53
|
{
|
|
54
|
-
className:
|
|
54
|
+
className: m.normalBackground,
|
|
55
55
|
style: {
|
|
56
56
|
position: "absolute",
|
|
57
57
|
top: `${-t.top}px`,
|
|
58
58
|
left: `${-t.left}px`,
|
|
59
|
-
backgroundImage: `url(${
|
|
59
|
+
backgroundImage: `url(${h})`,
|
|
60
60
|
clipPath: d,
|
|
61
61
|
WebkitClipPath: d,
|
|
62
|
-
backgroundPosition: `center ${-
|
|
62
|
+
backgroundPosition: `center ${-M}px`
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
)
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
|
-
return /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ P(p, { children: [
|
|
69
69
|
/* @__PURE__ */ r(
|
|
70
70
|
"div",
|
|
71
71
|
{
|
|
72
72
|
"data-type": "hero",
|
|
73
|
-
onMouseEnter:
|
|
74
|
-
onMouseLeave:
|
|
75
|
-
onClick:
|
|
73
|
+
onMouseEnter: C,
|
|
74
|
+
onMouseLeave: L,
|
|
75
|
+
onClick: k,
|
|
76
76
|
style: { cursor: "pointer" },
|
|
77
77
|
children: s
|
|
78
78
|
}
|
|
79
79
|
),
|
|
80
|
-
|
|
80
|
+
y && u && R(u, document.body)
|
|
81
81
|
] });
|
|
82
82
|
}
|
|
83
83
|
export {
|