@readdy/anim 0.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/animations/button/3d-flip/index.js +60 -0
- package/animations/button/3d-flip/react.tsx +29 -0
- package/animations/button/3d-flip/style.css +17 -0
- package/animations/button/blur-fade-in/index.js +21 -0
- package/animations/button/blur-fade-in/react.tsx +26 -0
- package/animations/button/blur-fade-in/style.css +27 -0
- package/animations/button/border-beam/index.js +172 -0
- package/animations/button/border-beam/react.tsx +55 -0
- package/animations/button/border-beam/style.css +59 -0
- package/animations/button/bounce-elastic/index.js +21 -0
- package/animations/button/bounce-elastic/react.tsx +26 -0
- package/animations/button/bounce-elastic/style.css +31 -0
- package/animations/button/bubble-button/index.js +317 -0
- package/animations/button/bubble-button/react.tsx +19 -0
- package/animations/button/bubble-button/style.css +245 -0
- package/animations/button/confetti-button/index.js +66 -0
- package/animations/button/confetti-button/react.tsx +30 -0
- package/animations/button/confetti-button/style.css +48 -0
- package/animations/button/glow-cta/index.js +69 -0
- package/animations/button/glow-cta/react.tsx +45 -0
- package/animations/button/glow-cta/style.css +78 -0
- package/animations/button/magnetic-hover/index.js +61 -0
- package/animations/button/magnetic-hover/react.tsx +29 -0
- package/animations/button/magnetic-hover/style.css +18 -0
- package/animations/button/pulse/index.js +21 -0
- package/animations/button/pulse/react.tsx +26 -0
- package/animations/button/pulse/style.css +24 -0
- package/animations/button/rainbow-button/index.js +21 -0
- package/animations/button/rainbow-button/react.tsx +26 -0
- package/animations/button/rainbow-button/style.css +54 -0
- package/animations/button/shimmer-border/index.js +28 -0
- package/animations/button/shimmer-border/react.tsx +41 -0
- package/animations/button/shimmer-border/style.css +53 -0
- package/animations/button/sketch-button/index.js +16 -0
- package/animations/button/sketch-button/react.tsx +19 -0
- package/animations/button/sketch-button/style.css +25 -0
- package/animations/card/blur-rise/index.js +21 -0
- package/animations/card/blur-rise/react.tsx +26 -0
- package/animations/card/blur-rise/style.css +27 -0
- package/animations/card/bounce-in-bottom/index.js +21 -0
- package/animations/card/bounce-in-bottom/react.tsx +26 -0
- package/animations/card/bounce-in-bottom/style.css +31 -0
- package/animations/card/card-fan-spread/index.js +146 -0
- package/animations/card/card-fan-spread/react.tsx +35 -0
- package/animations/card/card-fan-spread/style.css +90 -0
- package/animations/card/card-flip/index.js +203 -0
- package/animations/card/card-flip/react.tsx +35 -0
- package/animations/card/card-flip/style.css +71 -0
- package/animations/card/float-idle/index.js +21 -0
- package/animations/card/float-idle/react.tsx +26 -0
- package/animations/card/float-idle/style.css +21 -0
- package/animations/card/image-magnifier/index.js +333 -0
- package/animations/card/image-magnifier/react.tsx +31 -0
- package/animations/card/image-magnifier/style.css +42 -0
- package/animations/card/image-zoom-rotate/index.js +48 -0
- package/animations/card/image-zoom-rotate/react.tsx +31 -0
- package/animations/card/image-zoom-rotate/style.css +20 -0
- package/animations/card/pop-in-stack/index.js +25 -0
- package/animations/card/pop-in-stack/react.tsx +33 -0
- package/animations/card/pop-in-stack/style.css +25 -0
- package/animations/card/reveal-from-top/index.js +21 -0
- package/animations/card/reveal-from-top/react.tsx +26 -0
- package/animations/card/reveal-from-top/style.css +28 -0
- package/animations/card/rgb-split-glitch/index.js +28 -0
- package/animations/card/rgb-split-glitch/react.tsx +41 -0
- package/animations/card/rgb-split-glitch/style.css +33 -0
- package/animations/card/tilted-card/index.js +64 -0
- package/animations/card/tilted-card/react.tsx +33 -0
- package/animations/card/tilted-card/style.css +27 -0
- package/animations/header/anime-splittext/index.js +108 -0
- package/animations/header/anime-splittext/react.tsx +30 -0
- package/animations/header/anime-splittext/style.css +71 -0
- package/animations/header/bounce-in-down/index.js +40 -0
- package/animations/header/bounce-in-down/react.tsx +29 -0
- package/animations/header/bounce-in-down/style.css +40 -0
- package/animations/header/fly-in-chars/index.js +46 -0
- package/animations/header/fly-in-chars/react.tsx +30 -0
- package/animations/header/fly-in-chars/style.css +29 -0
- package/animations/header/gradient-text/index.js +21 -0
- package/animations/header/gradient-text/react.tsx +26 -0
- package/animations/header/gradient-text/style.css +28 -0
- package/animations/header/letter-bounce/index.js +33 -0
- package/animations/header/letter-bounce/react.tsx +34 -0
- package/animations/header/letter-bounce/style.css +25 -0
- package/animations/header/roll-in/index.js +40 -0
- package/animations/header/roll-in/react.tsx +29 -0
- package/animations/header/roll-in/style.css +31 -0
- package/animations/header/shimmer-text/index.js +16 -0
- package/animations/header/shimmer-text/react.tsx +28 -0
- package/animations/header/shimmer-text/style.css +29 -0
- package/animations/header/shuffle/index.js +118 -0
- package/animations/header/shuffle/react.tsx +50 -0
- package/animations/header/shuffle/style.css +25 -0
- package/animations/header/split-text/index.js +72 -0
- package/animations/header/split-text/react.tsx +38 -0
- package/animations/header/split-text/style.css +31 -0
- package/animations/header/text-type/index.js +267 -0
- package/animations/header/text-type/react.tsx +63 -0
- package/animations/header/text-type/style.css +37 -0
- package/animations/header/word-curtain-reveal/index.js +97 -0
- package/animations/header/word-curtain-reveal/react.tsx +30 -0
- package/animations/header/word-curtain-reveal/style.css +39 -0
- package/dist/button/3d-flip/react.js +21 -0
- package/dist/button/3d-flip.js +61 -0
- package/dist/button/blur-fade-in/react.js +28 -0
- package/dist/button/blur-fade-in.js +17 -0
- package/dist/button/border-beam/react.js +22 -0
- package/dist/button/border-beam.js +168 -0
- package/dist/button/bounce-elastic/react.js +28 -0
- package/dist/button/bounce-elastic.js +17 -0
- package/dist/button/bubble-button/react.js +20 -0
- package/dist/button/bubble-button.js +318 -0
- package/dist/button/confetti-button/react.js +21 -0
- package/dist/button/confetti-button.js +67 -0
- package/dist/button/glow-cta/react.js +23 -0
- package/dist/button/glow-cta.js +65 -0
- package/dist/button/magnetic-hover/react.js +21 -0
- package/dist/button/magnetic-hover.js +62 -0
- package/dist/button/pulse/react.js +28 -0
- package/dist/button/pulse.js +17 -0
- package/dist/button/rainbow-button/react.js +28 -0
- package/dist/button/rainbow-button.js +17 -0
- package/dist/button/shimmer-border/react.js +22 -0
- package/dist/button/shimmer-border.js +24 -0
- package/dist/button/sketch-button/react.js +20 -0
- package/dist/button/sketch-button.js +17 -0
- package/dist/card/blur-rise/react.js +28 -0
- package/dist/card/blur-rise.js +17 -0
- package/dist/card/bounce-in-bottom/react.js +28 -0
- package/dist/card/bounce-in-bottom.js +17 -0
- package/dist/card/card-fan-spread/react.js +20 -0
- package/dist/card/card-fan-spread.js +147 -0
- package/dist/card/float-idle/react.js +28 -0
- package/dist/card/float-idle.js +17 -0
- package/dist/card/image-magnifier/react.js +22 -0
- package/dist/card/image-magnifier.js +334 -0
- package/dist/card/image-zoom-rotate/react.js +21 -0
- package/dist/card/image-zoom-rotate.js +49 -0
- package/dist/card/pop-in-stack/react.js +20 -0
- package/dist/card/pop-in-stack.js +26 -0
- package/dist/card/reveal-from-top/react.js +28 -0
- package/dist/card/reveal-from-top.js +17 -0
- package/dist/card/rgb-split-glitch/react.js +22 -0
- package/dist/card/rgb-split-glitch.js +24 -0
- package/dist/card/tilted-card/react.js +21 -0
- package/dist/card/tilted-card.js +65 -0
- package/dist/chunks/constants-EnH6-Pz4.js +66 -0
- package/dist/chunks/constants-ZTHic1pf.js +66 -0
- package/dist/chunks/pointer-follow-B3RFnn_q.js +93 -0
- package/dist/chunks/pointer-follow-BETANySn.js +93 -0
- package/dist/chunks/reduced-motion-BpQYuEzK.js +17 -0
- package/dist/chunks/reduced-motion-HX79Ac8G.js +17 -0
- package/dist/chunks/resolve-card-media-Cj3V_oms.js +43 -0
- package/dist/chunks/resolve-card-media-DBIU-duL.js +43 -0
- package/dist/chunks/text-split-D02jltVh.js +191 -0
- package/dist/chunks/text-split-frOR4UpH.js +191 -0
- package/dist/full.css +1 -0
- package/dist/full.js +3192 -0
- package/dist/header/anime-splittext/react.js +22 -0
- package/dist/header/anime-splittext.js +109 -0
- package/dist/header/bounce-in-down/react.js +32 -0
- package/dist/header/bounce-in-down.js +36 -0
- package/dist/header/fly-in-chars/react.js +23 -0
- package/dist/header/fly-in-chars.js +47 -0
- package/dist/header/gradient-text/react.js +28 -0
- package/dist/header/gradient-text.js +17 -0
- package/dist/header/letter-bounce/react.js +23 -0
- package/dist/header/letter-bounce.js +34 -0
- package/dist/header/roll-in/react.js +32 -0
- package/dist/header/roll-in.js +36 -0
- package/dist/header/shimmer-text/react.js +27 -0
- package/dist/header/shimmer-text.js +17 -0
- package/dist/header/shuffle/react.js +30 -0
- package/dist/header/shuffle.js +119 -0
- package/dist/header/split-text/react.js +26 -0
- package/dist/header/split-text.js +73 -0
- package/dist/header/text-type/react.js +43 -0
- package/dist/header/text-type.js +268 -0
- package/dist/header/word-curtain-reveal/react.js +22 -0
- package/dist/header/word-curtain-reveal.js +98 -0
- package/dist/meta.json +6 -0
- package/dist/metadata.json +1051 -0
- package/dist/react.css +1 -0
- package/dist/types/animations/button/3d-flip/index.d.ts +3 -0
- package/dist/types/animations/button/3d-flip/react.d.ts +8 -0
- package/dist/types/animations/button/blur-fade-in/index.d.ts +3 -0
- package/dist/types/animations/button/blur-fade-in/react.d.ts +13 -0
- package/dist/types/animations/button/border-beam/index.d.ts +3 -0
- package/dist/types/animations/button/border-beam/react.d.ts +25 -0
- package/dist/types/animations/button/bounce-elastic/index.d.ts +3 -0
- package/dist/types/animations/button/bounce-elastic/react.d.ts +13 -0
- package/dist/types/animations/button/bubble-button/index.d.ts +3 -0
- package/dist/types/animations/button/bubble-button/react.d.ts +4 -0
- package/dist/types/animations/button/confetti-button/index.d.ts +3 -0
- package/dist/types/animations/button/confetti-button/react.d.ts +8 -0
- package/dist/types/animations/button/glow-cta/index.d.ts +3 -0
- package/dist/types/animations/button/glow-cta/react.d.ts +20 -0
- package/dist/types/animations/button/magnetic-hover/index.d.ts +3 -0
- package/dist/types/animations/button/magnetic-hover/react.d.ts +8 -0
- package/dist/types/animations/button/pulse/index.d.ts +3 -0
- package/dist/types/animations/button/pulse/react.d.ts +13 -0
- package/dist/types/animations/button/rainbow-button/index.d.ts +3 -0
- package/dist/types/animations/button/rainbow-button/react.d.ts +13 -0
- package/dist/types/animations/button/shimmer-border/index.d.ts +3 -0
- package/dist/types/animations/button/shimmer-border/react.d.ts +18 -0
- package/dist/types/animations/button/sketch-button/index.d.ts +3 -0
- package/dist/types/animations/button/sketch-button/react.d.ts +4 -0
- package/dist/types/animations/card/blur-rise/index.d.ts +3 -0
- package/dist/types/animations/card/blur-rise/react.d.ts +13 -0
- package/dist/types/animations/card/bounce-in-bottom/index.d.ts +3 -0
- package/dist/types/animations/card/bounce-in-bottom/react.d.ts +13 -0
- package/dist/types/animations/card/card-fan-spread/index.d.ts +3 -0
- package/dist/types/animations/card/card-fan-spread/react.d.ts +11 -0
- package/dist/types/animations/card/card-flip/index.d.ts +3 -0
- package/dist/types/animations/card/card-flip/react.d.ts +11 -0
- package/dist/types/animations/card/float-idle/index.d.ts +3 -0
- package/dist/types/animations/card/float-idle/react.d.ts +13 -0
- package/dist/types/animations/card/image-magnifier/index.d.ts +3 -0
- package/dist/types/animations/card/image-magnifier/react.d.ts +9 -0
- package/dist/types/animations/card/image-zoom-rotate/index.d.ts +3 -0
- package/dist/types/animations/card/image-zoom-rotate/react.d.ts +9 -0
- package/dist/types/animations/card/pop-in-stack/index.d.ts +3 -0
- package/dist/types/animations/card/pop-in-stack/react.d.ts +10 -0
- package/dist/types/animations/card/reveal-from-top/index.d.ts +3 -0
- package/dist/types/animations/card/reveal-from-top/react.d.ts +13 -0
- package/dist/types/animations/card/rgb-split-glitch/index.d.ts +3 -0
- package/dist/types/animations/card/rgb-split-glitch/react.d.ts +18 -0
- package/dist/types/animations/card/tilted-card/index.d.ts +3 -0
- package/dist/types/animations/card/tilted-card/react.d.ts +10 -0
- package/dist/types/animations/header/anime-splittext/index.d.ts +3 -0
- package/dist/types/animations/header/anime-splittext/react.d.ts +8 -0
- package/dist/types/animations/header/bounce-in-down/index.d.ts +3 -0
- package/dist/types/animations/header/bounce-in-down/react.d.ts +13 -0
- package/dist/types/animations/header/fly-in-chars/index.d.ts +3 -0
- package/dist/types/animations/header/fly-in-chars/react.d.ts +8 -0
- package/dist/types/animations/header/gradient-text/index.d.ts +3 -0
- package/dist/types/animations/header/gradient-text/react.d.ts +13 -0
- package/dist/types/animations/header/letter-bounce/index.d.ts +3 -0
- package/dist/types/animations/header/letter-bounce/react.d.ts +10 -0
- package/dist/types/animations/header/roll-in/index.d.ts +3 -0
- package/dist/types/animations/header/roll-in/react.d.ts +13 -0
- package/dist/types/animations/header/shimmer-text/index.d.ts +3 -0
- package/dist/types/animations/header/shimmer-text/react.d.ts +4 -0
- package/dist/types/animations/header/shuffle/index.d.ts +3 -0
- package/dist/types/animations/header/shuffle/react.d.ts +14 -0
- package/dist/types/animations/header/split-text/index.d.ts +3 -0
- package/dist/types/animations/header/split-text/react.d.ts +10 -0
- package/dist/types/animations/header/text-type/index.d.ts +3 -0
- package/dist/types/animations/header/text-type/react.d.ts +13 -0
- package/dist/types/animations/header/word-curtain-reveal/index.d.ts +3 -0
- package/dist/types/animations/header/word-curtain-reveal/react.d.ts +8 -0
- package/dist/types/react-barrel.d.ts +34 -0
- package/dist/types/scripts/bundle-all.d.ts +173 -0
- package/dist/types/scripts/check-metadata.d.ts +1 -0
- package/dist/types/scripts/copy-metadata.d.ts +1 -0
- package/dist/types/scripts/generate-animation-id-map.d.ts +1 -0
- package/dist/types/scripts/generate-dist-meta.d.ts +1 -0
- package/dist/types/scripts/generate-preview-manifest.d.ts +1 -0
- package/dist/types/scripts/update-metadata.d.ts +1 -0
- package/dist/types/shared/constants.d.ts +34 -0
- package/dist/types/shared/meta.d.ts +18 -0
- package/dist/types/shared/pointer-follow.d.ts +8 -0
- package/dist/types/shared/reduced-motion.d.ts +11 -0
- package/dist/types/shared/resolve-card-media.d.ts +1 -0
- package/dist/types/shared/text-split.d.ts +19 -0
- package/dist/types/stories/3d-flip.stories.d.ts +7 -0
- package/dist/types/stories/_helpers.d.ts +24 -0
- package/dist/types/stories/anime-splittext.stories.d.ts +8 -0
- package/dist/types/stories/blur-fade-in.stories.d.ts +8 -0
- package/dist/types/stories/blur-rise.stories.d.ts +8 -0
- package/dist/types/stories/blur-to-sharp-rise-header.stories.d.ts +8 -0
- package/dist/types/stories/border-beam.stories.d.ts +8 -0
- package/dist/types/stories/bounce-elastic.stories.d.ts +8 -0
- package/dist/types/stories/bounce-in-bottom.stories.d.ts +8 -0
- package/dist/types/stories/bounce-in-down.stories.d.ts +9 -0
- package/dist/types/stories/bubble-button.stories.d.ts +8 -0
- package/dist/types/stories/card-fan-spread.stories.d.ts +7 -0
- package/dist/types/stories/card-flip.stories.d.ts +7 -0
- package/dist/types/stories/confetti-button.stories.d.ts +7 -0
- package/dist/types/stories/float-idle.stories.d.ts +8 -0
- package/dist/types/stories/fly-in-chars.stories.d.ts +8 -0
- package/dist/types/stories/glow-cta.stories.d.ts +9 -0
- package/dist/types/stories/gradient-text.stories.d.ts +9 -0
- package/dist/types/stories/image-magnifier.stories.d.ts +10 -0
- package/dist/types/stories/image-zoom-rotate.stories.d.ts +7 -0
- package/dist/types/stories/letter-bounce.stories.d.ts +8 -0
- package/dist/types/stories/magic-ui-border-beam-card.stories.d.ts +8 -0
- package/dist/types/stories/magnetic-hover.stories.d.ts +7 -0
- package/dist/types/stories/pop-in-stack.stories.d.ts +7 -0
- package/dist/types/stories/pulse.stories.d.ts +8 -0
- package/dist/types/stories/rainbow-button.stories.d.ts +8 -0
- package/dist/types/stories/reveal-from-top.stories.d.ts +8 -0
- package/dist/types/stories/rgb-split-glitch.stories.d.ts +8 -0
- package/dist/types/stories/roll-in.stories.d.ts +9 -0
- package/dist/types/stories/shimmer-border.stories.d.ts +9 -0
- package/dist/types/stories/shimmer-text.stories.d.ts +8 -0
- package/dist/types/stories/shuffle.stories.d.ts +8 -0
- package/dist/types/stories/sketch-button.stories.d.ts +7 -0
- package/dist/types/stories/split-text.stories.d.ts +8 -0
- package/dist/types/stories/text-type.stories.d.ts +8 -0
- package/dist/types/stories/tilted-card.stories.d.ts +7 -0
- package/dist/types/stories/word-curtain-reveal.stories.d.ts +8 -0
- package/package.json +166 -0
- package/react-barrel.js +44 -0
- package/shared/constants.js +64 -0
- package/shared/meta.js +21 -0
- package/shared/pointer-follow.js +91 -0
- package/shared/reduced-motion.js +15 -0
- package/shared/resolve-card-media.js +41 -0
- package/shared/text-split.js +188 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import './style.css'
|
|
2
|
+
import { prefersReducedMotion } from '../../../shared/reduced-motion.js'
|
|
3
|
+
import { attachPointerFollow, getPointerMetrics } from '../../../shared/pointer-follow.js'
|
|
4
|
+
import { buildAnimClass, buildAnimId } from '../../../shared/constants.js'
|
|
5
|
+
|
|
6
|
+
export const ANIMATION_ID = buildAnimId('3d-flip')
|
|
7
|
+
|
|
8
|
+
const CSS_CLASS = buildAnimClass('3d-flip')
|
|
9
|
+
const stateMap = new WeakMap()
|
|
10
|
+
|
|
11
|
+
function reset(el) {
|
|
12
|
+
el.style.setProperty('--readdy-anim-3d-rotate-x', '0deg')
|
|
13
|
+
el.style.setProperty('--readdy-anim-3d-rotate-y', '0deg')
|
|
14
|
+
el.style.setProperty('--readdy-anim-3d-translate-x', '0px')
|
|
15
|
+
el.style.setProperty('--readdy-anim-3d-translate-y', '0px')
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function init(el, options = {}) {
|
|
19
|
+
destroy(el)
|
|
20
|
+
|
|
21
|
+
el.classList.add(CSS_CLASS)
|
|
22
|
+
reset(el)
|
|
23
|
+
|
|
24
|
+
if (prefersReducedMotion()) {
|
|
25
|
+
return
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const tilt = options.maxTilt ?? 12
|
|
29
|
+
const travel = options.translate ?? 8
|
|
30
|
+
|
|
31
|
+
const onMove = (event, context) => {
|
|
32
|
+
const { relativeX, relativeY } = getPointerMetrics(context.rect, event)
|
|
33
|
+
|
|
34
|
+
el.style.setProperty('--readdy-anim-3d-rotate-x', `${relativeY * -tilt * 2}deg`)
|
|
35
|
+
el.style.setProperty('--readdy-anim-3d-rotate-y', `${relativeX * tilt * 2}deg`)
|
|
36
|
+
el.style.setProperty('--readdy-anim-3d-translate-x', `${relativeX * travel * 2}px`)
|
|
37
|
+
el.style.setProperty('--readdy-anim-3d-translate-y', `${relativeY * travel * 2}px`)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const onLeave = () => {
|
|
41
|
+
reset(el)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const cleanup = attachPointerFollow(el, { onMove, onLeave })
|
|
45
|
+
stateMap.set(el, { cleanup })
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function destroy(el) {
|
|
49
|
+
const state = stateMap.get(el)
|
|
50
|
+
if (state) {
|
|
51
|
+
state.cleanup()
|
|
52
|
+
stateMap.delete(el)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
el.classList.remove(CSS_CLASS)
|
|
56
|
+
el.style.removeProperty('--readdy-anim-3d-rotate-x')
|
|
57
|
+
el.style.removeProperty('--readdy-anim-3d-rotate-y')
|
|
58
|
+
el.style.removeProperty('--readdy-anim-3d-translate-x')
|
|
59
|
+
el.style.removeProperty('--readdy-anim-3d-translate-y')
|
|
60
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react'
|
|
2
|
+
import { init, destroy } from './index.js'
|
|
3
|
+
import { prefersReducedMotion } from '../../../shared/reduced-motion.js'
|
|
4
|
+
|
|
5
|
+
type Anim3DFlipProps = {
|
|
6
|
+
children: React.ReactElement
|
|
7
|
+
maxTilt?: number
|
|
8
|
+
translate?: number
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function Anim3DFlip({
|
|
12
|
+
children,
|
|
13
|
+
maxTilt,
|
|
14
|
+
translate,
|
|
15
|
+
}: Anim3DFlipProps) {
|
|
16
|
+
const ref = useRef<HTMLElement>(null)
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const el = ref.current
|
|
20
|
+
if (!el || prefersReducedMotion()) return
|
|
21
|
+
|
|
22
|
+
init(el, { maxTilt, translate })
|
|
23
|
+
return () => {
|
|
24
|
+
destroy(el)
|
|
25
|
+
}
|
|
26
|
+
}, [maxTilt, translate])
|
|
27
|
+
|
|
28
|
+
return React.cloneElement(React.Children.only(children), { ref })
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.readdy-anim-3d-flip {
|
|
2
|
+
transform:
|
|
3
|
+
perspective(600px)
|
|
4
|
+
translate3d(var(--readdy-anim-3d-translate-x, 0), var(--readdy-anim-3d-translate-y, 0), 0)
|
|
5
|
+
rotateX(var(--readdy-anim-3d-rotate-x, 0deg))
|
|
6
|
+
rotateY(var(--readdy-anim-3d-rotate-y, 0deg));
|
|
7
|
+
transform-style: preserve-3d;
|
|
8
|
+
transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
|
|
9
|
+
will-change: transform;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@media (prefers-reduced-motion: reduce) {
|
|
13
|
+
.readdy-anim-3d-flip {
|
|
14
|
+
transform: none;
|
|
15
|
+
transition: none;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { buildAnimClass, buildAnimId } from '../../../shared/constants.js'
|
|
2
|
+
export const ANIMATION_ID = buildAnimId('blur-fade-in')
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Blur Fade In — 按钮模糊淡入
|
|
6
|
+
* 实现:CSS-only,init 给元素加 .readdy-anim-blur-fade-in class,destroy 移除
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import './style.css'
|
|
10
|
+
|
|
11
|
+
const CSS_CLASS = buildAnimClass('blur-fade-in')
|
|
12
|
+
|
|
13
|
+
export function init(el, options = {}) {
|
|
14
|
+
if (!el.classList.contains(CSS_CLASS)) {
|
|
15
|
+
el.classList.add(CSS_CLASS)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function destroy(el) {
|
|
20
|
+
el.classList.remove(CSS_CLASS)
|
|
21
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useRef, useEffect } from 'react'
|
|
2
|
+
import { init, destroy } from './index.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Blur Fade In — 按钮模糊淡入
|
|
6
|
+
*
|
|
7
|
+
* 用法:
|
|
8
|
+
* <AnimBlurFadeIn><button>点击</button></AnimBlurFadeIn>
|
|
9
|
+
*
|
|
10
|
+
* 不加 wrapper div — 通过 cloneElement 给子元素注入 ref,加/删 .readdy-anim-blur-fade-in class
|
|
11
|
+
* 必须恰好包裹一个子元素
|
|
12
|
+
*/
|
|
13
|
+
export function AnimBlurFadeIn({ children }: { children: React.ReactElement }) {
|
|
14
|
+
const ref = useRef<HTMLElement>(null)
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const el = ref.current
|
|
18
|
+
if (!el) return
|
|
19
|
+
init(el)
|
|
20
|
+
return () => {
|
|
21
|
+
destroy(el)
|
|
22
|
+
}
|
|
23
|
+
}, [])
|
|
24
|
+
|
|
25
|
+
return React.cloneElement(React.Children.only(children), { ref })
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/* Blur Fade In — 按钮模糊淡入 */
|
|
2
|
+
|
|
3
|
+
@keyframes readdy-anim-blur-fade-in {
|
|
4
|
+
from {
|
|
5
|
+
opacity: 0;
|
|
6
|
+
filter: blur(10px);
|
|
7
|
+
transform: translateY(8px);
|
|
8
|
+
}
|
|
9
|
+
to {
|
|
10
|
+
opacity: 1;
|
|
11
|
+
filter: blur(0);
|
|
12
|
+
transform: translateY(0);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.readdy-anim-blur-fade-in {
|
|
17
|
+
animation: readdy-anim-blur-fade-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (prefers-reduced-motion: reduce) {
|
|
21
|
+
.readdy-anim-blur-fade-in {
|
|
22
|
+
animation: none;
|
|
23
|
+
opacity: 1;
|
|
24
|
+
filter: none;
|
|
25
|
+
transform: none;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { buildAnimClass, buildAnimId } from '../../../shared/constants.js'
|
|
2
|
+
export const ANIMATION_ID = buildAnimId('border-beam')
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Border Beam — 光束边框
|
|
6
|
+
* 实现:init 给元素加 class,并插入一层 beam overlay;destroy 清理
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import './style.css'
|
|
10
|
+
|
|
11
|
+
const CSS_CLASS = buildAnimClass('border-beam')
|
|
12
|
+
const LAYER_CLASS = `${CSS_CLASS}__layer`
|
|
13
|
+
const BEAM_CLASS = `${CSS_CLASS}__beam`
|
|
14
|
+
const BEAM_WARM_CLASS = `${BEAM_CLASS}--warm`
|
|
15
|
+
const BEAM_COOL_CLASS = `${BEAM_CLASS}--cool`
|
|
16
|
+
const ANIMATION_KEY = '__readdyBorderBeamAnimation'
|
|
17
|
+
const STATE_KEY = '__readdyBorderBeamState'
|
|
18
|
+
const DEFAULT_SIZE = 72
|
|
19
|
+
|
|
20
|
+
function ensureLayer(el) {
|
|
21
|
+
const existing = Array.from(el.children).find((child) => child.classList?.contains(LAYER_CLASS))
|
|
22
|
+
if (existing) {
|
|
23
|
+
const warmBeam = existing.querySelector(`.${BEAM_WARM_CLASS}`)
|
|
24
|
+
const coolBeam = existing.querySelector(`.${BEAM_COOL_CLASS}`)
|
|
25
|
+
if (warmBeam && coolBeam) {
|
|
26
|
+
return { layer: existing, beams: [warmBeam, coolBeam] }
|
|
27
|
+
}
|
|
28
|
+
existing.remove()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const layer = document.createElement('span')
|
|
32
|
+
layer.className = LAYER_CLASS
|
|
33
|
+
layer.setAttribute('aria-hidden', 'true')
|
|
34
|
+
|
|
35
|
+
const warmBeam = document.createElement('span')
|
|
36
|
+
warmBeam.className = `${BEAM_CLASS} ${BEAM_WARM_CLASS}`
|
|
37
|
+
layer.appendChild(warmBeam)
|
|
38
|
+
|
|
39
|
+
const coolBeam = document.createElement('span')
|
|
40
|
+
coolBeam.className = `${BEAM_CLASS} ${BEAM_COOL_CLASS}`
|
|
41
|
+
layer.appendChild(coolBeam)
|
|
42
|
+
|
|
43
|
+
el.appendChild(layer)
|
|
44
|
+
|
|
45
|
+
return { layer, beams: [warmBeam, coolBeam] }
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function cancelAnimation(el) {
|
|
49
|
+
el[ANIMATION_KEY]?.cancel?.()
|
|
50
|
+
delete el[ANIMATION_KEY]
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function getBeamSize(el, options) {
|
|
54
|
+
if (typeof options.size === 'number') {
|
|
55
|
+
return options.size
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const { width, height } = el.getBoundingClientRect()
|
|
59
|
+
return Math.max(DEFAULT_SIZE, Math.min(Math.round((width + height) * 0.22), 160))
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function syncLayer(el) {
|
|
63
|
+
const state = el[STATE_KEY]
|
|
64
|
+
if (!state) return
|
|
65
|
+
|
|
66
|
+
const { beams, options } = state
|
|
67
|
+
const radius = getComputedStyle(el).borderRadius || '0px'
|
|
68
|
+
const size = getBeamSize(el, options)
|
|
69
|
+
|
|
70
|
+
el.style.setProperty('--readdy-anim-border-beam-radius', radius)
|
|
71
|
+
el.style.setProperty('--readdy-anim-border-beam-duration', `${options.duration ?? 3000}ms`)
|
|
72
|
+
el.style.setProperty('--readdy-anim-border-beam-width', `${options.borderWidth ?? 1.35}px`)
|
|
73
|
+
el.style.setProperty('--readdy-anim-border-beam-glow-opacity', `${options.glowOpacity ?? 0.28}`)
|
|
74
|
+
el.style.setProperty('--readdy-anim-border-beam-size', `${size}px`)
|
|
75
|
+
|
|
76
|
+
beams.forEach((beam, index) => {
|
|
77
|
+
beam.style.width = `${size}px`
|
|
78
|
+
beam.style.offsetPath = `rect(0 auto auto 0 round ${radius})`
|
|
79
|
+
if (index === 0) {
|
|
80
|
+
beam.style.setProperty('--readdy-anim-border-beam-color-from', options.colorFrom ?? '#ff6b6b')
|
|
81
|
+
beam.style.setProperty('--readdy-anim-border-beam-color-to', options.colorTo ?? '#ffb86b')
|
|
82
|
+
} else {
|
|
83
|
+
beam.style.setProperty('--readdy-anim-border-beam-color-from', options.secondaryColorFrom ?? '#5ea0ff')
|
|
84
|
+
beam.style.setProperty('--readdy-anim-border-beam-color-to', options.secondaryColorTo ?? '#9ec5ff')
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function runAnimation(el) {
|
|
90
|
+
const state = el[STATE_KEY]
|
|
91
|
+
if (!state) return
|
|
92
|
+
|
|
93
|
+
const { beams, options } = state
|
|
94
|
+
const initialOffset = options.initialOffset ?? 0
|
|
95
|
+
const duration = options.duration ?? 3000
|
|
96
|
+
const delay = options.delay ?? 0
|
|
97
|
+
const reverse = options.reverse ?? false
|
|
98
|
+
|
|
99
|
+
cancelAnimation(el)
|
|
100
|
+
const animations = beams
|
|
101
|
+
.map((beam, index) => {
|
|
102
|
+
if (typeof beam.animate !== 'function') return null
|
|
103
|
+
|
|
104
|
+
const beamOffset = initialOffset + index * 50
|
|
105
|
+
const from = reverse ? `${100 - beamOffset}%` : `${beamOffset}%`
|
|
106
|
+
const to = reverse ? `${-beamOffset}%` : `${100 + beamOffset}%`
|
|
107
|
+
beam.style.offsetDistance = from
|
|
108
|
+
|
|
109
|
+
return beam.animate(
|
|
110
|
+
[
|
|
111
|
+
{ offsetDistance: from },
|
|
112
|
+
{ offsetDistance: to },
|
|
113
|
+
],
|
|
114
|
+
{
|
|
115
|
+
duration,
|
|
116
|
+
delay: -delay,
|
|
117
|
+
easing: 'linear',
|
|
118
|
+
iterations: Infinity,
|
|
119
|
+
fill: 'both',
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
})
|
|
123
|
+
.filter(Boolean)
|
|
124
|
+
|
|
125
|
+
if (animations.length > 0) {
|
|
126
|
+
el[ANIMATION_KEY] = {
|
|
127
|
+
cancel() {
|
|
128
|
+
animations.forEach((animation) => animation.cancel())
|
|
129
|
+
},
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export function init(el, options = {}) {
|
|
135
|
+
if (!el.classList.contains(CSS_CLASS)) {
|
|
136
|
+
el.classList.add(CSS_CLASS)
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const { layer, beams } = ensureLayer(el)
|
|
140
|
+
const state = el[STATE_KEY] ?? { layer, beams, options }
|
|
141
|
+
|
|
142
|
+
state.layer = layer
|
|
143
|
+
state.beams = beams
|
|
144
|
+
state.options = options
|
|
145
|
+
|
|
146
|
+
if (!state.resizeObserver && typeof ResizeObserver !== 'undefined') {
|
|
147
|
+
state.resizeObserver = new ResizeObserver(() => {
|
|
148
|
+
syncLayer(el)
|
|
149
|
+
})
|
|
150
|
+
state.resizeObserver.observe(el)
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
el[STATE_KEY] = state
|
|
154
|
+
syncLayer(el)
|
|
155
|
+
runAnimation(el)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function destroy(el) {
|
|
159
|
+
cancelAnimation(el)
|
|
160
|
+
|
|
161
|
+
const state = el[STATE_KEY]
|
|
162
|
+
state?.resizeObserver?.disconnect()
|
|
163
|
+
state?.layer?.remove()
|
|
164
|
+
delete el[STATE_KEY]
|
|
165
|
+
|
|
166
|
+
el.classList.remove(CSS_CLASS)
|
|
167
|
+
el.style.removeProperty('--readdy-anim-border-beam-radius')
|
|
168
|
+
el.style.removeProperty('--readdy-anim-border-beam-duration')
|
|
169
|
+
el.style.removeProperty('--readdy-anim-border-beam-width')
|
|
170
|
+
el.style.removeProperty('--readdy-anim-border-beam-glow-opacity')
|
|
171
|
+
el.style.removeProperty('--readdy-anim-border-beam-size')
|
|
172
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { useRef, useEffect } from 'react'
|
|
2
|
+
import { prefersReducedMotion } from '../../../shared/reduced-motion.js'
|
|
3
|
+
import { init, destroy } from './index.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Border Beam — 光束边框
|
|
7
|
+
*
|
|
8
|
+
* 用法:
|
|
9
|
+
* <AnimBorderBeam><button>点击</button></AnimBorderBeam>
|
|
10
|
+
*
|
|
11
|
+
* 不加 wrapper div — 通过 cloneElement 给子元素注入 ref,加/删 .readdy-anim-border-beam class
|
|
12
|
+
* 必须恰好包裹一个子元素
|
|
13
|
+
*/
|
|
14
|
+
type AnimBorderBeamProps = {
|
|
15
|
+
children: React.ReactElement
|
|
16
|
+
duration?: number
|
|
17
|
+
delay?: number
|
|
18
|
+
borderWidth?: number
|
|
19
|
+
glowOpacity?: number
|
|
20
|
+
size?: number
|
|
21
|
+
initialOffset?: number
|
|
22
|
+
colorFrom?: string
|
|
23
|
+
colorTo?: string
|
|
24
|
+
reverse?: boolean
|
|
25
|
+
respectReducedMotion?: boolean
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function AnimBorderBeam({
|
|
29
|
+
children,
|
|
30
|
+
duration,
|
|
31
|
+
delay,
|
|
32
|
+
borderWidth,
|
|
33
|
+
glowOpacity,
|
|
34
|
+
size,
|
|
35
|
+
initialOffset,
|
|
36
|
+
colorFrom,
|
|
37
|
+
colorTo,
|
|
38
|
+
reverse,
|
|
39
|
+
respectReducedMotion = true,
|
|
40
|
+
}: AnimBorderBeamProps) {
|
|
41
|
+
const ref = useRef<HTMLElement>(null)
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
const el = ref.current
|
|
45
|
+
if (!el) return
|
|
46
|
+
if (respectReducedMotion && prefersReducedMotion()) return
|
|
47
|
+
|
|
48
|
+
init(el, { duration, delay, borderWidth, glowOpacity, size, initialOffset, colorFrom, colorTo, reverse })
|
|
49
|
+
return () => {
|
|
50
|
+
destroy(el)
|
|
51
|
+
}
|
|
52
|
+
}, [borderWidth, colorFrom, colorTo, delay, duration, glowOpacity, initialOffset, respectReducedMotion, reverse, size])
|
|
53
|
+
|
|
54
|
+
return React.cloneElement(React.Children.only(children), { ref })
|
|
55
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
.readdy-anim-border-beam {
|
|
2
|
+
position: relative;
|
|
3
|
+
isolation: isolate;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.readdy-anim-border-beam__layer {
|
|
7
|
+
display: block;
|
|
8
|
+
position: absolute;
|
|
9
|
+
inset: 0;
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
padding: var(--readdy-anim-border-beam-width, 1.35px);
|
|
12
|
+
border-radius: var(--readdy-anim-border-beam-radius, inherit);
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
overflow: clip;
|
|
15
|
+
z-index: 2;
|
|
16
|
+
-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
17
|
+
-webkit-mask-composite: xor;
|
|
18
|
+
mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
|
|
19
|
+
mask-composite: exclude;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.readdy-anim-border-beam__beam {
|
|
23
|
+
display: block;
|
|
24
|
+
position: absolute;
|
|
25
|
+
top: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
aspect-ratio: 1;
|
|
28
|
+
width: var(--readdy-anim-border-beam-size, 72px);
|
|
29
|
+
pointer-events: none;
|
|
30
|
+
border-radius: 0;
|
|
31
|
+
offset-rotate: 0deg;
|
|
32
|
+
background: linear-gradient(
|
|
33
|
+
to left,
|
|
34
|
+
var(--readdy-anim-border-beam-color-from, #ffaa40),
|
|
35
|
+
var(--readdy-anim-border-beam-color-to, #9c40ff) 55%,
|
|
36
|
+
transparent
|
|
37
|
+
);
|
|
38
|
+
filter:
|
|
39
|
+
drop-shadow(0 0 4px rgba(255, 170, 64, calc(var(--readdy-anim-border-beam-glow-opacity, 0.28) * 1.3)))
|
|
40
|
+
drop-shadow(0 0 12px rgba(156, 64, 255, calc(var(--readdy-anim-border-beam-glow-opacity, 0.28) * 0.65)));
|
|
41
|
+
will-change: offset-distance;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.readdy-anim-border-beam__beam--warm {
|
|
45
|
+
opacity: 0.95;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.readdy-anim-border-beam__beam--cool {
|
|
49
|
+
opacity: 0.88;
|
|
50
|
+
filter:
|
|
51
|
+
drop-shadow(0 0 4px rgba(94, 160, 255, calc(var(--readdy-anim-border-beam-glow-opacity, 0.28) * 1.2)))
|
|
52
|
+
drop-shadow(0 0 12px rgba(96, 165, 250, calc(var(--readdy-anim-border-beam-glow-opacity, 0.28) * 0.6)));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (prefers-reduced-motion: reduce) {
|
|
56
|
+
.readdy-anim-border-beam__beam {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { buildAnimClass, buildAnimId } from '../../../shared/constants.js'
|
|
2
|
+
export const ANIMATION_ID = buildAnimId('bounce-elastic')
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Bounce Elastic — 按钮弹性弹入
|
|
6
|
+
* 实现:CSS-only,init 给元素加 .readdy-anim-bounce-elastic class,destroy 移除
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import './style.css'
|
|
10
|
+
|
|
11
|
+
const CSS_CLASS = buildAnimClass('bounce-elastic')
|
|
12
|
+
|
|
13
|
+
export function init(el, options = {}) {
|
|
14
|
+
if (!el.classList.contains(CSS_CLASS)) {
|
|
15
|
+
el.classList.add(CSS_CLASS)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function destroy(el) {
|
|
20
|
+
el.classList.remove(CSS_CLASS)
|
|
21
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useRef, useEffect } from 'react'
|
|
2
|
+
import { init, destroy } from './index.js'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Bounce Elastic — 按钮弹性弹入
|
|
6
|
+
*
|
|
7
|
+
* 用法:
|
|
8
|
+
* <AnimBounceElastic><button>点击</button></AnimBounceElastic>
|
|
9
|
+
*
|
|
10
|
+
* 不加 wrapper div — 通过 cloneElement 给子元素注入 ref,加/删 .readdy-anim-bounce-elastic class
|
|
11
|
+
* 必须恰好包裹一个子元素
|
|
12
|
+
*/
|
|
13
|
+
export function AnimBounceElastic({ children }: { children: React.ReactElement }) {
|
|
14
|
+
const ref = useRef<HTMLElement>(null)
|
|
15
|
+
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const el = ref.current
|
|
18
|
+
if (!el) return
|
|
19
|
+
init(el)
|
|
20
|
+
return () => {
|
|
21
|
+
destroy(el)
|
|
22
|
+
}
|
|
23
|
+
}, [])
|
|
24
|
+
|
|
25
|
+
return React.cloneElement(React.Children.only(children), { ref })
|
|
26
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* Bounce Elastic — 按钮弹性弹入 */
|
|
2
|
+
|
|
3
|
+
@keyframes readdy-anim-bounce-elastic {
|
|
4
|
+
0% {
|
|
5
|
+
opacity: 0;
|
|
6
|
+
transform: scale(0.6) translateY(12px);
|
|
7
|
+
}
|
|
8
|
+
60% {
|
|
9
|
+
opacity: 1;
|
|
10
|
+
transform: scale(1.08) translateY(-4px);
|
|
11
|
+
}
|
|
12
|
+
80% {
|
|
13
|
+
transform: scale(0.96) translateY(2px);
|
|
14
|
+
}
|
|
15
|
+
100% {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
transform: scale(1) translateY(0);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.readdy-anim-bounce-elastic {
|
|
22
|
+
animation: readdy-anim-bounce-elastic 1s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@media (prefers-reduced-motion: reduce) {
|
|
26
|
+
.readdy-anim-bounce-elastic {
|
|
27
|
+
animation: none;
|
|
28
|
+
opacity: 1;
|
|
29
|
+
transform: none;
|
|
30
|
+
}
|
|
31
|
+
}
|