-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.modern.js.map
1 lines (1 loc) · 6.11 KB
/
index.modern.js.map
1
{"version":3,"file":"index.modern.js","sources":["../src/index.tsx"],"sourcesContent":["import React from 'react'\nimport styles from './styles.module.css'\n\ninterface AnimatedTextProps {\n text: string\n animation?: string\n delay?: number\n easing?: string\n transitionOnlyDifferentLetters?: boolean\n animationDuration?: number\n style?: React.CSSProperties\n}\n\nconst AnimatedText = ({\n text,\n animation = 'fade-in',\n delay = 32,\n easing = 'ease',\n transitionOnlyDifferentLetters = false,\n animationDuration = 1000,\n style\n}: AnimatedTextProps) => {\n const animations = [\n styles.slideDown,\n styles.slideUp,\n styles.slideLeft,\n styles.slideRight,\n styles.popUp,\n styles.fadeIn,\n styles.rotateClockwise,\n styles.rotateCounterClockwise,\n styles.revealUp,\n styles.revealDown,\n styles.revealLeft,\n styles.revealRight\n ]\n\n function getAnimation(animation: string) {\n switch (animation) {\n case 'slide-down':\n return styles.slideDown\n case 'slide-up':\n return styles.slideUp\n case 'slide-left':\n return styles.slideLeft\n case 'slide-right':\n return styles.slideRight\n case 'pop-up':\n return styles.popUp\n case 'rotate-clockwise':\n return styles.rotateClockwise\n case 'rotate-counter-clockwise':\n return styles.rotateCounterClockwise\n case 'reveal-up':\n return styles.revealUp\n case 'reveal-down':\n return styles.revealDown\n case 'reveal-left':\n return styles.revealLeft\n case 'reveal-right':\n return styles.revealRight\n case 'random':\n const number = Math.floor(Math.random() * animations.length)\n return animations[number]\n default:\n return styles.fadeIn\n }\n }\n\n return (\n <div\n style={\n style\n ? style\n : {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexWrap: 'wrap'\n }\n }\n >\n {text?.split(' ').map((word, idx) => {\n return (\n <div\n style={{\n display: 'flex'\n }}\n >\n {word.split('').map((letter, index) => {\n let relative_index = index\n index = idx + 1 * word.length + index\n return (\n <div\n key={\n transitionOnlyDifferentLetters\n ? index + letter\n : Math.random()\n }\n className={styles.char + ' ' + getAnimation(animation)}\n style={{\n animationDelay: `${index * delay}ms`,\n animationDuration: `${animationDuration}ms`,\n animationTimingFunction: easing\n }}\n >\n {relative_index === word.length - 1\n ? letter + '\\xA0'\n : letter}\n </div>\n )\n })}\n </div>\n )\n })}\n </div>\n )\n}\n\nexport default AnimatedText\n"],"names":["AnimatedText","_ref","text","_ref$animation","animation","_ref$delay","delay","_ref$easing","easing","_ref$transitionOnlyDi","transitionOnlyDifferentLetters","_ref$animationDuratio","animationDuration","style","animations","styles","slideDown","slideUp","slideLeft","slideRight","popUp","fadeIn","rotateClockwise","rotateCounterClockwise","revealUp","revealDown","revealLeft","revealRight","getAnimation","number","Math","floor","random","length","React","display","alignItems","justifyContent","flexWrap","split","map","word","idx","letter","index","relative_index","key","className","animationDelay","animationTimingFunction"],"mappings":";;;;AAaA,IAAMA,YAAY,GAAG,SAAfA,YAAYA,CAAAC,IAAA;MAChBC,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAAC,cAAA,GAAAF,IAAA,CACJG,SAAS;IAATA,SAAS,GAAAD,cAAA,cAAG,SAAS,GAAAA,cAAA;IAAAE,UAAA,GAAAJ,IAAA,CACrBK,KAAK;IAALA,KAAK,GAAAD,UAAA,cAAG,EAAE,GAAAA,UAAA;IAAAE,WAAA,GAAAN,IAAA,CACVO,MAAM;IAANA,MAAM,GAAAD,WAAA,cAAG,MAAM,GAAAA,WAAA;IAAAE,qBAAA,GAAAR,IAAA,CACfS,8BAA8B;IAA9BA,8BAA8B,GAAAD,qBAAA,cAAG,KAAK,GAAAA,qBAAA;IAAAE,qBAAA,GAAAV,IAAA,CACtCW,iBAAiB;IAAjBA,iBAAiB,GAAAD,qBAAA,cAAG,IAAI,GAAAA,qBAAA;IACxBE,KAAK,GAAAZ,IAAA,CAALY,KAAK;EAEL,IAAMC,UAAU,GAAG,CACjBC,MAAM,CAACC,SAAS,EAChBD,MAAM,CAACE,OAAO,EACdF,MAAM,CAACG,SAAS,EAChBH,MAAM,CAACI,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