-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
134 lines (134 loc) · 3.95 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<meta name="viewport" content="width=640">
<title>Crealaxian - simple js game</title>
<style>
@font-face {
font-family: '8bit';
src: url('assets/fonts/PressStart2P.ttf');
}
* {
margin: 0;
padding: 0;
}
body {
background: url('assets/img/cc-game-bg.jpg');
background-position: center;
background-size: cover;
width: 100%;
min-height: 100vh;
text-align: center;
padding: 50px;
box-sizing: border-box;
}
#game {
text-align: center;
font-family: "8bit";
position: relative;
display: inline-block;
outline: 0;
}
#game > canvas {
/* box-shadow: 0px 0px 30px 0px rgba(255, 255, 255, 0.5); */
}
#game > start_button {
width: 128px;
height: 64px;
border: 3px solid #6c962a;
color: #d1ff00;
cursor: pointer;
position: absolute;
bottom: 50px;
left: calc(50% - 67px);
background: transparent;
line-height: 64px;
text-align: center;
font-size: 16px;
}
#game > start_button:hover {
background: #6c962a;
border-color: #d1ff00;
color: #fff;
}
#game > gameover {
color: #ffffff;
position: absolute;
top: calc(50% - 28px);
left: calc(50% - 250px);
text-align: center;
font-size: 56px;
}
#game > restart_button {
width: 172px;
height: 64px;
border: 3px solid #c05f62;
color: #ca8888;
cursor: pointer;
position: absolute;
bottom: 50px;
left: calc(50% - 86px);
background: transparent;
line-height: 64px;
text-align: center;
font-size: 16
}
#game > restart_button:hover {
background: #c05f62;
border-color: #ca8888;
color: #fff;
}
lives {
position: absolute;
top: 10px;
left: 10px;
color: #fff;
}
lives span {
display: inline-block;
width: 12px;
height: 16px;
margin-right: 6px;
background: transparent url('assets/img/sprites2.png') no-repeat 0 -93px;
}
score {
position: absolute;
top: 10px;
right: 10px;
width: 165px;
padding-top: 20px;
color: #fff;
text-align: right;
font-size: 16px;
}
score:before {
position: absolute;
top: 0;
right: 0;
content: 'YOUR SCORE';
color: #6c962a;
}
.gh_ribbon {
position: absolute;
top: 0px;
right: 0px;
}
</style>
</head>
<body>
<div id="game"></div>
<!-- Github ribbon -->
<a href="https://github.com/dvs-crcr/ts-crealaxian" target="blank" class="gh_ribbon"><img loading="lazy" width="149" height="149" src="https://github.blog/wp-content/uploads/2008/12/forkme_right_red_aa0000.png?resize=149%2C149" class="attachment-full size-full" alt="Fork me on GitHub" data-recalc-dims="1"></a>
<!-- Подключаем скрипт с игрой -->
<script src="dist/game.js"></script>
<!-- Задаем габариты холста и указывааем ID контейнера -->
<script>
var Crealaxian = new CrealaxianGame('game', {
width: 640,
height: 480
})
</script>
</body>
</html>