-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
58 lines (58 loc) · 2.03 KB
/
index.php
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
<!DOCTYPE html>
<html>
<head>
<?php
function isMobile() {
return preg_match("/(android|avantgo|blackberry|bolt|boost|cricket|docomo|fone|hiptop|mini|mobi|palm|phone|pie|tablet|up\.browser|up\.link|webos|wos)/i", $_SERVER["HTTP_USER_AGENT"]);
}
?>
<title>Snake</title>
<link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body>
<div class="page-container">
<?php
if(isMobile()){
?>
<div class="control-panel">
<div class="control-row">
<div class="control-button">
<div id="upButton" class="button-layer"></div>
<div class="button-area"></div>
</div>
</div>
<div class="control-row">
<div class="control-button">
<div id="downButton" class="button-layer"></div>
<div class="button-area"></div>
</div>
</div>
</div>
<?php
}
?>
<div class="game-panel">
<canvas id="gameCanvas"></canvas>
</div>
<?php
if(isMobile()){
?>
<div class="control-panel">
<div class="control-row">
<div class="control-button">
<div id="leftButton" class="button-layer"></div>
<div class="button-area"></div>
</div>
<div class="control-button">
<div id="rightButton" class="button-layer"></div>
<div class="button-area"></div>
</div>
</div>
</div>
<?php
}
?>
</div>
<script type="module" src="js/snakeGame.js"></script>
</body>
</html>