Skip to content

v2.2.0

Compare
Choose a tag to compare
@7PH 7PH released this 22 Sep 23:24
· 26 commits to master since this release
7a84b15

πŸ”₯ 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

πŸ’» Code quality

  • Code refactoring to optimize bundle size (still <2kb)

🐞 Bug fixes

N/A

πŸ‘₯ Thanks

N/A