diff options
Diffstat (limited to 'js/portfolio.js')
-rwxr-xr-x | js/portfolio.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/js/portfolio.js b/js/portfolio.js deleted file mode 100755 index f1ab1fb..0000000 --- a/js/portfolio.js +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | var sleep = function(ms, callback) { | ||
2 | setTimeout(function() { | ||
3 | callback() | ||
4 | }, ms) | ||
5 | }, | ||
6 | favthings = ["raspberrypi", "Linux", "Let's Encrypt", "Ingress", "Computer Vision", | ||
7 | "Machine Learning"], | ||
8 | removeClass = function(el, className) { | ||
9 | el.classList ? el.classList.remove(className) : el.className = | ||
10 | el.className.replace(new RegExp("(^|\\b)" + className.split(" ").join("|") + "(\\b|$)", | ||
11 | "gi"), " ") | ||
12 | }, | ||
13 | addClass = function(el, className) { | ||
14 | el.classList ? el.classList.add(className) : el.className += " " + className | ||
15 | }, | ||
16 | i = 0, | ||
17 | nextThing = function(thing) { | ||
18 | i < favthings.length - 1 ? i++ : i = 0, removeClass(thing, "slideInDown"), | ||
19 | addClass(thing, "slideOutUp"), sleep(700, function() { | ||
20 | thing.innerHTML = favthings[i], removeClass(thing, "slideOutUp"), | ||
21 | addClass(thing, "slideInDown") | ||
22 | }) | ||
23 | }; | ||
24 | document.addEventListener("DOMContentLoaded", function() { | ||
25 | var thing = document.querySelectorAll(".favthing")[0]; | ||
26 | setTimeout(function() { | ||
27 | nextThing(thing) | ||
28 | }, 1e3), setInterval(function() { | ||
29 | nextThing(thing) | ||
30 | }, 4e3) | ||
31 | }); | ||
32 | |||