-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make 404 redirect to game w/ url info
- Loading branch information
1 parent
49c6fb1
commit 5a71d84
Showing
2 changed files
with
17 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,19 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="pragma" content="no-cache" /> | ||
<meta http-equiv="expires" content="0" /> | ||
<meta | ||
http-equiv="cache-control" | ||
content="no-cache, no-store, must-revalidate" | ||
/> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + TS</title> | ||
</head> | ||
|
||
<body> | ||
TEST | ||
<div class="take-up-viewport shelf-flex"> | ||
<div id="info" class="flex-grow-and-shrink"> | ||
<div id="log"></div> | ||
</div> | ||
<div id="game-wrapper" class="flex-grow-and-shrink"> | ||
<canvas id="game" class="flex-end"></canvas> | ||
</div> | ||
</div> | ||
|
||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
<head> | ||
<title>Loading...</title> | ||
<script type="text/javascript"> | ||
// When the 404 page loads | ||
document.addEventListener('DOMContentLoaded', function() { | ||
// Get the current URL | ||
var currentUrl = window.location.href; | ||
|
||
// Redirect to the game page and pass the original URL as a query parameter | ||
window.location.href = '/minigames?' + encodeURIComponent(currentUrl.split('/')[currentUrl.length - 1]); | ||
}); | ||
</script> | ||
</head> | ||
<body> | ||
<p>Just a moment...</p> | ||
</body> | ||
</html> |