From 0329f776d7d0618e7a64e38da86e50df7bf29eb6 Mon Sep 17 00:00:00 2001 From: Jinwei Zhao Date: Sun, 1 May 2016 20:35:41 +0800 Subject: # This is a combination of 5 commits. # The first commit's message is: update # The 2nd commit message will be skipped: # refer # The 3rd commit message will be skipped: # test # The 4th commit message will be skipped: # test # The 5th commit message will be skipped: # deploy --- js/portfolio.js | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 js/portfolio.js (limited to 'js') diff --git a/js/portfolio.js b/js/portfolio.js deleted file mode 100644 index 9e3f76f..0000000 --- a/js/portfolio.js +++ /dev/null @@ -1,26 +0,0 @@ -var sleep = function(ms, callback) { - setTimeout(function() { - callback() - }, ms) - }, - favthings = ["raspberrypi", "Linux", "Let's Encrypt", "Ingress"], - removeClass = function(el, className) { - el.classList ? el.classList.remove(className) : el.className = el.className.replace(new RegExp("(^|\\b)" + className.split(" ").join("|") + "(\\b|$)", "gi"), " ") - }, - addClass = function(el, className) { - el.classList ? el.classList.add(className) : el.className += " " + className - }, - i = 0, - nextThing = function(thing) { - i < favthings.length - 1 ? i++ : i = 0, removeClass(thing, "slideInDown"), addClass(thing, "slideOutUp"), sleep(700, function() { - thing.innerHTML = favthings[i], removeClass(thing, "slideOutUp"), addClass(thing, "slideInDown") - }) - }; -document.addEventListener("DOMContentLoaded", function() { - var thing = document.querySelectorAll(".favthing")[0]; - setTimeout(function() { - nextThing(thing) - }, 1e3), setInterval(function() { - nextThing(thing) - }, 4e3) -}); -- cgit v1.2.3