summaryrefslogtreecommitdiffstats
path: root/static/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/script.js')
-rw-r--r--static/script.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/static/script.js b/static/script.js
new file mode 100644
index 0000000..ee3260d
--- /dev/null
+++ b/static/script.js
@@ -0,0 +1,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);
+ })();
+}