-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
147 lines (114 loc) · 5.06 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="favicon.ico">
<title>CatNap</title>
<!-- Bootstrap core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- Custom styles for this template -->
<link href="css/carousel.css" rel="stylesheet">
<script src="https://cdn.firebase.com/js/client/1.1.0/firebase.js"></script>
</head>
<!-- NAVBAR
================================================== -->
<body>
<div class="navbar-wrapper">
<div class="container">
<div class="navbar navbar-inverse navbar-static-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">CatNap</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active"><a href="index.html">Reserve</a></li>
<li><a href="about.html">About</a></li>
<li><a href="#"></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- Marketing messaging and featurettes
================================================== -->
<!-- Wrap the rest of the page in another container to center all the content. -->
<div class="container marketing">
<!-- START THE FEATURETTES -->
<div class="row featurette" style="margin-top:130px">
<div class="col-md-7">
<img id="backgroundHack" class="featurette-image img-responsive" style="width:600px; height:600px" onmouseover="this.src='sleep.jpg'" onmouseout="this.src='nyanca.gif'" src="nyanca.gif"/>
</div>
<div class="col-md-5">
<h2 class="featurette-heading" style="margin-top: 20px"><span2 style="font-size:200px;">0:42</span2><br /><br /><span class="text-muted" style="font-size:50px">Sleep Scheduler</span></h2>
<br />
<form>
<select id="score" class="form-control" onchange="document.location.href = 'index.html?min=' + this.value">
<option value="default">Select Time</option>
<option value="1">1 Minute</option>
<option value="5">5 Minutes</option>
<option value="15">15 Minutes</option>
<option value="30">30 Minutes</option>
<option value="0">Force Stop</option>
</select>
</form>
</div>
</div><br /><hr />
<script>
document.getElementById("backgroundHack").style.src = "sleep.jpg";
var edit_save = document.getElementById("backgroundHack");
edit_save.hover = function(){
this.src = "sleep.jpg";
}
var myFirebaseRef = new Firebase("https://wakeuprightnowyourea.firebaseio.com/");
var minute = Number(window.location.href.substring(window.location.href.lastIndexOf("min=")+4,window.location.href.length));
var force = false;
var d = new Date();
var time = d.setUTCHours();
if (minute == 0) {
force = true;
var http = new XMLHttpRequest();
var url = "https://api.justyo.co/yoall/";
var params = "api_token=167e8726e5809368032d1e9c578fc519d48870c7";
http.open("POST", url, true);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Content-length", params.length);
http.setRequestHeader("Connection", "close");
http.onreadystatechange = function() {//Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
alert(http.responseText);
}
}
http.send(params);
}
y = [{"bed": 1, "minutes": minute, "force": force}];
myFirebaseRef.set(y);
</script>
<audio loop onloadeddata="var audioPlayer = this; setTimeout(function() { audioPlayer.play(); }, 0)">
<source src="catloop.mp3" type="audio/mpeg">
</audio>
<!-- FOOTER -->
<footer>
<p class="pull-right"><a href="#">Back to top</a></p>
<p>© HackMIT 2014</p>
</footer>
</div><!-- /.container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/docs.min.js"></script>
</body>
</html>