Compare commits

..

2 Commits

Author SHA1 Message Date
conatum 4221b836d0 Add testing mode and data 2026-06-05 17:43:16 +03:00
conatum e47dfce717 Rename examples 2026-06-05 17:43:03 +03:00
3 changed files with 41 additions and 4 deletions

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 64 KiB

+38 -1
View File
@@ -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();