Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4221b836d0 | |||
| e47dfce717 |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
@@ -2,13 +2,21 @@ let scrolling = false;
|
|||||||
let primaryAnimation, secondaryAnimation;
|
let primaryAnimation, secondaryAnimation;
|
||||||
let focusing = {};
|
let focusing = {};
|
||||||
let showseconds = true;
|
let showseconds = true;
|
||||||
|
let testing = false;
|
||||||
|
|
||||||
window.addEventListener("DOMContentLoaded", () => {
|
window.addEventListener("DOMContentLoaded", () => {
|
||||||
importStyles();
|
importStyles();
|
||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
testing = (params.get('community') === 'testing');
|
||||||
|
if (testing) {
|
||||||
|
setTestFocus();
|
||||||
|
renderList();
|
||||||
|
setInterval(updateTimers, 1000);
|
||||||
|
} else {
|
||||||
const websocket = new ReconnectingWebSocket("wss://croccyfocus.thewisewolf.dev/ws");
|
const websocket = new ReconnectingWebSocket("wss://croccyfocus.thewisewolf.dev/ws");
|
||||||
setInterval(updateTimers, 1000);
|
setInterval(updateTimers, 1000);
|
||||||
communicate(websocket);
|
communicate(websocket);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -174,6 +182,35 @@ function clearFocus(tasks) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Date.prototype.addTime = function (h) {
|
||||||
|
this.setTime(this.getTime() + (h));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setTestFocus() {
|
||||||
|
focusing[0] = {
|
||||||
|
name: "silentstudy101", hyper: true, end_at: new Date().addTime((26 * 60 + 44) * 1000)
|
||||||
|
}
|
||||||
|
focusing[1] = {
|
||||||
|
name: "Holonomy", hyper: true, end_at: new Date().addTime((2 * 60 + 36) * 1000)
|
||||||
|
}
|
||||||
|
focusing[2] = {
|
||||||
|
name: "siona_aoe", hyper: true, end_at: new Date().addTime((2 * 60 + 36) * 1000)
|
||||||
|
}
|
||||||
|
focusing[3] = {
|
||||||
|
name: "arandomdude_72269", hyper: true, end_at: new Date().addTime((2 * 60 + 36) * 1000)
|
||||||
|
}
|
||||||
|
focusing[4] = {
|
||||||
|
name: "xxkxpxx", hyper: true, end_at: new Date().addTime((2 * 60 + 36) * 1000)
|
||||||
|
}
|
||||||
|
focusing[5] = {
|
||||||
|
name: "Natsame", hyper: true, end_at: new Date().addTime((2 * 60 + 36) * 1000)
|
||||||
|
}
|
||||||
|
focusing[6] = {
|
||||||
|
name: "readersfan", hyper: true, end_at: new Date().addTime((2 * 60 + 36) * 1000)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function renderList() {
|
function renderList() {
|
||||||
let containers = document.querySelectorAll(".task-container")
|
let containers = document.querySelectorAll(".task-container")
|
||||||
let now = Date.now();
|
let now = Date.now();
|
||||||
|
|||||||
Reference in New Issue
Block a user