-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
1172 lines (943 loc) · 30.9 KB
/
Copy pathmain.js
File metadata and controls
1172 lines (943 loc) · 30.9 KB
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
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
Name: Empathy
Description: Responsive HTML5 vCard Template
Version: 1.0
Author: pixelwars
*/
/* global variables */
var classicLayout = false;
var portfolioKeyword;
(function($) { "use strict";
/* DOCUMENT LOAD */
$(function() {
// ------------------------------
// start loader
showLoader();
// ------------------------------
// ------------------------------
// HOME TEXT TYPE EFFECT
var typist;
typist = document.querySelector("#typist-element");
new Typist(typist, {
letterInterval: 60,
textInterval: 3000
});
// ------------------------------
// ------------------------------
// HEADER FUNCTIONS
$('.search-toggle').on("click", function() {
$('html').toggleClass('is-search-toggled-on');
$( ".search-box input" ).trigger( "focus" );
});
$('.menu-toggle').on("click", function() {
$('html').toggleClass('is-menu-toggled-on');
});
// ------------------------------
// ------------------------------
// remove click delay on touch devices
FastClick.attach(document.body);
// ------------------------------
// ------------------------------
// ONE PAGE LAYOUT FUNCTIONS
if($('html').hasClass('one-page-layout')) {
// ------------------------------
// PORTFOLIO DETAILS
// if url contains a portfolio detail url
portfolioKeyword = $('section.portfolio').attr('id');
var detailUrl = giveDetailUrl();
// ------------------------------
// ------------------------------
// LAYOUT DETECT
classicLayout = $('html').attr('data-classic-layout') === 'true';
classicLayout = classicLayout || ($('html').attr('data-mobile-classic-layout') === 'true' && ($(window).width() < 1025));
classicLayout = classicLayout || !Modernizr.cssanimations;
if(classicLayout) { // CLASSIC LAYOUT
$('html').addClass('classic-layout');
setActivePage();
$.address.change(function() {
setActivePage();
$('html').removeClass('is-menu-toggled-on');
});
} else { // MODERN LAYOUT
$('html').addClass('modern-layout');
$.address.change(function() {
setActivePage();
$('html').removeClass('is-menu-toggled-on');
});
}
// FULL BROWSER BACK BUTTON SUPPORT
$.address.change(function() {
var detailUrl = giveDetailUrl();
if(detailUrl != -1 ) {
showProjectDetails(detailUrl);
} else {
if ($.address.path().indexOf("/"+ portfolioKeyword)!=-1) {
hideProjectDetails(true,false);
}
}
});
}
// ------------------------------
// ------------------------------
// SETUP
setup();
// ------------------------------
// ------------------------------
// PORTFOLIO DETAILS
// Show details
$(".one-page-layout a.ajax").live('click',function() {
var returnVal;
var url = $(this).attr('href');
var baseUrl = $.address.baseURL();
if(url.indexOf(baseUrl) != -1) { // full url
var total = url.length;
detailUrl = url.slice(baseUrl.length+1, total);
} else { // relative url
detailUrl = url;
}
$.address.path(portfolioKeyword + '/' + detailUrl );
return false;
});
// ------------------------------
// ------------------------------
// FORM VALIDATION
// comment form validation fix
$('#commentform').addClass('validate-form');
$('#commentform').find('input,textarea').each(function(index, element) {
if($(this).attr('aria-required') == "true") {
$(this).addClass('required');
}
if($(this).attr('name') == "email") {
$(this).addClass('email');
}
});
// validate form
if($('.validate-form').length) {
$('.validate-form').each(function() {
$(this).validate();
});
}
// ------------------------------
// ------------------------------
// FILL SKILL BARS
fillBars();
// ------------------------------
// ------------------------------
// GOOGLE MAP
/*
custom map with google api
check out the link below for more information about api usage
https://developers.google.com/maps/documentaztion/javascript/examples/marker-simple
*/
// When the window has finished loading create our google map below
google.maps.event.addDomListener(window, 'load', initializeMap);
function initializeMap() {
var mapCanvas = $('#map-canvas');
if(mapCanvas.length) {
var latitude = mapCanvas.data("latitude");
var longitude = mapCanvas.data("longitude");
var zoom = mapCanvas.data("zoom");
var marker_image = mapCanvas.data("marker-image");
// Basic options for a simple Google Map
// For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
var mapOptions = {
// How zoomed in you want the map to start at (always required)
zoom: zoom,
// disable zoom controls
disableDefaultUI: true,
// The latitude and longitude to center the map (always required)
center: new google.maps.LatLng(latitude,longitude),
// How you would like to style the map.
// This is where you would paste any style found on Snazzy Maps.
styles: [{"featureType":"administrative.locality","elementType":"all","stylers":[{"hue":"#2c2e33"},{"saturation":7},{"lightness":19},{"visibility":"on"}]},{"featureType":"landscape","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"simplified"}]},{"featureType":"poi","elementType":"all","stylers":[{"hue":"#ffffff"},{"saturation":-100},{"lightness":100},{"visibility":"off"}]},{"featureType":"road","elementType":"geometry","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"simplified"}]},{"featureType":"road","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":31},{"visibility":"on"}]},{"featureType":"road.arterial","elementType":"labels","stylers":[{"hue":"#bbc0c4"},{"saturation":-93},{"lightness":-2},{"visibility":"simplified"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"hue":"#e9ebed"},{"saturation":-90},{"lightness":-8},{"visibility":"simplified"}]},{"featureType":"transit","elementType":"all","stylers":[{"hue":"#e9ebed"},{"saturation":10},{"lightness":69},{"visibility":"on"}]},{"featureType":"water","elementType":"all","stylers":[{"hue":"#e9ebed"},{"saturation":-78},{"lightness":67},{"visibility":"simplified"}]}]
};
// Get the HTML DOM element that will contain your map
// We are using a div with id="map" seen below in the <body>
var mapElement = document.getElementById('map-canvas');
//var mapElement = $('#map-canvas');
//var myLatlng = new google.maps.LatLng(mapElement.data("latitude"),mapElement.data("longitude"));
// Create the Google Map using our element and options defined above
var map = new google.maps.Map(mapElement, mapOptions);
//CREATE A CUSTOM PIN ICON
var marker_image = marker_image;
var pinIcon = new google.maps.MarkerImage(marker_image,null,null, null,new google.maps.Size(120, 90));
var marker = new google.maps.Marker({
position: new google.maps.LatLng(latitude,longitude),
map: map,
icon: pinIcon,
title: 'Hey, I am here'
});
}
}
// ------------------------------
// ------------------------------
/* jQuery Ajax Mail Send Script */
var contactForm = $( '#contact-form' );
var $alert = $('.site-alert');
var $submit = contactForm.find('.submit');
contactForm.submit(function()
{
if (contactForm.valid())
{
NProgress.start();
$submit.addClass("active loading");
var formValues = contactForm.serialize();
$.post(contactForm.attr('action'), formValues, function(data)
{
if ( data == 'success' ) {
contactForm.clearForm();
}
else {
$alert.addClass('error');
}
NProgress.done();
$alert.show();
setTimeout(function() { $alert.hide(); },6000)
});
}
return false
});
$.fn.clearForm = function() {
return this.each(function() {
var type = this.type, tag = this.tagName.toLowerCase();
if (tag == 'form')
return $(':input',this).clearForm();
if (type == 'text' || type == 'password' || tag == 'textarea')
this.value = '';
else if (type == 'checkbox' || type == 'radio')
this.checked = false;
else if (tag == 'select')
this.selectedIndex = -1;
});
};
// ------------------------------
// ------------------------------
/* SOCIAL FEED WIDGET */
var socialFeed = $('.social-feed');
if(socialFeed.length) {
socialFeed.each(function() {
$(this).socialstream({
socialnetwork: $(this).data("social-network"),
limit: $(this).data("limit"),
username: $(this).data("username")
})
});
}
// ------------------------------
});
// DOCUMENT READY
// WINDOW ONLOAD
window.onload = function() {
hideLoader();
};
// WINDOW ONLOAD
// ------------------------------
// ------------------------------
// FUNCTIONS
// ------------------------------
// ------------------------------
// ------------------------------
// SETUP : plugins
function setup() {
// MASONRY
setupMasonry();
// ------------------------------
// LIGHTBOX
setupLightbox();
// ------------------------------
// ------------------------------
// TABS
$('.tabs').each(function() {
if(!$(this).find('.tab-titles li a.active').length) {
$(this).find('.tab-titles li:first-child a').addClass('active');
$(this).find('.tab-content > div:first-child').show();
} else {
$(this).find('.tab-content > div').eq($(this).find('.tab-titles li a.active').parent().index()).show();
}
});
$('.tabs .tab-titles li a').on("click", function() {
if($(this).hasClass('active')) { return; }
$(this).parent().siblings().find('a').removeClass('active');
$(this).addClass('active');
$(this).parents('.tabs').find('.tab-content > div').hide().eq($(this).parent().index()).show();
return false;
});
// ------------------------------
// ------------------------------
// TOGGLES
var toggleSpeed = 300;
$('.toggle h4.active + .toggle-content').show();
$('.toggle h4').on("click", function() {
if($(this).hasClass('active')) {
$(this).removeClass('active');
$(this).next('.toggle-content').stop(true,true).slideUp(toggleSpeed);
} else {
$(this).addClass('active');
$(this).next('.toggle-content').stop(true,true).slideDown(toggleSpeed);
//accordion
if($(this).parents('.toggle-group').hasClass('accordion')) {
$(this).parent().siblings().find('h4').removeClass('active');
$(this).parent().siblings().find('.toggle-content').stop(true,true).slideUp(toggleSpeed);
}
}
return false;
});
// ------------------------------
// ------------------------------
// RESPONSIVE VIDEOS
if($('iframe,video').length) {
$("html").fitVids();
}
// ------------------------------
// ------------------------------
// UNIFORM
$("select:not([multiple]), input:checkbox, input:radio, input:file").uniform();
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1;
if(isAndroid) {
$('html').addClass('android');
}
// ------------------------------
}
// setup()
// ------------------------------
// ------------------------------
// MASONRY - ISOTOPE
function setupMasonry() {
var masonry = $('.masonry, .gallery');
if (masonry.length) {
masonry.each(function(index, el) {
// call isotope
refreshMasonry();
$(el).imagesLoaded(function() {
$(el).isotope({
layoutMode : $(el).data('layout') ? $(el).data('layout') : 'masonry'
});
// set columns
refreshMasonry();
});
if (!$(el).data('isotope')) {
// filters
var filters = $(el).siblings('.filters');
if(filters.length) {
filters.find('a').on("click", function() {
var selector = $(this).attr('data-filter');
$(el).isotope({ filter: selector });
$(this).parent().addClass('current').siblings().removeClass('current');
return false;
});
}
}
}); //each
}
}
$(window).on('resize debouncedresize', function() {
refreshMasonry();
});
// ------------------------------
// ------------------------------
// REFRSH MASONRY - ISOTOPE
function refreshMasonry() {
var masonry = $('.masonry');
if (masonry.length) {
masonry.each(function(index, el) {
// check if isotope initialized
if ($(el).data('isotope')) {
var itemW = $(el).data('item-width');
var containerW = $(el).width();
var items = $(el).children('.hentry');
var columns = Math.round(containerW/itemW);
// set the widths (%) for each of item
items.each(function(index, element) {
var multiplier = $(this).hasClass('x2') && columns > 1 ? 2 : 1;
var itemRealWidth = (Math.floor( containerW / columns ) * 100 / containerW) * multiplier ;
$(this).css( 'width', itemRealWidth + '%' );
});
var columnWidth = Math.floor( containerW / columns );
$(el).isotope( 'option', { masonry: { columnWidth: columnWidth } } );
$(el).isotope('layout');
}
}); //each
}
}
// ------------------------------
// ------------------------------
// LIGHTBOX - applied to porfolio and gallery post format
function setupLightbox() {
if($(".lightbox, .gallery").length) {
$('.media-box, .gallery').each(function(index, element) {
var $media_box = $(this);
$media_box.magnificPopup({
delegate: '.lightbox, .gallery-item a',
type: 'image',
image: {
markup: '<div class="mfp-figure">'+
'<div class="mfp-close"></div>'+
'<div class="mfp-img"></div>'+
'</div>' +
'<div class="mfp-bottom-bar">'+
'<div class="mfp-title"></div>'+
'<div class="mfp-counter"></div>'+
'</div>', // Popup HTML markup. `.mfp-img` div will be replaced with img tag, `.mfp-close` by close button
cursor: 'mfp-zoom-out-cur', // Class that adds zoom cursor, will be added to body. Set to null to disable zoom out cursor.
verticalFit: true, // Fits image in area vertically
tError: '<a href="%url%">The image</a> could not be loaded.' // Error message
},
gallery: {
enabled:true,
tCounter: '<span class="mfp-counter">%curr% / %total%</span>' // markup of counter
},
iframe: {
markup: '<div class="mfp-iframe-scaler">'+
'<div class="mfp-close"></div>'+
'<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
'<div class="mfp-title">Some caption</div>'+
'</div>'
},
mainClass: 'mfp-zoom-in',
tLoading: '',
removalDelay: 300, //delay removal by X to allow out-animation
callbacks: {
markupParse: function(template, values, item) {
var title = "";
if(item.el.parents('.gallery-item').length) {
title = item.el.parents('.gallery-item').find('.gallery-caption').text();
} else {
title = item.el.attr('title') == undefined ? "" : item.el.attr('title');
}
//return title;
values.title = title;
},
imageLoadComplete: function() {
var self = this;
setTimeout(function() {
self.wrap.addClass('mfp-image-loaded');
}, 16);
},
close: function() {
this.wrap.removeClass('mfp-image-loaded');
},
beforeAppend: function() {
var self = this;
this.content.find('iframe').on('load', function() {
setTimeout(function() {
self.wrap.addClass('mfp-image-loaded');
}, 16);
});
}
},
closeBtnInside: false,
closeOnContentClick: true,
midClick: true
});
});
}
}
// ------------------------------
// ------------------------------
// FILL PROGRESS BARS
function fillBars() {
$('.bar').each(function() {
var bar = $(this);
var percent = bar.attr('data-percent');
bar.find('.progress').css('width', percent + '%' ).html('<span>'+percent+'</span>');
});
}
// ------------------------------
// ------------------------------
// AJAX PORTFOLIO DETAILS
var pActive;
function showProjectDetails(url) {
showLoader();
var p = $('.p-overlay:not(.active)').first();
pActive = $('.p-overlay.active');
// ajax : fill data
p.empty().load(url + ' .portfolio-single', function() {
NProgress.set(0.5);
// wait for images to be loaded
p.imagesLoaded(function() {
// for galleries in ajax pulled content
setupMasonry();
if(pActive.length) {
hideProjectDetails();
}
hideLoader();
$('html').addClass('p-overlay-on');
$("body").scrollTop(0);
// setup plugins
setup();
if(classicLayout) {
p.show();
} else {
p.removeClass('animate-in animate-out').addClass('animate-in').show();
}
p.addClass('active');
});
});
}
function hideProjectDetails(forever, safeClose) {
$("body").scrollTop(0);
// close completely by back link.
if(forever) {
pActive = $('.p-overlay.active');
$('html').removeClass('p-overlay-on');
if(!safeClose) {
// remove detail url
$.address.path(portfolioKeyword);
}
}
pActive.removeClass('active');
if(classicLayout) {
pActive.hide().empty();
} else {
pActive.removeClass('animate-in animate-out').addClass('animate-out').show();
setTimeout(function() { pActive.hide().removeClass('animate-out').empty(); } ,10)
}
}
function giveDetailUrl() {
var address = $.address.value();
var detailUrl;
if (address.indexOf("/"+ portfolioKeyword + "/")!=-1 && address.length > portfolioKeyword.length + 2 ) {
var total = address.length;
detailUrl = address.slice(portfolioKeyword.length+2,total);
} else {
detailUrl = -1;
}
return detailUrl;
}
// ------------------------------
// ------------------------------
// AJAX LOADER
function showLoader() {
NProgress.start();
}
function hideLoader() {
NProgress.done();
}
// ------------------------------
// ------------------------------
// CHANGE PAGE
function setActivePage() {
var path = $.address.path();
path = path.slice(1, path.length);
path = giveDetailUrl() != -1 ? portfolioKeyword : path;
if(path == "") { // if hash tag doesnt exists - go to first page
var firstPage = $('.nav-menu li').first().find('a').attr('href');
path = firstPage.slice(2,firstPage.length);
if(classicLayout) {
$('#'+ path).addClass( 'page-current' ).siblings().removeClass( 'page-current' );
} else {
$('#'+ path).addClass( 'page-current' );
}
setCurrentMenuItem();
//$.address.path(path);
return false;
}
else { // show page change animation
// change page only if url doesn't target portfolio single page
if(giveDetailUrl() == -1){
if(classicLayout) {
$('#'+ path).addClass( 'page-current' ).siblings().removeClass( 'page-current' );
setCurrentMenuItem();
} else {
if(!($('.page-current').length)) { // first load - don't animate page change
$('#'+ path).addClass( 'page-current' );
current = $('#'+ path).index();
setCurrentMenuItem();
} else { // animate page change
//console.log(giveDetailUrl());
PageTransitions.nextPage( $('#'+ path).index() );
}
}
}
}
/*if(path.indexOf(portfolioKeyword) != -1) {
} */
// refresh masonry layouts
refreshMasonry();
setTimeout(function() { refreshMasonry(); }, 100);
}
// ------------------------------
// ------------------------------
// SET CURRENT MENU ITEM
function setCurrentMenuItem() {
var activePageId = $('.pt-page.page-current').attr('id');
// set default nav menu
$('.nav-menu a[href$=' + activePageId +']').parent().addClass('current_page_item').siblings().removeClass('current_page_item');
}
// ------------------------------
// ------------------------------
// PAGE TRANSITIONS : modern layout
var current = 0;
var inClass, outClass;
window.nextAnimation = $('html').data("next-animation");
window.prevAnimation = $('html').data("prev-animation");
window.randomize = $('html').data("random-animation");
var PageTransitions = (function() {
var $main = $( '#main' ),
$pages = $main.children( '.pt-page' ),
$menuLinks = $('.nav-menu a'),
animcursor = 1,
isAnimating = false,
endCurrPage = false,
endNextPage = false,
animEndEventNames = {
'WebkitAnimation' : 'webkitAnimationEnd',
'OAnimation' : 'oAnimationEnd',
'msAnimation' : 'MSAnimationEnd',
'animation' : 'animationend'
},
// animation end event name
animEndEventName = animEndEventNames[ Modernizr.prefixed( 'animation' ) ],
// support css animations
support = Modernizr.cssanimations;
// init()
function init() {
//$pages.each( function() {
//var $page = $( this );
//$page.attr('data-org-class-list', $page.attr( 'class' ) );
//} );
}
// end init()
// don't change hasg tag if isAnimating
$menuLinks.on("click", function() {
if( isAnimating ) {
return false;
}
});
// PAGE CHANGE FN
function nextPage(nextPageIndex) {
// DO NOTHING : if nextPage is same with the current page
if(nextPageIndex === current) {
return;
}
var animation = nextPageIndex > current ? nextAnimation : prevAnimation;
// random animation
if(randomize) {
if( animcursor > 67 ) {
animcursor = 1;
}
animation = animcursor;
++animcursor;
}
if( isAnimating ) {
return false;
}
isAnimating = true;
var $currPage = $pages.eq( current );
current = nextPageIndex;
var $nextPage = $pages.eq( current ).addClass( 'page-current' );
switch( animation ) {
case 1:
outClass = 'pt-page-moveToLeft';
inClass = 'pt-page-moveFromRight';
break;
case 2:
outClass = 'pt-page-moveToRight';
inClass = 'pt-page-moveFromLeft';
break;
case 3:
outClass = 'pt-page-moveToTop';
inClass = 'pt-page-moveFromBottom';
break;
case 4:
outClass = 'pt-page-moveToBottom';
inClass = 'pt-page-moveFromTop';
break;
case 5:
outClass = 'pt-page-fade';
inClass = 'pt-page-moveFromRight pt-page-ontop';
break;
case 6:
outClass = 'pt-page-fade';
inClass = 'pt-page-moveFromLeft pt-page-ontop';
break;
case 7:
outClass = 'pt-page-fade';
inClass = 'pt-page-moveFromBottom pt-page-ontop';
break;
case 8:
outClass = 'pt-page-fade';
inClass = 'pt-page-moveFromTop pt-page-ontop';
break;
case 9:
outClass = 'pt-page-moveToLeftFade';
inClass = 'pt-page-moveFromRightFade';
break;
case 10:
outClass = 'pt-page-moveToRightFade';
inClass = 'pt-page-moveFromLeftFade';
break;
case 11:
outClass = 'pt-page-moveToTopFade';
inClass = 'pt-page-moveFromBottomFade';
break;
case 12:
outClass = 'pt-page-moveToBottomFade';
inClass = 'pt-page-moveFromTopFade';
break;
case 13:
outClass = 'pt-page-moveToLeftEasing pt-page-ontop';
inClass = 'pt-page-moveFromRight';
break;
case 14:
outClass = 'pt-page-moveToRightEasing pt-page-ontop';
inClass = 'pt-page-moveFromLeft';
break;
case 15:
outClass = 'pt-page-moveToTopEasing pt-page-ontop';
inClass = 'pt-page-moveFromBottom';
break;
case 16:
outClass = 'pt-page-moveToBottomEasing pt-page-ontop';
inClass = 'pt-page-moveFromTop';
break;
case 17:
outClass = 'pt-page-scaleDown';
inClass = 'pt-page-moveFromRight pt-page-ontop';
break;
case 18:
outClass = 'pt-page-scaleDown';
inClass = 'pt-page-moveFromLeft pt-page-ontop';
break;
case 19:
outClass = 'pt-page-scaleDown';
inClass = 'pt-page-moveFromBottom pt-page-ontop';
break;
case 20:
outClass = 'pt-page-scaleDown';
inClass = 'pt-page-moveFromTop pt-page-ontop';
break;
case 21:
outClass = 'pt-page-scaleDown';
inClass = 'pt-page-scaleUpDown pt-page-delay300';
break;
case 22:
outClass = 'pt-page-scaleDownUp';
inClass = 'pt-page-scaleUp pt-page-delay300';
break;
case 23:
outClass = 'pt-page-moveToLeft pt-page-ontop';
inClass = 'pt-page-scaleUp';
break;
case 24:
outClass = 'pt-page-moveToRight pt-page-ontop';
inClass = 'pt-page-scaleUp';
break;
case 25:
outClass = 'pt-page-moveToTop pt-page-ontop';
inClass = 'pt-page-scaleUp';
break;
case 26:
outClass = 'pt-page-moveToBottom pt-page-ontop';
inClass = 'pt-page-scaleUp';
break;
case 27:
outClass = 'pt-page-scaleDownCenter';
inClass = 'pt-page-scaleUpCenter pt-page-delay400';
break;
case 28:
outClass = 'pt-page-rotateRightSideFirst';
inClass = 'pt-page-moveFromRight pt-page-delay200 pt-page-ontop';
break;
case 29:
outClass = 'pt-page-rotateLeftSideFirst';
inClass = 'pt-page-moveFromLeft pt-page-delay200 pt-page-ontop';
break;
case 30:
outClass = 'pt-page-rotateTopSideFirst';
inClass = 'pt-page-moveFromTop pt-page-delay200 pt-page-ontop';
break;
case 31:
outClass = 'pt-page-rotateBottomSideFirst';
inClass = 'pt-page-moveFromBottom pt-page-delay200 pt-page-ontop';
break;
case 32:
outClass = 'pt-page-flipOutRight';
inClass = 'pt-page-flipInLeft pt-page-delay500';
break;
case 33:
outClass = 'pt-page-flipOutLeft';
inClass = 'pt-page-flipInRight pt-page-delay500';
break;
case 34:
outClass = 'pt-page-flipOutTop';
inClass = 'pt-page-flipInBottom pt-page-delay500';
break;
case 35:
outClass = 'pt-page-flipOutBottom';
inClass = 'pt-page-flipInTop pt-page-delay500';
break;
case 36:
outClass = 'pt-page-rotateFall pt-page-ontop';
inClass = 'pt-page-scaleUp';
break;
case 37:
outClass = 'pt-page-rotateOutNewspaper';
inClass = 'pt-page-rotateInNewspaper pt-page-delay500';
break;
case 38:
outClass = 'pt-page-rotatePushLeft';
inClass = 'pt-page-moveFromRight';
break;
case 39:
outClass = 'pt-page-rotatePushRight';
inClass = 'pt-page-moveFromLeft';
break;