summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJinwei Zhao <[email protected]>2016-05-01 20:35:41 +0800
committerJinwei Zhao <[email protected]>2016-06-07 12:00:37 +0800
commit0329f776d7d0618e7a64e38da86e50df7bf29eb6 (patch)
tree264b1dfedfa92336cfcaea6219933b88513c8d16 /js
parent53a939bfa8ff9862ad8a298511f149a0fb53df49 (diff)
downloadring0.xyz-0329f776d7d0618e7a64e38da86e50df7bf29eb6.tar.gz
# 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
Diffstat (limited to 'js')
-rw-r--r--js/portfolio.js26
1 files changed, 0 insertions, 26 deletions
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 @@
1var sleep = function(ms, callback) {
2 setTimeout(function() {
3 callback()
4 }, ms)
5 },
6 favthings = ["raspberrypi", "Linux", "Let's Encrypt", "Ingress"],
7 removeClass = function(el, className) {
8 el.classList ? el.classList.remove(className) : el.className = el.className.replace(new RegExp("(^|\\b)" + className.split(" ").join("|") + "(\\b|$)", "gi"), " ")
9 },
10 addClass = function(el, className) {
11 el.classList ? el.classList.add(className) : el.className += " " + className
12 },
13 i = 0,
14 nextThing = function(thing) {
15 i < favthings.length - 1 ? i++ : i = 0, removeClass(thing, "slideInDown"), addClass(thing, "slideOutUp"), sleep(700, function() {
16 thing.innerHTML = favthings[i], removeClass(thing, "slideOutUp"), addClass(thing, "slideInDown")
17 })
18 };
19document.addEventListener("DOMContentLoaded", function() {
20 var thing = document.querySelectorAll(".favthing")[0];
21 setTimeout(function() {
22 nextThing(thing)
23 }, 1e3), setInterval(function() {
24 nextThing(thing)
25 }, 4e3)
26});
Powered by cgit v1.2.3 (git 2.41.0)