v2.2.0
π₯ Release preview
Add new createContainers
option that allows not to modify the DOM for better compatibility with wrapper libraries react-powerglitch and particularly vue-powerglitch.
π Features
- A new
createContainers
option is added (default: true). More information in the code comments:
/**
* 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:
* - That the first argument to glitch(..) is the layer container itself
* - That the first child of the layer container is the element to glitch
* And will:
* - Clone the element to glitch the required amount of times, and add the clones at the same level than the element to glitch in the layer container
*/
π€ Changes
- Add link to the React wrapper library react-powerglitch in README.md
π» Code quality
- Code refactoring to optimize bundle size (still <2kb)
π Bug fixes
N/A
π₯ Thanks
N/A