-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
163 lines (151 loc) · 5.63 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>C&R Portfolio Website</title>
<link rel="stylesheet" href="./main.css" />
<link rel="stylesheet" href="https://unpkg.com/xp.css" />
<script src="./dates.js"></script>
<script src="./cpu_counter.js"></script>
</head>
<!-- main window -->
<body>
<div id="main-window" class="window">
<!-- title bar -->
<div class="title-bar">
<div class="title-bar-text">Course members</div>
<div class="title-bar-controls">
<!-- <button id="minimize-main-window" aria-label="Minimize"></button> -->
<!-- <button id="maximize-main-window" aria-label="Maximize"></button> -->
<button id="close-main-window" aria-label="Close"></button>
</div>
</div>
<!-- window body -->
<div class="window-body">
<section class="tabs">
<menu role="tablist" aria-label="Sample Tabs">
<button role="tab" aria-selected="true" aria-controls="tab-A">
Links & Progress
</button>
<button role="tab" aria-controls="tab-B">Useful Links</button>
<button role="tab" aria-controls="tab-C">Exercises</button>
</menu>
<!-- the tab content -->
<article role="tabpanel" id="tab-A">
<h3>Portfolio Pages Link</h3>
<ul>
<li>
<a href="https://krabby21.github.io/">Florian</a>
<p>✔️🚀</p>
</li>
<li>
<a href="https://hendrikfley.github.io/">Hendrik</a>
<p>✔️🚀</p>
</li>
<li>
<a href="https://riomos.github.io/">Mario</a>
<p>✔️🚀</p>
</li>
<li>
<a href="https://timokue.github.io/">Timo</a>
<p>✔️🚀</p>
</li>
<li>
<a href="https://tartarov.github.io">Tim</a>
<p>✔️🚀</p>
</li>
<li>
<a href="https://adrosmc.github.io/">Adrian</a>
<p>✔️🚀</p>
</li>
<li>
<a href="https://c-w-schwind.github.io/c-r_portfolio-exercise/">Christian</a>
<p>✔️🚀</p>
</li>
</ul>
</article>
<article role="tabpanel" hidden id="tab-B">
<h3>Useful Links</h3>
<h4>Tutorials</h4>
<ul>
<li><a href="https://www.internetingishard.com/">Course Tutorial</a></li>
<li><a href="https://www.w3schools.com/html/default.asp">Oldschool HTML interactive Tutorial</a></li>
</ul>
<h4>Documentation</h4>
<ul>
<li><a href="https://developer.mozilla.org/en-US/">MDN Web Docs</a></li>
</ul>
</article>
<article role="tabpanel" hidden id="tab-C">
<h3>Exercises</h3>
<p>coming soon...</p>
</article>
</section>
</div>
<div class="status-bar">
<p id="next-date-field" class="status-bar-field">next Date: FINISHED</p>
<p class="status-bar-field">Tutorial Progress: DONE</p>
<p id="cpu-counter" class="status-bar-field">CPU Usage: 14%</p>
</div>
</div>
<script>
const closeButton = document.querySelector("#close-main-window");
closeButton.addEventListener("click", () => window.close());
//snippet required for tab functionality
//copied from
window.addEventListener("DOMContentLoaded", () => {
const tabs = document.querySelectorAll('[role="tab"]');
const tabList = document.querySelector('[role="tablist"]');
// Add a click event handler to each tab
tabs.forEach((tab) => {
tab.addEventListener("click", changeTabs);
});
// Enable arrow navigation between tabs in the tab list
let tabFocus = 0;
tabList.addEventListener("keydown", (e) => {
// Move right
if (e.keyCode === 39 || e.keyCode === 37) {
tabs[tabFocus].setAttribute("tabindex", -1);
if (e.keyCode === 39) {
tabFocus++;
// If we're at the end, go to the start
if (tabFocus >= tabs.length) {
tabFocus = 0;
}
// Move left
} else if (e.keyCode === 37) {
tabFocus--;
// If we're at the start, move to the end
if (tabFocus < 0) {
tabFocus = tabs.length - 1;
}
}
tabs[tabFocus].setAttribute("tabindex", 0);
tabs[tabFocus].focus();
}
});
});
function changeTabs(e) {
const target = e.target;
const parent = target.parentNode;
const grandparent = parent.parentNode;
// Remove all current selected tabs
parent
.querySelectorAll('[aria-selected="true"]')
.forEach((t) => t.setAttribute("aria-selected", false));
// Set this tab as selected
target.setAttribute("aria-selected", true);
// Hide all tab panels
grandparent
.querySelectorAll('[role="tabpanel"]')
.forEach((p) => p.setAttribute("hidden", true));
// Show the selected panel
grandparent.parentNode
.querySelector(`#${target.getAttribute("aria-controls")}`)
.removeAttribute("hidden");
}
</script>
</body>
</html>