-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
80 lines (65 loc) · 2.74 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
<!DOCTYPE html>
<html>
<head>
<title>JsCubeTimer</title>
<!-- TODO use require.js -->
<script type="text/javascript" src="vendor/zepto.min.js"></script>
<script type="text/javascript" src="vendor/lodash.underscore.min.js"></script>
<script type="text/javascript" src="vendor/backbone-min.js"></script>
<script type="text/javascript" src="vendor/backbone.localstorage.min.js"></script>
<script type="text/template" id="tpl-scoreList">
<div class="best">Best: <%- bestScore %></div>
<div class="average">Average: <%- averageScore %></div>
<h2>Scores:</h2>
<ul>
<% scores.each(function(score) { %>
<li><%- score.getFormattedScore() %> (<%- score.get('scrambleSequence') %>) <a data-id="<%- score.id %>" href="#" class="delete">×</a></li>
<% }); %>
</ul>
</script>
<script type="text/template" id="tpl-cubeTimer">
<div class="hero-unit" style="text-align: center;">
<p id="timerLabel" style="margin: 10px 0; font-size: 160px; font-weight: 800"><%- time %></p>
</div>
<div style="text-align: center;">
<p id="scrambleSequence" style="font-size: 20px; font-weight: 800; font-family: 'courier new'"><%- scrambleSequence %></p>
</div>
</script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/TimeFormatter.js"></script>
<script type="text/javascript" src="js/CubeTimer.js"></script>
<script type="text/javascript" src="js/CubeTimerView.js"></script>
<script type="text/javascript" src="js/Score.js"></script>
<script type="text/javascript" src="js/Scores.js"></script>
<script type="text/javascript" src="js/ScoreListView.js"></script>
<script type="text/javascript" src="js/ScrambleMove.js"></script>
<script type="text/javascript" src="js/ScrambleMoveGenerator.js"></script>
</head>
<body>
<script type="text/javascript">
var Controller = {
index: function() {
var timerLabel = document.getElementById('timerLabel');
var scrambleSequenceLabel = document.getElementById('scrambleSequence');
var scoreListBox = document.getElementById('scoreList');
// generate 25 moves and place the string in the scrambleSequence element
//var scrambleMoveGenerator = new ScrambleMoveGenerator(25, scrambleSequenceLabel);
var scores = new Scores();
scores.fetch();
var cubeTimerView = new CubeTimerView({
timer: new CubeTimer(scores),
scores: scores
});
cubeTimerView.render();
document.body.appendChild(cubeTimerView.el);
var scoreView = new ScoreListView({ scores: scores});
scoreView.render();
document.body.appendChild(scoreView.el);
// create the timer and pass the scrambleMoveGenerator
//var cubeTimer = new CubeTimer(timerLabel, scrambleMoveGenerator, scores, scoreView);
}
}
Controller.index();
</script>
</body>
</html>