-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
82 lines (72 loc) · 2.82 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
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>Screener-to-phaser Port</title>
<script src="phaser.min.js"></script>
<script src="logger.js"></script>
<script src="styles.js"></script>
<script src="stimuli.js"></script>
<script src="clock.js"></script>
<script src="difficulty.js"></script>
<script src="practice.js"></script>
<script src="randomizer.js"></script>
<script src="Boot.js"></script>
<script src="Preloader.js"></script>
<script src="instructions.js"></script>
<script src="circles.js"></script>
<script src="sessions.js"></script>
<script src="common.js"></script>
<script src="symbolic.js"></script>
<script src="nonsymbolic.js"></script>
<script src="ordinality.js"></script>
<script src="number_to_line.js"></script>
<script src="https://www.gstatic.com/firebasejs/3.4.1/firebase.js"></script>
</head>
<script>
// Initialize Firebase
var config = {
apiKey: "AIzaSyDhe-myTpw0J-69sFmTlLtpe_-ZrVgUmdo",
authDomain: "daos-84628.firebaseapp.com",
databaseURL: "https://daos-84628.firebaseio.com",
storageBucket: "daos-84628.appspot.com",
messagingSenderId: "922274621965"
};
firebase.initializeApp(config);
</script>
<script>
window.onload = function () {
// Listening for auth state changes.
// [START authstatelistener]
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
//create your phaser stuff
var game = new Phaser.Game(1024, 768, Phaser.CANVAS, 'gameContainer');
game.state.add('Boot', Game.Boot);
game.state.add('Preloader', Game.Preloader);
game.state.add('symbolic', Game.Symbolic);
game.state.add('nonsymbolic', Game.NonSymbolic);
game.state.add('ordinality', Game.Ordinality);
game.state.add('number_to_line', Game.Number_To_Line);
window.game = game;
var users = firebase.database().ref('users/' + user.uid + '/current_task' );
//users.once('value').then(function(snapshot) {
users.once('value').then(function(snapshot){
current_task = snapshot.val();
//current_task = snapshot.val().current_task;
if (current_task != null) {
// Now start the Boot state.
game.state.start('Boot', true,false, current_task);
} else {
begin_session();
}
});
} else {
window.location = 'login.html';
}
});
}
</script>
<body>
</body>
</html>