Додана сторінка "Стенд"
Додане повідомлення про оновлення застосунку Оновлен Service Worker Перероблен WebSocket APІ
This commit is contained in:
@@ -17,4 +17,6 @@
|
||||
<option value="large">Великий</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button onclick="Options.logout()">Вийти з облікового запису</button>
|
||||
</div>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
const Options = {
|
||||
init: async () => {
|
||||
async init() {
|
||||
let html = await fetch('/lib/pages/options/index.html').then((response) => response.text());
|
||||
app.innerHTML = html;
|
||||
|
||||
await Options.optionPush.init();
|
||||
Options.optionFont.init();
|
||||
},
|
||||
|
||||
optionPush: {
|
||||
init: async () => {
|
||||
async init() {
|
||||
const element = document.getElementById("page-options-notifications");
|
||||
const permission = await Notification.requestPermission();
|
||||
|
||||
@@ -25,7 +26,8 @@ const Options = {
|
||||
element.checked = false;
|
||||
}
|
||||
},
|
||||
edit: (state) => {
|
||||
|
||||
edit(state) {
|
||||
if (state) {
|
||||
webPush.init();
|
||||
} else {
|
||||
@@ -33,8 +35,9 @@ const Options = {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
optionFont: {
|
||||
init: () => {
|
||||
init() {
|
||||
const element = document.getElementById("page-options-fontSize");
|
||||
|
||||
let fontSize = localStorage.getItem("fontSize")
|
||||
@@ -43,9 +46,15 @@ const Options = {
|
||||
|
||||
element.value = fontSize;
|
||||
},
|
||||
edit: (mode) => {
|
||||
|
||||
edit(mode) {
|
||||
localStorage.setItem("fontSize", mode);
|
||||
applyFontMode(mode);
|
||||
}
|
||||
},
|
||||
|
||||
logout() {
|
||||
localStorage.removeItem("uuid");
|
||||
window.location.reload();
|
||||
}
|
||||
}
|
||||
@@ -53,4 +53,16 @@
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.page-options>button {
|
||||
border-radius: var(--border-radius);
|
||||
background: var(--PrimaryColor);
|
||||
color: var(--PrimaryColorText);
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
font-size: var(--FontSize3);
|
||||
font-weight: 400;
|
||||
margin: 20px 0;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
Reference in New Issue
Block a user