Skip to content

Commit

Permalink
0.9.2 : Sync fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shlavik committed Aug 3, 2024
1 parent 6e3f3ce commit 6f1e63f
Show file tree
Hide file tree
Showing 12 changed files with 1,482 additions and 1,489 deletions.
569 changes: 569 additions & 0 deletions backup/highCombo.json

Large diffs are not rendered by default.

569 changes: 569 additions & 0 deletions backup/highScore.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" translate="no">
<head>
<meta charset="utf-8" />
<meta name="description" content="Entropy fighting mathematactic game" />
Expand Down
505 changes: 269 additions & 236 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "digifall",
"version": "0.9.1",
"version": "0.9.2",
"type": "module",
"scripts": {
"dev": "vite --host",
Expand All @@ -9,21 +9,21 @@
},
"dependencies": {
"@chainsafe/libp2p-gossipsub": "13.1.0",
"@libp2p/bootstrap": "10.1.2",
"@libp2p/circuit-relay-v2": "1.1.2",
"@libp2p/identify": "2.1.2",
"@libp2p/mplex": "10.1.2",
"@libp2p/peer-id-factory": "4.2.1",
"@libp2p/plaintext": "1.1.2",
"@libp2p/bootstrap": "10.1.4",
"@libp2p/circuit-relay-v2": "1.1.4",
"@libp2p/identify": "2.1.4",
"@libp2p/mplex": "10.1.4",
"@libp2p/peer-id-factory": "4.2.3",
"@libp2p/plaintext": "1.1.4",
"@libp2p/pubsub-peer-discovery": "10.0.2",
"@libp2p/websockets": "8.1.2",
"@libp2p/websockets": "8.1.4",
"@sveltejs/vite-plugin-svelte": "3.1.1",
"howler": "2.2.4",
"idb-keyval": "6.2.1",
"it-pipe": "3.0.1",
"libp2p": "1.8.1",
"libp2p": "1.8.3",
"svelte": "4.2.18",
"uint8arrays": "5.1.0",
"vite": "5.3.4"
"vite": "5.3.5"
}
}
19 changes: 9 additions & 10 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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"](
Expand Down
6 changes: 3 additions & 3 deletions src/Leaderboard.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<script>
import { blur, fly } from "svelte/transition";
import { KEYS, OVERLAYS } from "./constants.js";
import { compare, leaderboardStores, maxSize } from "./leaderboard.js";
import { MAX_RECORDS, KEYS, OVERLAYS } from "./constants.js";
import { compare, leaderboardStores } from "./leaderboard.js";
import { options, overlay } from "./stores.js";
const pageSize = 9;
let page = 0;
const pageCounts = Math.ceil(maxSize / pageSize);
const pageCounts = Math.ceil(MAX_RECORDS / pageSize);
let type = KEYS.highScore;
let pagePrev = page;
Expand Down
Loading

0 comments on commit 6f1e63f

Please sign in to comment.