-
Notifications
You must be signed in to change notification settings - Fork 0
/
girl.html
579 lines (445 loc) · 23.2 KB
/
girl.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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
<!DOCTYPE html>
<html lang="en">
<head>
<title>Photos</title>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Draggable Image Boxes Grid" />
<meta name="keywords" content="images, boxes, template, thumbnail, css3, transition, jquery, template, fullscreen, grid, draggable" />
<meta name="author" content="Codrops" />
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<noscript>
<style>
.ib-main a{
cursor:pointer;
}
.ib-main-wrapper{
position:absolute;
top:0px;
bottom:24px;
overflow:scroll;
}
</style>
</noscript>
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css' />
<script id="previewTmpl" type="text/x-jquery-tmpl">
<div id="ib-img-preview" class="ib-preview">
<img src="${src}" alt="" class="ib-preview-img"/>
<span class="ib-preview-descr" style="display:none;">${description}</span>
<div class="ib-nav" style="display:none;">
<span class="ib-nav-prev">Previous</span>
<span class="ib-nav-next">Next</span>
</div>
<span class="ib-close" style="display:none;">Close Preview</span>
/*<div class="ib-loading-large" style="display:none;">Loading...</div>
</div>*/
</script>
<script id="contentTmpl" type="text/x-jquery-tmpl">
<div id="ib-content-preview" class="ib-content-preview">
<div class="ib-teaser" style="display:none;">{{html teaser}}</div>
<div class="ib-content-full" style="display:none;">{{html content}}</div>
<span class="ib-close" style="display:none;">Close Preview</span>
</div>
</script>
</head>
<body>
<div class="container">
<div id="header" class="header">
<a href='index.php'>Back to home<span>« Ganeshotsav 2kxi photos: </span>Girls Hostel</a>
<span class="right_ab">
<a > <strong>Designed By:</strong></a>
<a target="_blank">Sourabh Kumar Agrawal</a>
<a ><strong></strong></a>
</span>
</div>
<div id="ib-top" class="ib-top">
<h1> <span></span></h1>
</div>
<div id="ib-main-wrapper" class="ib-main-wrapper">
<div class="ib-main">
<a href="#"><img src="images/thumbs/14.jpg" data-largesrc="images/large/14.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/1.jpg" data-largesrc="images/large/1.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/2.jpg" data-largesrc="images/large/2.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/3.jpg" data-largesrc="images/large/3.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/4.jpg" data-largesrc="images/large/4.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/5.jpg" data-largesrc="images/large/5.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/6.jpg" bgcolor='#00ff' data-largesrc="images/large/6.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/7.jpg" data-largesrc="images/large/7.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/8.jpg" data-largesrc="images/large/8.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/9.jpg" data-largesrc="images/large/9.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/10.jpg" data-largesrc="images/large/10.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#" class="ib-content">
<div class="ib-teaser">
<h2> <span></span></h2>
</div>
<div class="ib-content-full">
</div>
</a>
<a href="#"><img src="images/thumbs/11.jpg" data-largesrc="images/large/11.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/12.jpg" data-largesrc="images/large/12.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/13.jpg" data-largesrc="images/large/13.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/14.jpg" data-largesrc="images/large/14.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/1.jpg" data-largesrc="images/large/1.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/2.jpg" data-largesrc="images/large/2.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/3.jpg" data-largesrc="images/large/3.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/4.jpg" data-largesrc="images/large/4.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/5.jpg" data-largesrc="images/large/5.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/6.jpg" data-largesrc="images/large/6.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/7.jpg" data-largesrc="images/large/7.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/8.jpg" data-largesrc="images/large/8.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/9.jpg" data-largesrc="images/large/9.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/10.jpg" data-largesrc="images/large/10.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/11.jpg" data-largesrc="images/large/11.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/12.jpg" data-largesrc="images/large/12.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/13.jpg" data-largesrc="images/large/13.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/14.jpg" data-largesrc="images/large/14.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/1.jpg" data-largesrc="images/large/1.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/2.jpg" data-largesrc="images/large/2.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/3.jpg" data-largesrc="images/large/3.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/13.jpg" data-largesrc="images/large/13.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/4.jpg" data-largesrc="images/large/4.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/5.jpg" data-largesrc="images/large/5.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/6.jpg" data-largesrc="images/large/6.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/7.jpg" data-largesrc="images/large/7.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/8.jpg" data-largesrc="images/large/8.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/9.jpg" data-largesrc="images/large/9.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/10.jpg" data-largesrc="images/large/10.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/11.jpg" data-largesrc="images/large/11.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/12.jpg" data-largesrc="images/large/12.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/13.jpg" data-largesrc="images/large/13.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/14.jpg" data-largesrc="images/large/14.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/1.jpg" data-largesrc="images/large/1.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/2.jpg" data-largesrc="images/large/2.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/3.jpg" data-largesrc="images/large/3.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/4.jpg" data-largesrc="images/large/4.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/5.jpg" data-largesrc="images/large/5.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/6.jpg" data-largesrc="images/large/6.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/7.jpg" data-largesrc="images/large/7.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/8.jpg" data-largesrc="images/large/8.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/9.jpg" data-largesrc="images/large/9.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/10.jpg" data-largesrc="images/large/10.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/11.jpg" data-largesrc="images/large/11.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/12.jpg" data-largesrc="images/large/12.jpg" alt="image01"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/13.jpg" data-largesrc="images/large/13.jpg" alt="image02"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/14.jpg" data-largesrc="images/large/14.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<a href="#"><img src="images/thumbs/14.jpg" data-largesrc="images/large/14.jpg" alt="image03"/><span>Ganeshotsav 2kxi</span></a>
<div class="clr"></div>
</div><!-- ib-main -->
</div><!-- ib-main-wrapper -->
</div>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.tmpl.min.js"></script>
<script type="text/javascript" src="js/jquery.kinetic.js"></script>
<script type="text/javascript" src="js/jquery.easing.1.3.js"></script>
<script type="text/javascript">
$(function() {
var $ibWrapper = $('#ib-main-wrapper'),
Template = (function() {
// true if dragging the container
var kinetic_moving = false,
// current index of the opened item
current = -1,
// true if the item is being opened / closed
isAnimating = false,
// items on the grid
$ibItems = $ibWrapper.find('div.ib-main > a'),
// image items on the grid
$ibImgItems = $ibItems.not('.ib-content'),
// total image items on the grid
imgItemsCount = $ibImgItems.length,
init = function() {
// add a class ib-image to the image items
$ibImgItems.addClass('ib-image');
// apply the kinetic plugin to the wrapper
loadKinetic();
// load some events
initEvents();
},
loadKinetic = function() {
setWrapperSize();
$ibWrapper.kinetic({
moved : function() {
kinetic_moving = true;
},
stopped : function() {
kinetic_moving = false;
}
});
},
setWrapperSize = function() {
var containerMargins = $('#ib-top').outerHeight(true) + $('#header').outerHeight(true) + parseFloat( $ibItems.css('margin-top') );
$ibWrapper.css( 'height', $(window).height() - containerMargins )
},
initEvents = function() {
// open the item only if not dragging the container
$ibItems.bind('click.ibTemplate', function( event ) {
if( !kinetic_moving )
openItem( $(this) );
return false;
});
// on window resize, set the wrapper and preview size accordingly
$(window).bind('resize.ibTemplate', function( event ) {
setWrapperSize();
$('#ib-img-preview, #ib-content-preview').css({
width : $(window).width(),
height : $(window).height()
})
});
},
openItem = function( $item ) {
if( isAnimating ) return false;
// if content item
if( $item.hasClass('ib-content') ) {
isAnimating = true;
current = $item.index('.ib-content');
loadContentItem( $item, function() { isAnimating = false; } );
}
// if image item
else {
isAnimating = true;
current = $item.index('.ib-image');
loadImgPreview( $item, function() { isAnimating = false; } );
}
},
// opens one image item (fullscreen)
loadImgPreview = function( $item, callback ) {
var largeSrc = $item.children('img').data('largesrc'),
description = $item.children('span').text(),
largeImageData = {
src : largeSrc,
description : description
};
// preload large image
$item.addClass('ib-loading');
preloadImage( largeSrc, function() {
$item.removeClass('ib-loading');
var hasImgPreview = ( $('#ib-img-preview').length > 0 );
if( !hasImgPreview )
$('#previewTmpl').tmpl( largeImageData ).insertAfter( $ibWrapper );
else
$('#ib-img-preview').children('img.ib-preview-img')
.attr( 'src', largeSrc )
.end()
.find('span.ib-preview-descr')
.text( description );
//get dimentions for the image, based on the windows size
var dim = getImageDim( largeSrc );
$item.removeClass('ib-img-loading');
//set the returned values and show/animate preview
$('#ib-img-preview').css({
width : $item.width(),
height : $item.height(),
left : $item.offset().left,
top : $item.offset().top
}).children('img.ib-preview-img').hide().css({
width : dim.width,
height : dim.height,
left : dim.left,
top : dim.top
}).fadeIn( 400 ).end().show().animate({
width : $(window).width(),
left : 0
}, 500, 'easeOutExpo', function() {
$(this).animate({
height : $(window).height(),
top : 0
}, 400, function() {
var $this = $(this);
$this.find('span.ib-preview-descr, span.ib-close').show()
if( imgItemsCount > 1 )
$this.find('div.ib-nav').show();
if( callback ) callback.call();
});
});
if( !hasImgPreview )
initImgPreviewEvents();
} );
},
// opens one content item (fullscreen)
loadContentItem = function( $item, callback ) {
var hasContentPreview = ( $('#ib-content-preview').length > 0 ),
teaser = $item.children('div.ib-teaser').html(),
content = $item.children('div.ib-content-full').html(),
contentData = {
teaser : teaser,
content : content
};
if( !hasContentPreview )
$('#contentTmpl').tmpl( contentData ).insertAfter( $ibWrapper );
//set the returned values and show/animate preview
$('#ib-content-preview').css({
width : $item.width(),
height : $item.height(),
left : $item.offset().left,
top : $item.offset().top
}).show().animate({
width : $(window).width(),
left : 0
}, 500, 'easeOutExpo', function() {
$(this).animate({
height : $(window).height(),
top : 0
}, 400, function() {
var $this = $(this),
$teaser = $this.find('div.ib-teaser'),
$content= $this.find('div.ib-content-full'),
$close = $this.find('span.ib-close');
if( hasContentPreview ) {
$teaser.html( teaser )
$content.html( content )
}
$teaser.show();
$content.show();
$close.show();
if( callback ) callback.call();
});
});
if( !hasContentPreview )
initContentPreviewEvents();
},
// preloads an image
preloadImage = function( src, callback ) {
$('<img/>').load(function(){
if( callback ) callback.call();
}).attr( 'src', src );
},
// load the events for the image preview : navigation ,close button, and window resize
initImgPreviewEvents = function() {
var $preview = $('#ib-img-preview');
$preview.find('span.ib-nav-prev').bind('click.ibTemplate', function( event ) {
navigate( 'prev' );
}).end().find('span.ib-nav-next').bind('click.ibTemplate', function( event ) {
navigate( 'next' );
}).end().find('span.ib-close').bind('click.ibTemplate', function( event ) {
closeImgPreview();
});
//resizing the window resizes the preview image
$(window).bind('resize.ibTemplate', function( event ) {
var $largeImg = $preview.children('img.ib-preview-img'),
dim = getImageDim( $largeImg.attr('src') );
$largeImg.css({
width : dim.width,
height : dim.height,
left : dim.left,
top : dim.top
})
});
},
// load the events for the content preview : close button
initContentPreviewEvents = function() {
$('#ib-content-preview').find('span.ib-close').bind('click.ibTemplate', function( event ) {
closeContentPreview();
});
},
// navigate the image items in fullscreen mode
navigate = function( dir ) {
if( isAnimating ) return false;
isAnimating = true;
var $preview = $('#ib-img-preview'),
$loading = $preview.find('div.ib-loading-large');
$loading.show();
if( dir === 'next' ) {
( current === imgItemsCount - 1 ) ? current = 0 : ++current;
}
else if( dir === 'prev' ) {
( current === 0 ) ? current = imgItemsCount - 1 : --current;
}
var $item = $ibImgItems.eq( current ),
largeSrc = $item.children('img').data('largesrc'),
description = $item.children('span').text();
preloadImage( largeSrc, function() {
$loading.hide();
//get dimentions for the image, based on the windows size
var dim = getImageDim( largeSrc );
$preview.children('img.ib-preview-img')
.attr( 'src', largeSrc )
.css({
width : dim.width,
height : dim.height,
left : dim.left,
top : dim.top
})
.end()
.find('span.ib-preview-descr')
.text( description );
$ibWrapper.scrollTop( $item.offset().top )
.scrollLeft( $item.offset().left );
isAnimating = false;
});
},
// closes the fullscreen image item
closeImgPreview = function() {
if( isAnimating ) return false;
isAnimating = true;
var $item = $ibImgItems.eq( current );
$('#ib-img-preview').find('span.ib-preview-descr, div.ib-nav, span.ib-close')
.hide()
.end()
.animate({
height : $item.height(),
top : $item.offset().top
}, 500, 'easeOutExpo', function() {
$(this).animate({
width : $item.width(),
left : $item.offset().left
}, 400, function() {
$(this).fadeOut(function() {isAnimating = false;});
} );
});
},
// closes the fullscreen content item
closeContentPreview = function() {
if( isAnimating ) return false;
isAnimating = true;
var $item = $ibItems.not('.ib-image').eq( current );
$('#ib-content-preview').find('div.ib-teaser, div.ib-content-full, span.ib-close')
.hide()
.end()
.animate({
height : $item.height(),
top : $item.offset().top
}, 500, 'easeOutExpo', function() {
$(this).animate({
width : $item.width(),
left : $item.offset().left
}, 400, function() {
$(this).fadeOut(function() {isAnimating = false;});
} );
});
},
// get the size of one image to make it full size and centered
getImageDim = function( src ) {
var img = new Image();
img.src = src;
var w_w = $(window).width(),
w_h = $(window).height(),
r_w = w_h / w_w,
i_w = img.width,
i_h = img.height,
r_i = i_h / i_w,
new_w, new_h,
new_left, new_top;
if( r_w > r_i ) {
new_h = w_h;
new_w = w_h / r_i;
}
else {
new_h = w_w * r_i;
new_w = w_w;
}
return {
width : new_w,
height : new_h,
left : (w_w - new_w) / 2,
top : (w_h - new_h) / 2
};
};
return { init : init };
})();
Template.init();
});
</script>
</body>
</html>