Skip to content

Commit

Permalink
Implement 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 cc31bab commit 9a4bf06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/scripts/accesskit.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
right: 1ch;

height: 1em;
padding: 5px;
padding: 0.6ch;
border-radius: 3px;

background-color: rgb(var(--black));
Expand All @@ -18,6 +18,10 @@
content: "GIF";
}

.xkit-paused-gif-label.mini {
font-size: 0.6rem;
}

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

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

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

0 comments on commit 9a4bf06

Please sign in to comment.