diff --git a/index.html b/index.html index 5bf323d..94e40cf 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + diff --git a/package-lock.json b/package-lock.json index 7ff6792..aa204eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "digifall", - "version": "0.9.1", + "version": "0.9.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "digifall", - "version": "0.9.1", + "version": "0.9.2", "dependencies": { "@chainsafe/libp2p-gossipsub": "13.1.0", "@libp2p/bootstrap": "10.1.2", @@ -24,7 +24,7 @@ "libp2p": "1.8.1", "svelte": "4.2.18", "uint8arrays": "5.1.0", - "vite": "5.3.4" + "vite": "5.3.5" } }, "node_modules/@ampproject/remapping": { @@ -1122,9 +1122,9 @@ "integrity": "sha512-QvlqvYtGBYIDeO8dFdY4djkRubcrc+yTJtBc7n8VZPlJDUS/00A+PssbvERM8f9bYRmcaSEHPZgZojeQj7kzAA==" }, "node_modules/@types/node": { - "version": "20.14.11", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.11.tgz", - "integrity": "sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==", + "version": "20.14.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.12.tgz", + "integrity": "sha512-r7wNXakLeSsGT0H1AU863vS2wa5wBOK4bWMjZz2wj+8nBx+m5PeIn0k8AloSLpRuiwdRQZwarZqHE4FNArPuJQ==", "dependencies": { "undici-types": "~5.26.4" } @@ -1647,9 +1647,9 @@ "integrity": "sha512-uqw3MRzf9to1SOLxaureGa73lK8k8ZB/asOApTAkvrzUqCznGtKNgPFH7uYIWlt4UuWq/hU6I+U4Fm5xpjN8Vg==" }, "node_modules/it-ws": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-6.1.1.tgz", - "integrity": "sha512-oyk4eCeZto2lzWDnJOa3j1S2M+VOGKUh8isEf94ySoaL6IFlyie0T4P9E0ZUaIvX8LyJxYFHFKCt8Zk7Sm/XPQ==", + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/it-ws/-/it-ws-6.1.3.tgz", + "integrity": "sha512-nIMAXDflcMjojc7gBHHOj5nsTOTSAb7TWSXZPNQWhb7ezBfV05TuiCXt9Z86jjbFy4cgqyUz5XJLeSU1nbhw5w==", "dependencies": { "@types/ws": "^8.2.2", "event-iterator": "^2.0.0", @@ -1747,9 +1747,9 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/multiformats": { - "version": "13.1.3", - "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.1.3.tgz", - "integrity": "sha512-CZPi9lFZCM/+7oRolWYsvalsyWQGFo+GpdaTmjxXXomC+nP/W1Rnxb9sUgjvmNmRZ5bOPqRAl4nuK+Ydw/4tGw==" + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/multiformats/-/multiformats-13.2.1.tgz", + "integrity": "sha512-83SyOLC30MyJtUt92LBeOmiEC4MQX7Xm25kBW70k92e6Ec+E+z1UfgCOuKABQ/30I/kgGS9A+rguJRSXYNZ86Q==" }, "node_modules/murmurhash3js-revisited": { "version": "3.0.0", @@ -1846,9 +1846,9 @@ "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" }, "node_modules/postcss": { - "version": "8.4.39", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", - "integrity": "sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==", + "version": "8.4.40", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.40.tgz", + "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", "funding": [ { "type": "opencollective", @@ -2026,9 +2026,9 @@ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/vite": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.4.tgz", - "integrity": "sha512-Cw+7zL3ZG9/NZBB8C+8QbQZmR54GwqIz+WMI4b3JgdYJvX+ny9AjJXqkGQlDXSXRP9rP0B4tbciRMOVEKulVOA==", + "version": "5.3.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.5.tgz", + "integrity": "sha512-MdjglKR6AQXQb9JGiS7Rc2wC6uMjcm7Go/NHNO63EwiJXfuk9PgqiP/n5IDJCziMkfw9n4Ubp7lttNwz+8ZVKA==", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.39", diff --git a/package.json b/package.json index f96743a..56919a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "digifall", - "version": "0.9.1", + "version": "0.9.2", "type": "module", "scripts": { "dev": "vite --host", @@ -24,6 +24,6 @@ "libp2p": "1.8.1", "svelte": "4.2.18", "uint8arrays": "5.1.0", - "vite": "5.3.4" + "vite": "5.3.5" } } diff --git a/src/App.svelte b/src/App.svelte index 206840d..3e6ffa8 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -2,34 +2,33 @@ import Game from "./Game.svelte"; import Overlay from "./Overlay.svelte"; - import { OVERLAYS, PHASES } from "./constants.js"; + import { RELOAD_IN_SEC, OVERLAYS, PHASES } from "./constants.js"; import { energy, overlay, phase, seed } from "./stores.js"; let gameComponent = null; let overlayComponent = null; - /** - * Reloading page 1 time in day just in case - */ - setTimeout(() => (location = location), 86400000); + if (RELOAD_IN_SEC > 0) { + setTimeout(() => (location = location), RELOAD_IN_SEC * 1e3); + } onstorage = function syncTabs() { if (document.hasFocus()) return; document.location = document.location; }; - function updatePixelSize() { + function updateRem() { const { style, offsetHeight, offsetWidth } = document.documentElement; const ratio = offsetHeight / offsetWidth; const landscape = ratio < 1.5; const size = landscape ? offsetHeight / 192 : offsetWidth / 128; const diff = size % 0.25; - style.setProperty("--pixel", size - diff + "px"); + style.setProperty("font-size", size - diff + "px"); } - updatePixelSize(); - onresize = updatePixelSize; - document.addEventListener("visibilitychange", updatePixelSize); + updateRem(); + onresize = updateRem; + document.addEventListener("visibilitychange", updateRem); function manageRandomColorClass(value) { document.documentElement.classList[value ? "add" : "remove"]( diff --git a/src/Leaderboard.svelte b/src/Leaderboard.svelte index a6d51a2..cf8f552 100644 --- a/src/Leaderboard.svelte +++ b/src/Leaderboard.svelte @@ -1,14 +1,14 @@