-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathsettings.html
More file actions
85 lines (85 loc) · 3.53 KB
/
settings.html
File metadata and controls
85 lines (85 loc) · 3.53 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Settings</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="styles.css" />
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Q919W0VJ1S"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Q919W0VJ1S');
</script>
<style>
#games { display: flex; justify-content: center; }
#games main { text-align: center; width: 100%; max-width: 900px; margin: 0 auto; }
#games main > div { display: inline-block; text-align: center; }
</style>
</head>
<body>
<nav>
<button type="button" class="nav-btn" onclick="location.href='/start.html'">
<img src="media/nav-buttons/home.svg" width="40px" height="40px">
</button>
<button type="button" class="nav-btn" onclick="window.location.href='/select.html'">
<img src="media/nav-buttons/game.svg" width="40px" height="40px">
</button>
<button type="button" class="nav-btn" onclick="location.href='search/index.html'">
<img src="media/nav-buttons/search.svg" width="40px" height="40px">
</button>
<button type="button" class="nav-btn" onclick="location.href='/tools.html'">
<img src="media/nav-buttons/tools.svg" width="40px" height="40px">
</button>
<button type="button" class="nav-btn" aria-current="page" onclick="location.href='/settings.html'">
<img src="media/nav-buttons/settings.svg" width="40px" height="40px">
</button>
<button type="button" class="nav-btn" onclick="location.href='/disclaimer.html'">
<img src="media/nav-buttons/disclaimer.svg" width="40px" height="40px">
</button>
</nav>
<div id="games">
<main>
<h1>Settings:</h1>
<div style="margin-top:2rem;">
<select id="tabCloaker" style="font-size:1em;padding:0.5em;">
<option value="default">Default</option>
<option value="google">Google</option>
<option value="vocab">Vocabulary.com</option>
</select>
</div>
<div style="height:1.5em;"></div>
<script>
// Tab cloaker logic for settings page
const tabCloaker = document.getElementById('tabCloaker');
const favicon = document.querySelector("link[rel~='icon']") || (() => {
const link = document.createElement('link');
link.rel = 'icon';
document.head.appendChild(link);
return link;
})();
function setTabCloak(value) {
if (value === 'google') {
document.title = 'Google';
favicon.href = 'https://www.google.com/favicon.ico';
} else if (value === 'vocab') {
document.title = 'My Learning | Vocabulary.com';
favicon.href = 'https://www.vocabulary.com/favicon.ico';
} else {
favicon.href = '/favicon.ico';
}
// Save choice for other pages
localStorage.setItem('tabCloaker', value);
}
tabCloaker.addEventListener('change', e => setTabCloak(e.target.value));
// On load, set dropdown and tab
const saved = localStorage.getItem('tabCloaker') || 'default';
tabCloaker.value = saved;
setTabCloak(saved);
</script>
</main>
</div>
</body>
</html>