89 lines
4.4 KiB
HTML
89 lines
4.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<!-- TODO: Not fully covnerted into templates -->
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Silkscreen&family=VT323&display=swap" rel="stylesheet">
|
|
<!-- <link rel="stylesheet" href="style.css"> -->
|
|
<link rel="stylesheet" href="{{ url_for('static', filename='Space-Impact-Web/style.css') }}">
|
|
<title>Space Impact Web</title>
|
|
</head>
|
|
|
|
<body>
|
|
<nav>
|
|
<img src="{{ url_for('static', filename='Space-Impact-Web/img/logo.png') }}" alt="logo" id="logo">
|
|
</nav>
|
|
|
|
<div id="game">
|
|
<canvas id="canvas-bg">Your browswer doesn't support HTML Canvas</canvas>
|
|
<canvas id="canvas-main"></canvas>
|
|
<button id="pause-button">Pause</button>
|
|
<button class="ingame-button" id="play">Play</button>
|
|
<button class="ingame-button" id="exit">Exit</button>
|
|
</div>
|
|
<div class="toggle-container">
|
|
<span>On-screen Buttons:</span>
|
|
<div class="toggle">
|
|
<div class="toggle-ball"></div>
|
|
</div>
|
|
</div>
|
|
<div id="info">
|
|
<h2 class="info-head">Controls:</h3>
|
|
<div class="controls">
|
|
<div class="control-wrapper">
|
|
<div class="action">Move:</div>
|
|
<!-- <img id="arrows" src="./img/arrowKeys.png" alt="arrow keys"> -->
|
|
<img id="arrows" src="{{ url_for('static', filename='Space-Impact-Web/img/arrowKeys.png') }}" alt="arrow keys">
|
|
</div>
|
|
<div class="control-wrapper">
|
|
<div class="action">Fire:</div>
|
|
<!-- <img id="space" src="./img/spacebar.png" alt="spacebar"> -->
|
|
<img id="space" src="{{ url_for('static', filename='Space-Impact-Web/img/spacebar.png') }}" alt="spacebar">
|
|
</div>
|
|
<div class="control-wrapper">
|
|
<div class="action">Special:</div>
|
|
<!-- <img id="xKey" src="./img/special.png" alt="X key"> -->
|
|
<img id="xKey" src="{{ url_for('static', filename='Space-Impact-Web/img/special.png') }}" alt="X key">
|
|
</div>
|
|
</div>
|
|
<h2 class="desc-head">Description:</h2>
|
|
<p class="desc">Shoot down the enemy ships and survive all 8 levels.</p>
|
|
</div>
|
|
<div class="buttons-onscreen" oncontextmenu="return false">
|
|
<button type="button" id="button-left" class="button"><img src="{{ url_for('static', filename='Space-Impact-Web/img/buttonLeft.png') }}" alt=""></button>
|
|
<button type="button" id="button-up" class="button"><img src="{{ url_for('static', filename='Space-Impact-Web/img/buttonUp.png') }}" alt=""></button>
|
|
<button type="button" id="button-right" class="button"><img src="{{ url_for('static', filename='Space-Impact-Web/img/buttonRight.png') }}" alt=""></button>
|
|
<button type="button" id="button-down" class="button"><img src="{{ url_for('static', filename='Space-Impact-Web/img/buttonDown.png') }}" alt=""></button>
|
|
<button type="button" id="button-fire" class="button"><img src="{{ url_for('static', filename='Space-Impact-Web/img/buttonFire.png') }}" alt=""></button>
|
|
<button type="button" id="button-x" class="button"><img src="{{ url_for('static', filename='Space-Impact-Web/img/buttonX.png') }}" alt=""></button>
|
|
</div>
|
|
|
|
<script>
|
|
const toggleBar = document.querySelector(".toggle");
|
|
const toggleBall = document.querySelector(".toggle-ball");
|
|
const buttons = document.querySelector(".buttons-onscreen");
|
|
const info = document.querySelector("#info");
|
|
let flag = false;
|
|
toggleBar.addEventListener("click", () => {
|
|
toggleBar.classList.toggle("toggle-on");
|
|
toggleBall.classList.toggle("toggle-ball-on");
|
|
flag = !flag;
|
|
if (flag) {
|
|
buttons.style.display = "inline-block";
|
|
info.style.display = "none";
|
|
} else {
|
|
buttons.style.display = "none";
|
|
info.style.display = "inline-block";
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<script src="{{ url_for('static', filename='Space-Impact-Web/game.js') }}"></script>
|
|
</body>
|
|
|
|
</html>
|