Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Change homepage to use query params
Browse files Browse the repository at this point in the history
+ Fix multiplayer info not being sent to play page
  • Loading branch information
Nixinova committed May 13, 2021
1 parent 2319f59 commit 81d54c4
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 13 deletions.
8 changes: 4 additions & 4 deletions _redirects
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/ menu=bot /menu/bot/
/ menu=offline /menu/offline/
/ menu=online /menu/online/
/ /menu/
/ menu=bot /menu/bot/ 200
/ menu=offline /menu/offline/ 200
/ menu=online /menu/online/ 200
/ /menu/index 200
2 changes: 1 addition & 1 deletion layouts/menu.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</head>

<body>
<a href="/menu/">
<a href="/">
<img id="logo" src="/assets/logo.svg" height="65px">
</a>

Expand Down
2 changes: 1 addition & 1 deletion pages/home/bot.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ <h2>Bot colour</h2>
</div>

<div style="display: flex;">
<a href="/menu/" id="back" class="card wide">
<a href="/" id="back" class="card wide">
Back
</a>
<button type="submit" id="play" class="card wide">
Expand Down
6 changes: 3 additions & 3 deletions pages/home/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ <h2>Select opponent</h2>

<div class="cards">

<a href="/menu/bot" class="card big">
<a href="/?menu=bot" class="card big">
<img src="/assets/icons/computer.svg" class="card-image" height="100px">
<span class="card-heading">Computer</span>
<span class="card-description">Play against the computer</span>
</a>

<a href="/menu/offline" class="card big">
<a href="/?menu=offline" class="card big">
<img src="/assets/icons/offline.svg" class="card-image" height="100px">
<span class="card-heading">Offline</span>
<span class="card-description">Play against someone on the same device</span>
</a>

<a href="/menu/online" class="card big">
<a href="/?menu=online" class="card big">
<img src="/assets/icons/online.svg" class="card-image" height="100px">
<span class="card-heading">Online</span>
<span class="card-description">Play against someone anywhere in the world</span>
Expand Down
2 changes: 1 addition & 1 deletion pages/home/offline.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h3>Game options</h3>
</div>

<div style="display: flex;">
<a href="/menu/" id="back" class="card wide">
<a href="/" id="back" class="card wide">
Back
</a>
<button type="submit" id="play" class="card wide">
Expand Down
4 changes: 2 additions & 2 deletions pages/home/online.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<form action="/play" method="GET">

<input readonly type="checkbox" name="multiplayer" class="hide">
<input readonly type="checkbox" checked name="multiplayer" class="hide">

<h2>Online</h2>
<h3>Game Code</h3>
Expand All @@ -15,7 +15,7 @@ <h3>Game Code</h3>
</button>

<div style="display: flex;">
<a href="/menu/" id="back" class="card wide">
<a href="/" id="back" class="card wide">
Back
</a>
<button type="submit" id="play" class="card wide">
Expand Down
1 change: 1 addition & 0 deletions pages/play.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<script src="/scripts/play/bot.js"></script>
<script src="/scripts/play/fen.js"></script>
<script src="/scripts/play/game-cycle.js"></script>
<script src="/scripts/play/online.js"></script>
<script src="/scripts/play/pagelog.js"></script>
<script src="/scripts/play/pieces.js"></script>
<script src="/scripts/play/validation.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion styles/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ input[type="text"] {
}

.card.big {
margin: 1em;
height: 250px;
width: 250px;
border-radius: 0;
border-radius: 1em;
}
@media (min-width: 600px) {
.card.big {
Expand Down

0 comments on commit 81d54c4

Please sign in to comment.