telecop 0.1.39 → 0.1.40
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.
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ParallaxScrollProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
speed?: number;
|
|
5
|
+
direction?: 'up' | 'down' | 'left' | 'right';
|
|
6
|
+
scale?: boolean;
|
|
7
|
+
rotate?: boolean;
|
|
8
|
+
blur?: boolean;
|
|
9
|
+
opacity?: boolean;
|
|
10
|
+
triggerStart?: string;
|
|
11
|
+
triggerEnd?: string;
|
|
12
|
+
scrub?: boolean | number;
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function ParallaxScroll({ children, speed, direction, scale, rotate, blur, opacity, triggerStart, triggerEnd, scrub, className, }: ParallaxScrollProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/motion/index.d.ts
CHANGED
package/dist/motion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";var
|
|
1
|
+
"use client";"use strict";var S=Object.create;var P=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var M=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of T(t))!v.call(e,o)&&o!==n&&P(e,o,{get:()=>t[o],enumerable:!(r=h(t,o))||r.enumerable});return e};var m=(e,t,n)=>(n=e!=null?S(j(e)):{},M(t||!e||!e.__esModule?P(n,"default",{value:e,enumerable:!0}):n,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react/jsx-runtime"),p=require("react");function b({children:e,duration:t=1,delay:n=0,y:r=30,className:o=""}){const l=p.useRef(null);return p.useEffect(()=>{(async()=>{try{const{gsap:c}=await import("gsap");c.from(l.current,{opacity:0,y:r,duration:t,delay:n,ease:"power3.out"})}catch{console.warn("⚠️ Telecop: Please install GSAP to use motion components"),console.warn("Run: npm install gsap")}})()},[t,n,r]),y.jsx("div",{ref:l,className:o,children:e})}function A({children:e,speed:t=1,direction:n="up",scale:r=!1,rotate:o=!1,blur:l=!1,opacity:g=!1,triggerStart:c="top bottom",triggerEnd:w="bottom top",scrub:x=!0,className:R=""}){const i=p.useRef(null);return p.useEffect(()=>((async()=>{if(i.current)try{const u=(await import("gsap")).default,{ScrollTrigger:f}=await import("gsap/ScrollTrigger");u.registerPlugin(f);const a=100*t,s={...{up:{y:-a},down:{y:a},left:{x:-a},right:{x:a}}[n]};r&&(s.scale=1+.2*t),o&&(s.rotation=15*t),l&&(s.filter=`blur(${10*t}px)`),g&&(s.opacity=Math.max(0,1-.5*t)),u.to(i.current,{...s,ease:"none",scrollTrigger:{trigger:i.current,start:c,end:w,scrub:x}})}catch{console.warn("⚠️ Telecop: Please install GSAP to use ParallaxScroll"),console.warn("Run: npm install gsap")}})(),()=>{(async()=>{try{const{ScrollTrigger:f}=await import("gsap/ScrollTrigger");f.getAll().forEach(a=>a.kill())}catch{}})()}),[t,n,r,o,l,g,c,w,x]),y.jsx("div",{ref:i,className:R,children:e})}exports.FadeIn=b;exports.ParallaxScroll=A;
|
package/dist/motion.mjs
CHANGED
|
@@ -1,31 +1,83 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useRef as
|
|
4
|
-
function
|
|
5
|
-
children:
|
|
6
|
-
duration:
|
|
7
|
-
delay:
|
|
8
|
-
y:
|
|
9
|
-
className:
|
|
2
|
+
import { jsx as w } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as x, useEffect as P } from "react";
|
|
4
|
+
function v({
|
|
5
|
+
children: m,
|
|
6
|
+
duration: t = 1,
|
|
7
|
+
delay: o = 0,
|
|
8
|
+
y: r = 30,
|
|
9
|
+
className: c = ""
|
|
10
10
|
}) {
|
|
11
|
-
const
|
|
12
|
-
return
|
|
11
|
+
const e = x(null);
|
|
12
|
+
return P(() => {
|
|
13
13
|
(async () => {
|
|
14
14
|
try {
|
|
15
|
-
const { gsap:
|
|
16
|
-
|
|
15
|
+
const { gsap: a } = await import("gsap");
|
|
16
|
+
a.from(e.current, {
|
|
17
17
|
opacity: 0,
|
|
18
|
-
y:
|
|
19
|
-
duration:
|
|
20
|
-
delay:
|
|
18
|
+
y: r,
|
|
19
|
+
duration: t,
|
|
20
|
+
delay: o,
|
|
21
21
|
ease: "power3.out"
|
|
22
22
|
});
|
|
23
23
|
} catch {
|
|
24
24
|
console.warn("⚠️ Telecop: Please install GSAP to use motion components"), console.warn("Run: npm install gsap");
|
|
25
25
|
}
|
|
26
26
|
})();
|
|
27
|
-
}, [
|
|
27
|
+
}, [t, o, r]), /* @__PURE__ */ w("div", { ref: e, className: c, children: m });
|
|
28
|
+
}
|
|
29
|
+
function A({
|
|
30
|
+
children: m,
|
|
31
|
+
speed: t = 1,
|
|
32
|
+
direction: o = "up",
|
|
33
|
+
scale: r = !1,
|
|
34
|
+
rotate: c = !1,
|
|
35
|
+
blur: e = !1,
|
|
36
|
+
opacity: u = !1,
|
|
37
|
+
triggerStart: a = "top bottom",
|
|
38
|
+
triggerEnd: p = "bottom top",
|
|
39
|
+
scrub: g = !0,
|
|
40
|
+
className: y = ""
|
|
41
|
+
}) {
|
|
42
|
+
const i = x(null);
|
|
43
|
+
return P(() => ((async () => {
|
|
44
|
+
if (i.current)
|
|
45
|
+
try {
|
|
46
|
+
const s = (await import("gsap")).default, { ScrollTrigger: f } = await import("gsap/ScrollTrigger");
|
|
47
|
+
s.registerPlugin(f);
|
|
48
|
+
const n = 100 * t, l = {
|
|
49
|
+
...{
|
|
50
|
+
up: { y: -n },
|
|
51
|
+
down: { y: n },
|
|
52
|
+
left: { x: -n },
|
|
53
|
+
right: { x: n }
|
|
54
|
+
}[o]
|
|
55
|
+
};
|
|
56
|
+
r && (l.scale = 1 + 0.2 * t), c && (l.rotation = 15 * t), e && (l.filter = `blur(${10 * t}px)`), u && (l.opacity = Math.max(0, 1 - 0.5 * t)), s.to(i.current, {
|
|
57
|
+
...l,
|
|
58
|
+
ease: "none",
|
|
59
|
+
scrollTrigger: {
|
|
60
|
+
trigger: i.current,
|
|
61
|
+
start: a,
|
|
62
|
+
end: p,
|
|
63
|
+
scrub: g
|
|
64
|
+
// markers: true, // Enable for debugging
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
} catch {
|
|
68
|
+
console.warn("⚠️ Telecop: Please install GSAP to use ParallaxScroll"), console.warn("Run: npm install gsap");
|
|
69
|
+
}
|
|
70
|
+
})(), () => {
|
|
71
|
+
(async () => {
|
|
72
|
+
try {
|
|
73
|
+
const { ScrollTrigger: f } = await import("gsap/ScrollTrigger");
|
|
74
|
+
f.getAll().forEach((n) => n.kill());
|
|
75
|
+
} catch {
|
|
76
|
+
}
|
|
77
|
+
})();
|
|
78
|
+
}), [t, o, r, c, e, u, a, p, g]), /* @__PURE__ */ w("div", { ref: i, className: y, children: m });
|
|
28
79
|
}
|
|
29
80
|
export {
|
|
30
|
-
|
|
81
|
+
v as FadeIn,
|
|
82
|
+
A as ParallaxScroll
|
|
31
83
|
};
|