-
Notifications
You must be signed in to change notification settings - Fork 0
/
footer.js
77 lines (56 loc) · 1.54 KB
/
footer.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
var footer = document.getElementById("footer");
let _vis = "hidden";
// [tag, label, attr]
let links = [
{"tag": "a", "label": "HOME",
"attr": {"href": "index.html"}},
// {"tag": "a", "label": "iRésume",
// "attr": {"href": "iresume/iresume.html"}},
{"tag": "a", "label": "Digital Portfolio",
"attr": {"href": "iresume/digiport.html"}},
{"tag": "a", "label": "Contact (GitHub Login Required)",
"attr": {"href": "https://github.com/ksgwxfan/ksgwxfan.github.io/issues"}},
{"tag": "span", "label": "<u>Contact (email)</u>",
"attr": {"title": "Click to reveal email",
"id": "c_email",
"onClick": "toggle_email()"}},
{"tag": "a", "label": "Echo Tops Weather Blog",
"attr": {"href": "https://echotops.blogspot.com/"}}
];
function createLink(tag, label, attrs, last=false) {
element = document.createElement(tag);
element.innerHTML = label;
for (attr in attrs) {
element.setAttribute(attr, attrs[attr]);
};
footer.appendChild(element);
footer.innerHTML += "<span class='footer-bullet'> • </span>";
}
// Build Links
for (link of links) {
createLink(
link.tag,
link.label,
link.attr
);
}
function toggle_email() {
let pre1 = "Kyle";
let pre3 = "Gentry";
let pre2 = "S";
let pre5 = ".com";
let pre4 = "@outlook";
let emailid = document.getElementById("c_email");
if (_vis == "hidden") {
_vis = "show";
let email_addy = pre1 + pre2 + pre3 + pre4 + pre5;
emailid.innerHTML = [
"<a href='mailto:",
email_addy.toLowerCase(),
"'>",
email_addy,
"</a>"
].join("");
emailid.title = "";
}
}