-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
76 lines (66 loc) · 2.71 KB
/
main.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
65
66
67
68
69
70
71
72
73
74
75
76
//counter //fuck jquery
finaldate = new Date("28 January 2023 08:00:00");
console.log(finaldate);
setInterval(() => {
let timeleft = finaldate - new Date();
d = document.getElementById("days");
h = document.getElementById("hours");
m = document.getElementById("mins");
s = document.getElementById("secs");
d.innerHTML = Math.floor(timeleft / (1000 * 60 * 60 * 24));
h.innerHTML = Math.floor((timeleft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
m.innerHTML = Math.floor((timeleft % (1000 * 60 * 60)) / (1000 * 60));
s.innerHTML = Math.floor((timeleft % (1000 * 60)) / 1000);
}, 1000);
// timeline
// document.getElementById("28th").addEventListener("click", () => {
// document.getElementById("29th").classList.remove("current-day");
// document.getElementById("28th").classList.add("current-day");
// document.getElementById("28th list").classList.remove("hidden");
// document.getElementById("29th list").classList.add("hidden");
// });
// document.getElementById("29th").addEventListener("click", () => {
// document.getElementById("29th").classList.add("current-day");
// document.getElementById("28th").classList.remove("current-day");
// document.getElementById("29th list").classList.remove("hidden");
// document.getElementById("28th list").classList.add("hidden");
// });
// navigation
document.getElementById("clear").addEventListener("click", () => {
document.getElementById("nav-list").classList.add("nav-hide");
});
document.getElementById("menu-icon").addEventListener("click", () => {
document.getElementById("nav-list").classList.remove("nav-hide");
});
let ll = document.getElementsByClassName("link");
for (let link of ll) {
link.addEventListener("click", () => {
document.getElementById("nav-list").classList.add("nav-hide");
});
}
//faq
buttons = document.getElementsByClassName("add");
// console.log(buttons);
for (let b of buttons) {
b.addEventListener("click", (e) => {
b.nextElementSibling.classList.toggle("active");
});
}
// //devfolio
// document.addEventListener('DOMContentLoaded', function () {
// let devfolioOptions = {
// buttonSelector: '#devfolio-apply-now',
// key: 'ingenious-hackathon-4',
// }
// let script = document.createElement('script');
// script.src = "https://apply.devfolio.co";
// document.head.append(script);
// script.onload = function () {
// new Devfolio(devfolioOptions);
// }
// script.onerror = function () {
// document.querySelector(devfolioOptions.buttonSelector).addEventListener('click', function () {
// window.location.href = 'https://devfolio.co/external-apply/' + devfolioOptions.key;
// });
// }
// });