-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
97 lines (89 loc) · 3.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pong Typescript Demo | Colors of code</title>
<script type="module" src="pong.ts"></script>
<base href="https://colorsofcode.github.io/pong-typescript-game-development/">
<link rel="stylesheet" href="assets/robot/robot.styles.css">
</head>
<body>
<style>
@font-face {
font-family: "Pong Font";
src: url("assets/fonts/retro_font.ttf") format("truetype");
}
body {
font-family: "Pong Font";
background: #1071bc;
background-image: url(./assets/images/grid-pattern.png);
display: flex;
align-items: center;
color: white;
flex-direction: column;
}
a {
color: white;
}
img {
image-rendering: pixelated;
}
canvas {
position: absolute;
top: 142px;
left: 136px;
}
.game-demo {
position: relative;
}
.footer {
opacity: 0.7;
text-align: center;
}
.binary {
font-size: 0.6rem;
}
.binary::selection {
color: black;
background: white;
}
</style>
<div class="game-demo">
<!-- Animate sprite -->
<div class="computer">
<audio data-audio="game-start">
<source src="./assets/sounds/game-start.mp3" type="audio/mp3" />
</audio>
<audio data-audio="paddle-hit">
<source src="./assets/sounds/paddle_hit.wav" type="audio/wav" />
</audio>
<audio data-audio="wall-hit">
<source src="./assets/sounds/wall_hit.wav" type="audio/wav" />
</audio>
<audio data-audio="win-sound">
<source src="./assets/sounds/win_sound.wav" type="audio/wav" />
</audio>
<img class="sprite" src="./assets/robot/robot.sprite.png" alt="Computer spritesheet" >
</div>
<!-- Pong game -->
<canvas is="pong-game"></canvas>
</div>
<p>
Press Space to start (⚠️ will play sound). Use W and S to move the paddle
</p>
<footer class="footer">
<p>MIT License Copyright (C) 2022 Colors of code.
<a href="https://github.com/colorsofcode/pong-typescript-game-development" target="_blank" title="Pong Typescript Github repository">Github</a>
.
<a href="https://twitter.com/colorsofcode" target="_blank" title="Twitter account of Colors of code">Twitter</a>
</p>
<p>Pixelart is Copyright (C) 2022 Woostar.
<a href="https://twitter.com/WoostarsPixels" target="_blank" title="Twitter account of Woostar">Twitter</a>
</p>
<p class="binary">
01110010 01100101 01101101 01100101 01101101 01100010 01100101 01110010 00100000 01110100 01101111 <br>
00100000 01101100 01101111 01110110 01100101 00001101 00001010 00001101 00001010 00001101 00001010
</p>
</footer>
</body>