-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.php
151 lines (117 loc) · 3.44 KB
/
game.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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Game</title>
<style type="text/css">
#imageFond {
position:relative
}
#imageCentreFond {
position: absolute;
left: 725px;
top: 325px;
z-index: : 1;
}
#buttons {
position: absolute;
left: 10px;
top: 5px;
}
#players{
position: absolute;
width:1600px;height:615px;
left: 20px;
top: 25px;
display: grid;
grid-template-columns: repeat(1600,1px);
grid-template-rows: repeat(800,1px);
}
#south{
display: flex;
justify-content: center;
align-items: center;
grid-column: 100 / 1500;
grid-row: 600/800;
position: relative;
}
#north{
display: flex;
justify-content: center;
align-items: center;
grid-column: 100 / 1500;
grid-row: 1/151;
}
#west{
display: flex;
justify-content: center;
align-items: center;
grid-column: 1 / 151;
grid-row: 100/800;
}
#east{
display: flex;
justify-content: center;
align-items: center;
grid-column: 1450 / 1600;
grid-row: 100/800;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript" src="./statics/js/game.js" defer></script>
<script type="text/javascript">
window.onload = function () {
$.ajax({
url: 'addUser.php?idRoom=' +<?php echo $_GET['idRoom'];?> +"&username=" +'<?php echo $_GET['username'];?>',
type: "post",
async:false,
data: {},
success: function (data) {
console.log(data);
}
});
var modele = new CModele(<?php echo $_GET['idRoom'];?>,'<?= $_GET["username"] ?>');
var vue = new CVue(modele);
setInterval( ()=>{vue.notifier()},500);
console.log("json add");
// alert("hello world");
}
window.onbeforeunload = function () {
console.log("exit");
$.ajax({
url: 'deleUser.php?idRoom=' +<?php echo $_GET['idRoom'];?> +"&username=" +'<?php echo $_GET['username'];?>',
type: "post",
async:true,
data: {},
success: function (data) {
console.log(data);
}
});
return "close web";
}
</script>
</head>
<body>
<div id="compte">
<p> <?= $_GET["username"] ?> <br> dans la chambre <?= $_GET["idRoom"] ?> </p>
</div>
<div id="a">
<div id="imageFond">
<div id="imageCentreFond"></div>
<div id="buttons"></div>
<div id="players">
<div id="north">
<div id="chatRoomFond"></div>
</div>
<div id="west"></div>
<div id="east"></div>
<div id="south"></div>
<div id ="noteTable">
<div id = "webLeft"></div>
<div id = "webRight"></div>
</div>
</div>
</div>
</div>
</body>
</html>