summaryrefslogtreecommitdiffstats
path: root/static/script.js
blob: ee3260d9b6946a1c76ab88ecf9e6381165d1219a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
function loadImage(url, callback) {
    var img = new Image();
    img.src = url;

	img.onload = callback;
}

(function() {
	var animeGrill = document.getElementById("anime");
	var animeEngineTimer = null;

	animeGrill.onmouseover = function() {
		animeEngineTimer = setTimeout(function() {
			loadImage("/static/animeengine.png", function() {
				animeGrill.src = "/static/animeengine.png";
			});
		}, 5000);
	}

	animeGrill.onmouseout = function() {
		clearTimeout(animeEngineTimer);
	}
})();

function uploadPage() {
    (function() {
        Array.prototype.forEach.call(document.querySelectorAll(".upload"), (upload) => {
            var url = upload.querySelector("a").innerHTML;

            upload.innerHTML += ' -- <a href="#" class="clipboard-copy" data-clipboard-text="' + url + '">Copy to clipboard</a>';
        });
    })();

    (function() {
        var btns = document.querySelectorAll(".clipboard-copy");
        new Clipboard(btns);
    })();
}