-
Notifications
You must be signed in to change notification settings - Fork 5
/
home.html
129 lines (99 loc) · 4.31 KB
/
home.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-beta1/jquery.js"></script>
<script type="text/javascript" src="js/jquery.mobile-events.js"></script>
<script src="js/gatt.js"></script>
<script src="js/setBit.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="css/slotmachine.css"></link>
<link rel="stylesheet" type="text/css" href="css/stylesheet.css"></link>
<link rel="stylesheet" type="text/css" href="css/controllers.css"></link>
<title>Physical Web Toy</title>
</head>
<body>
<div id="orientation-message">
<div>Vennligst snu enheten 90°</div>
</div>
<div id="connectionStatus">Status</div>
<div id="fullscreen" onclick="">Klikk for fullskjerm</div>
<div class="column">
<div class="panel">
<a href='home.html'><div class="menu" id="home">Home</div></a>
<a href='joy.html'><div class="menu" id="settings">Main</div></a>
<a href='about.html'><div class="menu" id="about">About</div></a>
</div>
<div class="pull-down-menu">Menu</div>
<h1>Welcome to Physical Web Toy!</h1>
<p id="welcome">You can now connect to a robot car in your vicinity, control it using your smart device
and play laser tag with other people!</p>
<h2 onclick="game_init();" id='connect'>Connect</h2>
<h2 onclick="disconnect();" id='disconnect'>Disconnect</h2>
</div>
<div id="footer">
<a href="https://google.github.io/physical-web/"><img src="pics/physical_web_logo.png" class="imglink"></img></a>
<a href="https://www.ntnu.edu/"><img src="pics/NTNULogo.png" id="ntnu" class="imglink"></img></a>
<a href="http://www.nordicsemi.no"><img src="pics/NordicSemiLogo.png" id="nordiclogo" class="imglink"></img></a>
</div>
<script>
$(document).ready(function(){
$('.pull-down-menu').click(function() { // Function to slide down the menu selector
$('.panel').slideToggle('slow');
});
$('.menu').hover( // Makes the menus change color while hovering over them
function(){
$(this).addClass('active');
},
function(){
$(this).removeClass('active');
}
);
});
//*** Initialize game **/
function game_init() {
var time = new Date();
var e = time.getTime();
toggleFullscreen();
connect();
setTimeout(function() {
$('.column').load('include/controllers.html?t=' + e);
}, 600);
}
</script>
<script>
// Funksjon for å vise siden i fullskjerm
function toggleFullscreen(elem) {
elem = elem || document.documentElement;
if (!document.fullscreenElement && !document.mozFullScreenElement &&
!document.webkitFullscreenElement && !document.msFullscreenElement) {
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
}
$('#fullscreen').html("Avslutt fullskjerm");
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
}
$('#fullscreen').html("Klikk for fullskjerm");
}
}
document.getElementById('fullscreen').addEventListener('click', function() {
toggleFullscreen();
});
</script>
</body>
</html>