@arolariu/components 0.0.36 → 0.0.38
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/changelog.md +15 -0
- package/dist/cjs/components/ui/background-beams.cjs +200 -0
- package/dist/cjs/components/ui/background-beams.cjs.map +1 -0
- package/dist/cjs/components/ui/bubble-background.cjs +214 -0
- package/dist/cjs/components/ui/bubble-background.cjs.map +1 -0
- package/dist/cjs/components/ui/chart.cjs.map +1 -1
- package/dist/cjs/components/ui/counting-number.cjs +95 -0
- package/dist/cjs/components/ui/counting-number.cjs.map +1 -0
- package/dist/cjs/components/ui/dot-background.cjs +131 -0
- package/dist/cjs/components/ui/dot-background.cjs.map +1 -0
- package/dist/cjs/components/ui/drawer.cjs.map +1 -1
- package/dist/cjs/components/ui/dropdown-menu.cjs.map +1 -1
- package/dist/cjs/components/ui/dropdrawer.cjs +627 -0
- package/dist/cjs/components/ui/dropdrawer.cjs.map +1 -0
- package/dist/cjs/components/ui/fireworks-background.cjs +259 -0
- package/dist/cjs/components/ui/fireworks-background.cjs.map +1 -0
- package/dist/cjs/components/ui/flip-button.cjs +100 -0
- package/dist/cjs/components/ui/flip-button.cjs.map +1 -0
- package/dist/cjs/components/ui/gradient-background.cjs +60 -0
- package/dist/cjs/components/ui/gradient-background.cjs.map +1 -0
- package/dist/cjs/components/ui/gradient-text.cjs +83 -0
- package/dist/cjs/components/ui/gradient-text.cjs.map +1 -0
- package/dist/cjs/components/ui/highlight-text.cjs +74 -0
- package/dist/cjs/components/ui/highlight-text.cjs.map +1 -0
- package/dist/cjs/components/ui/hole-background.cjs +361 -0
- package/dist/cjs/components/ui/hole-background.cjs.map +1 -0
- package/dist/cjs/components/ui/pagination.cjs.map +1 -1
- package/dist/cjs/components/ui/ripple-button.cjs +108 -0
- package/dist/cjs/components/ui/ripple-button.cjs.map +1 -0
- package/dist/cjs/components/ui/scratcher.cjs +179 -0
- package/dist/cjs/components/ui/scratcher.cjs.map +1 -0
- package/dist/cjs/hooks/use-mobile.cjs.map +1 -1
- package/dist/cjs/index.cjs +86 -4
- package/dist/cjs/index.css +2859 -160
- package/dist/esm/components/ui/background-beams.js +166 -0
- package/dist/esm/components/ui/background-beams.js.map +1 -0
- package/dist/esm/components/ui/bubble-background.js +180 -0
- package/dist/esm/components/ui/bubble-background.js.map +1 -0
- package/dist/esm/components/ui/chart.js.map +1 -1
- package/dist/esm/components/ui/counting-number.js +61 -0
- package/dist/esm/components/ui/counting-number.js.map +1 -0
- package/dist/esm/components/ui/dot-background.js +97 -0
- package/dist/esm/components/ui/dot-background.js.map +1 -0
- package/dist/esm/components/ui/drawer.js.map +1 -1
- package/dist/esm/components/ui/dropdown-menu.js.map +1 -1
- package/dist/esm/components/ui/dropdrawer.js +563 -0
- package/dist/esm/components/ui/dropdrawer.js.map +1 -0
- package/dist/esm/components/ui/fireworks-background.js +225 -0
- package/dist/esm/components/ui/fireworks-background.js.map +1 -0
- package/dist/esm/components/ui/flip-button.js +66 -0
- package/dist/esm/components/ui/flip-button.js.map +1 -0
- package/dist/esm/components/ui/gradient-background.js +26 -0
- package/dist/esm/components/ui/gradient-background.js.map +1 -0
- package/dist/esm/components/ui/gradient-text.js +49 -0
- package/dist/esm/components/ui/gradient-text.js.map +1 -0
- package/dist/esm/components/ui/highlight-text.js +40 -0
- package/dist/esm/components/ui/highlight-text.js.map +1 -0
- package/dist/esm/components/ui/hole-background.js +327 -0
- package/dist/esm/components/ui/hole-background.js.map +1 -0
- package/dist/esm/components/ui/pagination.js.map +1 -1
- package/dist/esm/components/ui/ripple-button.js +74 -0
- package/dist/esm/components/ui/ripple-button.js.map +1 -0
- package/dist/esm/components/ui/scratcher.js +145 -0
- package/dist/esm/components/ui/scratcher.js.map +1 -0
- package/dist/esm/hooks/use-mobile.js.map +1 -1
- package/dist/esm/index.css +2859 -160
- package/dist/esm/index.js +37 -1
- package/dist/index.css +2859 -160
- package/dist/index.js +37 -1
- package/dist/types/components/ui/background-beams.d.ts +4 -0
- package/dist/types/components/ui/bubble-background.d.ts +16 -0
- package/dist/types/components/ui/counting-number.d.ts +15 -0
- package/dist/types/components/ui/dot-background.d.ts +57 -0
- package/dist/types/components/ui/dropdrawer.d.ts +23 -0
- package/dist/types/components/ui/fireworks-background.d.ts +24 -0
- package/dist/types/components/ui/flip-button.d.ts +13 -0
- package/dist/types/components/ui/gradient-background.d.ts +7 -0
- package/dist/types/components/ui/gradient-text.d.ts +10 -0
- package/dist/types/components/ui/highlight-text.d.ts +11 -0
- package/dist/types/components/ui/hole-background.d.ts +9 -0
- package/dist/types/components/ui/ripple-button.d.ts +10 -0
- package/dist/types/components/ui/scratcher.d.ts +12 -0
- package/dist/types/hooks/use-mobile.d.ts +23 -0
- package/dist/types/index.d.ts +13 -0
- package/package.json +159 -70
- package/readme.md +12 -7
- package/src/components/ui/background-beams.tsx +142 -0
- package/src/components/ui/bubble-background.tsx +187 -0
- package/src/components/ui/counting-number.tsx +108 -0
- package/src/components/ui/dot-background.tsx +158 -0
- package/src/components/ui/drawer.tsx +4 -4
- package/src/components/ui/dropdown-menu.tsx +9 -9
- package/src/components/ui/dropdrawer.tsx +973 -0
- package/src/components/ui/fireworks-background.tsx +378 -0
- package/src/components/ui/flip-button.tsx +110 -0
- package/src/components/ui/gradient-background.tsx +43 -0
- package/src/components/ui/gradient-text.tsx +65 -0
- package/src/components/ui/highlight-text.tsx +71 -0
- package/src/components/ui/hole-background.tsx +361 -0
- package/src/components/ui/ripple-button.tsx +111 -0
- package/src/components/ui/scratcher.tsx +171 -0
- package/src/hooks/use-mobile.tsx +37 -12
- package/src/index.ts +69 -0
- package/tsconfig.json +50 -50
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
GradientText: ()=>GradientText
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
32
|
+
const react_namespaceObject = require("motion/react");
|
|
33
|
+
const utils_cjs_namespaceObject = require("../../lib/utils.cjs");
|
|
34
|
+
const GradientText = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ text, className, gradient = "linear-gradient(90deg, #3b82f6 0%, #a855f7 20%, #ec4899 50%, #a855f7 80%, #3b82f6 100%)", neon = false, transition = {
|
|
35
|
+
duration: 50,
|
|
36
|
+
repeat: 1 / 0,
|
|
37
|
+
ease: "linear"
|
|
38
|
+
}, ...props }, ref)=>{
|
|
39
|
+
const baseStyle = {
|
|
40
|
+
backgroundImage: gradient
|
|
41
|
+
};
|
|
42
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
43
|
+
ref: ref,
|
|
44
|
+
className: (0, utils_cjs_namespaceObject.cn)("relative inline-block", className),
|
|
45
|
+
...props,
|
|
46
|
+
children: [
|
|
47
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.motion.span, {
|
|
48
|
+
className: "m-0 text-transparent bg-clip-text bg-[length:700%_100%] bg-[position:0%_0%]",
|
|
49
|
+
style: baseStyle,
|
|
50
|
+
initial: {
|
|
51
|
+
backgroundPosition: "0% 0%"
|
|
52
|
+
},
|
|
53
|
+
animate: {
|
|
54
|
+
backgroundPosition: "500% 100%"
|
|
55
|
+
},
|
|
56
|
+
transition: transition,
|
|
57
|
+
children: text
|
|
58
|
+
}),
|
|
59
|
+
neon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.motion.span, {
|
|
60
|
+
className: "m-0 absolute top-0 left-0 text-transparent bg-clip-text blur-[8px] mix-blend-plus-lighter bg-[length:700%_100%] bg-[position:0%_0%]",
|
|
61
|
+
style: baseStyle,
|
|
62
|
+
initial: {
|
|
63
|
+
backgroundPosition: "0% 0%"
|
|
64
|
+
},
|
|
65
|
+
animate: {
|
|
66
|
+
backgroundPosition: "500% 100%"
|
|
67
|
+
},
|
|
68
|
+
transition: transition,
|
|
69
|
+
children: text
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
GradientText.displayName = "GradientText";
|
|
75
|
+
exports.GradientText = __webpack_exports__.GradientText;
|
|
76
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
77
|
+
"GradientText"
|
|
78
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
79
|
+
Object.defineProperty(exports, '__esModule', {
|
|
80
|
+
value: true
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=gradient-text.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components\\ui\\gradient-text.cjs","sources":["webpack://@arolariu/components/./src/components/ui/gradient-text.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport { motion, type Transition } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface GradientTextProps extends React.HTMLAttributes<HTMLSpanElement> {\n text: string;\n gradient?: string;\n neon?: boolean;\n transition?: Transition;\n}\n\nconst GradientText = React.forwardRef<HTMLSpanElement, GradientTextProps>(\n (\n {\n text,\n className,\n gradient = \"linear-gradient(90deg, #3b82f6 0%, #a855f7 20%, #ec4899 50%, #a855f7 80%, #3b82f6 100%)\",\n neon = false,\n transition = { duration: 50, repeat: Infinity, ease: \"linear\" },\n ...props\n },\n ref\n ) => {\n const baseStyle: React.CSSProperties = {\n backgroundImage: gradient,\n };\n\n return (\n <span\n ref={ref}\n className={cn(\"relative inline-block\", className)}\n {...props}\n >\n <motion.span\n className=\"m-0 text-transparent bg-clip-text bg-[length:700%_100%] bg-[position:0%_0%]\"\n style={baseStyle}\n initial={{ backgroundPosition: \"0% 0%\" }}\n animate={{ backgroundPosition: \"500% 100%\" }}\n transition={transition}\n >\n {text}\n </motion.span>\n\n {neon && (\n <motion.span\n className=\"m-0 absolute top-0 left-0 text-transparent bg-clip-text blur-[8px] mix-blend-plus-lighter bg-[length:700%_100%] bg-[position:0%_0%]\"\n style={baseStyle}\n initial={{ backgroundPosition: \"0% 0%\" }}\n animate={{ backgroundPosition: \"500% 100%\" }}\n transition={transition}\n >\n {text}\n </motion.span>\n )}\n </span>\n );\n }\n);\n\nGradientText.displayName = \"GradientText\";\n\nexport { GradientText, type GradientTextProps };\n"],"names":["GradientText","React","text","className","gradient","neon","transition","Infinity","props","ref","baseStyle","cn","motion"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAMA,eAAe,WAAfA,GAAeC,+BAAAA,UAAgB,CACnC,CACE,EACEC,IAAI,EACJC,SAAS,EACTC,WAAW,yFAAyF,EACpGC,OAAO,KAAK,EACZC,aAAa;IAAE,UAAU;IAAI,QAAQC;IAAU,MAAM;AAAS,CAAC,EAC/D,GAAGC,OACJ,EACDC;IAEA,MAAMC,YAAiC;QACrC,iBAAiBN;IACnB;IAEA,OACE,WADF,GACE,sCAAC;QACC,KAAKK;QACL,WAAWE,IAAAA,0BAAAA,EAAAA,EAAG,yBAAyBR;QACtC,GAAGK,KAAK;;0BAET,qCAACI,sBAAAA,MAAAA,CAAAA,IAAW;gBACV,WAAU;gBACV,OAAOF;gBACP,SAAS;oBAAE,oBAAoB;gBAAQ;gBACvC,SAAS;oBAAE,oBAAoB;gBAAY;gBAC3C,YAAYJ;0BAEXJ;;YAGFG,QACC,WADDA,GACC,qCAACO,sBAAAA,MAAAA,CAAAA,IAAW;gBACV,WAAU;gBACV,OAAOF;gBACP,SAAS;oBAAE,oBAAoB;gBAAQ;gBACvC,SAAS;oBAAE,oBAAoB;gBAAY;gBAC3C,YAAYJ;0BAEXJ;;;;AAKX;AAGFF,aAAa,WAAW,GAAG"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
HighlightText: ()=>HighlightText
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
32
|
+
const react_namespaceObject = require("motion/react");
|
|
33
|
+
const utils_cjs_namespaceObject = require("../../lib/utils.cjs");
|
|
34
|
+
const animation = {
|
|
35
|
+
backgroundSize: "100% 100%"
|
|
36
|
+
};
|
|
37
|
+
const HighlightText = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ text, className, inView = false, inViewMargin = "0px", transition = {
|
|
38
|
+
duration: 2,
|
|
39
|
+
ease: "easeInOut"
|
|
40
|
+
}, ...props }, ref)=>{
|
|
41
|
+
const localRef = external_react_namespaceObject.useRef(null);
|
|
42
|
+
external_react_namespaceObject.useImperativeHandle(ref, ()=>localRef.current);
|
|
43
|
+
const inViewResult = (0, react_namespaceObject.useInView)(localRef, {
|
|
44
|
+
once: true,
|
|
45
|
+
margin: inViewMargin
|
|
46
|
+
});
|
|
47
|
+
const isInView = !inView || inViewResult;
|
|
48
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.motion.span, {
|
|
49
|
+
ref: localRef,
|
|
50
|
+
initial: {
|
|
51
|
+
backgroundSize: "0% 100%"
|
|
52
|
+
},
|
|
53
|
+
animate: isInView ? animation : void 0,
|
|
54
|
+
transition: transition,
|
|
55
|
+
style: {
|
|
56
|
+
backgroundRepeat: "no-repeat",
|
|
57
|
+
backgroundPosition: "left center",
|
|
58
|
+
display: "inline"
|
|
59
|
+
},
|
|
60
|
+
className: (0, utils_cjs_namespaceObject.cn)("relative inline-block px-2 py-1 rounded-lg bg-gradient-to-r from-blue-100 to-purple-100 dark:from-blue-500 dark:to-purple-500", className),
|
|
61
|
+
...props,
|
|
62
|
+
children: text
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
HighlightText.displayName = "HighlightText";
|
|
66
|
+
exports.HighlightText = __webpack_exports__.HighlightText;
|
|
67
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
68
|
+
"HighlightText"
|
|
69
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
70
|
+
Object.defineProperty(exports, '__esModule', {
|
|
71
|
+
value: true
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
//# sourceMappingURL=highlight-text.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components\\ui\\highlight-text.cjs","sources":["webpack://@arolariu/components/./src/components/ui/highlight-text.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport {\n motion,\n useInView,\n type HTMLMotionProps,\n type Transition,\n type UseInViewOptions,\n} from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface HighlightTextProps extends HTMLMotionProps<\"span\"> {\n text: string;\n inView?: boolean;\n inViewMargin?: UseInViewOptions[\"margin\"];\n inViewOnce?: boolean;\n transition?: Transition;\n}\n\nconst animation = { backgroundSize: \"100% 100%\" };\n\nconst HighlightText = React.forwardRef<HTMLSpanElement, HighlightTextProps>(\n (\n {\n text,\n className,\n inView = false,\n inViewMargin = \"0px\",\n transition = { duration: 2, ease: \"easeInOut\" },\n ...props\n },\n ref\n ) => {\n const localRef = React.useRef<HTMLSpanElement>(null);\n React.useImperativeHandle(ref, () => localRef.current as HTMLSpanElement);\n\n const inViewResult = useInView(localRef, {\n once: true,\n margin: inViewMargin,\n });\n const isInView = !inView || inViewResult;\n\n return (\n <motion.span\n ref={localRef}\n initial={{\n backgroundSize: \"0% 100%\",\n }}\n animate={isInView ? animation : undefined}\n transition={transition}\n style={{\n backgroundRepeat: \"no-repeat\",\n backgroundPosition: \"left center\",\n display: \"inline\",\n }}\n className={cn(\n `relative inline-block px-2 py-1 rounded-lg bg-gradient-to-r from-blue-100 to-purple-100 dark:from-blue-500 dark:to-purple-500`,\n className\n )}\n {...props}\n >\n {text}\n </motion.span>\n );\n }\n);\nHighlightText.displayName = \"HighlightText\";\n\nexport { HighlightText, type HighlightTextProps };\n"],"names":["animation","HighlightText","React","text","className","inView","inViewMargin","transition","props","ref","localRef","inViewResult","useInView","isInView","motion","undefined","cn"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBA,MAAMA,YAAY;IAAE,gBAAgB;AAAY;AAEhD,MAAMC,gBAAgB,WAAhBA,GAAgBC,+BAAAA,UAAgB,CACpC,CACE,EACEC,IAAI,EACJC,SAAS,EACTC,SAAS,KAAK,EACdC,eAAe,KAAK,EACpBC,aAAa;IAAE,UAAU;IAAG,MAAM;AAAY,CAAC,EAC/C,GAAGC,OACJ,EACDC;IAEA,MAAMC,WAAWR,+BAAAA,MAAY,CAAkB;IAC/CA,+BAAAA,mBAAyB,CAACO,KAAK,IAAMC,SAAS,OAAO;IAErD,MAAMC,eAAeC,IAAAA,sBAAAA,SAAAA,EAAUF,UAAU;QACvC,MAAM;QACN,QAAQJ;IACV;IACA,MAAMO,WAAW,CAACR,UAAUM;IAE5B,OACE,WADF,GACE,qCAACG,sBAAAA,MAAAA,CAAAA,IAAW;QACV,KAAKJ;QACL,SAAS;YACP,gBAAgB;QAClB;QACA,SAASG,WAAWb,YAAYe;QAChC,YAAYR;QACZ,OAAO;YACL,kBAAkB;YAClB,oBAAoB;YACpB,SAAS;QACX;QACA,WAAWS,IAAAA,0BAAAA,EAAAA,EACT,iIACAZ;QAED,GAAGI,KAAK;kBAERL;;AAGP;AAEFF,cAAc,WAAW,GAAG"}
|
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __webpack_require__ = {};
|
|
4
|
+
(()=>{
|
|
5
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
6
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: definition[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.r = (exports1)=>{
|
|
17
|
+
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
18
|
+
value: 'Module'
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
21
|
+
value: true
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
})();
|
|
25
|
+
var __webpack_exports__ = {};
|
|
26
|
+
__webpack_require__.r(__webpack_exports__);
|
|
27
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
28
|
+
HoleBackground: ()=>HoleBackground
|
|
29
|
+
});
|
|
30
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
31
|
+
const external_react_namespaceObject = require("react");
|
|
32
|
+
const react_namespaceObject = require("motion/react");
|
|
33
|
+
const utils_cjs_namespaceObject = require("../../lib/utils.cjs");
|
|
34
|
+
const HoleBackground = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ strokeColor = "#737373", numberOfLines = 50, numberOfDiscs = 50, particleRGBColor = [
|
|
35
|
+
255,
|
|
36
|
+
255,
|
|
37
|
+
255
|
|
38
|
+
], className, children, ...props }, ref)=>{
|
|
39
|
+
const canvasRef = external_react_namespaceObject.useRef(null);
|
|
40
|
+
external_react_namespaceObject.useImperativeHandle(ref, ()=>canvasRef.current);
|
|
41
|
+
const animationFrameIdRef = external_react_namespaceObject.useRef(0);
|
|
42
|
+
const stateRef = external_react_namespaceObject.useRef({
|
|
43
|
+
discs: [],
|
|
44
|
+
lines: [],
|
|
45
|
+
particles: [],
|
|
46
|
+
clip: {},
|
|
47
|
+
startDisc: {},
|
|
48
|
+
endDisc: {},
|
|
49
|
+
rect: {
|
|
50
|
+
width: 0,
|
|
51
|
+
height: 0
|
|
52
|
+
},
|
|
53
|
+
render: {
|
|
54
|
+
width: 0,
|
|
55
|
+
height: 0,
|
|
56
|
+
dpi: 1
|
|
57
|
+
},
|
|
58
|
+
particleArea: {},
|
|
59
|
+
linesCanvas: null
|
|
60
|
+
});
|
|
61
|
+
const linear = (p)=>p;
|
|
62
|
+
const easeInExpo = (p)=>0 === p ? 0 : Math.pow(2, 10 * (p - 1));
|
|
63
|
+
const tweenValue = external_react_namespaceObject.useCallback((start, end, p, ease = null)=>{
|
|
64
|
+
const delta = end - start;
|
|
65
|
+
const easeFn = "inExpo" === ease ? easeInExpo : linear;
|
|
66
|
+
return start + delta * easeFn(p);
|
|
67
|
+
}, []);
|
|
68
|
+
const tweenDisc = external_react_namespaceObject.useCallback((disc)=>{
|
|
69
|
+
const { startDisc, endDisc } = stateRef.current;
|
|
70
|
+
disc.x = tweenValue(startDisc.x, endDisc.x, disc.p);
|
|
71
|
+
disc.y = tweenValue(startDisc.y, endDisc.y, disc.p, "inExpo");
|
|
72
|
+
disc.w = tweenValue(startDisc.w, endDisc.w, disc.p);
|
|
73
|
+
disc.h = tweenValue(startDisc.h, endDisc.h, disc.p);
|
|
74
|
+
}, [
|
|
75
|
+
tweenValue
|
|
76
|
+
]);
|
|
77
|
+
const setSize = external_react_namespaceObject.useCallback(()=>{
|
|
78
|
+
const canvas = canvasRef.current;
|
|
79
|
+
if (!canvas) return;
|
|
80
|
+
const rect = canvas.getBoundingClientRect();
|
|
81
|
+
stateRef.current.rect = {
|
|
82
|
+
width: rect.width,
|
|
83
|
+
height: rect.height
|
|
84
|
+
};
|
|
85
|
+
stateRef.current.render = {
|
|
86
|
+
width: rect.width,
|
|
87
|
+
height: rect.height,
|
|
88
|
+
dpi: window.devicePixelRatio || 1
|
|
89
|
+
};
|
|
90
|
+
canvas.width = stateRef.current.render.width * stateRef.current.render.dpi;
|
|
91
|
+
canvas.height = stateRef.current.render.height * stateRef.current.render.dpi;
|
|
92
|
+
}, []);
|
|
93
|
+
const setDiscs = external_react_namespaceObject.useCallback(()=>{
|
|
94
|
+
const { width, height } = stateRef.current.rect;
|
|
95
|
+
stateRef.current.discs = [];
|
|
96
|
+
stateRef.current.startDisc = {
|
|
97
|
+
x: 0.5 * width,
|
|
98
|
+
y: 0.45 * height,
|
|
99
|
+
w: 0.75 * width,
|
|
100
|
+
h: 0.7 * height
|
|
101
|
+
};
|
|
102
|
+
stateRef.current.endDisc = {
|
|
103
|
+
x: 0.5 * width,
|
|
104
|
+
y: 0.95 * height,
|
|
105
|
+
w: 0,
|
|
106
|
+
h: 0
|
|
107
|
+
};
|
|
108
|
+
let prevBottom = height;
|
|
109
|
+
stateRef.current.clip = {};
|
|
110
|
+
for(let i = 0; i < numberOfDiscs; i++){
|
|
111
|
+
const p = i / numberOfDiscs;
|
|
112
|
+
const disc = {
|
|
113
|
+
p,
|
|
114
|
+
x: 0,
|
|
115
|
+
y: 0,
|
|
116
|
+
w: 0,
|
|
117
|
+
h: 0
|
|
118
|
+
};
|
|
119
|
+
tweenDisc(disc);
|
|
120
|
+
const bottom = disc.y + disc.h;
|
|
121
|
+
if (bottom <= prevBottom) stateRef.current.clip = {
|
|
122
|
+
disc: {
|
|
123
|
+
...disc
|
|
124
|
+
},
|
|
125
|
+
i
|
|
126
|
+
};
|
|
127
|
+
prevBottom = bottom;
|
|
128
|
+
stateRef.current.discs.push(disc);
|
|
129
|
+
}
|
|
130
|
+
const clipPath = new Path2D();
|
|
131
|
+
const disc = stateRef.current.clip.disc;
|
|
132
|
+
clipPath.ellipse(disc.x, disc.y, disc.w, disc.h, 0, 0, 2 * Math.PI);
|
|
133
|
+
clipPath.rect(disc.x - disc.w, 0, 2 * disc.w, disc.y);
|
|
134
|
+
stateRef.current.clip.path = clipPath;
|
|
135
|
+
}, [
|
|
136
|
+
tweenDisc
|
|
137
|
+
]);
|
|
138
|
+
const setLines = external_react_namespaceObject.useCallback(()=>{
|
|
139
|
+
const { width, height } = stateRef.current.rect;
|
|
140
|
+
stateRef.current.lines = [];
|
|
141
|
+
const linesAngle = 2 * Math.PI / numberOfLines;
|
|
142
|
+
for(let i = 0; i < numberOfLines; i++)stateRef.current.lines.push([]);
|
|
143
|
+
stateRef.current.discs.forEach((disc)=>{
|
|
144
|
+
for(let i = 0; i < numberOfLines; i++){
|
|
145
|
+
const angle = i * linesAngle;
|
|
146
|
+
const p = {
|
|
147
|
+
x: disc.x + Math.cos(angle) * disc.w,
|
|
148
|
+
y: disc.y + Math.sin(angle) * disc.h
|
|
149
|
+
};
|
|
150
|
+
stateRef.current.lines[i].push(p);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
const offCanvas = document.createElement("canvas");
|
|
154
|
+
offCanvas.width = width;
|
|
155
|
+
offCanvas.height = height;
|
|
156
|
+
const ctx = offCanvas.getContext("2d");
|
|
157
|
+
if (!ctx) return;
|
|
158
|
+
stateRef.current.lines.forEach((line)=>{
|
|
159
|
+
ctx.save();
|
|
160
|
+
let lineIsIn = false;
|
|
161
|
+
line.forEach((p1, j)=>{
|
|
162
|
+
if (0 === j) return;
|
|
163
|
+
const p0 = line[j - 1];
|
|
164
|
+
if (!lineIsIn && (ctx.isPointInPath(stateRef.current.clip.path, p1.x, p1.y) || ctx.isPointInStroke(stateRef.current.clip.path, p1.x, p1.y))) lineIsIn = true;
|
|
165
|
+
else if (lineIsIn) ctx.clip(stateRef.current.clip.path);
|
|
166
|
+
ctx.beginPath();
|
|
167
|
+
ctx.moveTo(p0.x, p0.y);
|
|
168
|
+
ctx.lineTo(p1.x, p1.y);
|
|
169
|
+
ctx.strokeStyle = strokeColor;
|
|
170
|
+
ctx.lineWidth = 2;
|
|
171
|
+
ctx.stroke();
|
|
172
|
+
ctx.closePath();
|
|
173
|
+
});
|
|
174
|
+
ctx.restore();
|
|
175
|
+
});
|
|
176
|
+
stateRef.current.linesCanvas = offCanvas;
|
|
177
|
+
}, [
|
|
178
|
+
strokeColor
|
|
179
|
+
]);
|
|
180
|
+
const initParticle = external_react_namespaceObject.useCallback((start = false)=>{
|
|
181
|
+
const sx = stateRef.current.particleArea.sx + stateRef.current.particleArea.sw * Math.random();
|
|
182
|
+
const ex = stateRef.current.particleArea.ex + stateRef.current.particleArea.ew * Math.random();
|
|
183
|
+
const dx = ex - sx;
|
|
184
|
+
const y = start ? stateRef.current.particleArea.h * Math.random() : stateRef.current.particleArea.h;
|
|
185
|
+
const r = 0.5 + 4 * Math.random();
|
|
186
|
+
const vy = 0.5 + Math.random();
|
|
187
|
+
return {
|
|
188
|
+
x: sx,
|
|
189
|
+
sx,
|
|
190
|
+
dx,
|
|
191
|
+
y,
|
|
192
|
+
vy,
|
|
193
|
+
p: 0,
|
|
194
|
+
r,
|
|
195
|
+
c: `rgba(${particleRGBColor[0]}, ${particleRGBColor[1]}, ${particleRGBColor[2]}, ${Math.random()})`
|
|
196
|
+
};
|
|
197
|
+
}, []);
|
|
198
|
+
const setParticles = external_react_namespaceObject.useCallback(()=>{
|
|
199
|
+
const { width, height } = stateRef.current.rect;
|
|
200
|
+
stateRef.current.particles = [];
|
|
201
|
+
const disc = stateRef.current.clip.disc;
|
|
202
|
+
stateRef.current.particleArea = {
|
|
203
|
+
sw: 0.5 * disc.w,
|
|
204
|
+
ew: 2 * disc.w,
|
|
205
|
+
h: 0.85 * height
|
|
206
|
+
};
|
|
207
|
+
stateRef.current.particleArea.sx = (width - stateRef.current.particleArea.sw) / 2;
|
|
208
|
+
stateRef.current.particleArea.ex = (width - stateRef.current.particleArea.ew) / 2;
|
|
209
|
+
const totalParticles = 100;
|
|
210
|
+
for(let i = 0; i < totalParticles; i++)stateRef.current.particles.push(initParticle(true));
|
|
211
|
+
}, [
|
|
212
|
+
initParticle
|
|
213
|
+
]);
|
|
214
|
+
const drawDiscs = external_react_namespaceObject.useCallback((ctx)=>{
|
|
215
|
+
ctx.strokeStyle = strokeColor;
|
|
216
|
+
ctx.lineWidth = 2;
|
|
217
|
+
const outerDisc = stateRef.current.startDisc;
|
|
218
|
+
ctx.beginPath();
|
|
219
|
+
ctx.ellipse(outerDisc.x, outerDisc.y, outerDisc.w, outerDisc.h, 0, 0, 2 * Math.PI);
|
|
220
|
+
ctx.stroke();
|
|
221
|
+
ctx.closePath();
|
|
222
|
+
stateRef.current.discs.forEach((disc, i)=>{
|
|
223
|
+
if (i % 5 !== 0) return;
|
|
224
|
+
if (disc.w < stateRef.current.clip.disc.w - 5) {
|
|
225
|
+
ctx.save();
|
|
226
|
+
ctx.clip(stateRef.current.clip.path);
|
|
227
|
+
}
|
|
228
|
+
ctx.beginPath();
|
|
229
|
+
ctx.ellipse(disc.x, disc.y, disc.w, disc.h, 0, 0, 2 * Math.PI);
|
|
230
|
+
ctx.stroke();
|
|
231
|
+
ctx.closePath();
|
|
232
|
+
if (disc.w < stateRef.current.clip.disc.w - 5) ctx.restore();
|
|
233
|
+
});
|
|
234
|
+
}, [
|
|
235
|
+
strokeColor
|
|
236
|
+
]);
|
|
237
|
+
const drawLines = external_react_namespaceObject.useCallback((ctx)=>{
|
|
238
|
+
if (stateRef.current.linesCanvas) ctx.drawImage(stateRef.current.linesCanvas, 0, 0);
|
|
239
|
+
}, []);
|
|
240
|
+
const drawParticles = external_react_namespaceObject.useCallback((ctx)=>{
|
|
241
|
+
ctx.save();
|
|
242
|
+
ctx.clip(stateRef.current.clip.path);
|
|
243
|
+
stateRef.current.particles.forEach((particle)=>{
|
|
244
|
+
ctx.fillStyle = particle.c;
|
|
245
|
+
ctx.beginPath();
|
|
246
|
+
ctx.rect(particle.x, particle.y, particle.r, particle.r);
|
|
247
|
+
ctx.closePath();
|
|
248
|
+
ctx.fill();
|
|
249
|
+
});
|
|
250
|
+
ctx.restore();
|
|
251
|
+
}, []);
|
|
252
|
+
const moveDiscs = external_react_namespaceObject.useCallback(()=>{
|
|
253
|
+
stateRef.current.discs.forEach((disc)=>{
|
|
254
|
+
disc.p = (disc.p + 0.001) % 1;
|
|
255
|
+
tweenDisc(disc);
|
|
256
|
+
});
|
|
257
|
+
}, [
|
|
258
|
+
tweenDisc
|
|
259
|
+
]);
|
|
260
|
+
const moveParticles = external_react_namespaceObject.useCallback(()=>{
|
|
261
|
+
stateRef.current.particles.forEach((particle, idx)=>{
|
|
262
|
+
particle.p = 1 - particle.y / stateRef.current.particleArea.h;
|
|
263
|
+
particle.x = particle.sx + particle.dx * particle.p;
|
|
264
|
+
particle.y -= particle.vy;
|
|
265
|
+
if (particle.y < 0) stateRef.current.particles[idx] = initParticle();
|
|
266
|
+
});
|
|
267
|
+
}, [
|
|
268
|
+
initParticle
|
|
269
|
+
]);
|
|
270
|
+
const tick = external_react_namespaceObject.useCallback(()=>{
|
|
271
|
+
const canvas = canvasRef.current;
|
|
272
|
+
if (!canvas) return;
|
|
273
|
+
const ctx = canvas.getContext("2d");
|
|
274
|
+
if (!ctx) return;
|
|
275
|
+
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
276
|
+
ctx.save();
|
|
277
|
+
ctx.scale(stateRef.current.render.dpi, stateRef.current.render.dpi);
|
|
278
|
+
moveDiscs();
|
|
279
|
+
moveParticles();
|
|
280
|
+
drawDiscs(ctx);
|
|
281
|
+
drawLines(ctx);
|
|
282
|
+
drawParticles(ctx);
|
|
283
|
+
ctx.restore();
|
|
284
|
+
animationFrameIdRef.current = requestAnimationFrame(tick);
|
|
285
|
+
}, [
|
|
286
|
+
moveDiscs,
|
|
287
|
+
moveParticles,
|
|
288
|
+
drawDiscs,
|
|
289
|
+
drawLines,
|
|
290
|
+
drawParticles
|
|
291
|
+
]);
|
|
292
|
+
const init = external_react_namespaceObject.useCallback(()=>{
|
|
293
|
+
setSize();
|
|
294
|
+
setDiscs();
|
|
295
|
+
setLines();
|
|
296
|
+
setParticles();
|
|
297
|
+
}, [
|
|
298
|
+
setSize,
|
|
299
|
+
setDiscs,
|
|
300
|
+
setLines,
|
|
301
|
+
setParticles
|
|
302
|
+
]);
|
|
303
|
+
external_react_namespaceObject.useEffect(()=>{
|
|
304
|
+
const canvas = canvasRef.current;
|
|
305
|
+
if (!canvas) return;
|
|
306
|
+
init();
|
|
307
|
+
tick();
|
|
308
|
+
const handleResize = ()=>{
|
|
309
|
+
setSize();
|
|
310
|
+
setDiscs();
|
|
311
|
+
setLines();
|
|
312
|
+
setParticles();
|
|
313
|
+
};
|
|
314
|
+
window.addEventListener("resize", handleResize);
|
|
315
|
+
return ()=>{
|
|
316
|
+
window.removeEventListener("resize", handleResize);
|
|
317
|
+
cancelAnimationFrame(animationFrameIdRef.current);
|
|
318
|
+
};
|
|
319
|
+
}, [
|
|
320
|
+
init,
|
|
321
|
+
tick,
|
|
322
|
+
setSize,
|
|
323
|
+
setDiscs,
|
|
324
|
+
setLines,
|
|
325
|
+
setParticles
|
|
326
|
+
]);
|
|
327
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
328
|
+
className: (0, utils_cjs_namespaceObject.cn)("relative size-full overflow-hidden", 'before:content-[""] before:absolute before:top-1/2 before:left-1/2 before:block before:size-[140%] dark:before:[background:radial-gradient(ellipse_at_50%_55%,transparent_10%,black_50%)] before:[background:radial-gradient(ellipse_at_50%_55%,transparent_10%,white_50%)] before:[transform:translate3d(-50%,-50%,0)]', 'after:content-[""] after:absolute after:z-[5] after:top-1/2 after:left-1/2 after:block after:size-full after:[background:radial-gradient(ellipse_at_50%_75%,#a900ff_20%,transparent_75%)] after:[transform:translate3d(-50%,-50%,0)] after:mix-blend-overlay', className),
|
|
329
|
+
children: [
|
|
330
|
+
children,
|
|
331
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("canvas", {
|
|
332
|
+
ref: canvasRef,
|
|
333
|
+
className: "absolute inset-0 block size-full dark:opacity-20 opacity-10",
|
|
334
|
+
...props
|
|
335
|
+
}),
|
|
336
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_namespaceObject.motion.div, {
|
|
337
|
+
className: (0, utils_cjs_namespaceObject.cn)("absolute top-[-71.5%] left-1/2 z-[3] w-[30%] h-[140%] rounded-b-full blur-3xl opacity-75 dark:mix-blend-plus-lighter mix-blend-plus-darker [transform:translate3d(-50%,0,0)] [background-position:0%_100%] [background-size:100%_200%]", "dark:[background:linear-gradient(20deg,#00f8f1,#ffbd1e20_16.5%,#fe848f_33%,#fe848f20_49.5%,#00f8f1_66%,#00f8f160_85.5%,#ffbd1e_100%)_0_100%_/_100%_200%] [background:linear-gradient(20deg,#00f8f1,#ffbd1e40_16.5%,#fe848f_33%,#fe848f40_49.5%,#00f8f1_66%,#00f8f180_85.5%,#ffbd1e_100%)_0_100%_/_100%_200%]"),
|
|
338
|
+
animate: {
|
|
339
|
+
backgroundPosition: "0% 300%"
|
|
340
|
+
},
|
|
341
|
+
transition: {
|
|
342
|
+
duration: 5,
|
|
343
|
+
ease: "linear",
|
|
344
|
+
repeat: 1 / 0
|
|
345
|
+
}
|
|
346
|
+
}),
|
|
347
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
348
|
+
className: "absolute top-0 left-0 z-[7] size-full dark:[background:repeating-linear-gradient(transparent,transparent_1px,white_1px,white_2px)] mix-blend-overlay opacity-50"
|
|
349
|
+
})
|
|
350
|
+
]
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
exports.HoleBackground = __webpack_exports__.HoleBackground;
|
|
354
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
355
|
+
"HoleBackground"
|
|
356
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
|
357
|
+
Object.defineProperty(exports, '__esModule', {
|
|
358
|
+
value: true
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
//# sourceMappingURL=hole-background.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components\\ui\\hole-background.cjs","sources":["webpack://@arolariu/components/./src/components/ui/hole-background.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport { motion } from \"motion/react\";\n\nimport { cn } from \"@/lib/utils\";\n\ninterface HoleBackgroundProps extends React.HTMLAttributes<HTMLCanvasElement> {\n strokeColor?: string;\n numberOfLines?: number;\n numberOfDiscs?: number;\n particleRGBColor?: [number, number, number];\n}\n\nconst HoleBackground = React.forwardRef<HTMLCanvasElement, HoleBackgroundProps>(\n (\n {\n strokeColor = \"#737373\",\n numberOfLines = 50,\n numberOfDiscs = 50,\n particleRGBColor = [255, 255, 255],\n className,\n children,\n ...props\n },\n ref\n ) => {\n const canvasRef = React.useRef<HTMLCanvasElement>(null);\n React.useImperativeHandle(\n ref,\n () => canvasRef.current as HTMLCanvasElement\n );\n\n const animationFrameIdRef = React.useRef<number>(0);\n const stateRef = React.useRef<any>({\n discs: [] as any[],\n lines: [] as any[],\n particles: [] as any[],\n clip: {},\n startDisc: {},\n endDisc: {},\n rect: { width: 0, height: 0 },\n render: { width: 0, height: 0, dpi: 1 },\n particleArea: {},\n linesCanvas: null,\n });\n\n const linear = (p: number) => p;\n const easeInExpo = (p: number) => (p === 0 ? 0 : Math.pow(2, 10 * (p - 1)));\n\n const tweenValue = React.useCallback(\n (start: number, end: number, p: number, ease: \"inExpo\" | null = null) => {\n const delta = end - start;\n const easeFn = ease === \"inExpo\" ? easeInExpo : linear;\n return start + delta * easeFn(p);\n },\n []\n );\n\n const tweenDisc = React.useCallback(\n (disc: any) => {\n const { startDisc, endDisc } = stateRef.current;\n disc.x = tweenValue(startDisc.x, endDisc.x, disc.p);\n disc.y = tweenValue(startDisc.y, endDisc.y, disc.p, \"inExpo\");\n disc.w = tweenValue(startDisc.w, endDisc.w, disc.p);\n disc.h = tweenValue(startDisc.h, endDisc.h, disc.p);\n },\n [tweenValue]\n );\n\n const setSize = React.useCallback(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const rect = canvas.getBoundingClientRect();\n stateRef.current.rect = { width: rect.width, height: rect.height };\n stateRef.current.render = {\n width: rect.width,\n height: rect.height,\n dpi: window.devicePixelRatio || 1,\n };\n canvas.width =\n stateRef.current.render.width * stateRef.current.render.dpi;\n canvas.height =\n stateRef.current.render.height * stateRef.current.render.dpi;\n }, []);\n\n const setDiscs = React.useCallback(() => {\n const { width, height } = stateRef.current.rect;\n stateRef.current.discs = [];\n stateRef.current.startDisc = {\n x: width * 0.5,\n y: height * 0.45,\n w: width * 0.75,\n h: height * 0.7,\n };\n stateRef.current.endDisc = {\n x: width * 0.5,\n y: height * 0.95,\n w: 0,\n h: 0,\n };\n let prevBottom = height;\n stateRef.current.clip = {};\n for (let i = 0; i < numberOfDiscs; i++) {\n const p = i / numberOfDiscs;\n const disc = { p, x: 0, y: 0, w: 0, h: 0 };\n tweenDisc(disc);\n const bottom = disc.y + disc.h;\n if (bottom <= prevBottom) {\n stateRef.current.clip = { disc: { ...disc }, i };\n }\n prevBottom = bottom;\n stateRef.current.discs.push(disc);\n }\n const clipPath = new Path2D();\n const disc = stateRef.current.clip.disc;\n clipPath.ellipse(disc.x, disc.y, disc.w, disc.h, 0, 0, Math.PI * 2);\n clipPath.rect(disc.x - disc.w, 0, disc.w * 2, disc.y);\n stateRef.current.clip.path = clipPath;\n }, [tweenDisc]);\n\n const setLines = React.useCallback(() => {\n const { width, height } = stateRef.current.rect;\n stateRef.current.lines = [];\n const linesAngle = (Math.PI * 2) / numberOfLines;\n for (let i = 0; i < numberOfLines; i++) {\n stateRef.current.lines.push([]);\n }\n stateRef.current.discs.forEach((disc: any) => {\n for (let i = 0; i < numberOfLines; i++) {\n const angle = i * linesAngle;\n const p = {\n x: disc.x + Math.cos(angle) * disc.w,\n y: disc.y + Math.sin(angle) * disc.h,\n };\n stateRef.current.lines[i].push(p);\n }\n });\n const offCanvas = document.createElement(\"canvas\");\n offCanvas.width = width;\n offCanvas.height = height;\n const ctx = offCanvas.getContext(\"2d\");\n if (!ctx) return;\n stateRef.current.lines.forEach((line: any) => {\n ctx.save();\n let lineIsIn = false;\n line.forEach((p1: any, j: number) => {\n if (j === 0) return;\n const p0 = line[j - 1];\n if (\n !lineIsIn &&\n (ctx.isPointInPath(stateRef.current.clip.path, p1.x, p1.y) ||\n ctx.isPointInStroke(stateRef.current.clip.path, p1.x, p1.y))\n ) {\n lineIsIn = true;\n } else if (lineIsIn) {\n ctx.clip(stateRef.current.clip.path);\n }\n ctx.beginPath();\n ctx.moveTo(p0.x, p0.y);\n ctx.lineTo(p1.x, p1.y);\n ctx.strokeStyle = strokeColor;\n ctx.lineWidth = 2;\n ctx.stroke();\n ctx.closePath();\n });\n ctx.restore();\n });\n stateRef.current.linesCanvas = offCanvas;\n }, [strokeColor]);\n\n const initParticle = React.useCallback((start: boolean = false) => {\n const sx =\n stateRef.current.particleArea.sx +\n stateRef.current.particleArea.sw * Math.random();\n const ex =\n stateRef.current.particleArea.ex +\n stateRef.current.particleArea.ew * Math.random();\n const dx = ex - sx;\n const y = start\n ? stateRef.current.particleArea.h * Math.random()\n : stateRef.current.particleArea.h;\n const r = 0.5 + Math.random() * 4;\n const vy = 0.5 + Math.random();\n return {\n x: sx,\n sx,\n dx,\n y,\n vy,\n p: 0,\n r,\n c: `rgba(${particleRGBColor[0]}, ${particleRGBColor[1]}, ${\n particleRGBColor[2]\n }, ${Math.random()})`,\n };\n }, []);\n\n const setParticles = React.useCallback(() => {\n const { width, height } = stateRef.current.rect;\n stateRef.current.particles = [];\n const disc = stateRef.current.clip.disc;\n stateRef.current.particleArea = {\n sw: disc.w * 0.5,\n ew: disc.w * 2,\n h: height * 0.85,\n };\n stateRef.current.particleArea.sx =\n (width - stateRef.current.particleArea.sw) / 2;\n stateRef.current.particleArea.ex =\n (width - stateRef.current.particleArea.ew) / 2;\n const totalParticles = 100;\n for (let i = 0; i < totalParticles; i++) {\n stateRef.current.particles.push(initParticle(true));\n }\n }, [initParticle]);\n\n const drawDiscs = React.useCallback(\n (ctx: CanvasRenderingContext2D) => {\n ctx.strokeStyle = strokeColor;\n ctx.lineWidth = 2;\n const outerDisc = stateRef.current.startDisc;\n ctx.beginPath();\n ctx.ellipse(\n outerDisc.x,\n outerDisc.y,\n outerDisc.w,\n outerDisc.h,\n 0,\n 0,\n Math.PI * 2\n );\n ctx.stroke();\n ctx.closePath();\n stateRef.current.discs.forEach((disc: any, i: number) => {\n if (i % 5 !== 0) return;\n if (disc.w < stateRef.current.clip.disc.w - 5) {\n ctx.save();\n ctx.clip(stateRef.current.clip.path);\n }\n ctx.beginPath();\n ctx.ellipse(disc.x, disc.y, disc.w, disc.h, 0, 0, Math.PI * 2);\n ctx.stroke();\n ctx.closePath();\n if (disc.w < stateRef.current.clip.disc.w - 5) {\n ctx.restore();\n }\n });\n },\n [strokeColor]\n );\n\n const drawLines = React.useCallback((ctx: CanvasRenderingContext2D) => {\n if (stateRef.current.linesCanvas) {\n ctx.drawImage(stateRef.current.linesCanvas, 0, 0);\n }\n }, []);\n\n const drawParticles = React.useCallback((ctx: CanvasRenderingContext2D) => {\n ctx.save();\n ctx.clip(stateRef.current.clip.path);\n stateRef.current.particles.forEach((particle: any) => {\n ctx.fillStyle = particle.c;\n ctx.beginPath();\n ctx.rect(particle.x, particle.y, particle.r, particle.r);\n ctx.closePath();\n ctx.fill();\n });\n ctx.restore();\n }, []);\n\n const moveDiscs = React.useCallback(() => {\n stateRef.current.discs.forEach((disc: any) => {\n disc.p = (disc.p + 0.001) % 1;\n tweenDisc(disc);\n });\n }, [tweenDisc]);\n\n const moveParticles = React.useCallback(() => {\n stateRef.current.particles.forEach((particle: any, idx: number) => {\n particle.p = 1 - particle.y / stateRef.current.particleArea.h;\n particle.x = particle.sx + particle.dx * particle.p;\n particle.y -= particle.vy;\n if (particle.y < 0) {\n stateRef.current.particles[idx] = initParticle();\n }\n });\n }, [initParticle]);\n\n const tick = React.useCallback(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.save();\n ctx.scale(stateRef.current.render.dpi, stateRef.current.render.dpi);\n moveDiscs();\n moveParticles();\n drawDiscs(ctx);\n drawLines(ctx);\n drawParticles(ctx);\n ctx.restore();\n animationFrameIdRef.current = requestAnimationFrame(tick);\n }, [moveDiscs, moveParticles, drawDiscs, drawLines, drawParticles]);\n\n const init = React.useCallback(() => {\n setSize();\n setDiscs();\n setLines();\n setParticles();\n }, [setSize, setDiscs, setLines, setParticles]);\n\n React.useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas) return;\n init();\n tick();\n const handleResize = () => {\n setSize();\n setDiscs();\n setLines();\n setParticles();\n };\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n cancelAnimationFrame(animationFrameIdRef.current);\n };\n }, [init, tick, setSize, setDiscs, setLines, setParticles]);\n\n return (\n <div\n className={cn(\n \"relative size-full overflow-hidden\",\n 'before:content-[\"\"] before:absolute before:top-1/2 before:left-1/2 before:block before:size-[140%] dark:before:[background:radial-gradient(ellipse_at_50%_55%,transparent_10%,black_50%)] before:[background:radial-gradient(ellipse_at_50%_55%,transparent_10%,white_50%)] before:[transform:translate3d(-50%,-50%,0)]',\n 'after:content-[\"\"] after:absolute after:z-[5] after:top-1/2 after:left-1/2 after:block after:size-full after:[background:radial-gradient(ellipse_at_50%_75%,#a900ff_20%,transparent_75%)] after:[transform:translate3d(-50%,-50%,0)] after:mix-blend-overlay',\n className\n )}\n >\n {children}\n <canvas\n ref={canvasRef}\n className=\"absolute inset-0 block size-full dark:opacity-20 opacity-10\"\n {...props}\n />\n <motion.div\n className={cn(\n \"absolute top-[-71.5%] left-1/2 z-[3] w-[30%] h-[140%] rounded-b-full blur-3xl opacity-75 dark:mix-blend-plus-lighter mix-blend-plus-darker [transform:translate3d(-50%,0,0)] [background-position:0%_100%] [background-size:100%_200%]\",\n \"dark:[background:linear-gradient(20deg,#00f8f1,#ffbd1e20_16.5%,#fe848f_33%,#fe848f20_49.5%,#00f8f1_66%,#00f8f160_85.5%,#ffbd1e_100%)_0_100%_/_100%_200%] [background:linear-gradient(20deg,#00f8f1,#ffbd1e40_16.5%,#fe848f_33%,#fe848f40_49.5%,#00f8f1_66%,#00f8f180_85.5%,#ffbd1e_100%)_0_100%_/_100%_200%]\"\n )}\n animate={{ backgroundPosition: \"0% 300%\" }}\n transition={{ duration: 5, ease: \"linear\", repeat: Infinity }}\n />\n <div className=\"absolute top-0 left-0 z-[7] size-full dark:[background:repeating-linear-gradient(transparent,transparent_1px,white_1px,white_2px)] mix-blend-overlay opacity-50\" />\n </div>\n );\n }\n);\n\nexport { HoleBackground, type HoleBackgroundProps };\n"],"names":["HoleBackground","React","strokeColor","numberOfLines","numberOfDiscs","particleRGBColor","className","children","props","ref","canvasRef","animationFrameIdRef","stateRef","linear","p","easeInExpo","Math","tweenValue","start","end","ease","delta","easeFn","tweenDisc","disc","startDisc","endDisc","setSize","canvas","rect","window","setDiscs","width","height","prevBottom","i","bottom","clipPath","Path2D","setLines","linesAngle","angle","offCanvas","document","ctx","line","lineIsIn","p1","j","p0","initParticle","sx","ex","dx","y","r","vy","setParticles","totalParticles","drawDiscs","outerDisc","drawLines","drawParticles","particle","moveDiscs","moveParticles","idx","tick","requestAnimationFrame","init","handleResize","cancelAnimationFrame","cn","motion","Infinity"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAMA,iBAAiB,WAAjBA,GAAiBC,+BAAAA,UAAgB,CACrC,CACE,EACEC,cAAc,SAAS,EACvBC,gBAAgB,EAAE,EAClBC,gBAAgB,EAAE,EAClBC,mBAAmB;IAAC;IAAK;IAAK;CAAI,EAClCC,SAAS,EACTC,QAAQ,EACR,GAAGC,OACJ,EACDC;IAEA,MAAMC,YAAYT,+BAAAA,MAAY,CAAoB;IAClDA,+BAAAA,mBAAyB,CACvBQ,KACA,IAAMC,UAAU,OAAO;IAGzB,MAAMC,sBA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;;;AAGrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components\\ui\\pagination.cjs","sources":["webpack://@arolariu/components/./src/components/ui/pagination.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport {\n ChevronLeftIcon,\n ChevronRightIcon,\n MoreHorizontalIcon,\n} from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button, buttonVariants } from \"@/components/ui/button\";\n\nfunction Pagination({ className, ...props }: React.ComponentProps<\"nav\">) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn(\"mx-auto flex w-full justify-center\", className)}\n {...props}\n />\n );\n}\n\nfunction PaginationContent({\n className,\n ...props\n}: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"pagination-content\"\n className={cn(\"flex flex-row items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n return <li data-slot=\"pagination-item\" {...props} />;\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<React.ComponentProps<typeof Button>, \"size\"> &\n React.ComponentProps<\"a\">;\n\nfunction PaginationLink({\n className,\n isActive,\n size = \"icon\",\n ...props\n}: PaginationLinkProps) {\n return (\n <a\n aria-current={isActive ? \"page\" : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n className={cn(\n buttonVariants({\n variant: isActive ? \"outline\" : \"ghost\",\n size,\n }),\n className\n )}\n {...props}\n />\n );\n}\n\nfunction PaginationPrevious({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn(\"gap-1 px-2.5 sm:pl-2.5\", className)}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"hidden sm:block\">Previous</span>\n </PaginationLink>\n );\n}\n\nfunction PaginationNext({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn(\"gap-1 px-2.5 sm:pr-2.5\", className)}\n {...props}\n >\n <span className=\"hidden sm:block\">Next</span>\n <ChevronRightIcon />\n </PaginationLink>\n );\n}\n\nfunction PaginationEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn(\"flex size-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontalIcon className=\"size-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n );\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n};\n"],"names":["Pagination","className","props","cn","PaginationContent","PaginationItem","PaginationLink","isActive","size","undefined","buttonVariants","PaginationPrevious","ChevronLeftIcon","PaginationNext","ChevronRightIcon","PaginationEllipsis","MoreHorizontalIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,WAAW,EAAEC,SAAS,EAAE,GAAGC,OAAoC;IACtE,OACE,WADF,GACE,qCAAC;QACC,MAAK;QACL,cAAW;QACX,aAAU;QACV,WAAWC,IAAAA,0BAAAA,EAAAA,EAAG,sCAAsCF;QACnD,GAAGC,KAAK;;AAGf;AAEA,SAASE,kBAAkB,EACzBH,SAAS,EACT,GAAGC,OACwB;IAC3B,OACE,WADF,GACE,qCAAC;QACC,aAAU;QACV,WAAWC,IAAAA,0BAAAA,EAAAA,EAAG,oCAAoCF;QACjD,GAAGC,KAAK;;AAGf;AAEA,SAASG,eAAe,EAAE,GAAGH,OAAmC;IAC9D,OAAO,WAAP,GAAO,qCAAC;QAAG,aAAU;QAAmB,GAAGA,KAAK;;AAClD;AAOA,SAASI,eAAe,EACtBL,SAAS,EACTM,QAAQ,EACRC,OAAO,MAAM,EACb,GAAGN,OACiB;IACpB,OACE,WADF,GACE,qCAAC;QACC,gBAAcK,WAAW,SAASE
|
|
1
|
+
{"version":3,"file":"components\\ui\\pagination.cjs","sources":["webpack://@arolariu/components/./src/components/ui/pagination.tsx"],"sourcesContent":["\n\nimport * as React from \"react\";\nimport {\n ChevronLeftIcon,\n ChevronRightIcon,\n MoreHorizontalIcon,\n} from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { Button, buttonVariants } from \"@/components/ui/button\";\n\nfunction Pagination({ className, ...props }: React.ComponentProps<\"nav\">) {\n return (\n <nav\n role=\"navigation\"\n aria-label=\"pagination\"\n data-slot=\"pagination\"\n className={cn(\"mx-auto flex w-full justify-center\", className)}\n {...props}\n />\n );\n}\n\nfunction PaginationContent({\n className,\n ...props\n}: React.ComponentProps<\"ul\">) {\n return (\n <ul\n data-slot=\"pagination-content\"\n className={cn(\"flex flex-row items-center gap-1\", className)}\n {...props}\n />\n );\n}\n\nfunction PaginationItem({ ...props }: React.ComponentProps<\"li\">) {\n return <li data-slot=\"pagination-item\" {...props} />;\n}\n\ntype PaginationLinkProps = {\n isActive?: boolean;\n} & Pick<React.ComponentProps<typeof Button>, \"size\"> &\n React.ComponentProps<\"a\">;\n\nfunction PaginationLink({\n className,\n isActive,\n size = \"icon\",\n ...props\n}: PaginationLinkProps) {\n return (\n <a\n aria-current={isActive ? \"page\" : undefined}\n data-slot=\"pagination-link\"\n data-active={isActive}\n className={cn(\n buttonVariants({\n variant: isActive ? \"outline\" : \"ghost\",\n size,\n }),\n className\n )}\n {...props}\n />\n );\n}\n\nfunction PaginationPrevious({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to previous page\"\n size=\"default\"\n className={cn(\"gap-1 px-2.5 sm:pl-2.5\", className)}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"hidden sm:block\">Previous</span>\n </PaginationLink>\n );\n}\n\nfunction PaginationNext({\n className,\n ...props\n}: React.ComponentProps<typeof PaginationLink>) {\n return (\n <PaginationLink\n aria-label=\"Go to next page\"\n size=\"default\"\n className={cn(\"gap-1 px-2.5 sm:pr-2.5\", className)}\n {...props}\n >\n <span className=\"hidden sm:block\">Next</span>\n <ChevronRightIcon />\n </PaginationLink>\n );\n}\n\nfunction PaginationEllipsis({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n aria-hidden\n data-slot=\"pagination-ellipsis\"\n className={cn(\"flex size-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontalIcon className=\"size-4\" />\n <span className=\"sr-only\">More pages</span>\n </span>\n );\n}\n\nexport {\n Pagination,\n PaginationContent,\n PaginationLink,\n PaginationItem,\n PaginationPrevious,\n PaginationNext,\n PaginationEllipsis,\n};\n"],"names":["Pagination","className","props","cn","PaginationContent","PaginationItem","PaginationLink","isActive","size","undefined","buttonVariants","PaginationPrevious","ChevronLeftIcon","PaginationNext","ChevronRightIcon","PaginationEllipsis","MoreHorizontalIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAASA,WAAW,EAAEC,SAAS,EAAE,GAAGC,OAAoC;IACtE,OACE,WADF,GACE,qCAAC;QACC,MAAK;QACL,cAAW;QACX,aAAU;QACV,WAAWC,IAAAA,0BAAAA,EAAAA,EAAG,sCAAsCF;QACnD,GAAGC,KAAK;;AAGf;AAEA,SAASE,kBAAkB,EACzBH,SAAS,EACT,GAAGC,OACwB;IAC3B,OACE,WADF,GACE,qCAAC;QACC,aAAU;QACV,WAAWC,IAAAA,0BAAAA,EAAAA,EAAG,oCAAoCF;QACjD,GAAGC,KAAK;;AAGf;AAEA,SAASG,eAAe,EAAE,GAAGH,OAAmC;IAC9D,OAAO,WAAP,GAAO,qCAAC;QAAG,aAAU;QAAmB,GAAGA,KAAK;;AAClD;AAOA,SAASI,eAAe,EACtBL,SAAS,EACTM,QAAQ,EACRC,OAAO,MAAM,EACb,GAAGN,OACiB;IACpB,OACE,WADF,GACE,qCAAC;QACC,gBAAcK,WAAW,SA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