Skip to content

Commit

Permalink
Implement... even more miniature disable gifs labels?
Browse files Browse the repository at this point in the history
  • Loading branch information
marcustyphoon committed Jul 9, 2023
1 parent 8a1e4cb commit e82da42
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/scripts/accesskit.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
font-size: 0.6rem;
}

.xkit-paused-gif-label.verymini {
font-size: 0.3rem;
}

.xkit-paused-gif {
position: absolute;
visibility: visible;
Expand Down
8 changes: 5 additions & 3 deletions src/scripts/accesskit/disable_gifs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ const pauseGif = function (gifElement) {
canvas.getContext('2d').drawImage(image, 0, 0);

const gifLabel = document.createElement('p');
gifLabel.className = gifElement.clientWidth < 150
? 'xkit-paused-gif-label mini'
: 'xkit-paused-gif-label';
gifLabel.className = gifElement.clientWidth < 30
? 'xkit-paused-gif-label verymini'
: gifElement.clientWidth < 150
? 'xkit-paused-gif-label mini'
: 'xkit-paused-gif-label';

gifElement.parentNode.append(canvas, gifLabel);
};
Expand Down

0 comments on commit e82da42

Please sign in to comment.