-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
134 lines (126 loc) · 4.69 KB
/
index.html
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PD Week Schedule Website</title>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/icon?family=Material+Icons"
/>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"
/>
<link rel="stylesheet" href="/styles/style.css" />
</head>
<body>
<div id="app"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/anime.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.3.1/p5.min.js"></script>
<script type="module" src="/src/main.ts" defer></script>
<script defer>
document.addEventListener('DOMContentLoaded', function () {
let elems = document.querySelectorAll('.collapsible');
let instances = M.Collapsible.init(elems);
async function delNodes(nList) {
await nList.forEach((n) => n.remove());
}
const day1Links = document.querySelectorAll(
'.day-1 > .card-action > a'
);
const day2Links = document.querySelectorAll(
'.day-2 > .card-action > a'
);
const day3Links = document.querySelectorAll(
'.day-3 > .card-action > a'
);
const day4Links = document.querySelectorAll(
'.day-4 > .card-action > a'
);
const day5Links = document.querySelectorAll(
'.day-5 > .card-action > a'
);
const allMatsDay1Links = document.querySelectorAll('.day1-all-links');
const allMatsDay2Links = document.querySelectorAll('.day2-all-links');
const allMatsDay3Links = document.querySelectorAll('.day3-all-links');
const allMatsDay4Links = document.querySelectorAll('.day4-all-links');
const allMatsDay5Links = document.querySelectorAll('.day5-all-links');
const allLinks = document.querySelectorAll('.all-links');
let now = new Date();
let today = now.getDate();
let thisMonth = now.getMonth();
// const day1Date = new Date(2021, 5, 2, 15, 18);
// const day2Date = new Date(2021, 5, 2, 15, 19);
// const day3Date = new Date(2021, 5, 2, 15, 20);
// const day4Date = new Date(2021, 5, 2, 15, 21);
// const day5Date = new Date(2021, 5, 2, 15, 22);
const day1Date = new Date(2021, 5, 28);
const day2Date = new Date(2021, 5, 29);
const day3Date = new Date(2021, 5, 30);
const day4Date = new Date(2021, 6, 1);
const day5Date = new Date(2021, 6, 2);
if (now < day1Date) {
// console.log("It's not day one, deleting all links...");
delNodes([
...day1Links,
...day2Links,
...day3Links,
...day4Links,
...day5Links,
...allMatsDay1Links,
...allMatsDay2Links,
...allMatsDay3Links,
...allMatsDay4Links,
...allMatsDay5Links,
]);
} else if (now < day2Date) {
// console.log("It's not day 2 deleting day 2+");
delNodes([
...day2Links,
...day3Links,
...day4Links,
...day5Links,
...allMatsDay2Links,
...allMatsDay3Links,
...allMatsDay4Links,
...allMatsDay5Links,
]);
} else if (now < day3Date) {
// console.log("It's not day 3 deleting day 3+");
delNodes([
...day3Links,
...day4Links,
...day5Links,
...allMatsDay3Links,
...allMatsDay4Links,
...allMatsDay5Links,
]);
} else if (now < day4Date) {
// console.log("It's not day 4 deleting day 4+");
delNodes([
...day4Links,
...day5Links,
...allMatsDay4Links,
...allMatsDay5Links,
]);
} else if (now < day5Date) {
// console.log("It's not day 5 deleting day 5+");
delNodes([...day5Links, ...allMatsDay5Links]);
} else {
console.log("It's day 5 not deleting anything");
}
const activities = document.querySelectorAll(
'.sched-item > .card-content'
);
for (let act of activities) {
let actSize = parseInt(act.querySelector('.hidden').innerText);
let increase = 60 * (actSize / 15 - 1);
act.style.height = `${120 + increase}px`;
}
});
</script>
</body>
</html>