8000 GitHub - lostsh/jikan: WEB ING1 First project
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

lostsh/jikan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jikan

HTML CSS JS
Native 5.0 3 Vanilla 2015

API

Medias

Annex

Old and first version of the js glitch handler. Now the script loads glitch effect on row hover, the logic is pretty cool you can take a look at it assets/js/main.js.

/**
 * This function replace normal pic with glitched
 * on mouse hover
 */
function main(){
    console.log("[+]\tAdding event listener on pictures");

    /**
     * Get all img tags of the table
     */
    var images = document.querySelectorAll("table img");

    /**
     * For each image add an anonymous fct
     * onhover: replace img path with glitched path
     * onout  : replace img path with normal path
     */
    images.forEach( e => e.addEventListener("mouseover", function(e){
        //console.log("current image url : %s", e.target.getAttribute('src'));
        e.target.src = e.target.getAttribute('src').replace("normal", "glitch");
    }));

    images.forEach( e => e.addEventListener("mouseout", function(e){
        //console.log("current image url : %s", e.target.getAttribute('src'));
        e.target.src = e.target.getAttribute('src').replace("glitch", "normal");
    }));
}

a bit of ugly js ...


Thanks for reading ~

ᓚᘏᗢ

0