Releases: 7PH/powerglitch
v2.5.0
π₯ Release preview
Add slice.cssFilters option to add a custom CSS filter string to the glitch effect
eg
glitch({
"slice": {
"cssFilters": "invert(71%) sepia(83%) saturate(453%) hue-rotate(145deg) brightness(95%) contrast(96%)"
}
})gives you a cyan glitched effect instead of the default random hue rotate applied to glitched layers:
π Features
- Add new
slice.cssFiltersoption
π» Code quality
n/a
π₯ Thanks
v2.4.0
π₯ Release preview
Add optional optimizeSeo flag (defaults to true) to prevent SEO impact
π Features
- Add new optional flag
optimizeSeo(defaults totrue). Whentrue, crawlers will be detected no glitch will be shown to them. This prevents duplicate content from being rendered for crawlers that execute JavaScript.- This optimization can be removed by setting
optimizeSeotofalsein the options.
- This optimization can be removed by setting
π» Code quality
- Added an exclusions for SonarCloud for the
docspages to stop false-positive issues from being raised.
π₯ Thanks
- @AnixPasBesoin for raising the issue (#32)
v2.3.5
v2.3.4
π Bug fixes
- Provide both ESM & CJS bundles. New structure:
./build/src/index.d.ts: type declaration./lib/index.esm.js: ESM bundle./lib/index.cjs: CJS bundle (same as before, but generated using esbuild rather than tsc)./dist/powerglitch.min.js: IIFE bundle (unchanged)./package.json: Add links to GH repo, specify CJS/ESM locations
π₯ Thanks
@rklos for raising the issue
v2.3.3
π Bug fixes
- Fix an issue preventing to glitch multiple times an element when using query selectors.
PowerGlitch.glitch()is now idempotent. It can be called multiple times using the same query selector, and the glitch effect will be updated based on the new options parameter.
π₯ Thanks
@ValerioB88 for calling out the bug and for sponsoring π
v2.3.0
π₯ Release preview
Add an optional pulse animation to the glitch, add MIT licence file
π Features
- Implement an optional pulse animation controlled with the
pulseoption- When used with restricting the glitch time span, the pulse will coordinate itself to start at the same time than the glitch effect
- When used without restricting the glitch time span, the pulse will take the whole duration
- When used, easing will always be
ease-in-outto avoid having a stepped pulse which would not look good - Defaults to not used (
= false) scalenumber determines the final pulse scale (playground uses2as default value)
π€ Changes
- Increase max bundle size from
2kBto2.1kBto allow for a bit of margin - Add MIT licence file
- Add pulse option to the playground
π» Code quality
- 100% line, branch coverage
π Bug fixes
N/A
π₯ Thanks
N/A
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
createContainersoption 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
v2.1.0
π₯ Release preview
Full support for glitching inline elements, fix bold artefact when glitching text, add API full documentation from TSDoc comments
π Features
- Add API full documentation from TSDoc comments
- Use CSS grid to better stack elements (fixes the incorrect stacking of paragraph elements)
- Support for glitching inline elements (e.g.
<div>hello <span class='glitch'>world</span></div>) - Add
<p>element to playground
π€ Changes
- Improve home page examples
π» Code quality
- Improve documentation
- Optimize bundle size, removing non-necessary spaces in CSS properties and inlining
getDefaultTimingCssfunction
π Bug fixes
- Fix bold artefact when glitching text
- Fix glitch stop control when options.timing.iterations is Infinity (since
2.0.2)
π₯ Thanks
v2.0.0
π₯ Release preview
New major version to support glitching any DOM element, add animation control callbacks, click play mode, add jest testing with >99% statement coverage and improve documentation/playground.
π Features
- Made possible to glitch any DOM element (image, button, div containing anything, etc).
- Made
PowerGlitch.glitch()return{ containers, startGlitch, stopGlitch }containers: Containers for each glitched element.startGlitch(): Manually start the glitch.stopGlitch(): Manually stop the glitch.
- Removed
hover-triggeredplay mode for simplicity and symmetry withclick, since the effect could be achieved with animation control callbacks. - Added
clickplay mode. - Added
manualplay mode (never plays until the animation control callbacks are called). - Added support for switching play modes in playground.
- Added support for passing a
NodeList(result from querySelectorAll) as the elements to glitch inPowerGlitch.glitch() - Added support for passing an array of
HTMLElementas the elements to glitch inPowerGlitch.glitch() - Improved homepage to add examples reflecting the new features
π€ Changes
- Updated documentation and playground to reflect the new changes.
- Removed
imageUrloption, replaced withhtmland now accepts any valid html string.
π» Code quality
- Added
jesttesting with>99%statement coverage.
π Bug fixes
N/A
v1.2.0
π₯ Release preview
Retro-compatible release that adds support for triggering the glitch effect only when hovering the image, serving the library iife bundle through unpkg, improves the playground, and more βΊ
π Features
- Introduced a new
playModeoption to choose when to play the defined glitch animation:always(default): Always be glitchin'.hover-triggered: Start glitching hovering the image for the first time.hover-only: Only glitch when hovering the image.
- The library is now served by unpkg.com.
- A
Show codesection in the playground lets you copy/paste the options object to use it in your code directly.
π€ Changes
- Updated documentation to reflect the new changes (and fix a misleading example).
- Updated the playground with new
recommended defaultsbuttons to check out good-looking effects for the 3 play modes.
π» Code quality
- Switch case indent rule customized to force inner indentation.
π Bug fixes
- Remove original image instead of hidding it (in some cases, the image would not be hidden because of conflicting CSS rules).
π₯ Thanks
- @Code-Victor for suggesting the feature (#4)