Skip to content

Commit

Permalink
Add support for anilist, fixes #1223
Browse files Browse the repository at this point in the history
  • Loading branch information
extesy committed Aug 26, 2023
1 parent 128f2c2 commit d6a93e3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions plugins/anilist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push({
name:'anilist',
version:'1.0',
prepareImgLinks:function (callback) {
var res = [];

// sample: https://s4.anilist.co/file/anilistcdn/media/anime/cover/large/bx159831-TxAC0ujoLTK6.png
$('img[src*="/anilistcdn/media/"]').each(function() {
const img = $(this), src = img.attr('src');
img.data().hoverZoomSrc = [src];
img.addClass('hoverZoomLink');
res.push(img);
});

callback($(res), this.name);
}
});

0 comments on commit d6a93e3

Please sign in to comment.