mirror of
https://github.com/MaciejkaG/statki.git
synced 2024-11-30 04:42:55 +01:00
MaciejkaG
a212161733
- Improved PWA support on mobile. - Added Vs. AI game menu. - Added the first AI algorithm. - Vs. AI is now available with every option leading to simple bot - Fixed a bug where placing ships in certain rotation around the boundaries of the board would wrongly colour them when sunk. - Improved code clarity and comments - Added an option in the settings to change your nickname - Added version display in the settings - Slightly improved box scaling and layout - Made multiple improvements to the PWA support - Added multiple minor features - Brought back full SPA URL functionality, now if you copy a URL to specific view/page in the menu and go into it, you will actually arrive at that page if it's not restricted.
99 lines
5.0 KiB
Handlebars
99 lines
5.0 KiB
Handlebars
<div class="cover">
|
|
<h1 class="title">{{ t 'board.Connecting' }}</h1>
|
|
<div class="dialog">
|
|
<h1 id="state"></h1>
|
|
<h3 id="opponent"></h3>
|
|
<button onclick="window.location.href = '/'">{{ t 'board.Back to menu' }}</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="container" id="gameView">
|
|
<div>
|
|
<h1>Statki</h1>
|
|
<div class="panelContainer">
|
|
<div class="shapes">
|
|
<div class="ownBoardInfo">
|
|
<h3>{{ t 'board.Selected ship' }}</h3>
|
|
<h2 class="dynamic" id="selectedShip">{{ t 'board.Single-masted' }}</h2>
|
|
<h3>{{ t 'board.Available:' }} <span class="dynamic danger" id="shipsLeft">-</span></h3>
|
|
</div>
|
|
<div class="lateBoardInfo">
|
|
<h3>{{ t 'board.To sunk' }}</h3>
|
|
<p>
|
|
{{ t 'board.Single-mastedPlu' }} <span class="dynamic shipnote" id="singlemasted">4</span><br>
|
|
{{ t 'board.Two-mastedPlu' }} <span class="dynamic shipnote" id="twomasted">3</span><br>
|
|
{{ t 'board.Three-mastedPlu' }} <span class="dynamic shipnote" id="threemasted">2</span><br>
|
|
{{ t 'board.Four-mastedPlu' }} <span class="dynamic shipnote" id="fourmasted">1</span><br>
|
|
</p>
|
|
<h3>{{ t 'board.Your accuracy' }}</h3>
|
|
<h2 id="accuracy">-</h2>
|
|
</div>
|
|
<span class="break"></span>
|
|
<div class="controls">
|
|
<h2>{{ t 'board.Controls' }}</h2>
|
|
<h3 class="controlsOwnBoard"><span class="important">S</span> {{ t 'board.Change ship' }}</h3>
|
|
<h3 class="controlsOwnBoard"><span class="important">R</span> {{ t 'board.Rotate ship' }}</h3>
|
|
<h3 class="boardSwitch"><span class="important">B</span> {{ t 'board.Change boards' }}</h3>
|
|
</div>
|
|
<div class="mobileControls">
|
|
<button class="controlsOwnBoard" onclick="switchShips()">{{ t 'board.Change ship' }}</button>
|
|
<button class="boardSwitch" onclick="switchBoards()">{{ t 'board.Change boards' }}</button>
|
|
</div>
|
|
<span class="break"></span>
|
|
<button class="readyButton" onclick="readyUp()">{{ t 'board.Ready up' }}</button>
|
|
<h3><span class="dynamic" id="whosTurn"></span></h3>
|
|
<h2 class="important" id="timer">∞</h2>
|
|
</div>
|
|
<div class="boardContainer">
|
|
<div class="board" id="board" oncontextmenu="return false;"></div>
|
|
<div class="board" id="secondaryBoard" class="secondary" oncontextmenu="return false;"></div>
|
|
</div>
|
|
<div class="spaceFiller"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="mainTippyTemplate" class="tippyTemplate">
|
|
<button class="tippyBtn" style="background-color: var(--dynamic)" onclick="manualPlace([[FIELDPOS]])"><span class="material-symbols-outlined">place_item</span></button>
|
|
<button class="tippyBtn" style="background-color: var(--important)" onclick="switchRotation()"><span class="material-symbols-outlined">refresh</span></button>
|
|
</div>
|
|
|
|
<div id="removeTippyTemplate" class="tippyTemplate">
|
|
<button class="tippyBtn" style="background-color: var(--danger)" onclick="manualRemove([[FIELDPOS]])"><span class="material-symbols-outlined">delete</span></button>
|
|
</div>
|
|
|
|
<div id="secondaryTippyTemplate" class="tippyTemplate">
|
|
<button class="tippyBtn" style="background-color: var(--danger)" onclick="manualShoot([[FIELDPOS]])"><span class="material-symbols-outlined">ads_click</span></button>
|
|
</div>
|
|
|
|
<script>
|
|
window.locale = {
|
|
"Waiting for the server": "{{ t 'board.Waiting for the server' }}",
|
|
|
|
"Reconnecting": "{{ t 'errors.Reconnecting' }}",
|
|
"Reconnected": "{{ t 'errors.Reconnected' }}",
|
|
"Reconnection error occured": "{{ t 'errors.Reconnection error occured' }}",
|
|
"Reconnection failed": "{{ t 'errors.Reconnection failed' }}",
|
|
"Disconnected": "{{ t 'errors.Disconnected' }}",
|
|
"Try to refresh the page if this error reoccurs": "{{ t 'errors.Try to refresh the page if this error reoccurs' }}",
|
|
"Connection error": "{{ t 'errors.Connection error' }}",
|
|
|
|
"Single-masted": "{{ t 'board.Single-masted' }}",
|
|
"Two-masted": "{{ t 'board.Two-masted' }}",
|
|
"Three-masted": "{{ t 'board.Three-masted' }}",
|
|
"Four-masted": "{{ t 'board.Four-masted' }}",
|
|
|
|
"Victory": "{{ t 'board.Victory' }}",
|
|
"Defeat": "{{ t 'board.Defeat' }}",
|
|
|
|
"Preparation phase": "{{ t 'board.Preparation phase' }}",
|
|
"Your turn": "{{ t 'board.Your turn' }}",
|
|
"Opponents turn": "{{ t 'board.Opponents turn' }}",
|
|
};
|
|
</script>
|
|
|
|
<script src="/assets/js/battleships-lib.js"></script>
|
|
<script src="/assets/js/main.js"></script>
|
|
<script src="/assets/js/key-handling.js"></script>
|
|
<script src="/assets/js/socket-game.js"></script>
|
|
<script src="/assets/js/socket-err-handler.js"></script> |