Releases: adamchaboryk/gifa11y
Gifa11y 2.0.4
- Ensure Gifa11y buttons are added before elements with
[role="link"]
and[role="button"]
attributes. - Added a new prop,
useDevicePixelRatio
, to support scaling on high-resolution displays usingwindow.devicePixelRatio
. - Added a
resize
event listener to the canvas element to ensure it always matches the size of the original image. - Disabled the alpha channel, e.g.,
canvas.getContext("2d", { alpha: false })
. - Performed minor code cleanup and reorganization.
Gifa11y 2.0.3
- Buttons are now encapsulated within a web component to avoid CSS conflicts.
- New prop
buttonBorder
to change properties of a play/pause button's border.
Gifa11y 2.0.2
- Sync GitHub and NPM version number... 🤦♂️
Gifa11y 2.0.1
— Fixed GitHub pages
- Published to npm. Install via
npm i gifa11y
Gifa11y 2.0
- Refactored & modularized. Less spaghetti code.
- Added dev tooling & CSS/JavaScript linting.
- New props and button style.
target
: Use CSS selectors to target other images like.webp
(that don't end with.gif
), for exampletarget: 'img[src$=".webp"]'
or by class name.showButtons
: Boolean prop to show or hide Play/Pause buttons.showGifText
: Alternative button style. Boolean prop to show the text 'GIF' within the Play/Pause buttons.
- CDN links added to README.md
Gifa11y 1.0.7
Replaced canvas.height
assignment using an aspect ratio calculation which seems to work just fine with different sizes (vertical and landscape).
Thanks to @hugosolar
Gifa11y 1.0.6
Bug fix. Resolve maincontainer === undefined
.
Thanks to @haykh
Gifa11y 1.0.5
Added vertical-align: middle
to SVG and within button. Removed .webp
support, given that animated webp is less common, and mostly used for static images. If any demand to have it back, I'll create a prop for it.
Gifa11y 1.0.4
Fixed a bug where GIFs within collapsed content would not display because the <img>
tag will always have a clientWidth
and clientHeight
of 0
since it's not rendered content. Solution: added a fallback to use naturalWidth
and naturalHeight
for dimensions of generated canvas still of GIF.
Gifa11y 1.0.3
Support for .webp animations.