Whether to avoid running the glitch effect on crawlers for SEO optimization.
Optional
html?: stringHtml to glitch. If not provided, will use the elements themselves. If provided, all elements should have an innerHTML
property.
Whether to create the 2 containers (one containing the other) necessary to create the glitch animation (defaults to true).
The glitch effect relies on cloning the glitched element, and stacking them on top of the others inside 2 containers (one containing the other). The embedded container is called the layer container, it has grid display and stacks its children, which are the original element and its cloned versions. The top-level container replaces the original element (and the element is moved inside the layer container) This logic is necessary to ensure layout consistency before/after the glitch, and to create the actual glitch effect with CSS. In short, this maximizes compatibility for gitching about anything, but has to rearrange the DOM for that purpose.
In some cases, it is better to handle this logic of two containers elsewhere than in PowerGlitch. For that, this flag should be false, which will make PowerGlitch.giltch(..) assume:
While you can control the glitch with the startGlitch/stopGlitch methods, You can also set a default behavior for playing the glitch.
Whether to hide the glitch animation when it goes out of the bounding rectangle.
Timing of the animation.
Duration of the animation loop in milliseconds.
Number of times the animation should repeat. Set to Infinity
to repeat forever.
Optional
easing?: stringEase animation for all layers. Defauls to a sequential easing (no transition).
Specify if the animation should always glitch uniformly (if false) or if it should glitch at a given time.
If start and end are set, the animation will glitch between those two times, and the peak glitch will be at the middle. glitchTimeSpan.end should be greater than glitchTimeSpan.start. Otherwise, the glitch will not happen.
Whether the base layer should shake. If not set to false, the base layer will shake in the given amplitude.
The shake animation respects the glitch time span constraint, if set.
Slice layers are the base animation to give the glitch effect. They clip a part of the element and move it somewhere else.
The slice animation respects the glitch time span constraint, if set.
Number of layers to generate.
Number of steps to compute for each layer per second of animation.
Minimum height in percent for a given slice, between 0 and 1.
Maximum height in percent for a given slice, between 0 and 1.
Whether the hue should rotate for the given slice.
Pulse layer adds a pulsing effect to the glitch.
Generated using TypeDoc
Custom options for the glitch animations.