ShuffleText

Parse a CSS color string to [r, g, b] via a temporary canvas.

Import

svelte
import { ShuffleText } from 'markgraphy';

Basic usage

svelte
<ShuffleText
  text="example"
  style={''}
  shuffleDirection={'right'}
/>

example

Props

PropTypeDefaultDescription
textstring
class?string''
style?string''
shuffleDirection?ShuffleDirection'right'
duration?number0.35
maxDelay?number0
ease?`stringEasingFunction`'power3.out'
threshold?number0.1
rootMargin?string'-100px'
tag?TagName'p'
textAlign?string'center'
onShuffleComplete?() => void
shuffleTimes?number1
animationMode?AnimationMode'evenodd'
loop?booleanfalse
loopDelay?number0
stagger?number0.03
scrambleCharset?string''
colorFrom?string
colorTo?string
triggerOnce?booleantrue
respectReducedMotion?booleantrue
triggerOnHover?booleantrue

Exported types

  • ShuffleDirection
  • AnimationMode
  • TagName
  • ShuffleTextProps

Reduced motion

Animation is disabled under prefers-reduced-motion.