-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
201 lines (187 loc) · 9.23 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
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
195
196
197
198
199
200
201
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Eye track</title>
<meta name="description" content="Track eyes">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<!-- Place favicon.ico in the root directory -->
<!-- <link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/vendor/modernizr-2.8.3.min.js"></script> -->
<style>
body{
font-family: Helvetica, sans-serif;
font-weight: lighter;
}
#heatmap-toggle{
position: absolute;
top: 0;
left: 0;
background-color: rgba(200, 0, 0, .5);
z-index: 100;
}
#start-button{
position:absolute;
top:50%;
left:50%;
transform: translate(-50%, -50%);
background-color: rgb(0,150,50);
padding: 10px;
border-radius: 5px;
color: white;
text-decoration: none;
font-size: 25px;
}
#start-button:hover{
background-color: rgb(0,100,0);
}
.splash{
position: absolute;
z-index: 100;
left: 0;
top: 0;
height: 100%;
width: 100%;
background-color: white;
}
#heatmap-container{
height: 1000px;
}
.content-container{
width: 100%;
display: block;
max-width: 1000px;
margin: auto;
}
</style>
</head>
<body>
<a id="heatmap-toggle">Toogle Heatmap</a>
<div class="splash" style="">
<a href="#start" id="start-button">Click to start</a>
</div>
<div id="container-wrapper">
<div id="heatmap-container">
<div class="content-container">
<div style="display: inline-block; width: 100%">
<div style="float: left; width: 40%;">
<img style="width: 100%" src="https://h5p.org/sites/default/files/h5p/content/15671/images/file-5752ba5724095.jpg"/>
</div>
<div style="float: left; width: 60%; padding: 10px; box-sizing: border-box;">
<h1>The night sky</h1>
<h2>It’s January. The holiday is over, and you have already broken your New Year’s resolutions. What is there to look forward to?</h2>
<p>Travel back in time and space to just before the Sun was born then move forward into the future to watch a star die. Exciting enough? Stick with us, and explore places you could never imagine, as you travel to Orion, explore the night sky and study the birth, life and death of stars.</p>
</div>
</div>
<div>
<h1>The course</h1>
<p>The course will be unveiled one week at a time so that everyone gets to view the telescope together in Week 3. You can get more of an idea about what’s covered in the course from this short summary.</p>
<p>In Week 1, you’ll discover the constellation of Orion, find it in the sky and find out how the constellations can be used for navigation.</p>
<p>In Week 2, learn about the lifecycle of different types of star, their birth and what happens when they die. Find out about nuclear fusion that happens inside a star and how their mass, luminosity and temperature are related to their lifecycle.</p>
<p>In Week 3, investigate what the night sky can reveal about how it all began. You’ll be able to join our team investigating the night sky via the Pirate telescope, The Open University’s observatory in Mallorca – weather permitting!</p>
<p>In Week 4, consider how planets and planetary systems formed and find out about our place in the Universe. You’ll also find out about exoplanets and consider whether other stars have planets like ours.</p>
<p>The course is designed to run on desktops, tablets and mobile devices; however, some of the material is quite detailed and using a larger screen will enhance your experience. Materials are best viewed running the most up-to-date software available for your device and using the most recent version of the web browser.</p>
</div>
</div>
</div>
</div>
<!-- <script src="https://code.jquery.com/jquery-1.12.2.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.12.2.min.js"><\/script>')</script> -->
<script src="webgazer.js"></script>
<script src="heatmap.min.js"></script>
<!-- <script src="https://h5p.org/sites/all/modules/h5p/library/js/h5p-resizer.js" charset="UTF-8"></script> -->
<script>
function reflowHeatmap(){
if(window.heatmapDisplay){
var rawMapData = window.data;
var mapData = rawMapData
.filter(function(obj){
return (obj.data !== null);
})
.map(function(obj){
var cleanNode = {x: obj.data.x, y: obj.data.y, value: 1};
return cleanNode;
});
heatmap.setData({
max: 1,
data: mapData
});
setTimeout(reflowHeatmap, 250)
}
}
window.heatmapDisplay = false;
window.data = [];
var heatmapContainer = document.getElementById('heatmap-container');
window.heatmap = h337.create({
container: heatmapContainer
});
window.onload = function() {
webgazer.setRegression('ridge') /* currently must set regression and tracker */
.setTracker('clmtrackr')
.setGazeListener(function(data, clock) {
window.data.push({data});
})
.begin()
.showPredictionPoints(false); /* shows a square every 100 milliseconds where current prediction is */
document.addEventListener("keypress",function(e){
if(e.keyCode === 116){
window.heatmapDisplay = !heatmapDisplay;
if(window.heatmapDisplay){
setTimeout(
reflowHeatmap,
250);
}
if(!window.heatmapDisplay){
window.heatmap.setData({
data: []
});
heatmapContainer.style = "";
var heatmapCanvas = document.getElementsByClassName('heatmap-canvas')[0];
if(heatmapCanvas.length > 0){
heatmapCanvas.remove();
}
}
}
});
var startButton = document.getElementById("start-button");
var page = document.getElementById("container-wrapper");
startButton.addEventListener("click", function(e){
e.preventDefault();
document.getElementsByClassName("splash")[0].style = "display: none";
page.style = "";
});
var heatmapToggle = document.getElementById('heatmap-toggle');
heatmapToggle.addEventListener('click', function(e){
e.preventDefault();
window.heatmapDisplay = !heatmapDisplay;
if(window.heatmapDisplay){
setTimeout(
reflowHeatmap,
100);
}
if(!window.heatmapDisplay){
window.heatmap.setData({
data: []
});
heatmapContainer.style = "";
document.getElementsByClassName('heatmap-canvas')[0].remove();
}
});
var setup = function() {
// window.localStorage.setItem('data', JSON.stringify([]));
};
function checkIfReady() {
if (webgazer.isReady()) {
setup();
} else {
setTimeout(checkIfReady, 100);
}
}
setTimeout(checkIfReady,100);
};
</script>
</body>
</html>