mnpj22 / hanime.tv full sized images

// ==UserScript==
// @name         hanime.tv full sized images
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  Loads full sized images (that you hover over with the cursor) instead of compressed thumbnails on hanime.tv
// @author       mnpj22
// @match        https://www.tampermonkey.net/scripts.php
// @match        https://hanime.tv/*
// @match        https://members.hanime.tv/*
// @match        https://members.hanime.tv/browse/images/*
// @match        https://hanime.tv/browse/images/*
// @grant        none
// @require  https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
// @require  https://raw.githubusercontent.com/briancherne/jquery-hoverIntent/master/jquery.hoverIntent.min.js
// @require  https://gist.github.com/raw/2625891/waitForKeyElements.js
// @license GPL-3.0-or-later; https://www.gnu.org/licenses/gpl-3.0.txt
// ==/UserScript==


// NEW DEFAULT - only loads images that you hover with your cursor over (to reduce network usage)

(function() {
    'use strict';
    waitForKeyElements(".cuc__content", doIt);
    function doIt(){
        $(".cuc__content").parent().hoverIntent({
        over: function(event){
            event.stopPropagation();
            event.stopImmediatePropagation();
            $(this).children(".cuc__content").attr("src",$(this).attr("href"));
        }});
    }
})();


// DEFAULT + added a little imperfect scale up effect when hovering over an image (the z-index change doesn't work when the cursor moves away from the image)
/*
(function() {
    'use strict';
    waitForKeyElements(".cuc__content", doIt);
    function setOutZIndex(elem){
        elem.css({'z-index':'0'});
    }
    function doIt(){
        $(".cuc__content").parent().each(function(){
            $(this).css({'transition':'transform 0.5s', 'position':'relative'});
        });
        $(".cuc__content").parent().hoverIntent({
        over: function(event){
            event.stopPropagation();
            event.stopImmediatePropagation();
            $(this).css({'transform':'scale(2.5)', 'z-index':'5'});
            $(this).children(".cuc__content").attr("src",$(this).attr("href"));
        },out: function(){
            $(this).css({'transform':'scale(1)', 'z-index':'5'})
            var elem = $(this);
            setTimeout(setOutZIndex(elem),500);
        }});
    }
})();
*/

// OLD - loads all of the images one by one once they appear on the page 
/*
(function() {
    'use strict';
    waitForKeyElements(".cuc__content", doIt);
    function doIt(){
        var imgs_a = document.getElementsByClassName("cuc__content");
        for (var i = 0; i < imgs_a.length; i++){
            (imgs_a[i]).setAttribute("src",(imgs_a[i]).parentNode.getAttribute("href"));
        }
    }
})();
*/