Transforme l'accueil et sépare l'application
This commit is contained in:
15
app.js
15
app.js
@@ -1,4 +1,5 @@
|
||||
const PAGE = document.body.dataset.page;
|
||||
const SETUP_PAGE = "application.html";
|
||||
|
||||
const STORAGE_KEY = "chesscubing-arena-state-v2";
|
||||
const WINDOW_NAME_KEY = "chesscubing-arena-state-v2:";
|
||||
@@ -178,7 +179,7 @@ function initSetupPage() {
|
||||
|
||||
function initChronoPage() {
|
||||
if (!match) {
|
||||
replaceTo("index.html");
|
||||
replaceTo(SETUP_PAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -314,7 +315,7 @@ function initChronoPage() {
|
||||
|
||||
refs.arbiterResetButton?.addEventListener("click", () => {
|
||||
clearMatch();
|
||||
replaceTo("index.html");
|
||||
replaceTo(SETUP_PAGE);
|
||||
});
|
||||
|
||||
function handleChronoTap(color) {
|
||||
@@ -344,7 +345,7 @@ function initChronoPage() {
|
||||
syncRunningState(match);
|
||||
|
||||
if (match.result) {
|
||||
navigateTo("index.html");
|
||||
navigateTo(SETUP_PAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -500,7 +501,7 @@ function initChronoPage() {
|
||||
|
||||
function initCubePage() {
|
||||
if (!match) {
|
||||
replaceTo("index.html");
|
||||
replaceTo(SETUP_PAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -564,7 +565,7 @@ function initCubePage() {
|
||||
|
||||
refs.primaryButton?.addEventListener("click", () => {
|
||||
if (match.result) {
|
||||
navigateTo("index.html");
|
||||
navigateTo(SETUP_PAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -596,7 +597,7 @@ function initCubePage() {
|
||||
|
||||
refs.resetButton?.addEventListener("click", () => {
|
||||
clearMatch();
|
||||
replaceTo("index.html");
|
||||
replaceTo(SETUP_PAGE);
|
||||
});
|
||||
|
||||
function handleCubeTap(color) {
|
||||
@@ -1384,7 +1385,7 @@ function resultText(storedMatch) {
|
||||
|
||||
function routeForMatch(storedMatch) {
|
||||
if (!storedMatch) {
|
||||
return "index.html";
|
||||
return SETUP_PAGE;
|
||||
}
|
||||
|
||||
return storedMatch.phase === "cube" && !storedMatch.result ? "cube.html" : "chrono.html";
|
||||
|
||||
Reference in New Issue
Block a user