-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.js
64 lines (53 loc) · 1.67 KB
/
template.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
58
59
60
61
62
63
64
let path = Array()
//there are 5 max spots so depending on how many destinations the user has they will be passed into the spot variables
const ids = ["spot1", "spot2", "spot3", "spot4", "spot5",]
// functions are called when their corresponding button is clicked
function clearPath()
{
window.localStorage.setItem('path', JSON.stringify([]));
}
function workForce()
{
path = JSON.parse(window.localStorage.getItem('path'));
path.push("Enter the\nWork Force")
window.localStorage.setItem('path', JSON.stringify(path));
console.log("work")
}
function university()
{
path = JSON.parse(window.localStorage.getItem('path'));
path.push("University")
window.localStorage.setItem('path', JSON.stringify(path));
console.log("uni")
}
function vocational()
{
path = JSON.parse(window.localStorage.getItem('path'));
path.push("Vocational/\nTrade School")
window.localStorage.setItem('path', JSON.stringify(path));
console.log("voc")
}
function community()
{
path = JSON.parse(window.localStorage.getItem('path'));
path.push("Community\nCollege")
window.localStorage.setItem('path', JSON.stringify(path));
console.log("comm")
}
function grad()
{
path = JSON.parse(window.localStorage.getItem('path'));
path.push("Grad\nSchool/PhD")
window.localStorage.setItem('path', JSON.stringify(path));
console.log("grad")
}
// hopefully assigns path indexes to the ids
function getPath()
{
path = JSON.parse(window.localStorage.getItem('path'));
for (let i = 0; i < path.length; i++)
{
document.getElementById(ids[i]).innerHTML = path[i]
console.log(path[i])
}
}