-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
176 lines (139 loc) · 7.29 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
<!DOCTYPE html>
<html>
<head>
<title>courrrt</title>
<link rel="stylesheet" type="text/css" href="style/reset-min.css" />
<link rel="stylesheet/less" type="text/less" href="style/list.less" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<script type="text/javascript" src="script/lib/jquery-1.6.2.js"></script>
<script type="text/javascript" src="script/lib/jquery-tmpl.js"></script>
<script type="text/javascript" src="script/lib/jquery.timeago.js"></script>
<script type="text/javascript" src="script/lib/jquery.easing-1.3.pack.js"></script>
<script type="text/javascript" src="script/lib/knockout-1.2.1.debug.js"></script>
<script type="text/javascript" src="script/lib/less-1.1.4.js"></script>
<script type="text/javascript" src="script/ext/ko.bindingHandlers.js"></script>
<script type="text/javascript" src="script/models/player.js"></script>
<script type="text/javascript" src="script/models/shot.js"></script>
<script type="text/javascript" src="script/viewModels/viewModel.js"></script>
<script type="text/javascript" src="script/viewModels/viewModel.list.js"></script>
<script type="text/javascript" src="script/viewModels/viewModel.shot.js"></script>
<script type="text/javascript">
$(document).ready(function () {
// Set HTML title when the list changes
courrrt.viewModel.list.subscribe(function () {
window.document.title = this.title + " \u2192 " + this.list();
}, window.courrrt.viewModel);
// Handle keyboard shortcuts.
$(document).keydown(function (e) {
switch (e.which) {
case 79: // O
case 111: // o
case 83: // S
case 115: // s
case 13: // enter
this.shot.open();
e.preventDefault();
break;
case 85: // U
case 117: // u
case 80: // P
case 112: // p
this.shot.openPlayer();
e.preventDefault();
break;
case 37: // left arrow
this.list.previous();
e.preventDefault();
break;
case 39: // right arrow
this.list.next();
e.preventDefault();
break;
case 27: // escape
this.reset(e);
e.preventDefault();
break;
}
}.bind(window.courrrt.viewModel));
// Default feed
courrrt.viewModel.list("popular");
// Ready, set...
ko.applyBindings(courrrt.viewModel);
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-25123799-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body data-bind="scroll: { call: list.fetch, within: 500, of: 'bottom', watch: list.items }">
<header class="page">
<div class="wrapper">
<nav>
<ul data-bind="template: 'listFeeds'"></ul>
<script id="listFeeds" type="text/x-jquery-tmpl">
{{each(name, url) list.feeds}}
<li data-bind="css: { selected: list() === name }, click: function () { list(name); }">
${name}
</li>
{{/each}}
</script>
</nav>
<h1 data-bind="text: title, click: reset"></h1>
<div class="loading" data-bind="visible: list.state() === 'loading'"></div>
</div>
</header>
<section class="shots">
<ul data-bind="template: { name: 'listItem', foreach: list.shots }" class="list"></ul>
<script id="listItem" type="text/x-jquery-tmpl">
<li data-bind="css: { selected: courrrt.viewModel.shot() && courrrt.viewModel.shot().id === id }, click: function () { courrrt.viewModel.shot($data); }">
<img src="${image.teaser_url}" class="teaser" />
</li>
</script>
</section>
<aside class="page">
<div class="wrapper">
<div class="content-container">
<div class="keyboard-shortcuts">
<h3>Try jammin’ on some keys:</h3>
<ul>
<li><kbd>←</kbd>, <kbd>→</kbd> navigate shots</li>
<li><kbd>u</kbd>, <kbd>p</kbd> view player on dribbble</li>
<li><kbd>o</kbd>, <kbd>s</kbd> view shot on dribbble</li>
</ul>
</div>
<div class="intro container" data-bind="visible: shot() === null">
<h2>Welcome to the <span class="name">courrrt</span>!</h2>
<p><span class="name">courrrt</span> is a simple <a href="http://dribbble.com" target="_blank">dribbble</a> client, which lets you flip through a lot of shots, quickly.</p>
<div class="explain">
<h3>What are these crazy words‽</h3>
<p>In the dribbble world, a <strong>player</strong> is a user, and a <strong>shot</strong> is an image that a player uploads.</p>
<p>The <strong>debuts</strong> feed is a player’s first shot on dribbble.</p>
</div>
</div>
<div class="shot container" data-bind="template: { name: 'shotBar', data: shot, afterRender: shot.render }"></div>
<script id="shotBar" type="text/x-jquery-tmpl">
<div class="player">
{{if player.avatar}}
<img src="${player.avatar}" class="avatar" />
{{else}}
<div class="avatar-spacer"></div>
{{/if}}
<h2 title="${title}">${title}</h2>
<p class="author"><a href="${player.dribbble.profile}" title="${player.dribbble.username}" class="name" target="_blank">${player.name}</a>, <span class="timeago" data-bind="timeAgo: createdAt"></span></p>
</div>
<a class="shot-container" href="${url}" target="_blank">
<img src="${image.url}" class="shot" />
</a>
</script>
</div>
</div>
</aside>
</body>
</html>