aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJinwei Zhao <[email protected]>2016-06-07 11:02:39 +0800
committerJinwei Zhao <[email protected]>2017-01-13 15:07:46 +0800
commitefb8867c8eb5d87b36e596f50119740cb3b27a73 (patch)
tree2d8d6a0cccdb1ae6ce9b0533fcfc665392519efe /js
parent219a02188797aedc5f141ce2d0a04a7661b75186 (diff)
downloadjinwei.me-efb8867c8eb5d87b36e596f50119740cb3b27a73.tar.gz
clean up
Diffstat (limited to 'js')
-rwxr-xr-xjs/portfolio.js32
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 @@
1var 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 =
10el.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"),
19addClass(thing, "slideOutUp"), sleep(700, function() {
20 thing.innerHTML = favthings[i], removeClass(thing, "slideOutUp"),
21addClass(thing, "slideInDown")
22 })
23 };
24document.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
Powered by cgit v1.2.3 (git 2.41.0)