skyron 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +28 -0
- data/Rakefile +2 -0
- data/lib/skyron.rb +9 -0
- data/lib/skyron/engine.rb +5 -0
- data/lib/skyron/version.rb +3 -0
- data/skyron.gemspec +17 -0
- data/stylesheets/_skyron.scss +0 -0
- data/stylesheets/skyron/_base.scss +0 -0
- data/stylesheets/skyron/_buttons.scss +0 -0
- data/stylesheets/skyron/_forms.scss +0 -0
- data/stylesheets/skyron/_grid.scss +0 -0
- data/stylesheets/skyron/_orbit.scss +0 -0
- data/stylesheets/skyron/_reveal.scss +0 -0
- data/stylesheets/skyron/_settings.scss +0 -0
- data/templates/project/.gitignore +44 -0
- data/templates/project/favicon.ico +0 -0
- data/templates/project/humans.txt +8 -0
- data/templates/project/index.html +133 -0
- data/templates/project/manifest.rb +61 -0
- data/templates/project/robots.txt +4 -0
- data/templates/project/sass/_settings.scss +48 -0
- data/templates/project/sass/skyron-styles/buttons.scss +0 -0
- data/templates/project/sass/skyron-styles/footer.scss +0 -0
- data/templates/project/sass/skyron-styles/forms.scss +0 -0
- data/templates/project/sass/skyron-styles/globals.scss +0 -0
- data/templates/project/sass/skyron-styles/grid.scss +0 -0
- data/templates/project/sass/skyron-styles/header.scss +0 -0
- data/templates/project/sass/skyron-styles/nav.scss +0 -0
- data/templates/project/sass/skyron-styles/orbit.scss +3 -0
- data/templates/project/sass/skyron-styles/pie.scss +73 -0
- data/templates/project/sass/skyron-styles/reveal.scss +3 -0
- data/templates/project/sass/skyron-styles/tabs.scss +0 -0
- data/templates/project/sass/style.scss +11 -0
- data/vendor/assets/images/orbit/bullets.jpg +0 -0
- data/vendor/assets/images/orbit/left-arrow-small.png +0 -0
- data/vendor/assets/images/orbit/left-arrow.png +0 -0
- data/vendor/assets/images/orbit/loading.gif +0 -0
- data/vendor/assets/images/orbit/mask-black.png +0 -0
- data/vendor/assets/images/orbit/pause-black.png +0 -0
- data/vendor/assets/images/orbit/right-arrow-small.png +0 -0
- data/vendor/assets/images/orbit/right-arrow.png +0 -0
- data/vendor/assets/images/orbit/rotator-black.png +0 -0
- data/vendor/assets/images/orbit/timer-black.png +0 -0
- data/vendor/assets/js/index.js +8 -0
- data/vendor/assets/js/jquery.customforms.js +258 -0
- data/vendor/assets/js/jquery.min.js +4 -0
- data/vendor/assets/js/jquery.offcanvas.js +50 -0
- data/vendor/assets/js/jquery.orbit-1.4.0.js +633 -0
- data/vendor/assets/js/jquery.placeholder.min.js +2 -0
- data/vendor/assets/js/jquery.reveal.js +178 -0
- data/vendor/assets/js/jquery.tooltips.js +166 -0
- data/vendor/assets/js/modernizr.js +4 -0
- data/vendor/assets/js/scripts.js +125 -0
- metadata +58 -2
@@ -0,0 +1,633 @@
|
|
1
|
+
/*
|
2
|
+
* jQuery Orbit Plugin 1.4.0
|
3
|
+
* www.ZURB.com/playground
|
4
|
+
* Copyright 2010, ZURB
|
5
|
+
* Free to use under the MIT license.
|
6
|
+
* http://www.opensource.org/licenses/mit-license.php
|
7
|
+
*/
|
8
|
+
|
9
|
+
|
10
|
+
(function($) {
|
11
|
+
'use strict';
|
12
|
+
$.fn.findFirstImage = function () {
|
13
|
+
return this.first()
|
14
|
+
.find('img')
|
15
|
+
.andSelf().filter('img')
|
16
|
+
.first();
|
17
|
+
};
|
18
|
+
|
19
|
+
var ORBIT = {
|
20
|
+
|
21
|
+
defaults: {
|
22
|
+
animation: 'horizontal-push', // fade, horizontal-slide, vertical-slide, horizontal-push, vertical-push
|
23
|
+
animationSpeed: 600, // how fast animtions are
|
24
|
+
timer: true, // true or false to have the timer
|
25
|
+
advanceSpeed: 4000, // if timer is enabled, time between transitions
|
26
|
+
pauseOnHover: false, // if you hover pauses the slider
|
27
|
+
startClockOnMouseOut: false, // if clock should start on MouseOut
|
28
|
+
startClockOnMouseOutAfter: 1000, // how long after MouseOut should the timer start again
|
29
|
+
directionalNav: true, // manual advancing directional navs
|
30
|
+
directionalNavRightText: 'Right', // text of right directional element for accessibility
|
31
|
+
directionalNavLeftText: 'Left', // text of left directional element for accessibility
|
32
|
+
captions: true, // do you want captions?
|
33
|
+
captionAnimation: 'fade', // fade, slideOpen, none
|
34
|
+
captionAnimationSpeed: 600, // if so how quickly should they animate in
|
35
|
+
resetTimerOnClick: false, // true resets the timer instead of pausing slideshow progress on manual navigation
|
36
|
+
bullets: false, // true or false to activate the bullet navigation
|
37
|
+
bulletThumbs: false, // thumbnails for the bullets
|
38
|
+
bulletThumbLocation: '', // location from this file where thumbs will be
|
39
|
+
afterSlideChange: $.noop, // empty function
|
40
|
+
afterLoadComplete: $.noop, //callback to execute after everything has been loaded
|
41
|
+
fluid: true,
|
42
|
+
centerBullets: true // center bullet nav with js, turn this off if you want to position the bullet nav manually
|
43
|
+
},
|
44
|
+
|
45
|
+
activeSlide: 0,
|
46
|
+
numberSlides: 0,
|
47
|
+
orbitWidth: null,
|
48
|
+
orbitHeight: null,
|
49
|
+
locked: null,
|
50
|
+
timerRunning: null,
|
51
|
+
degrees: 0,
|
52
|
+
wrapperHTML: '<div class="orbit-wrapper" />',
|
53
|
+
timerHTML: '<div class="timer"><span class="mask"><span class="rotator"></span></span><span class="pause"></span></div>',
|
54
|
+
captionHTML: '<div class="orbit-caption"></div>',
|
55
|
+
directionalNavHTML: '<div class="slider-nav"><span class="right"></span><span class="left"></span></div>',
|
56
|
+
bulletHTML: '<ul class="orbit-bullets"></ul>',
|
57
|
+
|
58
|
+
init: function (element, options) {
|
59
|
+
var $imageSlides,
|
60
|
+
imagesLoadedCount = 0,
|
61
|
+
self = this;
|
62
|
+
|
63
|
+
// Bind functions to correct context
|
64
|
+
this.clickTimer = $.proxy(this.clickTimer, this);
|
65
|
+
this.addBullet = $.proxy(this.addBullet, this);
|
66
|
+
this.resetAndUnlock = $.proxy(this.resetAndUnlock, this);
|
67
|
+
this.stopClock = $.proxy(this.stopClock, this);
|
68
|
+
this.startTimerAfterMouseLeave = $.proxy(this.startTimerAfterMouseLeave, this);
|
69
|
+
this.clearClockMouseLeaveTimer = $.proxy(this.clearClockMouseLeaveTimer, this);
|
70
|
+
this.rotateTimer = $.proxy(this.rotateTimer, this);
|
71
|
+
|
72
|
+
this.options = $.extend({}, this.defaults, options);
|
73
|
+
if (this.options.timer === 'false') this.options.timer = false;
|
74
|
+
if (this.options.captions === 'false') this.options.captions = false;
|
75
|
+
if (this.options.directionalNav === 'false') this.options.directionalNav = false;
|
76
|
+
|
77
|
+
this.$element = $(element);
|
78
|
+
this.$wrapper = this.$element.wrap(this.wrapperHTML).parent();
|
79
|
+
this.$slides = this.$element.children('img, a, div');
|
80
|
+
|
81
|
+
this.$element.bind('orbit.next', function () {
|
82
|
+
self.shift('next');
|
83
|
+
});
|
84
|
+
|
85
|
+
this.$element.bind('orbit.prev', function () {
|
86
|
+
self.shift('prev');
|
87
|
+
});
|
88
|
+
|
89
|
+
this.$element.bind('orbit.goto', function (event, index) {
|
90
|
+
self.shift(index);
|
91
|
+
});
|
92
|
+
|
93
|
+
this.$element.bind('orbit.start', function (event, index) {
|
94
|
+
self.startClock();
|
95
|
+
});
|
96
|
+
|
97
|
+
this.$element.bind('orbit.stop', function (event, index) {
|
98
|
+
self.stopClock();
|
99
|
+
});
|
100
|
+
|
101
|
+
$imageSlides = this.$slides.filter('img');
|
102
|
+
|
103
|
+
if ($imageSlides.length === 0) {
|
104
|
+
this.loaded();
|
105
|
+
} else {
|
106
|
+
$imageSlides.bind('imageready', function () {
|
107
|
+
imagesLoadedCount += 1;
|
108
|
+
if (imagesLoadedCount === $imageSlides.length) {
|
109
|
+
self.loaded();
|
110
|
+
}
|
111
|
+
});
|
112
|
+
}
|
113
|
+
},
|
114
|
+
|
115
|
+
loaded: function () {
|
116
|
+
this.$element
|
117
|
+
.addClass('orbit')
|
118
|
+
.css({width: '1px', height: '1px'});
|
119
|
+
|
120
|
+
this.$slides.addClass('orbit-slide');
|
121
|
+
|
122
|
+
this.setDimentionsFromLargestSlide();
|
123
|
+
this.updateOptionsIfOnlyOneSlide();
|
124
|
+
this.setupFirstSlide();
|
125
|
+
|
126
|
+
if (this.options.timer) {
|
127
|
+
this.setupTimer();
|
128
|
+
this.startClock();
|
129
|
+
}
|
130
|
+
|
131
|
+
if (this.options.captions) {
|
132
|
+
this.setupCaptions();
|
133
|
+
}
|
134
|
+
|
135
|
+
if (this.options.directionalNav) {
|
136
|
+
this.setupDirectionalNav();
|
137
|
+
}
|
138
|
+
|
139
|
+
if (this.options.bullets) {
|
140
|
+
this.setupBulletNav();
|
141
|
+
this.setActiveBullet();
|
142
|
+
}
|
143
|
+
|
144
|
+
this.options.afterLoadComplete.call(this);
|
145
|
+
},
|
146
|
+
|
147
|
+
currentSlide: function () {
|
148
|
+
return this.$slides.eq(this.activeSlide);
|
149
|
+
},
|
150
|
+
|
151
|
+
setDimentionsFromLargestSlide: function () {
|
152
|
+
//Collect all slides and set slider size of largest image
|
153
|
+
var self = this,
|
154
|
+
$fluidPlaceholder;
|
155
|
+
|
156
|
+
self.$element.add(self.$wrapper).width(this.$slides.first().outerWidth());
|
157
|
+
self.$element.add(self.$wrapper).height(this.$slides.first().height());
|
158
|
+
self.orbitWidth = this.$slides.first().outerWidth();
|
159
|
+
self.orbitHeight = this.$slides.first().height();
|
160
|
+
$fluidPlaceholder = this.$slides.first().findFirstImage().clone();
|
161
|
+
|
162
|
+
|
163
|
+
this.$slides.each(function () {
|
164
|
+
var slide = $(this),
|
165
|
+
slideWidth = slide.outerWidth(),
|
166
|
+
slideHeight = slide.height();
|
167
|
+
|
168
|
+
if (slideWidth > self.$element.outerWidth()) {
|
169
|
+
self.$element.add(self.$wrapper).width(slideWidth);
|
170
|
+
self.orbitWidth = self.$element.outerWidth();
|
171
|
+
}
|
172
|
+
if (slideHeight > self.$element.height()) {
|
173
|
+
self.$element.add(self.$wrapper).height(slideHeight);
|
174
|
+
self.orbitHeight = self.$element.height();
|
175
|
+
$fluidPlaceholder = $(this).findFirstImage().clone();
|
176
|
+
}
|
177
|
+
self.numberSlides += 1;
|
178
|
+
});
|
179
|
+
|
180
|
+
if (this.options.fluid) {
|
181
|
+
if (typeof this.options.fluid === "string") {
|
182
|
+
$fluidPlaceholder = $('<img src="http://placehold.it/' + this.options.fluid + '" />')
|
183
|
+
}
|
184
|
+
|
185
|
+
self.$element.prepend($fluidPlaceholder);
|
186
|
+
$fluidPlaceholder.addClass('fluid-placeholder');
|
187
|
+
self.$element.add(self.$wrapper).css({width: 'inherit'});
|
188
|
+
self.$element.add(self.$wrapper).css({height: 'inherit'});
|
189
|
+
|
190
|
+
$(window).bind('resize', function () {
|
191
|
+
self.orbitWidth = self.$element.outerWidth();
|
192
|
+
self.orbitHeight = self.$element.height();
|
193
|
+
});
|
194
|
+
}
|
195
|
+
},
|
196
|
+
|
197
|
+
//Animation locking functions
|
198
|
+
lock: function () {
|
199
|
+
this.locked = true;
|
200
|
+
},
|
201
|
+
|
202
|
+
unlock: function () {
|
203
|
+
this.locked = false;
|
204
|
+
},
|
205
|
+
|
206
|
+
updateOptionsIfOnlyOneSlide: function () {
|
207
|
+
if(this.$slides.length === 1) {
|
208
|
+
this.options.directionalNav = false;
|
209
|
+
this.options.timer = false;
|
210
|
+
this.options.bullets = false;
|
211
|
+
}
|
212
|
+
},
|
213
|
+
|
214
|
+
setupFirstSlide: function () {
|
215
|
+
//Set initial front photo z-index and fades it in
|
216
|
+
var self = this;
|
217
|
+
this.$slides.first()
|
218
|
+
.css({"z-index" : 3})
|
219
|
+
.fadeIn(function() {
|
220
|
+
//brings in all other slides IF css declares a display: none
|
221
|
+
self.$slides.css({"display":"block"})
|
222
|
+
});
|
223
|
+
},
|
224
|
+
|
225
|
+
startClock: function () {
|
226
|
+
var self = this;
|
227
|
+
|
228
|
+
if(!this.options.timer) {
|
229
|
+
return false;
|
230
|
+
}
|
231
|
+
|
232
|
+
if (this.$timer.is(':hidden')) {
|
233
|
+
this.clock = setInterval(function () {
|
234
|
+
self.$element.trigger('orbit.next');
|
235
|
+
}, this.options.advanceSpeed);
|
236
|
+
} else {
|
237
|
+
this.timerRunning = true;
|
238
|
+
this.$pause.removeClass('active')
|
239
|
+
this.clock = setInterval(this.rotateTimer, this.options.advanceSpeed / 180);
|
240
|
+
}
|
241
|
+
},
|
242
|
+
|
243
|
+
rotateTimer: function (reset) {
|
244
|
+
var degreeCSS = "rotate(" + this.degrees + "deg)"
|
245
|
+
this.degrees += 2;
|
246
|
+
this.$rotator.css({
|
247
|
+
"-webkit-transform": degreeCSS,
|
248
|
+
"-moz-transform": degreeCSS,
|
249
|
+
"-o-transform": degreeCSS
|
250
|
+
});
|
251
|
+
if(this.degrees > 180) {
|
252
|
+
this.$rotator.addClass('move');
|
253
|
+
this.$mask.addClass('move');
|
254
|
+
}
|
255
|
+
if(this.degrees > 360 || reset) {
|
256
|
+
this.$rotator.removeClass('move');
|
257
|
+
this.$mask.removeClass('move');
|
258
|
+
this.degrees = 0;
|
259
|
+
this.$element.trigger('orbit.next');
|
260
|
+
}
|
261
|
+
},
|
262
|
+
|
263
|
+
stopClock: function () {
|
264
|
+
if (!this.options.timer) {
|
265
|
+
return false;
|
266
|
+
} else {
|
267
|
+
this.timerRunning = false;
|
268
|
+
clearInterval(this.clock);
|
269
|
+
this.$pause.addClass('active');
|
270
|
+
}
|
271
|
+
},
|
272
|
+
|
273
|
+
setupTimer: function () {
|
274
|
+
this.$timer = $(this.timerHTML);
|
275
|
+
this.$wrapper.append(this.$timer);
|
276
|
+
|
277
|
+
this.$rotator = this.$timer.find('.rotator');
|
278
|
+
this.$mask = this.$timer.find('.mask');
|
279
|
+
this.$pause = this.$timer.find('.pause');
|
280
|
+
|
281
|
+
this.$timer.click(this.clickTimer);
|
282
|
+
|
283
|
+
if (this.options.startClockOnMouseOut) {
|
284
|
+
this.$wrapper.mouseleave(this.startTimerAfterMouseLeave);
|
285
|
+
this.$wrapper.mouseenter(this.clearClockMouseLeaveTimer);
|
286
|
+
}
|
287
|
+
|
288
|
+
if (this.options.pauseOnHover) {
|
289
|
+
this.$wrapper.mouseenter(this.stopClock);
|
290
|
+
}
|
291
|
+
},
|
292
|
+
|
293
|
+
startTimerAfterMouseLeave: function () {
|
294
|
+
var self = this;
|
295
|
+
|
296
|
+
this.outTimer = setTimeout(function() {
|
297
|
+
if(!self.timerRunning){
|
298
|
+
self.startClock();
|
299
|
+
}
|
300
|
+
}, this.options.startClockOnMouseOutAfter)
|
301
|
+
},
|
302
|
+
|
303
|
+
clearClockMouseLeaveTimer: function () {
|
304
|
+
clearTimeout(this.outTimer);
|
305
|
+
},
|
306
|
+
|
307
|
+
clickTimer: function () {
|
308
|
+
if(!this.timerRunning) {
|
309
|
+
this.startClock();
|
310
|
+
} else {
|
311
|
+
this.stopClock();
|
312
|
+
}
|
313
|
+
},
|
314
|
+
|
315
|
+
setupCaptions: function () {
|
316
|
+
this.$caption = $(this.captionHTML);
|
317
|
+
this.$wrapper.append(this.$caption);
|
318
|
+
this.setCaption();
|
319
|
+
},
|
320
|
+
|
321
|
+
setCaption: function () {
|
322
|
+
var captionLocation = this.currentSlide().attr('data-caption'),
|
323
|
+
captionHTML;
|
324
|
+
|
325
|
+
if (!this.options.captions) {
|
326
|
+
return false;
|
327
|
+
}
|
328
|
+
|
329
|
+
//Set HTML for the caption if it exists
|
330
|
+
if (captionLocation) {
|
331
|
+
//if caption text is blank, don't show captions
|
332
|
+
if ($.trim($(captionLocation).text()).length < 1){
|
333
|
+
return false;
|
334
|
+
}
|
335
|
+
captionHTML = $(captionLocation).html(); //get HTML from the matching HTML entity
|
336
|
+
this.$caption
|
337
|
+
.attr('id', captionLocation) // Add ID caption TODO why is the id being set?
|
338
|
+
.html(captionHTML); // Change HTML in Caption
|
339
|
+
//Animations for Caption entrances
|
340
|
+
switch (this.options.captionAnimation) {
|
341
|
+
case 'none':
|
342
|
+
this.$caption.show();
|
343
|
+
break;
|
344
|
+
case 'fade':
|
345
|
+
this.$caption.fadeIn(this.options.captionAnimationSpeed);
|
346
|
+
break;
|
347
|
+
case 'slideOpen':
|
348
|
+
this.$caption.slideDown(this.options.captionAnimationSpeed);
|
349
|
+
break;
|
350
|
+
}
|
351
|
+
} else {
|
352
|
+
//Animations for Caption exits
|
353
|
+
switch (this.options.captionAnimation) {
|
354
|
+
case 'none':
|
355
|
+
this.$caption.hide();
|
356
|
+
break;
|
357
|
+
case 'fade':
|
358
|
+
this.$caption.fadeOut(this.options.captionAnimationSpeed);
|
359
|
+
break;
|
360
|
+
case 'slideOpen':
|
361
|
+
this.$caption.slideUp(this.options.captionAnimationSpeed);
|
362
|
+
break;
|
363
|
+
}
|
364
|
+
}
|
365
|
+
},
|
366
|
+
|
367
|
+
setupDirectionalNav: function () {
|
368
|
+
var self = this,
|
369
|
+
$directionalNav = $(this.directionalNavHTML);
|
370
|
+
|
371
|
+
$directionalNav.find('.right').html(this.options.directionalNavRightText);
|
372
|
+
$directionalNav.find('.left').html(this.options.directionalNavLeftText);
|
373
|
+
|
374
|
+
this.$wrapper.append($directionalNav);
|
375
|
+
|
376
|
+
this.$wrapper.find('.left').click(function () {
|
377
|
+
self.stopClock();
|
378
|
+
if (self.options.resetTimerOnClick) {
|
379
|
+
self.rotateTimer(true);
|
380
|
+
self.startClock();
|
381
|
+
}
|
382
|
+
self.$element.trigger('orbit.prev');
|
383
|
+
});
|
384
|
+
|
385
|
+
this.$wrapper.find('.right').click(function () {
|
386
|
+
self.stopClock();
|
387
|
+
if (self.options.resetTimerOnClick) {
|
388
|
+
self.rotateTimer(true);
|
389
|
+
self.startClock();
|
390
|
+
}
|
391
|
+
self.$element.trigger('orbit.next');
|
392
|
+
});
|
393
|
+
},
|
394
|
+
|
395
|
+
setupBulletNav: function () {
|
396
|
+
this.$bullets = $(this.bulletHTML);
|
397
|
+
this.$wrapper.append(this.$bullets);
|
398
|
+
this.$slides.each(this.addBullet);
|
399
|
+
this.$element.addClass('with-bullets');
|
400
|
+
if (this.options.centerBullets) this.$bullets.css('margin-left', -this.$bullets.outerWidth() / 2);
|
401
|
+
},
|
402
|
+
|
403
|
+
addBullet: function (index, slide) {
|
404
|
+
var position = index + 1,
|
405
|
+
$li = $('<li>' + (position) + '</li>'),
|
406
|
+
thumbName,
|
407
|
+
self = this;
|
408
|
+
|
409
|
+
if (this.options.bulletThumbs) {
|
410
|
+
thumbName = $(slide).attr('data-thumb');
|
411
|
+
if (thumbName) {
|
412
|
+
$li
|
413
|
+
.addClass('has-thumb')
|
414
|
+
.css({background: "url(" + this.options.bulletThumbLocation + thumbName + ") no-repeat"});;
|
415
|
+
}
|
416
|
+
}
|
417
|
+
this.$bullets.append($li);
|
418
|
+
$li.data('index', index);
|
419
|
+
$li.click(function () {
|
420
|
+
self.stopClock();
|
421
|
+
if (self.options.resetTimerOnClick) {
|
422
|
+
self.rotateTimer(true);
|
423
|
+
self.startClock();
|
424
|
+
}
|
425
|
+
self.$element.trigger('orbit.goto', [$li.data('index')])
|
426
|
+
});
|
427
|
+
},
|
428
|
+
|
429
|
+
setActiveBullet: function () {
|
430
|
+
if(!this.options.bullets) { return false; } else {
|
431
|
+
this.$bullets.find('li')
|
432
|
+
.removeClass('active')
|
433
|
+
.eq(this.activeSlide)
|
434
|
+
.addClass('active');
|
435
|
+
}
|
436
|
+
},
|
437
|
+
|
438
|
+
resetAndUnlock: function () {
|
439
|
+
this.$slides
|
440
|
+
.eq(this.prevActiveSlide)
|
441
|
+
.css({"z-index" : 1});
|
442
|
+
this.unlock();
|
443
|
+
this.options.afterSlideChange.call(this, this.$slides.eq(this.prevActiveSlide), this.$slides.eq(this.activeSlide));
|
444
|
+
},
|
445
|
+
|
446
|
+
shift: function (direction) {
|
447
|
+
var slideDirection = direction;
|
448
|
+
|
449
|
+
//remember previous activeSlide
|
450
|
+
this.prevActiveSlide = this.activeSlide;
|
451
|
+
|
452
|
+
//exit function if bullet clicked is same as the current image
|
453
|
+
if (this.prevActiveSlide == slideDirection) { return false; }
|
454
|
+
|
455
|
+
if (this.$slides.length == "1") { return false; }
|
456
|
+
if (!this.locked) {
|
457
|
+
this.lock();
|
458
|
+
//deduce the proper activeImage
|
459
|
+
if (direction == "next") {
|
460
|
+
this.activeSlide++;
|
461
|
+
if (this.activeSlide == this.numberSlides) {
|
462
|
+
this.activeSlide = 0;
|
463
|
+
}
|
464
|
+
} else if (direction == "prev") {
|
465
|
+
this.activeSlide--
|
466
|
+
if (this.activeSlide < 0) {
|
467
|
+
this.activeSlide = this.numberSlides - 1;
|
468
|
+
}
|
469
|
+
} else {
|
470
|
+
this.activeSlide = direction;
|
471
|
+
if (this.prevActiveSlide < this.activeSlide) {
|
472
|
+
slideDirection = "next";
|
473
|
+
} else if (this.prevActiveSlide > this.activeSlide) {
|
474
|
+
slideDirection = "prev"
|
475
|
+
}
|
476
|
+
}
|
477
|
+
|
478
|
+
//set to correct bullet
|
479
|
+
this.setActiveBullet();
|
480
|
+
|
481
|
+
//set previous slide z-index to one below what new activeSlide will be
|
482
|
+
this.$slides
|
483
|
+
.eq(this.prevActiveSlide)
|
484
|
+
.css({"z-index" : 2});
|
485
|
+
|
486
|
+
//fade
|
487
|
+
if (this.options.animation == "fade") {
|
488
|
+
this.$slides
|
489
|
+
.eq(this.activeSlide)
|
490
|
+
.css({"opacity" : 0, "z-index" : 3})
|
491
|
+
.animate({"opacity" : 1}, this.options.animationSpeed, this.resetAndUnlock);
|
492
|
+
}
|
493
|
+
|
494
|
+
//horizontal-slide
|
495
|
+
if (this.options.animation == "horizontal-slide") {
|
496
|
+
if (slideDirection == "next") {
|
497
|
+
this.$slides
|
498
|
+
.eq(this.activeSlide)
|
499
|
+
.css({"left": this.orbitWidth, "z-index" : 3})
|
500
|
+
.animate({"left" : 0}, this.options.animationSpeed, this.resetAndUnlock);
|
501
|
+
}
|
502
|
+
if (slideDirection == "prev") {
|
503
|
+
this.$slides
|
504
|
+
.eq(this.activeSlide)
|
505
|
+
.css({"left": -this.orbitWidth, "z-index" : 3})
|
506
|
+
.animate({"left" : 0}, this.options.animationSpeed, this.resetAndUnlock);
|
507
|
+
}
|
508
|
+
}
|
509
|
+
|
510
|
+
//vertical-slide
|
511
|
+
if (this.options.animation == "vertical-slide") {
|
512
|
+
if (slideDirection == "prev") {
|
513
|
+
this.$slides
|
514
|
+
.eq(this.activeSlide)
|
515
|
+
.css({"top": this.orbitHeight, "z-index" : 3})
|
516
|
+
.animate({"top" : 0}, this.options.animationSpeed, this.resetAndUnlock);
|
517
|
+
}
|
518
|
+
if (slideDirection == "next") {
|
519
|
+
this.$slides
|
520
|
+
.eq(this.activeSlide)
|
521
|
+
.css({"top": -this.orbitHeight, "z-index" : 3})
|
522
|
+
.animate({"top" : 0}, this.options.animationSpeed, this.resetAndUnlock);
|
523
|
+
}
|
524
|
+
}
|
525
|
+
|
526
|
+
//horizontal-push
|
527
|
+
if (this.options.animation == "horizontal-push") {
|
528
|
+
if (slideDirection == "next") {
|
529
|
+
this.$slides
|
530
|
+
.eq(this.activeSlide)
|
531
|
+
.css({"left": this.orbitWidth, "z-index" : 3})
|
532
|
+
.animate({"left" : 0}, this.options.animationSpeed, this.resetAndUnlock);
|
533
|
+
this.$slides
|
534
|
+
.eq(this.prevActiveSlide)
|
535
|
+
.animate({"left" : -this.orbitWidth}, this.options.animationSpeed);
|
536
|
+
}
|
537
|
+
if (slideDirection == "prev") {
|
538
|
+
this.$slides
|
539
|
+
.eq(this.activeSlide)
|
540
|
+
.css({"left": -this.orbitWidth, "z-index" : 3})
|
541
|
+
.animate({"left" : 0}, this.options.animationSpeed, this.resetAndUnlock);
|
542
|
+
this.$slides
|
543
|
+
.eq(this.prevActiveSlide)
|
544
|
+
.animate({"left" : this.orbitWidth}, this.options.animationSpeed);
|
545
|
+
}
|
546
|
+
}
|
547
|
+
|
548
|
+
//vertical-push
|
549
|
+
if (this.options.animation == "vertical-push") {
|
550
|
+
if (slideDirection == "next") {
|
551
|
+
this.$slides
|
552
|
+
.eq(this.activeSlide)
|
553
|
+
.css({top: -this.orbitHeight, "z-index" : 3})
|
554
|
+
.animate({top : 0}, this.options.animationSpeed, this.resetAndUnlock);
|
555
|
+
this.$slides
|
556
|
+
.eq(this.prevActiveSlide)
|
557
|
+
.animate({top : this.orbitHeight}, this.options.animationSpeed);
|
558
|
+
}
|
559
|
+
if (slideDirection == "prev") {
|
560
|
+
this.$slides
|
561
|
+
.eq(this.activeSlide)
|
562
|
+
.css({top: this.orbitHeight, "z-index" : 3})
|
563
|
+
.animate({top : 0}, this.options.animationSpeed, this.resetAndUnlock);
|
564
|
+
this.$slides
|
565
|
+
.eq(this.prevActiveSlide)
|
566
|
+
.animate({top : -this.orbitHeight}, this.options.animationSpeed);
|
567
|
+
}
|
568
|
+
}
|
569
|
+
|
570
|
+
this.setCaption();
|
571
|
+
}
|
572
|
+
}
|
573
|
+
};
|
574
|
+
|
575
|
+
$.fn.orbit = function (options) {
|
576
|
+
return this.each(function () {
|
577
|
+
var orbit = $.extend({}, ORBIT);
|
578
|
+
orbit.init(this, options);
|
579
|
+
});
|
580
|
+
};
|
581
|
+
|
582
|
+
})(jQuery);
|
583
|
+
|
584
|
+
/*!
|
585
|
+
* jQuery imageready Plugin
|
586
|
+
* http://www.zurb.com/playground/
|
587
|
+
*
|
588
|
+
* Copyright 2011, ZURB
|
589
|
+
* Released under the MIT License
|
590
|
+
*/
|
591
|
+
(function ($) {
|
592
|
+
|
593
|
+
var options = {};
|
594
|
+
|
595
|
+
$.event.special.imageready = {
|
596
|
+
|
597
|
+
setup: function (data, namespaces, eventHandle) {
|
598
|
+
options = data || options;
|
599
|
+
},
|
600
|
+
|
601
|
+
add: function (handleObj) {
|
602
|
+
var $this = $(this),
|
603
|
+
src;
|
604
|
+
|
605
|
+
if ( this.nodeType === 1 && this.tagName.toLowerCase() === 'img' && this.src !== '' ) {
|
606
|
+
if (options.forceLoad) {
|
607
|
+
src = $this.attr('src');
|
608
|
+
$this.attr('src', '');
|
609
|
+
bindToLoad(this, handleObj.handler);
|
610
|
+
$this.attr('src', src);
|
611
|
+
} else if ( this.complete || this.readyState === 4 ) {
|
612
|
+
handleObj.handler.apply(this, arguments);
|
613
|
+
} else {
|
614
|
+
bindToLoad(this, handleObj.handler);
|
615
|
+
}
|
616
|
+
}
|
617
|
+
},
|
618
|
+
|
619
|
+
teardown: function (namespaces) {
|
620
|
+
$(this).unbind('.imageready');
|
621
|
+
}
|
622
|
+
};
|
623
|
+
|
624
|
+
function bindToLoad(element, callback) {
|
625
|
+
var $this = $(element);
|
626
|
+
|
627
|
+
$this.bind('load.imageready', function () {
|
628
|
+
callback.apply(element, arguments);
|
629
|
+
$this.unbind('load.imageready');
|
630
|
+
});
|
631
|
+
}
|
632
|
+
|
633
|
+
}(jQuery));
|