-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
291 lines (278 loc) · 10.1 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
<!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="Simple Infinite Scroll by use of isInViewport">
<meta name="author" content="cblweb">
<link rel="icon" href="../../favicon.ico">
<title>Simple Infinite Scroll by use of isInViewport</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js for 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]-->
<style>
body { background-color: #FFF; }
h1 { padding-top: 20px; }
.wrap { box-shadow: 0 0 3px rgba(0,0,0,0.3); background-color: #F3F3F3; margin-bottom: 30px; }
.media { width: 100%; text-align: center; color: #FFF; }
.media .fa { font-size: 100px; }
.caption { padding: 10px; font-size: 20px; text-align: center; }
.navbar-right { padding: 11px 15px 0 0; }
.loadmore { margin: 50px 0 80px; position: relative; }
.loadmore:before { content: ""; z-index: -1; background-color: #DDD; height: 1px; width: 100%; position: absolute; top: 15px; }
.spinner-wrap { margin: 0 auto; width: 44px; height: 32px; padding-left: 20px; background-color: #FFF; }
.loadmore.nomore .spinner { display: none; }
.loadmore.nomore .spinner-wrap { width: 100px; padding: 0; text-align: center; line-height: 32px; }
.loadmore.nomore .spinner-wrap:after { content: "No More Item"; }
.spinner, .spinner:before, .spinner:after {
width: 6px;
height: 30px;
background-color: #09F;
border-radius: 2px;
}
.spinner {
display: inline-block;
position: relative;
}
.spinner:before, .spinner:after {
content: "";
position: absolute;
display: block;
top: 0px;
}
.spinner:before {
left: -10px;
}
.spinner:after {
left: 10px;
}
@-webkit-keyframes bounce-middle {
0% {
height: 4px;
margin-top: 8px;
margin-bottom: 8px;
}
50% {
height: 30px;
margin-top: 0px;
margin-bottom: 0px;
}
100% {
height: 4px;
margin-top: 8px;
margin-bottom: 8px;
}
}
@keyframes bounce-middle {
0% {
height: 4px;
margin-top: 8px;
margin-bottom: 8px;
}
50% {
height: 30px;
margin-top: 0px;
margin-bottom: 0px;
}
100% {
height: 4px;
margin-top: 8px;
margin-bottom: 8px;
}
}
.loadmore.loading .spinner {
-webkit-animation: bounce-middle 0.6s ease 0.1s infinite;
animation: bounce-middle 0.6s ease 0.1s infinite;
}
.loadmore.loading .spinner:before, .loadmore.loading .spinner:after {
top: 50%;
-webkit-transform: translateY(-10px) translateZ(0);
transform: translateY(-10px) translateZ(0);
}
.loadmore.loading .spinner:before {
-webkit-animation: bounce-middle 0.6s ease 0s infinite;
animation: bounce-middle 0.6s ease 0s infinite;
}
.loadmore.loading .spinner:after {
-webkit-animation: bounce-middle 0.6s ease 0.2s infinite;
animation: bounce-middle 0.6s ease 0.2s infinite;
}
</style>
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#">Infinite Scroll with isInViewport</a>
</div>
<div class="navbar-right">
<a class="github-button" href="https://github.com/cblweb/infinite-scroll-with-isinviewport" data-style="mega" aria-label="Download cblweb/infinite-scroll-with-isinviewport on GitHub">View On Github</a>
<a class="github-button" href="https://github.com/cblweb/infinite-scroll-with-isinviewport/archive/master.zip" data-icon="octicon-cloud-download" data-style="mega" aria-label="Download cblweb/infinite-scroll-with-isinviewport on GitHub">Download</a>
</div>
</div>
</nav>
<div class="jumbotron">
<div class="container">
<h1>Hello, world!</h1>
<p>Here is a simple demostration of infinite scroll using isInViewport.</p>
</div>
</div>
<div class="container">
<div class="row" id="item-list">
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-md-3">
<div class="wrap">
<div class="media"><i class="fa"></i></div>
<div class="caption"></div>
</div>
</div>
</div>
<div class="loadmore" data-nextpage="2" data-url="./ajax/path-to-load-more.html" data-maxpage="5">
<div class="spinner-wrap">
<div class="spinner"></div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="vendor/isInViewport.min.js"></script>
<script src="vendor/masonry.pkgd.min.js"></script>
<script async defer id="github-bjs" src="https://buttons.github.io/buttons.js"></script>
<script src="script.js"></script>
</body>
</html>