-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsleep.html
195 lines (167 loc) · 5.96 KB
/
sleep.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<!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="shortcut icon" href="../../assets/ico/favicon.ico">
<title>Sleep with Friends</title>
<script src="js/jquery.js"></script>
<link href="js/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="js/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">
<link href="css/index.css" rel="stylesheet">
<link href="css/bootstrap-slider.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/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<style text/css>
#sleepytime{
display:inline;
}
</style>
<script>
$(document).ready( function(){
var d = new Date();
var hours = d.getHours();
var minutes = d.getMinutes();
var ampm;
if (hours > 11)
{
hours = hours % 12;
ampm = "PM";
}
else
{
ampm = "AM";
}
$("#sleepytime").html(hours+":"+minutes + " "+ampm);
});
var datapoint = new Object();
//structured as {day, sleepytime, waketime};
if (typeof localStorage.data !== 'undefined' && localStorage.data.length > 0) {
//var size = localStorage.data.size(day);
//localStorage.data = [{day: 1, sleep_time: d}];
// localStorage.data.push = new datapoint({day: size,sleepytime: d, waketime: 0});
}
else{
//localStorage.data = new Array();
//localStorage.data.push = new datapoint({day: size,sleepytime: d, waketime: 0});
}
// function to determine size local Storage object array
Object.size = function(obj) {
var size = 0, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) size++;
}
return size;
};
</script>
<body>
<div class="container">
<h2> </h2>
<div class="masthead">
<h3 class="text-muted">Time to sleep!</h3>
<!--<ul class="nav nav-justified">
<li class="active"><a href="#">Home</a></li>
<li><a href="login.html">Login</a></li>
<li><a href="about.html">About</a></li>
</ul>-->
</div>
<!-- Moode Slider -->
<div class="moodSlider">
<h3>It's <div id = "sleepytime"></div>, how do you feel?</h3>
<p id="description"></p>
<script>
localStorage.setItem("description", ["On a scale from watching reality TV to completing a Spartan Race:",
"On a scale from \"Adam's Song\" to \"Damnit (What's My Age Again?)\":",
"On a scale from \"A Perfect Circle\" to \"Girl Talk\":",
"On a scale from \"couch potato\" to \"CrossFit champion\":",
"On a scale from \"Subway\" to \"Alinea\":",
"On a scale from \"Bud Light\" to \"Green Chartreuse\":",
"On a scale from \"K-Mart\" to \"Warby Parker\":",
"On a scale from \"Green Line\" to \"Maglev train\":",
"On a scale from \"Payless\" to \"Air Jordan's\":",
"On a scale from 'Super 8\" to \"Mandarin Oriental\":",
]);
localStorage.descNum = parseInt(localStorage.descNum)+1;
desc = localStorage.getItem("description").split(",");
desc = desc[localStorage.descNum%(desc.length)];
console.log(localStorage.descNum)
$("#description").text(desc);
</script>
<input id="moodSleepSlider" data-slider-id='moodSleepSlider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="80"/>
</div>
<script>
function gotosleep() {
return true;
}
</script>
<form action="gotosleep.html" onsubmit="return gotosleep()">
<hr>
<div class="did">
<p class="did">Did you fulfill your challenge for the day? <input type="checkbox" id="do" onchange=""></p>
</div>
<hr>
<!-- Note -->
<div class="moodNote" style="">
<p class="noteInstructions">Write something interesting about your day:</p>
<input type="text" class="form-control" placeholder="Ex: drank Rocket Fuel off-menu special at Barrington with Chuck Norris">
</div>
<!-- Go to Sleep button -->
<div class="startSleep">
<button class="btn btn-lg btn-primary btn-block" type="submit">Sleepy time!</button>
</div>
</form>
</div> <!-- /container -->
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script type='text/javascript' src="js/bootstrap-slider.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
/* Example 1 */
$('#moodSleepSlider').slider({
formater: function(value) {
return 'Current value: ' + value;
}
});
});
</script>
<style>
body {
background: none;
}
</style>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/sleepwithfriends">Sleep with Friends</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="checkin.html">Check In</a></li>
<li><a href="dashboard.html">Dashboard</a></li>
<li><a href="settings.html">Settings</a></li>
<li><a href="index.html">Logout</a></li>
</ul>
</div>
</div>
</div>
<script>$('.navbar-toggle').click( function(){$('.navbar-collapse').toggleClass('collapse')} )</script>
<script>if(window.innerWidth > 500) $('body').css('background','none')</script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<style>* {font-family: 'Open Sans', 'sans-serif';}</style>
</body>
</html>