masoneffect 2.0.20 → 2.0.21
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/README.md +2 -2
- package/dist/core/index.d.ts +5 -14
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/textToParticle/index.d.ts.map +1 -1
- package/dist/count/core/index.d.ts +5 -14
- package/dist/count/core/index.d.ts.map +1 -1
- package/dist/count/core/textToParticle/index.d.ts.map +1 -1
- package/dist/count/index.d.ts +0 -9
- package/dist/count/index.d.ts.map +1 -1
- package/dist/count/index.umd.d.ts +0 -4
- package/dist/count/index.umd.d.ts.map +1 -1
- package/dist/count/react/count/Count.d.ts.map +1 -1
- package/dist/count/react/index.d.ts +0 -3
- package/dist/count/react/index.d.ts.map +1 -1
- package/dist/count/react/scrollFadeIn/ScrollFadeIn.d.ts.map +1 -1
- package/dist/count/react/textSpin/TextSpin.d.ts.map +1 -1
- package/dist/count/react/textSpin/index.d.ts +0 -1
- package/dist/count/react/textSpin/index.d.ts.map +1 -1
- package/dist/count/react/textToParticle/TextToParticle.d.ts.map +1 -1
- package/dist/count/react/typing/Typing.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.umd.d.ts +0 -4
- package/dist/index.umd.d.ts.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/react/core/index.d.ts +5 -14
- package/dist/react/count/Count.d.ts.map +1 -1
- package/dist/react/count/core/index.d.ts +5 -14
- package/dist/react/count/core/index.d.ts.map +1 -1
- package/dist/react/count/core/textToParticle/index.d.ts.map +1 -1
- package/dist/react/count/index.cjs +1 -1
- package/dist/react/count/index.d.ts +0 -9
- package/dist/react/count/index.d.ts.map +1 -1
- package/dist/react/count/index.mjs +1 -1
- package/dist/react/count/index.umd.d.ts +0 -4
- package/dist/react/count/index.umd.d.ts.map +1 -1
- package/dist/react/count/react/count/Count.d.ts.map +1 -1
- package/dist/react/count/react/index.d.ts +0 -3
- package/dist/react/count/react/index.d.ts.map +1 -1
- package/dist/react/count/react/scrollFadeIn/ScrollFadeIn.d.ts.map +1 -1
- package/dist/react/count/react/textSpin/TextSpin.d.ts.map +1 -1
- package/dist/react/count/react/textSpin/index.d.ts +0 -1
- package/dist/react/count/react/textSpin/index.d.ts.map +1 -1
- package/dist/react/count/react/textToParticle/TextToParticle.d.ts.map +1 -1
- package/dist/react/count/react/typing/Typing.d.ts.map +1 -1
- package/dist/react/index.d.ts +12 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.umd.d.ts +0 -4
- package/dist/react/react/index.d.ts +0 -3
- package/dist/react/react/textSpin/index.d.ts +0 -1
- package/dist/react/scrollFadeIn/ScrollFadeIn.d.ts.map +1 -1
- package/dist/react/scrollFadeIn/core/index.d.ts +5 -14
- package/dist/react/scrollFadeIn/core/index.d.ts.map +1 -1
- package/dist/react/scrollFadeIn/core/textToParticle/index.d.ts.map +1 -1
- package/dist/react/scrollFadeIn/index.cjs +1 -1
- package/dist/react/scrollFadeIn/index.d.ts +0 -9
- package/dist/react/scrollFadeIn/index.d.ts.map +1 -1
- package/dist/react/scrollFadeIn/index.mjs +1 -1
- package/dist/react/scrollFadeIn/index.umd.d.ts +0 -4
- package/dist/react/scrollFadeIn/index.umd.d.ts.map +1 -1
- package/dist/react/scrollFadeIn/react/count/Count.d.ts.map +1 -1
- package/dist/react/scrollFadeIn/react/index.d.ts +0 -3
- package/dist/react/scrollFadeIn/react/index.d.ts.map +1 -1
- package/dist/react/scrollFadeIn/react/scrollFadeIn/ScrollFadeIn.d.ts.map +1 -1
- package/dist/react/scrollFadeIn/react/textSpin/TextSpin.d.ts.map +1 -1
- package/dist/react/scrollFadeIn/react/textSpin/index.d.ts +0 -1
- package/dist/react/scrollFadeIn/react/textSpin/index.d.ts.map +1 -1
- package/dist/react/scrollFadeIn/react/textToParticle/TextToParticle.d.ts.map +1 -1
- package/dist/react/scrollFadeIn/react/typing/Typing.d.ts.map +1 -1
- package/dist/react/textSpin/TextSpin.d.ts.map +1 -1
- package/dist/react/textSpin/core/index.d.ts +5 -14
- package/dist/react/textSpin/core/index.d.ts.map +1 -1
- package/dist/react/textSpin/core/textToParticle/index.d.ts.map +1 -1
- package/dist/react/textSpin/index.cjs +1 -1
- package/dist/react/textSpin/index.d.ts +0 -9
- package/dist/react/textSpin/index.d.ts.map +1 -1
- package/dist/react/textSpin/index.mjs +1 -1
- package/dist/react/textSpin/index.umd.d.ts +0 -4
- package/dist/react/textSpin/index.umd.d.ts.map +1 -1
- package/dist/react/textSpin/react/count/Count.d.ts.map +1 -1
- package/dist/react/textSpin/react/index.d.ts +0 -3
- package/dist/react/textSpin/react/index.d.ts.map +1 -1
- package/dist/react/textSpin/react/scrollFadeIn/ScrollFadeIn.d.ts.map +1 -1
- package/dist/react/textSpin/react/textSpin/TextSpin.d.ts.map +1 -1
- package/dist/react/textSpin/react/textSpin/index.d.ts +0 -1
- package/dist/react/textSpin/react/textSpin/index.d.ts.map +1 -1
- package/dist/react/textSpin/react/textToParticle/TextToParticle.d.ts.map +1 -1
- package/dist/react/textSpin/react/typing/Typing.d.ts.map +1 -1
- package/dist/react/textToParticle/TextToParticle.d.ts.map +1 -1
- package/dist/react/textToParticle/core/index.d.ts +5 -14
- package/dist/react/textToParticle/core/index.d.ts.map +1 -1
- package/dist/react/textToParticle/core/textToParticle/index.d.ts.map +1 -1
- package/dist/react/textToParticle/index.cjs +1 -1
- package/dist/react/textToParticle/index.d.ts +0 -9
- package/dist/react/textToParticle/index.d.ts.map +1 -1
- package/dist/react/textToParticle/index.mjs +1 -1
- package/dist/react/textToParticle/index.umd.d.ts +0 -4
- package/dist/react/textToParticle/index.umd.d.ts.map +1 -1
- package/dist/react/textToParticle/react/count/Count.d.ts.map +1 -1
- package/dist/react/textToParticle/react/index.d.ts +0 -3
- package/dist/react/textToParticle/react/index.d.ts.map +1 -1
- package/dist/react/textToParticle/react/scrollFadeIn/ScrollFadeIn.d.ts.map +1 -1
- package/dist/react/textToParticle/react/textSpin/TextSpin.d.ts.map +1 -1
- package/dist/react/textToParticle/react/textSpin/index.d.ts +0 -1
- package/dist/react/textToParticle/react/textSpin/index.d.ts.map +1 -1
- package/dist/react/textToParticle/react/textToParticle/TextToParticle.d.ts.map +1 -1
- package/dist/react/textToParticle/react/typing/Typing.d.ts.map +1 -1
- package/dist/react/typing/Typing.d.ts.map +1 -1
- package/dist/react/typing/core/index.d.ts +5 -14
- package/dist/react/typing/core/index.d.ts.map +1 -1
- package/dist/react/typing/core/textToParticle/index.d.ts.map +1 -1
- package/dist/react/typing/index.cjs +1 -1
- package/dist/react/typing/index.d.ts +0 -9
- package/dist/react/typing/index.d.ts.map +1 -1
- package/dist/react/typing/index.mjs +1 -1
- package/dist/react/typing/index.umd.d.ts +0 -4
- package/dist/react/typing/index.umd.d.ts.map +1 -1
- package/dist/react/typing/react/count/Count.d.ts.map +1 -1
- package/dist/react/typing/react/index.d.ts +0 -3
- package/dist/react/typing/react/index.d.ts.map +1 -1
- package/dist/react/typing/react/scrollFadeIn/ScrollFadeIn.d.ts.map +1 -1
- package/dist/react/typing/react/textSpin/TextSpin.d.ts.map +1 -1
- package/dist/react/typing/react/textSpin/index.d.ts +0 -1
- package/dist/react/typing/react/textSpin/index.d.ts.map +1 -1
- package/dist/react/typing/react/textToParticle/TextToParticle.d.ts.map +1 -1
- package/dist/react/typing/react/typing/Typing.d.ts.map +1 -1
- package/dist/scrollFadeIn/core/index.d.ts +5 -14
- package/dist/scrollFadeIn/core/index.d.ts.map +1 -1
- package/dist/scrollFadeIn/core/textToParticle/index.d.ts.map +1 -1
- package/dist/scrollFadeIn/index.d.ts +0 -9
- package/dist/scrollFadeIn/index.d.ts.map +1 -1
- package/dist/scrollFadeIn/index.umd.d.ts +0 -4
- package/dist/scrollFadeIn/index.umd.d.ts.map +1 -1
- package/dist/scrollFadeIn/react/count/Count.d.ts.map +1 -1
- package/dist/scrollFadeIn/react/index.d.ts +0 -3
- package/dist/scrollFadeIn/react/index.d.ts.map +1 -1
- package/dist/scrollFadeIn/react/scrollFadeIn/ScrollFadeIn.d.ts.map +1 -1
- package/dist/scrollFadeIn/react/textSpin/TextSpin.d.ts.map +1 -1
- package/dist/scrollFadeIn/react/textSpin/index.d.ts +0 -1
- package/dist/scrollFadeIn/react/textSpin/index.d.ts.map +1 -1
- package/dist/scrollFadeIn/react/textToParticle/TextToParticle.d.ts.map +1 -1
- package/dist/scrollFadeIn/react/typing/Typing.d.ts.map +1 -1
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.mjs +3 -4
- package/dist/svelte/textToParticle/index.cjs +1 -1
- package/dist/svelte/textToParticle/index.mjs +3 -4
- package/dist/textSpin/core/index.d.ts +5 -14
- package/dist/textSpin/core/index.d.ts.map +1 -1
- package/dist/textSpin/core/textToParticle/index.d.ts.map +1 -1
- package/dist/textSpin/index.d.ts +0 -9
- package/dist/textSpin/index.d.ts.map +1 -1
- package/dist/textSpin/index.umd.d.ts +0 -4
- package/dist/textSpin/index.umd.d.ts.map +1 -1
- package/dist/textSpin/react/count/Count.d.ts.map +1 -1
- package/dist/textSpin/react/index.d.ts +0 -3
- package/dist/textSpin/react/index.d.ts.map +1 -1
- package/dist/textSpin/react/scrollFadeIn/ScrollFadeIn.d.ts.map +1 -1
- package/dist/textSpin/react/textSpin/TextSpin.d.ts.map +1 -1
- package/dist/textSpin/react/textSpin/index.d.ts +0 -1
- package/dist/textSpin/react/textSpin/index.d.ts.map +1 -1
- package/dist/textSpin/react/textToParticle/TextToParticle.d.ts.map +1 -1
- package/dist/textSpin/react/typing/Typing.d.ts.map +1 -1
- package/dist/textToParticle/core/index.d.ts +5 -14
- package/dist/textToParticle/core/index.d.ts.map +1 -1
- package/dist/textToParticle/core/textToParticle/index.d.ts.map +1 -1
- package/dist/textToParticle/index.cjs +1 -1
- package/dist/textToParticle/index.d.ts +0 -9
- package/dist/textToParticle/index.d.ts.map +1 -1
- package/dist/textToParticle/index.mjs +1 -1
- package/dist/textToParticle/index.umd.d.ts +0 -4
- package/dist/textToParticle/index.umd.d.ts.map +1 -1
- package/dist/textToParticle/react/count/Count.d.ts.map +1 -1
- package/dist/textToParticle/react/index.d.ts +0 -3
- package/dist/textToParticle/react/index.d.ts.map +1 -1
- package/dist/textToParticle/react/scrollFadeIn/ScrollFadeIn.d.ts.map +1 -1
- package/dist/textToParticle/react/textSpin/TextSpin.d.ts.map +1 -1
- package/dist/textToParticle/react/textSpin/index.d.ts +0 -1
- package/dist/textToParticle/react/textSpin/index.d.ts.map +1 -1
- package/dist/textToParticle/react/textToParticle/TextToParticle.d.ts.map +1 -1
- package/dist/textToParticle/react/typing/Typing.d.ts.map +1 -1
- package/dist/typing/core/index.d.ts +5 -14
- package/dist/typing/core/index.d.ts.map +1 -1
- package/dist/typing/core/textToParticle/index.d.ts.map +1 -1
- package/dist/typing/index.d.ts +0 -9
- package/dist/typing/index.d.ts.map +1 -1
- package/dist/typing/index.umd.d.ts +0 -4
- package/dist/typing/index.umd.d.ts.map +1 -1
- package/dist/typing/react/count/Count.d.ts.map +1 -1
- package/dist/typing/react/index.d.ts +0 -3
- package/dist/typing/react/index.d.ts.map +1 -1
- package/dist/typing/react/scrollFadeIn/ScrollFadeIn.d.ts.map +1 -1
- package/dist/typing/react/textSpin/TextSpin.d.ts.map +1 -1
- package/dist/typing/react/textSpin/index.d.ts +0 -1
- package/dist/typing/react/textSpin/index.d.ts.map +1 -1
- package/dist/typing/react/textToParticle/TextToParticle.d.ts.map +1 -1
- package/dist/typing/react/typing/Typing.d.ts.map +1 -1
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.mjs +3 -4
- package/dist/vue/textToParticle/index.cjs +1 -1
- package/dist/vue/textToParticle/index.mjs +3 -4
- package/package.json +2 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextSpin.d.ts","sourceRoot":"","sources":["../../../../../src/react/textSpin/TextSpin.tsx"],"names":[],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,eAAe,EAAE,SAAS,GAAG,YAAY,CAAC;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,iBAAiB,mFAwDrB,CAAC;AAIH,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/textSpin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/textSpin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextToParticle.d.ts","sourceRoot":"","sources":["../../../../../src/react/textToParticle/TextToParticle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IACzE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,uBAAuB,+
|
|
1
|
+
{"version":3,"file":"TextToParticle.d.ts","sourceRoot":"","sources":["../../../../../src/react/textToParticle/TextToParticle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IACzE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,uBAAuB,+FA8G3B,CAAC;AAIH,eAAe,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typing.d.ts","sourceRoot":"","sources":["../../../../../src/react/typing/Typing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,WAAY,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,YAAY,CAAC;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,eAAe,+
|
|
1
|
+
{"version":3,"file":"Typing.d.ts","sourceRoot":"","sources":["../../../../../src/react/typing/Typing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,WAAY,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,YAAY,CAAC;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,eAAe,+EA4CnB,CAAC;AAIH,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextSpin.d.ts","sourceRoot":"","sources":["../../../src/react/textSpin/TextSpin.tsx"],"names":[],"mappings":"AAAA,OAAO,KA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,YAAY,CAAC;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,iBAAiB,mFAwDrB,CAAC;AAIH,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
* MasonEffect Core - 모든 이펙트를 export하는 메인 파일
|
|
3
|
-
*
|
|
4
|
-
* 주의: tree-shaking을 위해 각 이펙트를 직접 import하는 것을 권장합니다:
|
|
5
|
-
* - import { TextToParticle } from 'masoneffect/textToParticle'
|
|
6
|
-
* - import { Count } from 'masoneffect/count'
|
|
7
|
-
*
|
|
8
|
-
* 이 파일은 하위 호환성을 위해 제공됩니다.
|
|
9
|
-
*/
|
|
10
|
-
export { TextToParticle, default as TextToParticleDefault } from './textToParticle/index.js';
|
|
1
|
+
export { TextToParticle } from './textToParticle/index.js';
|
|
11
2
|
export type { TextToParticleOptions, Particle } from './textToParticle/index.js';
|
|
12
|
-
export { Count
|
|
3
|
+
export { Count } from './count/index.js';
|
|
13
4
|
export type { CountOptions } from './count/index.js';
|
|
14
5
|
export { easingFunctions } from './count/index.js';
|
|
15
|
-
export { Typing
|
|
6
|
+
export { Typing } from './typing/index.js';
|
|
16
7
|
export type { TypingOptions } from './typing/index.js';
|
|
17
|
-
export { ScrollFadeIn
|
|
8
|
+
export { ScrollFadeIn } from './scrollFadeIn/index.js';
|
|
18
9
|
export type { ScrollFadeInOptions } from './scrollFadeIn/index.js';
|
|
19
|
-
export { TextSpin
|
|
10
|
+
export { TextSpin } from './textSpin/index.js';
|
|
20
11
|
export type { TextSpinOptions } from './textSpin/index.js';
|
|
21
12
|
export { TextToParticle as MasonEffect } from './textToParticle/index.js';
|
|
22
13
|
export type { TextToParticleOptions as MasonEffectOptions } from './textToParticle/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,YAAY,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEjF,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,cAAc,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC1E,YAAY,EAAE,qBAAqB,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/core/textToParticle/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,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,YAAY,IAAI,IAAI;IAuGpB,YAAY,IAAI,QAAQ;IAiBxB,aAAa,IAAI,IAAI;IAcrB,OAAO,IAAI,IAAI;IAiBf,KAAK,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI,GAAG,IAAI;IAM3E,cAAc,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI,GAAG,IAAI;IAuBpF,MAAM,IAAI,IAAI;IAoDd,OAAO,IAAI,IAAI;IAMf,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,IAAI;IAQZ,mBAAmB,IAAI,IAAI;IAQ3B,oBAAoB,IAAI,IAAI;IAQ5B,YAAY,IAAI,IAAI;IAIpB,eAAe,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAMpC,gBAAgB,IAAI,IAAI;IAIxB,eAAe,IAAI,IAAI;IAIvB,aAAa,IAAI,IAAI;IAKrB,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI;IAK7D,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI;IAQtE,OAAO,IAAI,IAAI;CAWhB;AAGD,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"t",{value:!0});var t=require("react");class i{constructor(t,i={}){this.container=t,this.options={threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,onVisible:i.onVisible,onHidden:i.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const i of t)i.target===this.container&&(i.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}class s{constructor(t,i){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!i.text)throw new Error("Text is required");this.config={text:i.text,delay:i.delay??.2,duration:i.duration??.6,randomDelay:i.randomDelay??2,threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,triggerOnce:i.triggerOnce??!1,enabled:i.enabled??!0,onStart:i.onStart||null,onComplete:i.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach(t=>{const i=document.createElement("span");i.className="masoneffect-textspin-char",i.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(i.classList.add("space"),i.innerHTML=" "):i.textContent=t,this.container.appendChild(i),this.textElements.push(i)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new i(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,i)=>{const s=this.config.delay+this.randomPoints[i]*this.config.randomDelay;t.style.transitionDelay=`${s}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){const i=this.isActive,s=void 0!==t.enabled&&t.enabled!==this.config.enabled;(s&&!1===t.enabled||i)&&this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),this.config.enabled&&(i||s&&!0===t.enabled)&&this.visibilityManager?.getIsVisible()&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}const e=t.forwardRef((i,e)=>{const n=t.useRef(null),o=t.useRef(null);return t.useEffect(()=>{if(!n.current)return;if(o.current)return;const{text:t,delay:e,duration:h,randomDelay:r,threshold:a,rootMargin:l,root:d,triggerOnce:
|
|
1
|
+
Object.defineProperty(exports,"t",{value:!0});var t=require("react");class i{constructor(t,i={}){this.container=t,this.options={threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,onVisible:i.onVisible,onHidden:i.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const i of t)i.target===this.container&&(i.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}class s{constructor(t,i){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!i.text)throw new Error("Text is required");this.config={text:i.text,delay:i.delay??.2,duration:i.duration??.6,randomDelay:i.randomDelay??2,threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,triggerOnce:i.triggerOnce??!1,enabled:i.enabled??!0,onStart:i.onStart||null,onComplete:i.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach(t=>{const i=document.createElement("span");i.className="masoneffect-textspin-char",i.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(i.classList.add("space"),i.innerHTML=" "):i.textContent=t,this.container.appendChild(i),this.textElements.push(i)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new i(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,i)=>{const s=this.config.delay+this.randomPoints[i]*this.config.randomDelay;t.style.transitionDelay=`${s}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){const i=this.isActive,s=void 0!==t.enabled&&t.enabled!==this.config.enabled;(s&&!1===t.enabled||i)&&this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),this.config.enabled&&(i||s&&!0===t.enabled)&&this.visibilityManager?.getIsVisible()&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}const e=t.forwardRef((i,e)=>{const n=t.useRef(null),o=t.useRef(null);return t.useEffect(()=>{if(!n.current)return;if(o.current)return;const{text:t,delay:e,duration:h,randomDelay:r,threshold:a,rootMargin:l,root:d,triggerOnce:u,enabled:c,onStart:p,onComplete:f}=i;return o.current=new s(n.current,{text:t,delay:e,duration:h,randomDelay:r,threshold:a,rootMargin:l,root:d,triggerOnce:u,enabled:c,onStart:p,onComplete:f}),()=>{o.current?.destroy(),o.current=null}},[]),t.useEffect(()=>{if(!o.current)return;const{text:t,delay:s,duration:e,randomDelay:n,threshold:h,rootMargin:r,root:a,triggerOnce:l,enabled:d,onStart:u,onComplete:c}=i;o.current.updateConfig({text:t,delay:s,duration:e,randomDelay:n,threshold:h,rootMargin:r,root:a,triggerOnce:l,enabled:d,onStart:u,onComplete:c})},[i.text,i.delay,i.duration,i.randomDelay,i.threshold,i.rootMargin,i.root,i.triggerOnce,i.enabled,i.onStart,i.onComplete]),t.useImperativeHandle(e,()=>({start:()=>o.current?.start(),stop:()=>o.current?.stop(),reset:()=>o.current?.reset(),updateText:t=>o.current?.updateText(t),updateConfig:t=>o.current?.updateConfig(t),destroy:()=>{o.current?.destroy(),o.current=null}})),t.createElement("div",{ref:n,className:i.className,style:i.style})});e.displayName="TextSpin",exports.default=e;
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MasonEffect - 메인 엔트리 포인트
|
|
3
|
-
*
|
|
4
|
-
* 주의: tree-shaking을 위해 각 이펙트를 직접 import하는 것을 권장합니다:
|
|
5
|
-
* - import { TextToParticle } from 'masoneffect/textToParticle'
|
|
6
|
-
* - import { Count } from 'masoneffect/count'
|
|
7
|
-
*
|
|
8
|
-
* 이 파일은 하위 호환성을 위해 제공됩니다.
|
|
9
|
-
*/
|
|
10
1
|
export { TextToParticle, MasonEffect } from './core/index.js';
|
|
11
2
|
export type { TextToParticleOptions, MasonEffectOptions, Particle } from './core/index.js';
|
|
12
3
|
export { Count } from './core/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3F,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{forwardRef as i,useRef as s,useEffect as e,useImperativeHandle as n}from"react";class o{constructor(t,i={}){this.container=t,this.options={threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,onVisible:i.onVisible,onHidden:i.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const i of t)i.target===this.container&&(i.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}class h{constructor(t,i){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!i.text)throw new Error("Text is required");this.config={text:i.text,delay:i.delay??.2,duration:i.duration??.6,randomDelay:i.randomDelay??2,threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,triggerOnce:i.triggerOnce??!1,enabled:i.enabled??!0,onStart:i.onStart||null,onComplete:i.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach(t=>{const i=document.createElement("span");i.className="masoneffect-textspin-char",i.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(i.classList.add("space"),i.innerHTML=" "):i.textContent=t,this.container.appendChild(i),this.textElements.push(i)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new o(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,i)=>{const s=this.config.delay+this.randomPoints[i]*this.config.randomDelay;t.style.transitionDelay=`${s}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){const i=this.isActive,s=void 0!==t.enabled&&t.enabled!==this.config.enabled;(s&&!1===t.enabled||i)&&this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),this.config.enabled&&(i||s&&!0===t.enabled)&&this.visibilityManager?.getIsVisible()&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}const r=i((i,o)=>{const r=s(null),a=s(null);return e(()=>{if(!r.current)return;if(a.current)return;const{text:t,delay:s,duration:e,randomDelay:n,threshold:o,rootMargin:l,root:d,triggerOnce:
|
|
1
|
+
import t,{forwardRef as i,useRef as s,useEffect as e,useImperativeHandle as n}from"react";class o{constructor(t,i={}){this.container=t,this.options={threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,onVisible:i.onVisible,onHidden:i.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const i of t)i.target===this.container&&(i.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}class h{constructor(t,i){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");if(!i.text)throw new Error("Text is required");this.config={text:i.text,delay:i.delay??.2,duration:i.duration??.6,randomDelay:i.randomDelay??2,threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,triggerOnce:i.triggerOnce??!1,enabled:i.enabled??!0,onStart:i.onStart||null,onComplete:i.onComplete||null},this.visibilityManager=null,this.textElements=[],this.randomPoints=[],this.hasTriggered=!1,this.isActive=!1,this.init()}init(){this.injectStyles(),this.createTextStructure(),this.setupVisibilityManager()}injectStyles(){if(document.getElementById("masoneffect-textspin-styles"))return;const t=document.createElement("style");t.id="masoneffect-textspin-styles",t.textContent="\n .masoneffect-textspin {\n display: inline-block;\n }\n .masoneffect-textspin-char {\n display: inline-block;\n opacity: 0;\n transform: rotateY(90deg);\n }\n .masoneffect-textspin-char.active {\n opacity: 1;\n transform: rotateY(0deg);\n }\n .masoneffect-textspin-char.space {\n width: 0.25em;\n }\n ",document.head.appendChild(t)}createTextStructure(){this.container.innerHTML="",this.textElements=[],this.randomPoints=[];const t=this.config.text.split("");t.forEach(()=>{this.randomPoints.push(Math.random())}),t.forEach(t=>{const i=document.createElement("span");i.className="masoneffect-textspin-char",i.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`," "===t?(i.classList.add("space"),i.innerHTML=" "):i.textContent=t,this.container.appendChild(i),this.textElements.push(i)}),this.container.classList.add("masoneffect-textspin")}setupVisibilityManager(){this.visibilityManager=new o(this.container,{threshold:this.config.threshold,rootMargin:this.config.rootMargin,root:this.config.root,onVisible:()=>{this.config.enabled&&(this.config.triggerOnce&&this.hasTriggered||(this.hasTriggered=!0,this.start()))},onHidden:()=>{this.config.enabled&&(this.stop(),this.config.triggerOnce||(this.hasTriggered=!1))}})}start(){if(this.isActive)return;this.isActive=!0,this.config.onStart&&this.config.onStart(),this.textElements.forEach((t,i)=>{const s=this.config.delay+this.randomPoints[i]*this.config.randomDelay;t.style.transitionDelay=`${s}s`,requestAnimationFrame(()=>{t.classList.add("active")})});const t=this.config.delay+this.config.randomDelay+this.config.duration;setTimeout(()=>{this.config.onComplete&&this.config.onComplete()},1e3*t)}stop(){this.isActive&&(this.isActive=!1,this.textElements.forEach(t=>{t.classList.remove("active"),t.style.transitionDelay=""}))}reset(){this.stop(),this.hasTriggered=!1}updateText(t){this.config.text=t,this.createTextStructure(),this.isActive&&this.start()}updateTransitions(){this.textElements.forEach(t=>{t.style.transition=`opacity ${this.config.duration}s ease-out, transform ${this.config.duration}s ease-out`})}updateConfig(t){const i=this.isActive,s=void 0!==t.enabled&&t.enabled!==this.config.enabled;(s&&!1===t.enabled||i)&&this.stop(),this.config={...this.config,...t,text:t.text??this.config.text,onStart:t.onStart??this.config.onStart,onComplete:t.onComplete??this.config.onComplete},void 0!==t.text?this.createTextStructure():void 0!==t.duration&&this.updateTransitions(),void 0===t.threshold&&void 0===t.rootMargin&&void 0===t.root||(this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.setupVisibilityManager()),this.config.enabled&&(i||s&&!0===t.enabled)&&this.visibilityManager?.getIsVisible()&&this.start()}destroy(){this.stop(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.container.innerHTML="",this.container.classList.remove("masoneffect-textspin")}}const r=i((i,o)=>{const r=s(null),a=s(null);return e(()=>{if(!r.current)return;if(a.current)return;const{text:t,delay:s,duration:e,randomDelay:n,threshold:o,rootMargin:l,root:d,triggerOnce:u,enabled:c,onStart:f,onComplete:p}=i;return a.current=new h(r.current,{text:t,delay:s,duration:e,randomDelay:n,threshold:o,rootMargin:l,root:d,triggerOnce:u,enabled:c,onStart:f,onComplete:p}),()=>{a.current?.destroy(),a.current=null}},[]),e(()=>{if(!a.current)return;const{text:t,delay:s,duration:e,randomDelay:n,threshold:o,rootMargin:h,root:r,triggerOnce:l,enabled:d,onStart:u,onComplete:c}=i;a.current.updateConfig({text:t,delay:s,duration:e,randomDelay:n,threshold:o,rootMargin:h,root:r,triggerOnce:l,enabled:d,onStart:u,onComplete:c})},[i.text,i.delay,i.duration,i.randomDelay,i.threshold,i.rootMargin,i.root,i.triggerOnce,i.enabled,i.onStart,i.onComplete]),n(o,()=>({start:()=>a.current?.start(),stop:()=>a.current?.stop(),reset:()=>a.current?.reset(),updateText:t=>a.current?.updateText(t),updateConfig:t=>a.current?.updateConfig(t),destroy:()=>{a.current?.destroy(),a.current=null}})),t.createElement("div",{ref:r,className:i.className,style:i.style})});r.displayName="TextSpin";export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.d.ts","sourceRoot":"","sources":["../../../src/index.umd.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.umd.d.ts","sourceRoot":"","sources":["../../../src/index.umd.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Count.d.ts","sourceRoot":"","sources":["../../../../../src/react/count/Count.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACtD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,UAAW,SAAQ,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,YAAY,CAAC;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"Count.d.ts","sourceRoot":"","sources":["../../../../../src/react/count/Count.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,IAAI,CAAC;IACtD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,UAAW,SAAQ,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,YAAY,CAAC;IACxE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,cAAc,6EAwDlB,CAAC;AAIH,eAAe,cAAc,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MasonEffect React - 모든 React 컴포넌트를 export하는 메인 파일
|
|
3
|
-
*/
|
|
4
1
|
export { default as TextToParticle } from './textToParticle/index.js';
|
|
5
2
|
export type { TextToParticleRef, TextToParticleOptions } from './textToParticle/index.js';
|
|
6
3
|
export { default as Count } from './count/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAE1F,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACnE,YAAY,EACV,iBAAiB,IAAI,cAAc,EACnC,qBAAqB,IAAI,kBAAkB,GAC5C,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollFadeIn.d.ts","sourceRoot":"","sources":["../../../../../src/react/scrollFadeIn/ScrollFadeIn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,iBAAkB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,YAAY,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ScrollFadeIn.d.ts","sourceRoot":"","sources":["../../../../../src/react/scrollFadeIn/ScrollFadeIn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,iBAAkB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,YAAY,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,qBAAqB,2FA2DzB,CAAC;AAIH,eAAe,qBAAqB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextSpin.d.ts","sourceRoot":"","sources":["../../../../../src/react/textSpin/TextSpin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACzD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,aAAc,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,CAAC;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"TextSpin.d.ts","sourceRoot":"","sources":["../../../../../src/react/textSpin/TextSpin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACzD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,aAAc,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,CAAC;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,iBAAiB,mFAwDrB,CAAC;AAIH,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/textSpin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/textSpin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextToParticle.d.ts","sourceRoot":"","sources":["../../../../../src/react/textToParticle/TextToParticle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IACzE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,uBAAuB,+
|
|
1
|
+
{"version":3,"file":"TextToParticle.d.ts","sourceRoot":"","sources":["../../../../../src/react/textToParticle/TextToParticle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IACzE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,uBAAuB,+FA8G3B,CAAC;AAIH,eAAe,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typing.d.ts","sourceRoot":"","sources":["../../../../../src/react/typing/Typing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,WAAY,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,YAAY,CAAC;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,eAAe,+
|
|
1
|
+
{"version":3,"file":"Typing.d.ts","sourceRoot":"","sources":["../../../../../src/react/typing/Typing.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAEjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,WAAY,SAAQ,IAAI,CAAC,aAAa,EAAE,UAAU,GAAG,YAAY,CAAC;IAC1E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,eAAe,+EA4CnB,CAAC;AAIH,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextToParticle.d.ts","sourceRoot":"","sources":["../../../src/react/textToParticle/TextToParticle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IACzE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,uBAAuB,+
|
|
1
|
+
{"version":3,"file":"TextToParticle.d.ts","sourceRoot":"","sources":["../../../src/react/textToParticle/TextToParticle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IACzE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,uBAAuB,+FA8G3B,CAAC;AAIH,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
* MasonEffect Core - 모든 이펙트를 export하는 메인 파일
|
|
3
|
-
*
|
|
4
|
-
* 주의: tree-shaking을 위해 각 이펙트를 직접 import하는 것을 권장합니다:
|
|
5
|
-
* - import { TextToParticle } from 'masoneffect/textToParticle'
|
|
6
|
-
* - import { Count } from 'masoneffect/count'
|
|
7
|
-
*
|
|
8
|
-
* 이 파일은 하위 호환성을 위해 제공됩니다.
|
|
9
|
-
*/
|
|
10
|
-
export { TextToParticle, default as TextToParticleDefault } from './textToParticle/index.js';
|
|
1
|
+
export { TextToParticle } from './textToParticle/index.js';
|
|
11
2
|
export type { TextToParticleOptions, Particle } from './textToParticle/index.js';
|
|
12
|
-
export { Count
|
|
3
|
+
export { Count } from './count/index.js';
|
|
13
4
|
export type { CountOptions } from './count/index.js';
|
|
14
5
|
export { easingFunctions } from './count/index.js';
|
|
15
|
-
export { Typing
|
|
6
|
+
export { Typing } from './typing/index.js';
|
|
16
7
|
export type { TypingOptions } from './typing/index.js';
|
|
17
|
-
export { ScrollFadeIn
|
|
8
|
+
export { ScrollFadeIn } from './scrollFadeIn/index.js';
|
|
18
9
|
export type { ScrollFadeInOptions } from './scrollFadeIn/index.js';
|
|
19
|
-
export { TextSpin
|
|
10
|
+
export { TextSpin } from './textSpin/index.js';
|
|
20
11
|
export type { TextSpinOptions } from './textSpin/index.js';
|
|
21
12
|
export { TextToParticle as MasonEffect } from './textToParticle/index.js';
|
|
22
13
|
export type { TextToParticleOptions as MasonEffectOptions } from './textToParticle/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,YAAY,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEjF,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,YAAY,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EAAE,cAAc,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC1E,YAAY,EAAE,qBAAqB,IAAI,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["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M,EAAE,OAAO,GAAE,qBAA0B;IAgFhF,IAAI,IAAI,IAAI;IAUZ,sBAAsB,IAAI,IAAI;IAY9B,MAAM,IAAI,IAAI;IAwCd;;;;;;;OAOG;IACH,OAAO,CAAC,cAAc;IAoCtB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAwC3B,YAAY,IAAI,IAAI;IAuGpB,YAAY,IAAI,QAAQ;IAiBxB,aAAa,IAAI,IAAI;IAcrB,OAAO,IAAI,IAAI;IAiBf,KAAK,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI,GAAG,IAAI;IAM3E,cAAc,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI,GAAG,IAAI;IAuBpF,MAAM,IAAI,IAAI;IAoDd,OAAO,IAAI,IAAI;IAMf,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,IAAI;IAQZ,mBAAmB,IAAI,IAAI;IAQ3B,oBAAoB,IAAI,IAAI;IAQ5B,YAAY,IAAI,IAAI;IAIpB,eAAe,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAMpC,gBAAgB,IAAI,IAAI;IAIxB,eAAe,IAAI,IAAI;IAIvB,aAAa,IAAI,IAAI;IAKrB,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI;IAK7D,qBAAqB,CAAC,SAAS,EAAE,OAAO,CAAC,qBAAqB,CAAC,GAAG,IAAI;IAQtE,OAAO,IAAI,IAAI;CAWhB;AAGD,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"t",{value:!0});var t=require("react");class i{constructor(t,i={}){this.container=t,this.options={threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,onVisible:i.onVisible,onHidden:i.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const i of t)i.target===this.container&&(i.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}function s(t,i){let s=null;return function(...h){null!==s&&clearTimeout(s),s=setTimeout(()=>{s=null,t.apply(this,h)},i)}}class h{constructor(t,i={}){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={text:i.text||"mason effect",densityStep:i.densityStep??2,maxParticles:i.maxParticles??3200,pointSize:i.pointSize??.5,ease:i.ease??.05,repelRadius:i.repelRadius??150,repelStrength:i.repelStrength??1,particleColor:i.particleColor||"#fff",fontFamily:i.fontFamily||"Inter, system-ui, Arial",fontSize:i.fontSize||null,width:i.width||null,height:i.height||null,devicePixelRatio:i.devicePixelRatio??null,onReady:i.onReady||null,onUpdate:i.onUpdate||null},this.canvas=document.createElement("canvas");const h=this.canvas.getContext("2d",{willReadFrequently:!0});if(!h)throw new Error("Canvas context not available");this.ctx=h,this.container.appendChild(this.canvas),this.canvas.style.display="block",this.offCanvas=document.createElement("canvas");const e=this.offCanvas.getContext("2d",{willReadFrequently:!0});if(!e)throw new Error("Offscreen canvas context not available");this.offCtx=e,this.W=0,this.H=0,this.DPR=this.config.devicePixelRatio||Math.min(window.devicePixelRatio||1,1.8),this.particles=[],this.mouse={x:0,y:0,down:!1},this.animationId=null,this.isRunning=!1,this.visibilityManager=null,this.debounceDelay=i.debounceDelay??150;const n=this.handleResize.bind(this);this.handleResize=s(n,this.debounceDelay),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.i=s(this.h.bind(this),this.debounceDelay),this.o=s(this.l.bind(this),this.debounceDelay),this.init()}init(){this.resize(),this.setupEventListeners(),this.setupVisibilityManager(),this.config.onReady&&this.config.onReady(this)}setupVisibilityManager(){this.visibilityManager=new i(this.container,{threshold:.1,onVisible:()=>{this.start()},onHidden:()=>{this.stop()}})}resize(){const t=this.container.getBoundingClientRect(),i=this.config.width||t.width||this.container.clientWidth||window.innerWidth,s=this.config.height||t.height||this.container.clientHeight||.7*window.innerHeight;if(i<=0||s<=0)return;this.W=Math.floor(i*this.DPR),this.H=Math.floor(s*this.DPR);const h=4096;if(this.W>h||this.H>h){const t=Math.min(h/this.W,h/this.H);this.W=Math.floor(this.W*t),this.H=Math.floor(this.H*t),this.DPR=this.DPR*t}this.canvas.width=this.W,this.canvas.height=this.H,this.canvas.style.width=i+"px",this.canvas.style.height=s+"px",this.W>0&&this.H>0&&(this.buildTargets(),this.particles.length||this.initParticles())}measureTextFit(t,i,s,h){this.offCtx.font=`400 ${t}px ${this.config.fontFamily}`;const e=i.split("\n"),n=t,o=.1*t,l=.05*t;let r=0;for(const t of e){if(0===t.length)continue;const i=this.offCtx.measureText(t).width+l*(t.length>0?t.length-1:0);r=Math.max(r,i)}const a=e.length>0?n*e.length+o*(e.length-1):n;return{width:r,height:a,fits:r<=s&&a<=h}}findOptimalFontSize(t,i,s,h){if(this.measureTextFit(h,t,i,s).fits)return h;if(h<=12)return 12;let e=12,n=h,o=12;for(;e<=n;){const h=Math.floor((e+n)/2);this.measureTextFit(h,t,i,s).fits?(o=h,e=h+1):n=h-1}return o}buildTargets(){if(this.W<=0||this.H<=0)return;const t=this.config.text;this.offCanvas.width=this.W,this.offCanvas.height=this.H,this.offCtx.clearRect(0,0,this.offCanvas.width,this.offCanvas.height);const i=Math.min(this.W,this.H),s=this.config.fontSize||Math.max(80,Math.floor(.18*i)),h=this.W-80,e=this.H-80,n=this.findOptimalFontSize(t,h,e,s);this.offCtx.fillStyle="#ffffff",this.offCtx.textAlign="center",this.offCtx.textBaseline="middle",this.offCtx.font=`400 ${n}px ${this.config.fontFamily}`;const o=t.split("\n"),l=n,r=.1*n,a=.05*n,u=o.length>0?l*o.length+r*(o.length-1):l;let c=this.H/2-u/2+l/2;for(const t of o){if(0===t.length){c+=l+r;continue}const i=t.split(""),s=this.offCtx.measureText(t).width+a*(i.length>0?i.length-1:0);let h=this.W/2-s/2;for(const t of i)this.offCtx.fillText(t,h+this.offCtx.measureText(t).width/2,c),h+=this.offCtx.measureText(t).width+a;c+=l+r}const d=Math.max(2,this.config.densityStep),f=this.offCtx.getImageData(0,0,this.W,this.H).data,p=[];for(let t=0;t<this.H;t+=d)for(let i=0;i<this.W;i+=d){const s=4*(t*this.W+i);f[s]+f[s+1]+f[s+2]>600&&p.push({x:i,y:t})}for(;p.length>this.config.maxParticles;)p.splice(Math.floor(Math.random()*p.length),1);if(this.particles.length<p.length){const t=p.length-this.particles.length;for(let i=0;i<t;i++)this.particles.push(this.makeParticle())}else this.particles.length>p.length&&(this.particles.length=p.length);for(let t=0;t<this.particles.length;t++){const i=this.particles[t],s=p[t];i.tx=s.x,i.ty=s.y}}makeParticle(){const t=Math.random()*this.W,i=Math.random()*this.H;return{x:t,y:i,vx:0,vy:0,tx:t,ty:i,initialX:t,initialY:i,j:Math.random()*Math.PI*2}}initParticles(){for(const t of this.particles){const i=Math.random()*this.W,s=Math.random()*this.H;t.x=i,t.y=s,t.vx=t.vy=0,t.initialX=i,t.initialY=s}}scatter(){for(const t of this.particles)void 0!==t.initialX&&void 0!==t.initialY?(t.tx=t.initialX,t.ty=t.initialY):(t.initialX=t.x,t.initialY=t.y,t.tx=t.initialX,t.ty=t.initialY)}morph(t){this.i(t)}h(t){if(0!==this.W&&0!==this.H||this.resize(),"string"==typeof t)this.config.text=t,this.buildTargets();else if(t&&"object"==typeof t){const i=void 0!==t.text;this.config={...this.config,...t},i&&this.buildTargets()}else this.buildTargets()}update(){this.ctx.clearRect(0,0,this.W,this.H);for(const t of this.particles){let i=(t.tx-t.x)*this.config.ease,s=(t.ty-t.y)*this.config.ease;if(this.mouse.x||this.mouse.y){const h=t.x-this.mouse.x,e=t.y-this.mouse.y,n=h*h+e*e,o=this.config.repelRadius*this.DPR;if(n<o*o){const t=Math.sqrt(n)+1e-4,l=(this.mouse.down?-1:1)*this.config.repelStrength*(1-t/o);i+=h/t*l*6,s+=e/t*l*6}}t.j+=2,i+=.05*Math.cos(t.j),s+=.05*Math.sin(1.3*t.j),t.vx=(t.vx+i)*Math.random(),t.vy=(t.vy+s)*Math.random(),t.x+=t.vx,t.y+=t.vy}this.ctx.fillStyle=this.config.particleColor;const t=Math.min(this.W,this.H)/this.DPR,i=Math.max(.5,Math.min(2,t/1920)),s=this.config.pointSize*this.DPR*i;for(const t of this.particles)this.ctx.beginPath(),this.ctx.arc(t.x,t.y,s,0,2*Math.PI),this.ctx.fill();this.config.onUpdate&&this.config.onUpdate(this)}animate(){this.isRunning&&(this.update(),this.animationId=requestAnimationFrame(()=>this.animate()))}start(){this.isRunning||(this.isRunning=!0,this.animate())}stop(){this.isRunning=!1,this.animationId&&(cancelAnimationFrame(this.animationId),this.animationId=null)}setupEventListeners(){window.addEventListener("resize",this.handleResize),this.canvas.addEventListener("mousemove",this.handleMouseMove),this.canvas.addEventListener("mouseleave",this.handleMouseLeave),this.canvas.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("mouseup",this.handleMouseUp)}removeEventListeners(){window.removeEventListener("resize",this.handleResize),this.canvas.removeEventListener("mousemove",this.handleMouseMove),this.canvas.removeEventListener("mouseleave",this.handleMouseLeave),this.canvas.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("mouseup",this.handleMouseUp)}handleResize(){this.resize()}handleMouseMove(t){const i=this.canvas.getBoundingClientRect();this.mouse.x=(t.clientX-i.left)*this.DPR,this.mouse.y=(t.clientY-i.top)*this.DPR}handleMouseLeave(){this.mouse.x=this.mouse.y=0}handleMouseDown(){this.mouse.down=!0}handleMouseUp(){this.mouse.down=!1}updateConfig(t){this.o(t)}l(t){this.config={...this.config,...t},t.text&&this.buildTargets()}destroy(){this.stop(),this.removeEventListeners(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}const e=t.forwardRef((i,s)=>{const e=t.useRef(null),n=t.useRef(null);t.useEffect(()=>{if(!e.current)return;let t=null,s=null,o=null;const l=()=>{const r=e.current;if(!r)return;if(n.current)return;const a=r.querySelector("canvas");a&&a.remove();const u=r.getBoundingClientRect();if(!(u.width>0&&u.height>0)){if("undefined"!=typeof ResizeObserver){let t=0;const i=20;return s&&(s.disconnect(),s=null),s=new ResizeObserver(()=>{t++;const h=r.getBoundingClientRect();(h.width>0&&h.height>0||t>=i)&&(s&&(s.disconnect(),s=null),l())}),void s.observe(r)}return void(o=window.setTimeout(l,50))}const{text:c,densityStep:d,maxParticles:f,pointSize:p,ease:m,repelRadius:w,repelStrength:v,particleColor:y,fontFamily:M,fontSize:x,width:g,height:S,devicePixelRatio:R,onReady:b,onUpdate:z}=i,P={text:c,densityStep:d,maxParticles:f,pointSize:p,ease:m,repelRadius:w,repelStrength:v,particleColor:y,fontFamily:M,fontSize:x,width:g,height:S,devicePixelRatio:R,onReady:b,onUpdate:z};n.current=new h(r,P),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(()=>{n.current&&n.current.resize()}),t.observe(r))};return requestAnimationFrame(l),()=>{o&&(clearTimeout(o),o=null),s&&(s.disconnect(),s=null),t&&(t.disconnect(),t=null),n.current&&(n.current.destroy(),n.current=null)}},[]),t.useEffect(()=>{if(!n.current)return;const{text:t,densityStep:s,maxParticles:h,pointSize:e,ease:o,repelRadius:l,repelStrength:r,particleColor:a,fontFamily:u,fontSize:c,width:d,height:f,devicePixelRatio:p}=i;n.current.updateConfig({text:t,densityStep:s,maxParticles:h,pointSize:e,ease:o,repelRadius:l,repelStrength:r,particleColor:a,fontFamily:u,fontSize:c,width:d,height:f,devicePixelRatio:p})},[i.text,i.densityStep,i.maxParticles,i.pointSize,i.ease,i.repelRadius,i.repelStrength,i.particleColor,i.fontFamily,i.fontSize,i.width,i.height,i.devicePixelRatio]),t.useImperativeHandle(s,()=>({morph:t=>{n.current?n.current.morph(t):console.warn("TextToParticle: 인스턴스가 아직 초기화되지 않았습니다.")},scatter:()=>{n.current?n.current.scatter():console.warn("TextToParticle: 인스턴스가 아직 초기화되지 않았습니다.")},updateConfig:t=>{n.current?n.current.updateConfig(t):console.warn("TextToParticle: 인스턴스가 아직 초기화되지 않았습니다.")},destroy:()=>{n.current&&(n.current.destroy(),n.current=null)}}));const o={width:"100%",height:"100%",minHeight:300,position:"relative",...i.style};return t.createElement("div",{ref:e,className:i.className,style:o})});e.displayName="TextToParticle",exports.default=e;
|
|
1
|
+
Object.defineProperty(exports,"t",{value:!0});var t=require("react");class i{constructor(t,i={}){this.container=t,this.options={threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,onVisible:i.onVisible,onHidden:i.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const i of t)i.target===this.container&&(i.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}function s(t,i){let s=null;return function(...h){null!==s&&clearTimeout(s),s=setTimeout(()=>{s=null,t.apply(this,h)},i)}}class h{constructor(t,i={}){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={text:i.text||"mason effect",densityStep:i.densityStep??2,maxParticles:i.maxParticles??3200,pointSize:i.pointSize??.5,ease:i.ease??.05,repelRadius:i.repelRadius??150,repelStrength:i.repelStrength??1,particleColor:i.particleColor||"#fff",fontFamily:i.fontFamily||"Inter, system-ui, Arial",fontSize:i.fontSize||null,width:i.width||null,height:i.height||null,devicePixelRatio:i.devicePixelRatio??null,onReady:i.onReady||null,onUpdate:i.onUpdate||null},this.canvas=document.createElement("canvas");const h=this.canvas.getContext("2d",{willReadFrequently:!0});if(!h)throw new Error("Canvas context not available");this.ctx=h,this.container.appendChild(this.canvas),this.canvas.style.display="block",this.offCanvas=document.createElement("canvas");const e=this.offCanvas.getContext("2d",{willReadFrequently:!0});if(!e)throw new Error("Offscreen canvas context not available");this.offCtx=e,this.W=0,this.H=0,this.DPR=this.config.devicePixelRatio||Math.min(window.devicePixelRatio||1,1.8),this.particles=[],this.mouse={x:0,y:0,down:!1},this.animationId=null,this.isRunning=!1,this.visibilityManager=null,this.debounceDelay=i.debounceDelay??150;const n=this.handleResize.bind(this);this.handleResize=s(n,this.debounceDelay),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.i=s(this.h.bind(this),this.debounceDelay),this.o=s(this.l.bind(this),this.debounceDelay),this.init()}init(){this.resize(),this.setupEventListeners(),this.setupVisibilityManager(),this.config.onReady&&this.config.onReady(this)}setupVisibilityManager(){this.visibilityManager=new i(this.container,{threshold:.1,onVisible:()=>{this.start()},onHidden:()=>{this.stop()}})}resize(){const t=this.container.getBoundingClientRect(),i=this.config.width||t.width||this.container.clientWidth||window.innerWidth,s=this.config.height||t.height||this.container.clientHeight||.7*window.innerHeight;if(i<=0||s<=0)return;this.W=Math.floor(i*this.DPR),this.H=Math.floor(s*this.DPR);const h=4096;if(this.W>h||this.H>h){const t=Math.min(h/this.W,h/this.H);this.W=Math.floor(this.W*t),this.H=Math.floor(this.H*t),this.DPR=this.DPR*t}this.canvas.width=this.W,this.canvas.height=this.H,this.canvas.style.width=i+"px",this.canvas.style.height=s+"px",this.W>0&&this.H>0&&(this.buildTargets(),this.particles.length||this.initParticles())}measureTextFit(t,i,s,h){this.offCtx.font=`400 ${t}px ${this.config.fontFamily}`;const e=i.split("\n"),n=t,o=.1*t,r=.05*t;let l=0;for(const t of e){if(0===t.length)continue;const i=this.offCtx.measureText(t).width+r*(t.length>0?t.length-1:0);l=Math.max(l,i)}const a=e.length>0?n*e.length+o*(e.length-1):n;return{width:l,height:a,fits:l<=s&&a<=h}}findOptimalFontSize(t,i,s,h){if(this.measureTextFit(h,t,i,s).fits)return h;if(h<=12)return 12;let e=12,n=h,o=12;for(;e<=n;){const h=Math.floor((e+n)/2);this.measureTextFit(h,t,i,s).fits?(o=h,e=h+1):n=h-1}return o}buildTargets(){if(this.W<=0||this.H<=0)return;const t=this.config.text;this.offCanvas.width=this.W,this.offCanvas.height=this.H,this.offCtx.clearRect(0,0,this.offCanvas.width,this.offCanvas.height);const i=Math.min(this.W,this.H),s=this.config.fontSize||Math.max(80,Math.floor(.18*i)),h=this.W-80,e=this.H-80,n=this.findOptimalFontSize(t,h,e,s);this.offCtx.fillStyle="#ffffff",this.offCtx.textAlign="center",this.offCtx.textBaseline="middle",this.offCtx.font=`400 ${n}px ${this.config.fontFamily}`;const o=t.split("\n"),r=n,l=.1*n,a=.05*n,u=o.length>0?r*o.length+l*(o.length-1):r;let c=this.H/2-u/2+r/2;for(const t of o){if(0===t.length){c+=r+l;continue}const i=t.split(""),s=this.offCtx.measureText(t).width+a*(i.length>0?i.length-1:0);let h=this.W/2-s/2;for(const t of i)this.offCtx.fillText(t,h+this.offCtx.measureText(t).width/2,c),h+=this.offCtx.measureText(t).width+a;c+=r+l}const d=Math.max(2,Math.round(this.config.densityStep*this.DPR)),f=this.offCtx.getImageData(0,0,this.W,this.H).data,p=[];for(let t=0;t<this.H;t+=d)for(let i=0;i<this.W;i+=d){const s=4*(t*this.W+i);f[s]+f[s+1]+f[s+2]>600&&p.push({x:i,y:t})}for(;p.length>this.config.maxParticles;)p.splice(Math.floor(Math.random()*p.length),1);if(this.particles.length<p.length){const t=p.length-this.particles.length;for(let i=0;i<t;i++)this.particles.push(this.makeParticle())}else this.particles.length>p.length&&(this.particles.length=p.length);for(let t=0;t<this.particles.length;t++){const i=this.particles[t],s=p[t];i.tx=s.x,i.ty=s.y}}makeParticle(){const t=Math.random()*this.W,i=Math.random()*this.H;return{x:t,y:i,vx:0,vy:0,tx:t,ty:i,initialX:t,initialY:i,j:Math.random()*Math.PI*2}}initParticles(){for(const t of this.particles){const i=Math.random()*this.W,s=Math.random()*this.H;t.x=i,t.y=s,t.vx=t.vy=0,t.initialX=i,t.initialY=s}}scatter(){for(const t of this.particles)void 0!==t.initialX&&void 0!==t.initialY?(t.tx=t.initialX,t.ty=t.initialY):(t.initialX=t.x,t.initialY=t.y,t.tx=t.initialX,t.ty=t.initialY)}morph(t){this.i(t)}h(t){if(0!==this.W&&0!==this.H||this.resize(),"string"==typeof t)this.config.text=t,this.buildTargets();else if(t&&"object"==typeof t){const i=void 0!==t.text;this.config={...this.config,...t},i&&this.buildTargets()}else this.buildTargets()}update(){this.ctx.clearRect(0,0,this.W,this.H);for(const t of this.particles){let i=(t.tx-t.x)*this.config.ease,s=(t.ty-t.y)*this.config.ease;if(this.mouse.x||this.mouse.y){const h=t.x-this.mouse.x,e=t.y-this.mouse.y,n=h*h+e*e,o=this.config.repelRadius*this.DPR;if(n<o*o){const t=Math.sqrt(n)+1e-4,r=(this.mouse.down?-1:1)*this.config.repelStrength*(1-t/o);i+=h/t*r*6,s+=e/t*r*6}}t.j+=2,i+=.05*Math.cos(t.j),s+=.05*Math.sin(1.3*t.j),t.vx=(t.vx+i)*Math.random(),t.vy=(t.vy+s)*Math.random(),t.x+=t.vx,t.y+=t.vy}this.ctx.fillStyle=this.config.particleColor;const t=Math.min(this.W,this.H)/this.DPR,i=Math.max(.5,Math.min(3,t/300)),s=this.config.pointSize*this.DPR*i;for(const t of this.particles)this.ctx.beginPath(),this.ctx.arc(t.x,t.y,s,0,2*Math.PI),this.ctx.fill();this.config.onUpdate&&this.config.onUpdate(this)}animate(){this.isRunning&&(this.update(),this.animationId=requestAnimationFrame(()=>this.animate()))}start(){this.isRunning||(this.isRunning=!0,this.animate())}stop(){this.isRunning=!1,this.animationId&&(cancelAnimationFrame(this.animationId),this.animationId=null)}setupEventListeners(){window.addEventListener("resize",this.handleResize),this.canvas.addEventListener("mousemove",this.handleMouseMove),this.canvas.addEventListener("mouseleave",this.handleMouseLeave),this.canvas.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("mouseup",this.handleMouseUp)}removeEventListeners(){window.removeEventListener("resize",this.handleResize),this.canvas.removeEventListener("mousemove",this.handleMouseMove),this.canvas.removeEventListener("mouseleave",this.handleMouseLeave),this.canvas.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("mouseup",this.handleMouseUp)}handleResize(){this.resize()}handleMouseMove(t){const i=this.canvas.getBoundingClientRect();this.mouse.x=(t.clientX-i.left)*this.DPR,this.mouse.y=(t.clientY-i.top)*this.DPR}handleMouseLeave(){this.mouse.x=this.mouse.y=0}handleMouseDown(){this.mouse.down=!0}handleMouseUp(){this.mouse.down=!1}updateConfig(t){this.o(t)}l(t){this.config={...this.config,...t},t.text&&this.buildTargets()}destroy(){this.stop(),this.removeEventListeners(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}const e=t.forwardRef((i,s)=>{const e=t.useRef(null),n=t.useRef(null);t.useEffect(()=>{if(!e.current)return;let t=null,s=null,o=null;const r=()=>{const l=e.current;if(!l)return;if(n.current)return;const a=l.querySelector("canvas");a&&a.remove();const u=l.getBoundingClientRect();if(0===u.width||0===u.height){if("undefined"!=typeof ResizeObserver){let t=0;s&&(s.disconnect(),s=null),s=new ResizeObserver(()=>{t++;const i=l.getBoundingClientRect();(i.width>0&&i.height>0||t>=20)&&(s?.disconnect(),s=null,r())}),s.observe(l)}else o=window.setTimeout(r,50);return}const{text:c,densityStep:d,maxParticles:f,pointSize:p,ease:m,repelRadius:w,repelStrength:v,particleColor:M,fontFamily:y,fontSize:x,width:g,height:S,devicePixelRatio:R,onReady:b,onUpdate:z}=i;n.current=new h(l,{text:c,densityStep:d,maxParticles:f,pointSize:p,ease:m,repelRadius:w,repelStrength:v,particleColor:M,fontFamily:y,fontSize:x,width:g,height:S,devicePixelRatio:R,onReady:b,onUpdate:z}),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(()=>n.current?.resize()),t.observe(l))};return requestAnimationFrame(r),()=>{o&&(clearTimeout(o),o=null),s?.disconnect(),t?.disconnect(),n.current?.destroy(),n.current=null}},[]),t.useEffect(()=>{if(!n.current)return;const{text:t,densityStep:s,maxParticles:h,pointSize:e,ease:o,repelRadius:r,repelStrength:l,particleColor:a,fontFamily:u,fontSize:c,width:d,height:f,devicePixelRatio:p}=i;n.current.updateConfig({text:t,densityStep:s,maxParticles:h,pointSize:e,ease:o,repelRadius:r,repelStrength:l,particleColor:a,fontFamily:u,fontSize:c,width:d,height:f,devicePixelRatio:p})},[i.text,i.densityStep,i.maxParticles,i.pointSize,i.ease,i.repelRadius,i.repelStrength,i.particleColor,i.fontFamily,i.fontSize,i.width,i.height,i.devicePixelRatio]),t.useImperativeHandle(s,()=>({morph:t=>n.current?.morph(t),scatter:()=>n.current?.scatter(),updateConfig:t=>n.current?.updateConfig(t),destroy:()=>{n.current?.destroy(),n.current=null}}));const o={width:"100%",height:"100%",minHeight:300,position:"relative",...i.style};return t.createElement("div",{ref:e,className:i.className,style:o})});e.displayName="TextToParticle",exports.default=e;
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MasonEffect - 메인 엔트리 포인트
|
|
3
|
-
*
|
|
4
|
-
* 주의: tree-shaking을 위해 각 이펙트를 직접 import하는 것을 권장합니다:
|
|
5
|
-
* - import { TextToParticle } from 'masoneffect/textToParticle'
|
|
6
|
-
* - import { Count } from 'masoneffect/count'
|
|
7
|
-
*
|
|
8
|
-
* 이 파일은 하위 호환성을 위해 제공됩니다.
|
|
9
|
-
*/
|
|
10
1
|
export { TextToParticle, MasonEffect } from './core/index.js';
|
|
11
2
|
export type { TextToParticleOptions, MasonEffectOptions, Particle } from './core/index.js';
|
|
12
3
|
export { Count } from './core/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3F,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t,{forwardRef as i,useRef as s,useEffect as h,useImperativeHandle as e}from"react";class n{constructor(t,i={}){this.container=t,this.options={threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,onVisible:i.onVisible,onHidden:i.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const i of t)i.target===this.container&&(i.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}function o(t,i){let s=null;return function(...h){null!==s&&clearTimeout(s),s=setTimeout(()=>{s=null,t.apply(this,h)},i)}}class l{constructor(t,i={}){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={text:i.text||"mason effect",densityStep:i.densityStep??2,maxParticles:i.maxParticles??3200,pointSize:i.pointSize??.5,ease:i.ease??.05,repelRadius:i.repelRadius??150,repelStrength:i.repelStrength??1,particleColor:i.particleColor||"#fff",fontFamily:i.fontFamily||"Inter, system-ui, Arial",fontSize:i.fontSize||null,width:i.width||null,height:i.height||null,devicePixelRatio:i.devicePixelRatio??null,onReady:i.onReady||null,onUpdate:i.onUpdate||null},this.canvas=document.createElement("canvas");const s=this.canvas.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("Canvas context not available");this.ctx=s,this.container.appendChild(this.canvas),this.canvas.style.display="block",this.offCanvas=document.createElement("canvas");const h=this.offCanvas.getContext("2d",{willReadFrequently:!0});if(!h)throw new Error("Offscreen canvas context not available");this.offCtx=h,this.W=0,this.H=0,this.DPR=this.config.devicePixelRatio||Math.min(window.devicePixelRatio||1,1.8),this.particles=[],this.mouse={x:0,y:0,down:!1},this.animationId=null,this.isRunning=!1,this.visibilityManager=null,this.debounceDelay=i.debounceDelay??150;const e=this.handleResize.bind(this);this.handleResize=o(e,this.debounceDelay),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.t=o(this.i.bind(this),this.debounceDelay),this.h=o(this.o.bind(this),this.debounceDelay),this.init()}init(){this.resize(),this.setupEventListeners(),this.setupVisibilityManager(),this.config.onReady&&this.config.onReady(this)}setupVisibilityManager(){this.visibilityManager=new n(this.container,{threshold:.1,onVisible:()=>{this.start()},onHidden:()=>{this.stop()}})}resize(){const t=this.container.getBoundingClientRect(),i=this.config.width||t.width||this.container.clientWidth||window.innerWidth,s=this.config.height||t.height||this.container.clientHeight||.7*window.innerHeight;if(i<=0||s<=0)return;this.W=Math.floor(i*this.DPR),this.H=Math.floor(s*this.DPR);const h=4096;if(this.W>h||this.H>h){const t=Math.min(h/this.W,h/this.H);this.W=Math.floor(this.W*t),this.H=Math.floor(this.H*t),this.DPR=this.DPR*t}this.canvas.width=this.W,this.canvas.height=this.H,this.canvas.style.width=i+"px",this.canvas.style.height=s+"px",this.W>0&&this.H>0&&(this.buildTargets(),this.particles.length||this.initParticles())}measureTextFit(t,i,s,h){this.offCtx.font=`400 ${t}px ${this.config.fontFamily}`;const e=i.split("\n"),n=t,o=.1*t,l=.05*t;let r=0;for(const t of e){if(0===t.length)continue;const i=this.offCtx.measureText(t).width+l*(t.length>0?t.length-1:0);r=Math.max(r,i)}const a=e.length>0?n*e.length+o*(e.length-1):n;return{width:r,height:a,fits:r<=s&&a<=h}}findOptimalFontSize(t,i,s,h){if(this.measureTextFit(h,t,i,s).fits)return h;if(h<=12)return 12;let e=12,n=h,o=12;for(;e<=n;){const h=Math.floor((e+n)/2);this.measureTextFit(h,t,i,s).fits?(o=h,e=h+1):n=h-1}return o}buildTargets(){if(this.W<=0||this.H<=0)return;const t=this.config.text;this.offCanvas.width=this.W,this.offCanvas.height=this.H,this.offCtx.clearRect(0,0,this.offCanvas.width,this.offCanvas.height);const i=Math.min(this.W,this.H),s=this.config.fontSize||Math.max(80,Math.floor(.18*i)),h=this.W-80,e=this.H-80,n=this.findOptimalFontSize(t,h,e,s);this.offCtx.fillStyle="#ffffff",this.offCtx.textAlign="center",this.offCtx.textBaseline="middle",this.offCtx.font=`400 ${n}px ${this.config.fontFamily}`;const o=t.split("\n"),l=n,r=.1*n,a=.05*n,c=o.length>0?l*o.length+r*(o.length-1):l;let u=this.H/2-c/2+l/2;for(const t of o){if(0===t.length){u+=l+r;continue}const i=t.split(""),s=this.offCtx.measureText(t).width+a*(i.length>0?i.length-1:0);let h=this.W/2-s/2;for(const t of i)this.offCtx.fillText(t,h+this.offCtx.measureText(t).width/2,u),h+=this.offCtx.measureText(t).width+a;u+=l+r}const d=Math.max(2,this.config.densityStep),f=this.offCtx.getImageData(0,0,this.W,this.H).data,p=[];for(let t=0;t<this.H;t+=d)for(let i=0;i<this.W;i+=d){const s=4*(t*this.W+i);f[s]+f[s+1]+f[s+2]>600&&p.push({x:i,y:t})}for(;p.length>this.config.maxParticles;)p.splice(Math.floor(Math.random()*p.length),1);if(this.particles.length<p.length){const t=p.length-this.particles.length;for(let i=0;i<t;i++)this.particles.push(this.makeParticle())}else this.particles.length>p.length&&(this.particles.length=p.length);for(let t=0;t<this.particles.length;t++){const i=this.particles[t],s=p[t];i.tx=s.x,i.ty=s.y}}makeParticle(){const t=Math.random()*this.W,i=Math.random()*this.H;return{x:t,y:i,vx:0,vy:0,tx:t,ty:i,initialX:t,initialY:i,j:Math.random()*Math.PI*2}}initParticles(){for(const t of this.particles){const i=Math.random()*this.W,s=Math.random()*this.H;t.x=i,t.y=s,t.vx=t.vy=0,t.initialX=i,t.initialY=s}}scatter(){for(const t of this.particles)void 0!==t.initialX&&void 0!==t.initialY?(t.tx=t.initialX,t.ty=t.initialY):(t.initialX=t.x,t.initialY=t.y,t.tx=t.initialX,t.ty=t.initialY)}morph(t){this.t(t)}i(t){if(0!==this.W&&0!==this.H||this.resize(),"string"==typeof t)this.config.text=t,this.buildTargets();else if(t&&"object"==typeof t){const i=void 0!==t.text;this.config={...this.config,...t},i&&this.buildTargets()}else this.buildTargets()}update(){this.ctx.clearRect(0,0,this.W,this.H);for(const t of this.particles){let i=(t.tx-t.x)*this.config.ease,s=(t.ty-t.y)*this.config.ease;if(this.mouse.x||this.mouse.y){const h=t.x-this.mouse.x,e=t.y-this.mouse.y,n=h*h+e*e,o=this.config.repelRadius*this.DPR;if(n<o*o){const t=Math.sqrt(n)+1e-4,l=(this.mouse.down?-1:1)*this.config.repelStrength*(1-t/o);i+=h/t*l*6,s+=e/t*l*6}}t.j+=2,i+=.05*Math.cos(t.j),s+=.05*Math.sin(1.3*t.j),t.vx=(t.vx+i)*Math.random(),t.vy=(t.vy+s)*Math.random(),t.x+=t.vx,t.y+=t.vy}this.ctx.fillStyle=this.config.particleColor;const t=Math.min(this.W,this.H)/this.DPR,i=Math.max(.5,Math.min(2,t/1920)),s=this.config.pointSize*this.DPR*i;for(const t of this.particles)this.ctx.beginPath(),this.ctx.arc(t.x,t.y,s,0,2*Math.PI),this.ctx.fill();this.config.onUpdate&&this.config.onUpdate(this)}animate(){this.isRunning&&(this.update(),this.animationId=requestAnimationFrame(()=>this.animate()))}start(){this.isRunning||(this.isRunning=!0,this.animate())}stop(){this.isRunning=!1,this.animationId&&(cancelAnimationFrame(this.animationId),this.animationId=null)}setupEventListeners(){window.addEventListener("resize",this.handleResize),this.canvas.addEventListener("mousemove",this.handleMouseMove),this.canvas.addEventListener("mouseleave",this.handleMouseLeave),this.canvas.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("mouseup",this.handleMouseUp)}removeEventListeners(){window.removeEventListener("resize",this.handleResize),this.canvas.removeEventListener("mousemove",this.handleMouseMove),this.canvas.removeEventListener("mouseleave",this.handleMouseLeave),this.canvas.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("mouseup",this.handleMouseUp)}handleResize(){this.resize()}handleMouseMove(t){const i=this.canvas.getBoundingClientRect();this.mouse.x=(t.clientX-i.left)*this.DPR,this.mouse.y=(t.clientY-i.top)*this.DPR}handleMouseLeave(){this.mouse.x=this.mouse.y=0}handleMouseDown(){this.mouse.down=!0}handleMouseUp(){this.mouse.down=!1}updateConfig(t){this.h(t)}o(t){this.config={...this.config,...t},t.text&&this.buildTargets()}destroy(){this.stop(),this.removeEventListeners(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}const r=i((i,n)=>{const o=s(null),r=s(null);h(()=>{if(!o.current)return;let t=null,s=null,h=null;const e=()=>{const n=o.current;if(!n)return;if(r.current)return;const a=n.querySelector("canvas");a&&a.remove();const c=n.getBoundingClientRect();if(!(c.width>0&&c.height>0)){if("undefined"!=typeof ResizeObserver){let t=0;const i=20;return s&&(s.disconnect(),s=null),s=new ResizeObserver(()=>{t++;const h=n.getBoundingClientRect();(h.width>0&&h.height>0||t>=i)&&(s&&(s.disconnect(),s=null),e())}),void s.observe(n)}return void(h=window.setTimeout(e,50))}const{text:u,densityStep:d,maxParticles:f,pointSize:p,ease:m,repelRadius:w,repelStrength:v,particleColor:y,fontFamily:M,fontSize:x,width:g,height:S,devicePixelRatio:R,onReady:z,onUpdate:b}=i,P={text:u,densityStep:d,maxParticles:f,pointSize:p,ease:m,repelRadius:w,repelStrength:v,particleColor:y,fontFamily:M,fontSize:x,width:g,height:S,devicePixelRatio:R,onReady:z,onUpdate:b};r.current=new l(n,P),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(()=>{r.current&&r.current.resize()}),t.observe(n))};return requestAnimationFrame(e),()=>{h&&(clearTimeout(h),h=null),s&&(s.disconnect(),s=null),t&&(t.disconnect(),t=null),r.current&&(r.current.destroy(),r.current=null)}},[]),h(()=>{if(!r.current)return;const{text:t,densityStep:s,maxParticles:h,pointSize:e,ease:n,repelRadius:o,repelStrength:l,particleColor:a,fontFamily:c,fontSize:u,width:d,height:f,devicePixelRatio:p}=i;r.current.updateConfig({text:t,densityStep:s,maxParticles:h,pointSize:e,ease:n,repelRadius:o,repelStrength:l,particleColor:a,fontFamily:c,fontSize:u,width:d,height:f,devicePixelRatio:p})},[i.text,i.densityStep,i.maxParticles,i.pointSize,i.ease,i.repelRadius,i.repelStrength,i.particleColor,i.fontFamily,i.fontSize,i.width,i.height,i.devicePixelRatio]),e(n,()=>({morph:t=>{r.current?r.current.morph(t):console.warn("TextToParticle: 인스턴스가 아직 초기화되지 않았습니다.")},scatter:()=>{r.current?r.current.scatter():console.warn("TextToParticle: 인스턴스가 아직 초기화되지 않았습니다.")},updateConfig:t=>{r.current?r.current.updateConfig(t):console.warn("TextToParticle: 인스턴스가 아직 초기화되지 않았습니다.")},destroy:()=>{r.current&&(r.current.destroy(),r.current=null)}}));const a={width:"100%",height:"100%",minHeight:300,position:"relative",...i.style};return t.createElement("div",{ref:o,className:i.className,style:a})});r.displayName="TextToParticle";export{r as default};
|
|
1
|
+
import t,{forwardRef as i,useRef as s,useEffect as h,useImperativeHandle as e}from"react";class n{constructor(t,i={}){this.container=t,this.options={threshold:i.threshold??.1,rootMargin:i.rootMargin??"0px",root:i.root??null,onVisible:i.onVisible,onHidden:i.onHidden},this.intersectionObserver=null,this.visibilityChangeHandler=null,this.isVisible=!1,this.isPageVisible="undefined"==typeof document||!document.hidden,this.setupIntersectionObserver(),this.setupPageVisibility()}setupIntersectionObserver(){if("undefined"==typeof window||void 0===window.IntersectionObserver)return this.isVisible=!0,void(this.isPageVisible&&this.options.onVisible&&this.options.onVisible());this.intersectionObserver=new IntersectionObserver(t=>{for(const i of t)i.target===this.container&&(i.isIntersecting?(this.isVisible=!0,this.isPageVisible&&this.options.onVisible&&this.options.onVisible()):(this.isVisible=!1,this.options.onHidden&&this.options.onHidden()))},{threshold:this.options.threshold,rootMargin:this.options.rootMargin,root:this.options.root||null}),this.intersectionObserver.observe(this.container)}setupPageVisibility(){"undefined"!=typeof document&&(this.visibilityChangeHandler=()=>{const t=this.isPageVisible;this.isPageVisible=!document.hidden,document.hidden?this.options.onHidden&&this.options.onHidden():t!==this.isPageVisible&&this.isVisible&&this.options.onVisible&&this.options.onVisible()},document.addEventListener("visibilitychange",this.visibilityChangeHandler),document.hidden&&this.isVisible&&this.options.onHidden&&this.options.onHidden())}getIsVisible(){return this.isVisible&&this.isPageVisible}updateOptions(t){this.options={...this.options,...t},this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.setupIntersectionObserver()}destroy(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.visibilityChangeHandler&&"undefined"!=typeof document&&(document.removeEventListener("visibilitychange",this.visibilityChangeHandler),this.visibilityChangeHandler=null)}}function o(t,i){let s=null;return function(...h){null!==s&&clearTimeout(s),s=setTimeout(()=>{s=null,t.apply(this,h)},i)}}class r{constructor(t,i={}){if(this.container="string"==typeof t?document.querySelector(t):t,!this.container)throw new Error("Container element not found");this.config={text:i.text||"mason effect",densityStep:i.densityStep??2,maxParticles:i.maxParticles??3200,pointSize:i.pointSize??.5,ease:i.ease??.05,repelRadius:i.repelRadius??150,repelStrength:i.repelStrength??1,particleColor:i.particleColor||"#fff",fontFamily:i.fontFamily||"Inter, system-ui, Arial",fontSize:i.fontSize||null,width:i.width||null,height:i.height||null,devicePixelRatio:i.devicePixelRatio??null,onReady:i.onReady||null,onUpdate:i.onUpdate||null},this.canvas=document.createElement("canvas");const s=this.canvas.getContext("2d",{willReadFrequently:!0});if(!s)throw new Error("Canvas context not available");this.ctx=s,this.container.appendChild(this.canvas),this.canvas.style.display="block",this.offCanvas=document.createElement("canvas");const h=this.offCanvas.getContext("2d",{willReadFrequently:!0});if(!h)throw new Error("Offscreen canvas context not available");this.offCtx=h,this.W=0,this.H=0,this.DPR=this.config.devicePixelRatio||Math.min(window.devicePixelRatio||1,1.8),this.particles=[],this.mouse={x:0,y:0,down:!1},this.animationId=null,this.isRunning=!1,this.visibilityManager=null,this.debounceDelay=i.debounceDelay??150;const e=this.handleResize.bind(this);this.handleResize=o(e,this.debounceDelay),this.handleMouseMove=this.handleMouseMove.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleMouseDown=this.handleMouseDown.bind(this),this.handleMouseUp=this.handleMouseUp.bind(this),this.t=o(this.i.bind(this),this.debounceDelay),this.h=o(this.o.bind(this),this.debounceDelay),this.init()}init(){this.resize(),this.setupEventListeners(),this.setupVisibilityManager(),this.config.onReady&&this.config.onReady(this)}setupVisibilityManager(){this.visibilityManager=new n(this.container,{threshold:.1,onVisible:()=>{this.start()},onHidden:()=>{this.stop()}})}resize(){const t=this.container.getBoundingClientRect(),i=this.config.width||t.width||this.container.clientWidth||window.innerWidth,s=this.config.height||t.height||this.container.clientHeight||.7*window.innerHeight;if(i<=0||s<=0)return;this.W=Math.floor(i*this.DPR),this.H=Math.floor(s*this.DPR);const h=4096;if(this.W>h||this.H>h){const t=Math.min(h/this.W,h/this.H);this.W=Math.floor(this.W*t),this.H=Math.floor(this.H*t),this.DPR=this.DPR*t}this.canvas.width=this.W,this.canvas.height=this.H,this.canvas.style.width=i+"px",this.canvas.style.height=s+"px",this.W>0&&this.H>0&&(this.buildTargets(),this.particles.length||this.initParticles())}measureTextFit(t,i,s,h){this.offCtx.font=`400 ${t}px ${this.config.fontFamily}`;const e=i.split("\n"),n=t,o=.1*t,r=.05*t;let l=0;for(const t of e){if(0===t.length)continue;const i=this.offCtx.measureText(t).width+r*(t.length>0?t.length-1:0);l=Math.max(l,i)}const a=e.length>0?n*e.length+o*(e.length-1):n;return{width:l,height:a,fits:l<=s&&a<=h}}findOptimalFontSize(t,i,s,h){if(this.measureTextFit(h,t,i,s).fits)return h;if(h<=12)return 12;let e=12,n=h,o=12;for(;e<=n;){const h=Math.floor((e+n)/2);this.measureTextFit(h,t,i,s).fits?(o=h,e=h+1):n=h-1}return o}buildTargets(){if(this.W<=0||this.H<=0)return;const t=this.config.text;this.offCanvas.width=this.W,this.offCanvas.height=this.H,this.offCtx.clearRect(0,0,this.offCanvas.width,this.offCanvas.height);const i=Math.min(this.W,this.H),s=this.config.fontSize||Math.max(80,Math.floor(.18*i)),h=this.W-80,e=this.H-80,n=this.findOptimalFontSize(t,h,e,s);this.offCtx.fillStyle="#ffffff",this.offCtx.textAlign="center",this.offCtx.textBaseline="middle",this.offCtx.font=`400 ${n}px ${this.config.fontFamily}`;const o=t.split("\n"),r=n,l=.1*n,a=.05*n,u=o.length>0?r*o.length+l*(o.length-1):r;let c=this.H/2-u/2+r/2;for(const t of o){if(0===t.length){c+=r+l;continue}const i=t.split(""),s=this.offCtx.measureText(t).width+a*(i.length>0?i.length-1:0);let h=this.W/2-s/2;for(const t of i)this.offCtx.fillText(t,h+this.offCtx.measureText(t).width/2,c),h+=this.offCtx.measureText(t).width+a;c+=r+l}const d=Math.max(2,Math.round(this.config.densityStep*this.DPR)),f=this.offCtx.getImageData(0,0,this.W,this.H).data,p=[];for(let t=0;t<this.H;t+=d)for(let i=0;i<this.W;i+=d){const s=4*(t*this.W+i);f[s]+f[s+1]+f[s+2]>600&&p.push({x:i,y:t})}for(;p.length>this.config.maxParticles;)p.splice(Math.floor(Math.random()*p.length),1);if(this.particles.length<p.length){const t=p.length-this.particles.length;for(let i=0;i<t;i++)this.particles.push(this.makeParticle())}else this.particles.length>p.length&&(this.particles.length=p.length);for(let t=0;t<this.particles.length;t++){const i=this.particles[t],s=p[t];i.tx=s.x,i.ty=s.y}}makeParticle(){const t=Math.random()*this.W,i=Math.random()*this.H;return{x:t,y:i,vx:0,vy:0,tx:t,ty:i,initialX:t,initialY:i,j:Math.random()*Math.PI*2}}initParticles(){for(const t of this.particles){const i=Math.random()*this.W,s=Math.random()*this.H;t.x=i,t.y=s,t.vx=t.vy=0,t.initialX=i,t.initialY=s}}scatter(){for(const t of this.particles)void 0!==t.initialX&&void 0!==t.initialY?(t.tx=t.initialX,t.ty=t.initialY):(t.initialX=t.x,t.initialY=t.y,t.tx=t.initialX,t.ty=t.initialY)}morph(t){this.t(t)}i(t){if(0!==this.W&&0!==this.H||this.resize(),"string"==typeof t)this.config.text=t,this.buildTargets();else if(t&&"object"==typeof t){const i=void 0!==t.text;this.config={...this.config,...t},i&&this.buildTargets()}else this.buildTargets()}update(){this.ctx.clearRect(0,0,this.W,this.H);for(const t of this.particles){let i=(t.tx-t.x)*this.config.ease,s=(t.ty-t.y)*this.config.ease;if(this.mouse.x||this.mouse.y){const h=t.x-this.mouse.x,e=t.y-this.mouse.y,n=h*h+e*e,o=this.config.repelRadius*this.DPR;if(n<o*o){const t=Math.sqrt(n)+1e-4,r=(this.mouse.down?-1:1)*this.config.repelStrength*(1-t/o);i+=h/t*r*6,s+=e/t*r*6}}t.j+=2,i+=.05*Math.cos(t.j),s+=.05*Math.sin(1.3*t.j),t.vx=(t.vx+i)*Math.random(),t.vy=(t.vy+s)*Math.random(),t.x+=t.vx,t.y+=t.vy}this.ctx.fillStyle=this.config.particleColor;const t=Math.min(this.W,this.H)/this.DPR,i=Math.max(.5,Math.min(3,t/300)),s=this.config.pointSize*this.DPR*i;for(const t of this.particles)this.ctx.beginPath(),this.ctx.arc(t.x,t.y,s,0,2*Math.PI),this.ctx.fill();this.config.onUpdate&&this.config.onUpdate(this)}animate(){this.isRunning&&(this.update(),this.animationId=requestAnimationFrame(()=>this.animate()))}start(){this.isRunning||(this.isRunning=!0,this.animate())}stop(){this.isRunning=!1,this.animationId&&(cancelAnimationFrame(this.animationId),this.animationId=null)}setupEventListeners(){window.addEventListener("resize",this.handleResize),this.canvas.addEventListener("mousemove",this.handleMouseMove),this.canvas.addEventListener("mouseleave",this.handleMouseLeave),this.canvas.addEventListener("mousedown",this.handleMouseDown),window.addEventListener("mouseup",this.handleMouseUp)}removeEventListeners(){window.removeEventListener("resize",this.handleResize),this.canvas.removeEventListener("mousemove",this.handleMouseMove),this.canvas.removeEventListener("mouseleave",this.handleMouseLeave),this.canvas.removeEventListener("mousedown",this.handleMouseDown),window.removeEventListener("mouseup",this.handleMouseUp)}handleResize(){this.resize()}handleMouseMove(t){const i=this.canvas.getBoundingClientRect();this.mouse.x=(t.clientX-i.left)*this.DPR,this.mouse.y=(t.clientY-i.top)*this.DPR}handleMouseLeave(){this.mouse.x=this.mouse.y=0}handleMouseDown(){this.mouse.down=!0}handleMouseUp(){this.mouse.down=!1}updateConfig(t){this.h(t)}o(t){this.config={...this.config,...t},t.text&&this.buildTargets()}destroy(){this.stop(),this.removeEventListeners(),this.visibilityManager&&(this.visibilityManager.destroy(),this.visibilityManager=null),this.canvas&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}}const l=i((i,n)=>{const o=s(null),l=s(null);h(()=>{if(!o.current)return;let t=null,s=null,h=null;const e=()=>{const n=o.current;if(!n)return;if(l.current)return;const a=n.querySelector("canvas");a&&a.remove();const u=n.getBoundingClientRect();if(0===u.width||0===u.height){if("undefined"!=typeof ResizeObserver){let t=0;s&&(s.disconnect(),s=null),s=new ResizeObserver(()=>{t++;const i=n.getBoundingClientRect();(i.width>0&&i.height>0||t>=20)&&(s?.disconnect(),s=null,e())}),s.observe(n)}else h=window.setTimeout(e,50);return}const{text:c,densityStep:d,maxParticles:f,pointSize:p,ease:m,repelRadius:w,repelStrength:v,particleColor:y,fontFamily:M,fontSize:x,width:g,height:S,devicePixelRatio:R,onReady:z,onUpdate:b}=i;l.current=new r(n,{text:c,densityStep:d,maxParticles:f,pointSize:p,ease:m,repelRadius:w,repelStrength:v,particleColor:y,fontFamily:M,fontSize:x,width:g,height:S,devicePixelRatio:R,onReady:z,onUpdate:b}),"undefined"!=typeof ResizeObserver&&(t=new ResizeObserver(()=>l.current?.resize()),t.observe(n))};return requestAnimationFrame(e),()=>{h&&(clearTimeout(h),h=null),s?.disconnect(),t?.disconnect(),l.current?.destroy(),l.current=null}},[]),h(()=>{if(!l.current)return;const{text:t,densityStep:s,maxParticles:h,pointSize:e,ease:n,repelRadius:o,repelStrength:r,particleColor:a,fontFamily:u,fontSize:c,width:d,height:f,devicePixelRatio:p}=i;l.current.updateConfig({text:t,densityStep:s,maxParticles:h,pointSize:e,ease:n,repelRadius:o,repelStrength:r,particleColor:a,fontFamily:u,fontSize:c,width:d,height:f,devicePixelRatio:p})},[i.text,i.densityStep,i.maxParticles,i.pointSize,i.ease,i.repelRadius,i.repelStrength,i.particleColor,i.fontFamily,i.fontSize,i.width,i.height,i.devicePixelRatio]),e(n,()=>({morph:t=>l.current?.morph(t),scatter:()=>l.current?.scatter(),updateConfig:t=>l.current?.updateConfig(t),destroy:()=>{l.current?.destroy(),l.current=null}}));const a={width:"100%",height:"100%",minHeight:300,position:"relative",...i.style};return t.createElement("div",{ref:o,className:i.className,style:a})});l.displayName="TextToParticle";export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.d.ts","sourceRoot":"","sources":["../../../src/index.umd.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.umd.d.ts","sourceRoot":"","sources":["../../../src/index.umd.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,iBAAiB,CAAC;AAE1C,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Count.d.ts","sourceRoot":"","sources":["../../../../../src/react/count/Count.tsx"],"names":[],"mappings":"AAAA,O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S,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,cAAc,6EAwDlB,CAAC;AAIH,eAAe,cAAc,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MasonEffect React - 모든 React 컴포넌트를 export하는 메인 파일
|
|
3
|
-
*/
|
|
4
1
|
export { default as TextToParticle } from './textToParticle/index.js';
|
|
5
2
|
export type { TextToParticleRef, TextToParticleOptions } from './textToParticle/index.js';
|
|
6
3
|
export { default as Count } from './count/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACtE,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAE1F,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACtD,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAClE,YAAY,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACnE,YAAY,EACV,iBAAiB,IAAI,cAAc,EACnC,qBAAqB,IAAI,kBAAkB,GAC5C,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScrollFadeIn.d.ts","sourceRoot":"","sources":["../../../../../src/react/scrollFadeIn/ScrollFadeIn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,iBAAkB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,YAAY,CAAC;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"ScrollFadeIn.d.ts","sourceRoot":"","sources":["../../../../../src/react/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AAC,KAAK,IAAI,CAAC;IACzD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,aAAc,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,CAAC;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"TextSpin.d.ts","sourceRoot":"","sources":["../../../../../src/react/textSpin/TextSpin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IACzD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,aAAc,SAAQ,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,YAAY,CAAC;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,iBAAiB,mFAwDrB,CAAC;AAIH,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/textSpin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/react/textSpin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextToParticle.d.ts","sourceRoot":"","sources":["../../../../../src/react/textToParticle/TextToParticle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IACzE,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,YAAY,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,qBAAqB,CAAC,KAAK,IAAI,CAAC;IAC/D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,QAAA,MAAM,uBAAuB,+
|
|
1
|
+
{"version":3,"file":"TextToParticle.d.ts","sourceRoot":"","sources":["../../../../../src/react/textToParticle/TextToParticle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6D,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;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