Skip to content

Commit

Permalink
0.9.2 : Force sync
Browse files Browse the repository at this point in the history
  • Loading branch information
shlavik committed Jul 26, 2024
1 parent 6e3f3ce commit 0faa230
Show file tree
Hide file tree
Showing 11 changed files with 1,219 additions and 1,261 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
36 changes: 18 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 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 @@ -24,6 +24,6 @@
"libp2p": "1.8.1",
"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 0faa230

Please sign in to comment.