-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsame.html
55 lines (43 loc) · 1.15 KB
/
same.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
<html>
</html>
<body>
<button onclick="left()">left </button>
<button onclick="right()">right </button>
<button onclick="up()">up </button>
<button onclick="down()">down </button>
</body>
<script src="https://www.gstatic.com/firebasejs/3.7.0/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyDvpv2wrDQEwHsBPUGzC5IDU4Io9PzHXAk",
authDomain: "memebot-a1790.firebaseapp.com",
databaseURL: "https://memebot-a1790.firebaseio.com",
storageBucket: "memebot-a1790.appspot.com",
messagingSenderId: "571304217602"
};
firebase.initializeApp(config);
var same = "";
let childUpdates = ["thing"]
var updates = {};
function left(){
same = "left"
updates['/move'] = same;
firebase.database().ref().update(updates);
}
function right(){
same = "right"
updates['/move'] = same;
firebase.database().ref().update(updates);
}
function down(){
same = "down"
updates['/move'] = same;
firebase.database().ref().update(updates);
}
function up(){
same = "up"
updates['/move'] = same;
firebase.database().ref().update(updates);
}
</script>