-
Notifications
You must be signed in to change notification settings - Fork 0
/
scripts.js
57 lines (51 loc) · 1.42 KB
/
scripts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
var count = 0;
var workLinks = [
{
text: "NPR 2020 Election Displays",
link: "https://apps.npr.org/elections20-interactive/",
img: "elections",
},
{
text: "Iowa Polling Places",
link:
"https://www.npr.org/2020/10/29/928315049/polling-places-are-closing-due-to-covid-19-it-could-tip-races-in-1-swing-state",
img: "iowa",
},
{
text: "Iowa Polling Places",
link:
"https://www.npr.org/2020/10/29/928315049/polling-places-are-closing-due-to-covid-19-it-could-tip-races-in-1-swing-state",
img: "iowa",
},
{
text: "NPR World COVID-19 Tracker",
link:
"https://www.npr.org/sections/goatsandsoda/2020/03/30/822491838/coronavirus-world-map-tracking-the-spread-of-the-outbreak",
img: "world-tracker",
},
];
var onWindowLoaded = function () {
createWorkLinks()
// setTimeout(timerRunner, 0);
};
var timerRunner = function () {
switchDisplay();
setTimeout(timerRunner, 3000);
};
var switchDisplay = function () {
console.log("here");
var element = document.getElementById("img-" + (count % 6));
element.classList.add("text");
var oldElement = document.getElementById("img-" + ((count - 1) % 6));
if (oldElement) oldElement.classList.remove("text");
count++;
};
var createWorkLinks = function() {
var work = document.getElementById("work");
var column;
for (link in workLinks) {
if
}
}
// wait for images to load
window.onload = onWindowLoaded;