-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.html
127 lines (118 loc) · 3.5 KB
/
settings.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<link rel="stylesheet" href="style.css" />
<script src="https://code.iconify.design/1/1.0.7/iconify.min.js"></script>
<script src="script.js"></script>
<title>Chatify</title>
</head>
<body>
<div class="container">
<!-- Banner -->
<div class="banner">
<h2>
Chatify
</h2>
</div>
<div class="text">
<h2>Settings</h2>
<div class="settings">
<div class="input"><input type="checkbox" name='sounds' checked><label for="sounds">Sounds</label></div>
<div class="input"><input type="checkbox" name='showtyping' checked><label for="showtyping">Show me
typing</label></div>
<div class="input"><input type="checkbox" name="leavejoin" checked><label for="leavejoin">Show me leaving and
joining</label></div><br>
<div class="input"><label for='font'>Font:</label><input type="text" name="font" placeholder="Font" value='Poppins'></div>
</div>
<a href="home.html">Back to home</a>
</div>
</div>
<button onclick="fullscreen()" id="fullscreen">
<span class="iconify" data-icon="octicon:screen-full-16" data-inline="false"></span>
</button>
</button>
</body>
</html>
<style>
:root {
--slider-size: .6px;
}
.text {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding: 30px;
}
.text h2 {
text-align: center;
}
input[type='checkbox'] {
margin-right: 10px;
}
input[type='text'] {
padding: 10px;
border-radius: 5px;
}
.text a {
transition: background-color .4s ease;
letter-spacing: 2px;
background: rgb(118, 184, 206);
padding: 10px;
border-radius: 5px;
text-decoration: none;
margin: 5px;
color: white;
}
.text a:hover {
background-color: rgb(112, 214, 112);
}
</style>
<script>
set('sounds');
set('leavejoin');
set('showtyping');
if (window.localStorage.getItem('font') == '') {
window.localStorage.setItem('font', 'Montserrat');
} else {
document.getElementsByName('font')[0].value = window.localStorage.getItem('font');
}
setInterval(() => {
window.localStorage.setItem('settings-visited', 'true')
window.localStorage.setItem('sounds', document.getElementsByName('sounds')[0].checked)
window.localStorage.setItem('showtyping', document.getElementsByName('showtyping')[0].checked)
window.localStorage.setItem('leavejoin', document.getElementsByName('leavejoin')[0].checked)
window.localStorage.setItem('font', document.getElementsByName('font')[0].value)
}, (10));
function set(item) {
if (window.localStorage.getItem(item) === null) {
window.localStorage.setItem(item, 'true');
}
document.getElementsByName(item)[0].checked = tof(window.localStorage.getItem(item));
}
function tof(str) {
if (str == 'true') {
return true
} else {
return false
}
}
</script>
<script>
setInterval(() => {
// Font
try {
font.remove();
} catch (err) { }
font = document.createElement("STYLE");
font.innerHTML = `@import url("https://fonts.googleapis.com/css2?family=${window.localStorage.getItem(
"font"
)}&display=swap");\n* {\n\tfont-family: ${window.localStorage.getItem(
"font"
)}, Poppins, sans-serif !important;\n}`;
document.body.appendChild(font);
}, 10);
</script>