1/** 2 * jQuery Skitter Slideshow 3 * @name jquery.skitter.js 4 * @description Slideshow 5 * @author Thiago Silva Ferreira - http://thiagosf.net 6 * @version 4.0 7 * @date August 04, 2010 8 * @update April 19, 2012 9 * @copyright (c) 2010 Thiago Silva Ferreira - http://thiagosf.net 10 * @license Dual licensed under the MIT or GPL Version 2 licenses 11 * @example http://thiagosf.net/projects/jquery/skitter/ 12 */ 13(function($) { 14 15 var number_skitter = 0, 16 skitters = []; 17 18 $.fn.skitter = function(options) { 19 return this.each(function() { 20 $(this).data('skitter_number', number_skitter); 21 skitters.push(new $sk(this, options, number_skitter)); 22 ++number_skitter; 23 }); 24 }; 25 26 var defaults = { 27 velocity: 1, 28 interval: 2500, 29 animation: '', 30 numbers: true, 31 navigation: true, 32 label: true, 33 easing_default: '', 34 box_skitter: null, 35 time_interval: null, 36 images_links: null, 37 image_atual: null, 38 link_atual: null, 39 label_atual: null, 40 target_atual: '_self', 41 width_skitter: null, 42 height_skitter: null, 43 image_i: 1, 44 is_animating: false, 45 is_hover_box_skitter: false, 46 random_ia: null, 47 show_randomly: false, 48 thumbs: false, 49 animateNumberOut: {backgroundColor:'#333', color:'#fff'}, 50 animateNumberOver: {backgroundColor:'#fff', color:'#000'}, 51 animateNumberActive: {backgroundColor:'#cc3333', color:'#fff'}, 52 hideTools: false, 53 fullscreen: false, 54 xml: false, 55 dots: false, 56 width_label: null, 57 opacity_elements: 0.75, // Final opacity of elements in hideTools 58 interval_in_elements: 300, // Interval animation hover elements hideTools 59 interval_out_elements: 500, // Interval animation out elements hideTools 60 onLoad: null, 61 imageSwitched: null, 62 max_number_height: 20, 63 numbers_align: 'left', 64 preview: false, 65 focus: false, 66 foucs_active: false, 67 focus_position: 'center', 68 controls: false, 69 controls_position: 'center', 70 progressbar: false, 71 progressbar_css: {}, 72 is_paused: false, 73 is_blur: false, 74 is_paused_time: false, 75 timeStart: 0, 76 elapsedTime: 0, 77 width: '100%', 78 height: '30%', 79 minHeight: '', 80 stop_over: true, 81 enable_navigation_keys: false, 82 with_animations: [], 83 mouseOverButton: function() { $(this).stop().animate({opacity:0.5}, 200); }, 84 mouseOutButton: function() { $(this).stop().animate({opacity:1}, 200); }, 85 auto_play: true, 86 structure: '<a href="#" class="prev_button">prev</a>' 87 + '<a href="#" class="next_button">next</a>' 88 + '<span class="info_slide"></span>' 89 + '<div class="container_skitter">' 90 + '<div class="image">' 91 + '<a href=""><img class="image_main" /></a>' 92 + '<div class="label_skitter"></div>' 93 + '</div>' 94 + '</div>' 95 96 }; 97 98 $.skitter = function(obj, options, number) { 99 this.box_skitter = $(obj); 100 this.timer = null; 101 this.settings = $.extend({}, defaults, options || {}); 102 this.number_skitter = number; 103 this.setup(); 104 }; 105 // Shortcut 106 var $sk = $.skitter; 107 $sk.fn = $sk.prototype = {}; 108 $sk.fn.extend = $.extend; 109 $sk.fn.extend({ 110 /** 111 * Init 112 */ 113 setup: function() 114 { 115 var self = this; 116 // Fullscreen 117 if (this.settings.fullscreen) { 118 var width = $(window).width(); 119 var height = $(window).height(); 120 this.box_skitter.width(width).height(height); 121 this.box_skitter.css({'position':'absolute', 'top':0, 'left':0, 'z-index':1000}); 122 this.settings.stop_over = false; 123 $('body').css({'overflown':'hidden'}); 124 } 125 this.box_skitter.wrap('<div class="vtemskitter-wrapper" />'); 126 this.box_skitter.parent().css({'width':this.settings.width, 'overflow':'hidden', 'height':'auto', 'display':'block'}); 127 //SET WIDTH FOR MODULE 128 if(this.settings.width.indexOf('%')!=-1 || this.settings.width=='auto') { 129 this.settings.width_skitter = parseFloat(this.box_skitter.parent().width()); 130 }else{ 131 this.settings.width_skitter = parseFloat(this.settings.width); 132 } 133 //SET HEIGHT FOR MODULE 134 if(this.settings.height.indexOf('%')!=-1) { 135 var startH = Math.round(this.settings.width_skitter / (100/parseFloat(this.settings.height))); 136 if(this.settings.minHeight != '' && startH < parseFloat(this.settings.minHeight)){ 137 h = parseFloat(this.settings.minHeight); 138 } else { 139 h = startH; 140 } 141 this.settings.height_skitter = parseFloat(h); 142 } else if (this.settings.height=='auto') { 143 h = this.box_skitter.height(); 144 } else { 145 h = this.settings.height; 146 this.settings.height_skitter = parseFloat(h); 147 } 148 //this.settings.height_skitter = parseFloat(this.box_skitter.css('height')); 149 150 if (!this.settings.width_skitter || !this.settings.height_skitter) { 151 console.warn('Width or height size is null! - Skitter Slideshow'); 152 return false;
153 } 154 155 // Structure html 156 this.box_skitter.append(this.settings.structure); 157 158 // Settings 159 this.settings.easing_default = this.getEasing(this.settings.easing); 160 161 if (this.settings.velocity >= 2) this.settings.velocity = 1.3; 162 if (this.settings.velocity <= 0) this.settings.velocity = 1; 163 164 this.box_skitter.find('.info_slide').hide(); 165 this.box_skitter.find('.label_skitter').hide(); 166 this.box_skitter.find('.prev_button').hide(); 167 this.box_skitter.find('.next_button').hide(); 168 this.box_skitter.find('.container_skitter').width(this.settings.width_skitter).height(this.settings.height_skitter); 169 var width_label = this.settings.width_label ? this.settings.width_label : this.settings.width_skitter; 170 this.box_skitter.find('.label_skitter').width(width_label); 171 172 var initial_select_class = ' image_number_select', u = 0; 173 this.settings.images_links = new Array(); 174 175 // Add image, link, animation type and label 176 var addImageLink = function (link, src, animation_type, label, target) { 177 self.settings.images_links.push([src, link, animation_type, label, target]); 178 if (self.settings.thumbs) { 179 var dimension_thumb = ''; 180 if (self.settings.width_skitter > self.settings.height_skitter) { 181 dimension_thumb = 'height="100"'; 182 } 183 else { 184 dimension_thumb = 'width="100"'; 185 } 186 self.box_skitter.find('.info_slide').append( 187 '<span class="image_number'+initial_select_class+'" rel="'+(u - 1)+'" id="image_n_'+u+'_'+self.number_skitter+'">' 188 +'<img src="'+src+'" '+dimension_thumb+' />' 189 +'</span> ' 190 ); 191 } 192 else { 193 self.box_skitter.find('.info_slide').append( 194 '<span class="image_number'+initial_select_class+'" rel="'+(u - 1)+'" id="image_n_'+u+'_'+self.number_skitter+'">'+u+'</span> ' 195 ); 196 } 197 initial_select_class = ''; 198 }; 199 // Load from XML 200 if (this.settings.xml) { 201 $.ajax({ 202 type: 'GET', 203 url: this.settings.xml, 204 async: false, 205 dataType: 'xml', 206 success: function(xml) { 207 var ul = $('<ul></ul>'); 208 $(xml).find('skitter slide').each(function(){ 209 ++u; 210 var link = ($(this).find('link').text()) ? $(this).find('link').text() : '#'; 211 var src = $(this).find('image').text(); 212 var animation_type = $(this).find('image').attr('type'); 213 var label = $(this).find('label').text(); 214 var target = ($(this).find('target').text()) ? $(this).find('target').text() : '_self'; 215 addImageLink(link, src, animation_type, label, target); 216 }); 217 } 218 }); 219 } 220 // Load from json 221 else if (this.settings.json) { 222 223 } 224 // Load from HTML 225 else { 226 this.box_skitter.find('ul li').each(function(){ 227 ++u; 228 var link = ($(this).find('a').length) ? $(this).find('a').attr('href') : '#'; 229 var src = $(this).find('img').attr('src'); 230 var animation_type = $(this).find('img').attr('class'); 231 var label = $(this).find('.label_text').html(); 232 var target = ($(this).find('a').length && $(this).find('a').attr('target')) ? $(this).find('a').attr('target') : '_self'; 233 addImageLink(link, src, animation_type, label, target); 234 }); 235 } 236 237 // Thumbs 238 if (self.settings.thumbs && !self.settings.fullscreen) 239 { 240 // New animation 241 self.settings.animateNumberOut = {opacity:0.3}; 242 self.settings.animateNumberOver = {opacity:0.5}; 243 self.settings.animateNumberActive = {opacity:1}; 244 245 self.box_skitter.find('.info_slide').addClass('info_slide_thumb'); 246 var width_info_slide = (u + 1) * self.box_skitter.find('.info_slide_thumb .image_number').width(); 247 self.box_skitter.find('.info_slide_thumb').width(width_info_slide); 248 self.box_skitter.css({height:self.box_skitter.height() + self.box_skitter.find('.info_slide').height()}); 249 250 self.box_skitter.append('<div class="container_thumbs"></div>'); 251 var copy_info_slide = self.box_skitter.find('.info_slide').clone(); 252 self.box_skitter.find('.info_slide').remove(); 253 self.box_skitter.find('.container_thumbs') 254 .width(self.settings.width_skitter) 255 .append(copy_info_slide); 256 257 // Scrolling with mouse movement 258 var width_image = 0, 259 width_skitter = this.settings.width_skitter, 260 height_skitter = this.settings.height_skitter, 261 w_info_slide_thumb = 0, 262 info_slide_thumb = self.box_skitter.find('.info_slide_thumb'), 263 x_value = 0, 264 y_value = self.box_skitter.offset().top; 265 266 info_slide_thumb.find('.image_number').each(function(){ 267 width_image += $(this).outerWidth(); 268 }); 269 270 info_slide_thumb.width(width_image+'px'); 271 w_info_slide_thumb = info_slide_thumb.width(); 272 width_value = this.settings.width_skitter; 273 274 width_value = width_skitter - 100; 275 276 if (width_info_slide > self.settings.width_skitter) { 277 self.box_skitter.mousemove(function(e){ 278 x_value = self.box_skitter.offset().left + 90; 279
280 var x = e.pageX, y = e.pageY, new_x = 0; 281 282 x = x - x_value; 283 y = y - y_value; 284 novo_width = w_info_slide_thumb - width_value; 285 new_x = -((novo_width * x) / width_value); 286 287 if (new_x > 0) new_x = 0; 288 if (new_x < -(w_info_slide_thumb - width_skitter)) new_x = -(w_info_slide_thumb - width_skitter); 289 290 if (y > height_skitter) { 291 info_slide_thumb.css({left: new_x}); 292 } 293 }); 294 } 295 296 self.box_skitter.find('.scroll_thumbs').css({'left':10}); 297 298 if (width_info_slide < self.settings.width_skitter) { 299 self.box_skitter.find('.info_slide').width('auto'); 300 self.box_skitter.find('.box_scroll_thumbs').hide(); 301 302 var class_info = '.info_slide'; 303 switch (self.settings.numbers_align) { 304 case 'center' : 305 var _vleft = (self.settings.width_skitter - self.box_skitter.find(class_info).width()) / 2; 306 self.box_skitter.find(class_info).css({'left':_vleft}); 307 break; 308 309 case 'right' : 310 self.box_skitter.find(class_info).css({'left':'auto', 'right':'-5px'}); 311 break; 312 313 case 'left' : 314 self.box_skitter.find(class_info).css({'left':'0px'}); 315 break; 316 } 317 } 318 319 } 320 else 321 { 322 var class_info = '.info_slide'; 323 324 if (self.settings.dots) { 325 self.box_skitter.find('.info_slide').addClass('info_slide_dots').removeClass('info_slide'); 326 class_info = '.info_slide_dots'; 327 } 328 329 switch (self.settings.numbers_align) { 330 case 'center' : 331 var _vleft = (self.settings.width_skitter - self.box_skitter.find(class_info).width()) / 2; 332 self.box_skitter.find(class_info).css({'left':_vleft}); 333 break; 334 335 case 'right' : 336 self.box_skitter.find(class_info).css({'left':'auto', 'right':'15px'}); 337 break; 338 339 case 'left' : 340 self.box_skitter.find(class_info).css({'left':'15px'}); 341 break; 342 } 343 344 if (!self.settings.dots) { 345 if (self.box_skitter.find('.info_slide').height() > 20) { 346 self.box_skitter.find('.info_slide').hide(); 347 } 348 } 349 } 350 351 this.box_skitter.find('ul.skitter-data').remove(); 352 353 if (this.settings.show_randomly) 354 this.settings.images_links.sort(function(a,b) {return Math.random() - 0.5;}); 355 356 this.settings.image_atual = this.settings.images_links[0][0]; 357 this.settings.link_atual = this.settings.images_links[0][1]; 358 this.settings.label_atual = this.settings.images_links[0][3]; 359 this.settings.target_atual = this.settings.images_links[0][4]; 360 361 if (this.settings.images_links.length > 1) 362 { 363 this.box_skitter.find('.prev_button').click(function() { 364 if (self.settings.is_animating == false) { 365 366 self.settings.image_i -= 2; 367 368 if (self.settings.image_i == -2) { 369 self.settings.image_i = self.settings.images_links.length - 2; 370 } 371 else if (self.settings.image_i == -1) { 372 self.settings.image_i = self.settings.images_links.length - 1; 373 } 374 375 self.jumpToImage(self.settings.image_i); 376 } 377 return false; 378 }); 379 380 this.box_skitter.find('.next_button').click(function() { 381 self.jumpToImage(self.settings.image_i); 382 return false; 383 }); 384 385 self.box_skitter.find('.next_button, .prev_button').bind('mouseover', self.settings.mouseOverButton); 386 self.box_skitter.find('.next_button, .prev_button').bind('mouseleave', self.settings.mouseOutButton); 387 388 this.box_skitter.find('.image_number').hover(function() { 389 if ($(this).attr('class') != 'image_number image_number_select') { 390 $(this).stop().animate(self.settings.animateNumberOver, 300); 391 } 392 }, function(){ 393 if ($(this).attr('class') != 'image_number image_number_select') { 394 $(this).stop().animate(self.settings.animateNumberOut, 500); 395 } 396 }); 397 398 this.box_skitter.find('.image_number').click(function(){ 399 if ($(this).attr('class') != 'image_number image_number_select') { 400 var imageNumber = parseInt($(this).attr('rel')); 401 self.jumpToImage(imageNumber); 402 } 403 return false; 404 }); 405 406 this.box_skitter.find('.image_number').css(self.settings.animateNumberOut); 407 this.box_skitter.find('.image_number:eq(0)').css(self.settings.animateNumberActive); 408 409 // Preview with dots 410 if (self.settings.preview && self.settings.dots) 411 { 412 var preview = $('<div class="preview_slide"><ul></ul></div>'); 413 414 for (var i = 0; i < this.settings.images_links.length; i++) { 415 var li = $('<li></li>'); 416 var img = $('<img />'); 417 img.attr('src', this.settings.images_links[i][0]); 418 li.append(img); 419 preview.find('ul').append(li); 420 } 421 422 var width_preview_ul = parseInt(this.settings.images_links.length * 100); 423 preview.find('ul').width(width_preview_ul); 424 $(class_info).append(preview); 425 426 self.box_skitter.find(class_info).find('.image_number').mouseenter(function() { 427 var _left_info = parseFloat(self.box_skitter.find(class_info).offset().left); 428 var _left_image = parseFloat($(this).offset().left); 429 var _left_preview = (_left_image - _left_info) - 43; 430 431 var rel = parseInt($(this).attr('rel')); 432 var image_current_preview = self.box_skitter.find('.preview_slide_current img').attr('src'); 433 var _left_ul = -(rel * 100); 434 435 self.box_skitter.find('.preview_slide').find('ul').animate({left: _left_ul}, {duration:200, queue: false, easing: 'easeOutSine'}); 436 self.box_skitter.find('.preview_slide').fadeTo(1,1).animate({left: _left_preview}, {duration:200, queue: false}); 437 }); 438 439 self.box_skitter.find(class_info).mouseleave(function() { 440 $('.preview_slide').animate({opacity: 'hide'}, {duration: 200, queue: false}); 441 }); 442 } 443 } 444 445 // Focus 446 if (self.settings.focus) { 447 self.focusSkitter(); 448 } 449 450 // Constrols 451 if (self.settings.controls) { 452 self.setControls(); 453 } 454 455 // Progressbar 456 if (self.settings.progressbar && self.settings.auto_play) { 457 self.addProgressBar(); 458 } 459 // hideTools 460 if (self.settings.hideTools) { 461 self.hideTools(); 462 } 463 // Navigation keys 464 if (self.settings.enable_navigation_keys) { 465 self.enableNavigationKeys(); 466 } 467 this.enableResize(); 468 this.loadImages(); 469 }, 470 /** 471 * Load images 472 */ 473 loadImages: function () 474 { 475 var self = this; 476 477 var loading = $('<div class="loading">Loading</div>'); 478 this.box_skitter.append(loading); 479 var total = this.settings.images_links.length; 480 481 var u = 0; 482 $.each(this.settings.images_links, function(i) 483 { 484 var self_il = this; 485 var loading = $('<span class="image_loading"></span>'); 486 loading.css({position:'absolute', top:'-9999em'}); 487 self.box_skitter.append(loading); 488 var img = new Image(); 489 490 $(img).load(function () { 491 ++u; 492 if (u == total) { 493 self.box_skitter.find('.loading').remove(); 494 self.box_skitter.find('.image_loading').remove(); 495 self.start(); 496 } 497 }).error(function () { 498 self.box_skitter.find('.loading, .image_loading, .image_number, .next_button, .prev_button').remove(); 499 self.box_skitter.html('<p style="color:white;background:black;">Error loading images. One or more images were not found.</p>'); 500 }).attr('src', self_il[0]); 501 }); 502 }, 503 /** 504 * Resize skitter 505 */ 506 enableResize: function() { 507 var self = this; 508 $(window).resize(function(){ 509 var sliderWidth = $('.vtemskitter-wrapper').width(); 510 if(self.settings.height.indexOf('%')!=-1) {
511 var startRH = Math.round(sliderWidth / (100/parseFloat(self.settings.height))); 512 if(self.settings.minHeight != '' && startRH < parseFloat(self.settings.minHeight)){ 513 h = parseFloat(self.settings.minHeight); 514 } else { 515 h = startRH; 516 } 517 self.settings.height_skitter = parseFloat(h); 518 } 519 self.box_skitter.find('.container_skitter').css({'width':sliderWidth, 'height': self.settings.height_skitter}); 520 }); 521 }, 522 523 /** 524 * Start skitter 525 */ 526 start: function() 527 { 528 var self = this; 529 var init_pause = false; 530 if (this.settings.numbers || this.settings.thumbs) this.box_skitter.find('.info_slide').fadeIn(500); 531 if (this.settings.dots) this.box_skitter.find('.info_slide_dots').fadeIn(500); 532 if (this.settings.label) this.box_skitter.find('.label_skitter').show(); 533 if (this.settings.navigation) { 534 this.box_skitter.find('.prev_button').fadeIn(500); 535 this.box_skitter.find('.next_button').fadeIn(500); 536 } 537 538 if (self.settings.auto_play) { 539 self.startTime(); 540 } 541 self.windowFocusOut(); 542 self.setLinkAtual(); 543 544 self.box_skitter.find('.image a img').attr({'src': self.settings.image_atual}); 545 img_link = self.box_skitter.find('.image a'); 546 img_link = self.resizeImage(img_link); 547 img_link.find('img').fadeIn(1500); 548 549 self.setValueBoxText(); 550 self.showBoxText(); 551 552 if (self.settings.auto_play) { 553 self.stopOnMouseOver(); 554 } 555 var mouseOverInit = function() { 556 if (self.settings.stop_over) { 557 init_pause = true; 558 self.settings.is_hover_box_skitter = true; 559 self.clearTimer(true); 560 self.pauseProgressBar(); 561 } 562 }; 563 self.box_skitter.mouseover(mouseOverInit); 564 self.box_skitter.find('.next_button').mouseover(mouseOverInit); 565 566 if (self.settings.images_links.length > 1 && !init_pause) { 567 if (self.settings.auto_play) { 568 self.timer = setTimeout(function() { self.nextImage(); }, self.settings.interval); 569 } 570 } 571 else { 572 self.box_skitter.find('.loading, .image_loading, .image_number, .next_button, .prev_button').remove(); 573 } 574 575 if ($.isFunction(self.settings.onLoad)) self.settings.onLoad(self); 576 }, 577 578 /** 579 * Jump to image 580 */ 581 jumpToImage: function(imageNumber) 582 { 583 if (this.settings.is_animating == false) { 584 this.settings.elapsedTime = 0; 585 this.box_skitter.find('.box_clone').stop(); 586 this.clearTimer(true); 587 this.settings.image_i = Math.floor(imageNumber); 588 589 this.box_skitter.find('.image a').attr({'href': this.settings.link_atual}); 590 this.box_skitter.find('.image_main').attr({'src': this.settings.image_atual}); 591 this.box_skitter.find('.box_clone').remove(); 592 593 this.nextImage(); 594 } 595 }, 596 597 /** 598 * Next image 599 */ 600 nextImage: function() 601 { 602 var self = this; 603 604 animations_functions = [ 605 'cube', 606 'cubeRandom', 607 'block', 608 'cubeStop', 609 'cubeStopRandom', 610 'cubeHide', 611 'cubeSize', 612 'horizontal', 613 'showBars', 614 'showBarsRandom', 615 'tube', 616 'fade', 617 'fadeFour', 618 'paralell', 619 'blind', 620 'blindHeight', 621 'blindWidth', 622 'directionTop', 623 'directionBottom', 624 'directionRight', 625 'directionLeft', 626 'cubeSpread', 627 'glassCube', 628 'glassBlock', 629 'circles', 630 'circlesInside', 631 'circlesRotate', 632 'cubeShow', 633 'upBars', 634 'downBars', 635 'hideBars', 636 'swapBars', 637 'swapBarsBack', 638 'swapBlocks', 639 'cut' 640 ]; 641 642 if (self.settings.progressbar) self.hideProgressBar(); 643 644 animation_type = (this.settings.animation == '' && this.settings.images_links[this.settings.image_i][2]) ? 645 this.settings.images_links[this.settings.image_i][2] : (this.settings.animation == '' ? 'default' : this.settings.animation); 646 647 // RandomUnique 648 if (animation_type == 'randomSmart') 649 { 650 if (!this.settings.random_ia) { 651 animations_functions.sort(function() { 652 return 0.5 - Math.random(); 653 }); 654 this.settings.random_ia = animations_functions; 655 } 656 animation_type = this.settings.random_ia[this.settings.image_i]; 657 } 658 // Random 659 else if (animation_type == 'random') 660 { 661 var random_id = parseInt(Math.random() * animations_functions.length); 662 animation_type = animations_functions[random_id]; 663 } 664 // Specific animations 665 else if (self.settings.with_animations.length > 0) 666 { 667 var total_with_animations = self.settings.with_animations.length; 668 if (this.settings._i_animation == undefined) { 669 this.settings._i_animation = 0; 670 } 671 animation_type = self.settings.with_animations[this.settings._i_animation]; 672 ++this.settings._i_animation; 673 if (this.settings._i_animation >= total_with_animations) this.settings._i_animation = 0; 674 } 675 676 switch (animation_type) 677 { 678 case 'cube' : 679 this.animationCube(); 680 break; 681 case 'cubeRandom' : 682 this.animationCube({random:true}); 683 break; 684 case 'block' : 685 this.animationBlock(); 686 break; 687 case 'cubeStop' : 688 this.animationCubeStop(); 689 break; 690 case 'cubeStopRandom' : 691 this.animationCubeStop({random:true}); 692 break; 693 case 'cubeHide' : 694 this.animationCubeHide(); 695 break; 696 case 'cubeSize' : 697 this.animationCubeSize(); 698 break; 699 case 'horizontal' : 700 this.animationHorizontal(); 701 break; 702 case 'showBars' : 703 this.animationShowBars(); 704 break; 705 case 'showBarsRandom' : 706 this.animationShowBars({random:true}); 707 break; 708 case 'tube' : 709 this.animationTube(); 710 break; 711 case 'fade' : 712 this.animationFade(); 713 break; 714 case 'fadeFour' : 715 this.animationFadeFour(); 716 break; 717 case 'paralell' : 718 this.animationParalell(); 719 break; 720 case 'blind' : 721 this.animationBlind(); 722 break; 723 case 'blindHeight' : 724 this.animationBlindDimension({height:true}); 725 break; 726 case 'blindWidth' : 727 this.animationBlindDimension({height:false, time_animate:400, delay:50}); 728 break; 729 case 'directionTop' : 730 this.animationDirection({direction:'top'}); 731 break; 732 case 'directionBottom' : 733 this.animationDirection({direction:'bottom'}); 734 break; 735 case 'directionRight' : 736 this.animationDirection({direction:'right', total:5}); 737 break; 738 case 'directionLeft' : 739 this.animationDirection({direction:'left', total:5}); 740 break; 741 case 'cubeSpread' : 742 this.animationCubeSpread(); 743 break; 744 case 'cubeJelly' : 745 this.animationCubeJelly(); 746 break; 747 case 'glassCube' : 748 this.animationGlassCube(); 749 break; 750 case 'glassBlock' : 751 this.animationGlassBlock(); 752 break; 753 case 'circles' : 754 this.animationCircles(); 755 break; 756 case 'circlesInside' : 757 this.animationCirclesInside(); 758 break; 759 case 'circlesRotate' : 760 this.animationCirclesRotate(); 761 break; 762 case 'cubeShow' : 763 this.animationCubeShow(); 764 break; 765 case 'upBars' : 766 this.animationDirectionBars({direction: 'top'}); 767 break; 768 case 'downBars' : 769 this.animationDirectionBars({direction: 'bottom'}); 770 break; 771 case 'hideBars' : 772 this.animationHideBars(); 773 break; 774 case 'swapBars' : 775 this.animationSwapBars(); 776 break; 777 case 'swapBarsBack' : 778 this.animationSwapBars({easing: 'easeOutBack'}); 779 break; 780 case 'swapBlocks' : 781 this.animationSwapBlocks(); 782 break; 783 case 'cut' : 784 this.animationCut(); 785 break; 786 default : 787 this.animationTube(); 788 break; 789 } 790 }, 791 792 animationCube: function (options) 793 { 794 var self = this; 795 796 var options = $.extend({}, {random: false}, options || {}); 797 798 this.settings.is_animating = true; 799 var easing = (this.settings.easing_default == '') ? 'easeOutExpo' : this.settings.easing_default; 800 var time_animate = 700 / this.settings.velocity; 801 802 this.setActualLevel(); 803
804 var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8)); 805 var division_h = Math.ceil(this.settings.height_skitter / (this.settings.height_skitter / 3)); 806 var total = division_w * division_h; 807 808 var width_box = Math.ceil(this.settings.width_skitter / division_w); 809 var height_box = Math.ceil(this.settings.height_skitter / division_h); 810 811 var init_top = this.settings.height_skitter + 200; 812 var init_left = this.settings.height_skitter + 200; 813 814 var col_t = 0; 815 var col = 0; 816 817 for (i = 0; i < total; i++) { 818 819 init_top = (i % 2 == 0) ? init_top : -init_top; 820 init_left = (i % 2 == 0) ? init_left : -init_left; 821 var _vtop = init_top + (height_box * col_t) + (col_t * 150); 822 var _vleft = -self.settings.width_skitter; 823 //var _vleft = (init_left + (width_box * col)) + (col * 50); 824 825 var _vtop_image = -(height_box * col_t); 826 827 var _vleft_image = -(width_box * col); 828 var _btop = (height_box * col_t); 829 var _bleft = (width_box * col); 830 831 var box_clone = this.getBoxClone(); 832 box_clone.hide(); 833 834 var delay_time = 50 * (i); 835 836 if (options.random) { 837 delay_time = 40 * (col); 838 box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box}); 839 } 840 else { 841 time_animate = 500; 842 //box_clone.css({left:(this.settings.width_skitter / 2), top:this.settings.height_skitter + 50, width:width_box, height:height_box}); 843 box_clone.css({left:(this.settings.width_skitter) + (width_box * i), top:this.settings.height_skitter + (height_box * i), width:width_box, height:height_box}); 844 } 845 846 //box_clone.find('img').css({left:_vleft_image, top:_vtop_image}); 847 //box_clone.find('img').css({left:_vleft_image+100, top:_vtop_image}); 848 849 this.addBoxClone(box_clone); 850 851 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 852 box_clone.show().delay(delay_time).animate({top:_btop+'px', left:_bleft+'px'}, time_animate, easing, callback); 853 854 if (options.random) { 855 box_clone.find('img').css({left:_vleft_image+100, top:_vtop_image+50}); 856 box_clone.find('img').delay(delay_time+(time_animate/2)).animate({left:_vleft_image, top:_vtop_image}, 1000, 'easeOutBack'); 857 } 858 else { 859 box_clone.find('img').css({left:_vleft_image, top:_vtop_image}); 860 box_clone.find('img').delay(delay_time+(time_animate/2)).fadeTo(100, 0.5).fadeTo(300, 1); 861 } 862 863 col_t++; 864 if (col_t == division_h) { 865 col_t = 0; 866 col++; 867 } 868 } 869 }, 870 871 animationBlock: function(options) 872 { 873 var self = this; 874 875 this.settings.is_animating = true; 876 var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default; 877 var time_animate = 500 / this.settings.velocity; 878 879 this.setActualLevel(); 880 881 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 15)); 882 var width_box = Math.ceil(this.settings.width_skitter / total); 883 var height_box = (this.settings.height_skitter); 884 885 for (i = 0; i < total; i++) { 886 887 var _bleft = (width_box * (i)); 888 var _btop = 0; 889 890 var box_clone = this.getBoxClone(); 891 box_clone.css({left: this.settings.width_skitter + 100, top:0, width:width_box, height:height_box}); 892 box_clone.find('img').css({left:-(width_box * i)}); 893 894 this.addBoxClone(box_clone); 895 896 var delay_time = 80 * (i); 897 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 898 //box_clone.delay(delay_time).animate({top:_btop, left:_bleft, opacity:'show'}, time_animate, easing, callback); 899 900 box_clone.show().delay(delay_time).animate({top:_btop, left:_bleft}, time_animate, easing); 901 box_clone.find('img').hide().delay(delay_time+100).animate({opacity:'show'}, time_animate+300, easing, callback); 902 } 903 904 }, 905 906 animationCubeStop: function(options) 907 { 908 var self = this; 909 var options = $.extend({}, {random: false}, options || {}); 910 this.settings.is_animating = true; 911 var easing = (this.settings.easing_default == '') ? 'easeInQuad' : this.settings.easing_default; 912 var time_animate = 300 / this.settings.velocity; 913 var image_old = this.box_skitter.find('.image_main').attr('src'); 914 this.setActualLevel(); 915 this.setLinkAtual(); 916 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 917 var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8)); 918 var division_h = Math.ceil(this.settings.height_skitter / (this.settings.width_skitter / 8)); 919 var total = division_w * division_h; 920 var width_box = Math.ceil(this.settings.width_skitter / division_w); 921 var height_box = Math.ceil(this.settings.height_skitter / division_h); 922 var init_top = 0; 923 var init_left = 0; 924 var col_t = 0; 925 var col = 0; 926 var _ftop = this.settings.width_skitter / 16; 927 for (i = 0; i < total; i++) { 928 init_top = (i % 2 == 0) ? init_top : -init_top; 929 init_left = (i % 2 == 0) ? init_left : -init_left; 930 var _vtop = init_top + (height_box * col_t); 931 var _vleft = (init_left + (width_box * col)); 932 var _vtop_image = -(height_box * col_t); 933 var _vleft_image = -(width_box * col); 934 var _btop = _vtop - _ftop; 935 var _bleft = _vleft - _ftop; 936 var box_clone = this.getBoxCloneImgOld(image_old); 937 box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box}); 938 box_clone.find('img').css({left:_vleft_image, top:_vtop_image}); 939 this.addBoxClone(box_clone); 940 box_clone.show(); 941 var delay_time = 50 * i; 942 if (options.random) { 943 time_animate = (400 * (self.getRandom(2) + 1)) / this.settings.velocity; 944 _btop = _vtop; 945 _bleft = _vleft;
946 delay_time = Math.ceil( 30 * self.getRandom(30) ); 947 } 948 949 if (options.random && i == (total - 1)) { 950 time_animate = 400 * 3; 951 delay_time = 30 * 30; 952 } 953 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 954 box_clone.delay(delay_time).animate({opacity:'hide', top:_btop+'px', left:_bleft+'px'}, time_animate, easing, callback); 955 col_t++; 956 if (col_t == division_h) { 957 col_t = 0; 958 col++; 959 } 960 } 961 }, 962 963 animationCubeHide: function(options) 964 { 965 var self = this; 966 967 this.settings.is_animating = true; 968 var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default; 969 var time_animate = 500 / this.settings.velocity; 970 971 var image_old = this.box_skitter.find('.image_main').attr('src'); 972 973 this.setActualLevel(); 974 975 this.setLinkAtual(); 976 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 977 978 var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8));
979 var division_h = Math.ceil(this.settings.height_skitter / (this.settings.height_skitter / 3)); 980 var total = division_w * division_h; 981 982 var width_box = Math.ceil(this.settings.width_skitter / division_w); 983 var height_box = Math.ceil(this.settings.height_skitter / division_h); 984 985 var init_top = 0; 986 var init_left = 0; 987 988 var col_t = 0; 989 var col = 0; 990 991 for (i = 0; i < total; i++) { 992 993 init_top = (i % 2 == 0) ? init_top : -init_top; 994 init_left = (i % 2 == 0) ? init_left : -init_left; 995 var _vtop = init_top + (height_box * col_t); 996 var _vleft = (init_left + (width_box * col)); 997 var _vtop_image = -(height_box * col_t); 998 999 var _vleft_image = -(width_box * col); 1000 var _btop = _vtop - 50; 1001 var _bleft = _vleft - 50; 1002 1003 var box_clone = this.getBoxCloneImgOld(image_old); 1004 box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box}); 1005 box_clone.find('img').css({left:_vleft_image, top:_vtop_image}); 1006 1007 this.addBoxClone(box_clone); 1008 box_clone.show(); 1009 1010 var delay_time = 50 * i; 1011 delay_time = (i == (total - 1)) ? (total * 50) : delay_time; 1012 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1013 1014 box_clone.delay(delay_time).animate({opacity:'hide'}, time_animate, easing, callback); 1015 1016 col_t++; 1017 if (col_t == division_h) { 1018 col_t = 0; 1019 col++; 1020 } 1021 } 1022 1023 }, 1024 1025 animationCubeJelly: function(options) 1026 { 1027 var self = this; 1028 1029 this.settings.is_animating = true; 1030 var easing = (this.settings.easing_default == '') ? 'easeInBack' : this.settings.easing_default; 1031 var time_animate = 300 / this.settings.velocity; 1032 1033 var image_old = this.box_skitter.find('.image_main').attr('src'); 1034 1035 this.setActualLevel(); 1036 1037 this.setLinkAtual(); 1038 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 1039 1040 var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8));
1041 var division_h = Math.ceil(this.settings.height_skitter / (this.settings.height_skitter / 3)); 1042 var total = division_w * division_h; 1043 1044 var width_box = Math.ceil(this.settings.width_skitter / division_w); 1045 var height_box = Math.ceil(this.settings.height_skitter / division_h); 1046 1047 var init_top = 0; 1048 var init_left = 0; 1049 1050 var col_t = 0; 1051 var col = 0; 1052 var u = -1; 1053 1054 for (i = 0; i < total; i++) { 1055 1056 if (col % 2 != 0) { 1057 if (col_t == 0) { 1058 u = u + division_h + 1; 1059 } 1060 u--; 1061 } 1062 else { 1063 if (col > 0 && col_t == 0) { 1064 u = u + 2; 1065 } 1066 u++; 1067 } 1068 1069 init_top = (i % 2 == 0) ? init_top : -init_top; 1070 init_left = (i % 2 == 0) ? init_left : -init_left; 1071 var _vtop = init_top + (height_box * col_t); 1072 var _vleft = (init_left + (width_box * col)); 1073 var _vtop_image = -(height_box * col_t); 1074 1075 var _vleft_image = -(width_box * col); 1076 var _btop = _vtop - 50; 1077 var _bleft = _vleft - 50; 1078 1079 var box_clone = this.getBoxCloneImgOld(image_old); 1080 box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box}); 1081 box_clone.find('img').css({left:_vleft_image, top:_vtop_image}); 1082 1083 this.addBoxClone(box_clone); 1084 box_clone.show(); 1085 1086 var delay_time = (50 * i); 1087 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1088 1089 box_clone.delay(delay_time).animate({width:'+=100px', height:'+=100px', top:'-=20px', left: '-=20px', opacity:'hide'}, time_animate, easing, callback); 1090 col_t++; 1091 1092 if (col_t == division_h) { 1093 col_t = 0; 1094 col++; 1095 } 1096 1097 } 1098 }, 1099 1100 animationCubeSize: function(options) 1101 { 1102 var self = this; 1103 1104 this.settings.is_animating = true; 1105 var easing = (this.settings.easing_default == '') ? 'easeInOutQuad' : this.settings.easing_default; 1106 var time_animate = 600 / this.settings.velocity; 1107 1108 var image_old = this.box_skitter.find('.image_main').attr('src'); 1109 1110 this.setActualLevel(); 1111 1112 this.setLinkAtual(); 1113 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 1114 1115 var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8));
1116 var division_h = Math.ceil(this.settings.height_skitter / (this.settings.height_skitter / 3)); 1117 var total = division_w * division_h; 1118 1119 var width_box = Math.ceil(this.settings.width_skitter / division_w); 1120 var height_box = Math.ceil(this.settings.height_skitter / division_h); 1121 1122 var init_top = 0; 1123 var init_left = 0; 1124 1125 var col_t = 0; 1126 var col = 0; 1127 var _ftop = Math.ceil(this.settings.width_skitter / 6); 1128 1129 for (i = 0; i < total; i++) { 1130 1131 init_top = (i % 2 == 0) ? init_top : -init_top; 1132 init_left = (i % 2 == 0) ? init_left : -init_left; 1133 var _vtop = init_top + (height_box * col_t); 1134 var _vleft = (init_left + (width_box * col)); 1135 var _vtop_image = -(height_box * col_t); 1136 1137 var _vleft_image = -(width_box * col); 1138 var _btop = _vtop - _ftop; 1139 var _bleft = _vleft - _ftop; 1140 1141 var box_clone = this.getBoxCloneImgOld(image_old); 1142 box_clone.css({left:_vleft, top:_vtop, width:width_box, height:height_box}); 1143 box_clone.find('img').css({left:_vleft_image, top:_vtop_image}); 1144 1145 this.addBoxClone(box_clone); 1146 box_clone.show(); 1147 1148 var delay_time = 50 * i; 1149 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1150 box_clone.delay(delay_time).animate({ 1151 opacity:'hide',width:'hide',height:'hide',top:_vtop+(width_box*1.5),left:_vleft+(height_box*1.5) 1152 }, time_animate, easing, callback); 1153 1154 col_t++; 1155 if (col_t == division_h) { 1156 col_t = 0; 1157 col++; 1158 } 1159 } 1160 1161 }, 1162 1163 animationHorizontal: function(options) 1164 { 1165 var self = this; 1166 1167 this.settings.is_animating = true; 1168 var easing = (this.settings.easing_default == '') ? 'easeOutExpo' : this.settings.easing_default; 1169 var time_animate = 700 / this.settings.velocity; 1170 1171 this.setActualLevel(); 1172 1173 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 7)); 1174 var width_box = (this.settings.width_skitter); 1175 var height_box = Math.ceil(this.settings.height_skitter / total); 1176 1177 for (i = 0; i < total; i++) { 1178 var _bleft = (i % 2 == 0 ? '' : '') + width_box; 1179 var _btop = (i * height_box); 1180 1181 var box_clone = this.getBoxClone(); 1182 1183 box_clone.css({left:_bleft+'px', top:_btop+'px', width:width_box, height:height_box}); 1184 box_clone.find('img').css({left:0, top:-_btop}); 1185 1186 this.addBoxClone(box_clone); 1187 1188 var delay_time = 90 * i; 1189 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1190 box_clone.delay(delay_time).animate({opacity:'show', top:_btop, left:0}, time_animate, easing, callback); 1191 } 1192 }, 1193 1194 animationShowBars: function(options) 1195 { 1196 var self = this; 1197 1198 var options = $.extend({}, {random: false}, options || {}); 1199 1200 this.settings.is_animating = true; 1201 var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default; 1202 var time_animate = 400 / this.settings.velocity; 1203 1204 this.setActualLevel(); 1205 1206 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10)); 1207 var width_box = Math.ceil(this.settings.width_skitter / total); 1208 var height_box = (this.settings.height_skitter); 1209 1210 for (i = 0; i < total; i++) { 1211 1212 var _bleft = (width_box * (i)); 1213 var _btop = 0; 1214 1215 var box_clone = this.getBoxClone(); 1216 1217 box_clone.css({left:_bleft, top:_btop - 50, width:width_box, height:height_box}); 1218 box_clone.find('img').css({left:-(width_box * i), top:0}); 1219 1220 this.addBoxClone(box_clone); 1221 1222 if (options.random) { 1223 var random = this.getRandom(total); 1224 var delay_time = 50 * random; 1225 delay_time = (i == (total - 1)) ? (50 * total) : delay_time; 1226 } 1227 else { 1228 var delay_time = 70 * (i); 1229 time_animate = time_animate - (i * 2); 1230 } 1231 1232 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1233 box_clone.delay(delay_time).animate({ 1234 opacity:'show', top:_btop+'px', left:_bleft+'px' 1235 }, time_animate, easing, callback); 1236 } 1237 1238 }, 1239 1240 animationTube: function(options) 1241 { 1242 var self = this; 1243 1244 this.settings.is_animating = true; 1245 var easing = (this.settings.easing_default == '') ? 'easeOutElastic' : this.settings.easing_default; 1246 var time_animate = 600 / this.settings.velocity; 1247 1248 this.setActualLevel(); 1249
1250 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10)); 1251 var width_box = Math.ceil(this.settings.width_skitter / total); 1252 var height_box = this.settings.height_skitter; 1253 1254 for (i = 0;i<total;i++) { 1255 var _btop = 0; 1256 var _vtop = height_box; 1257 var vleft = width_box * i; 1258 1259 var box_clone = this.getBoxClone(); 1260 1261 box_clone.css({left:vleft,top: _vtop, height:height_box, width: width_box}); 1262 box_clone.find('img').css({left:-(vleft)}); 1263 1264 this.addBoxClone(box_clone); 1265 1266 var random = this.getRandom(total); 1267 var delay_time = 30 * random; 1268 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1269 box_clone.show().delay(delay_time).animate({top:_btop}, time_animate, easing, callback); 1270 } 1271 }, 1272 1273 animationFade: function(options) 1274 { 1275 var self = this; 1276 1277 this.settings.is_animating = true; 1278 var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default; 1279 var time_animate = 800 / this.settings.velocity; 1280 1281 this.setActualLevel(); 1282 1283 var width_box = this.settings.width_skitter; 1284 var height_box = this.settings.height_skitter; 1285 var total = 2; 1286 1287 for (i = 0;i<total;i++) { 1288 var _vtop = 0; 1289 var _vleft = 0; 1290 1291 var box_clone = this.getBoxClone(); 1292 box_clone.css({left:_vleft, top:_vtop, width:width_box, height:height_box}); 1293 this.addBoxClone(box_clone); 1294 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1295 box_clone.animate({opacity:'show', left:0, top:0}, time_animate, easing, callback); 1296 } 1297 }, 1298 1299 animationFadeFour: function(options) 1300 { 1301 var self = this; 1302 1303 this.settings.is_animating = true; 1304 var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default; 1305 var time_animate = 500 / this.settings.velocity; 1306 1307 this.setActualLevel(); 1308 1309 var width_box = this.settings.width_skitter; 1310 var height_box = this.settings.height_skitter; 1311 var total = 4; 1312 1313 for (i = 0;i<total;i++) { 1314 1315 if (i == 0) { 1316 var _vtop = '-100px'; 1317 var _vleft = '-100px'; 1318 } else if (i == 1) { 1319 var _vtop = '-100px'; 1320 var _vleft = '100px'; 1321 } else if (i == 2) { 1322 var _vtop = '100px'; 1323 var _vleft = '-100px'; 1324 } else if (i == 3) { 1325 var _vtop = '100px'; 1326 var _vleft = '100px'; 1327 } 1328 1329 var box_clone = this.getBoxClone(); 1330 box_clone.css({left:_vleft, top:_vtop, width:width_box, height:height_box}); 1331 this.addBoxClone(box_clone); 1332 1333 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1334 box_clone.animate({opacity:'show', left:0, top:0}, time_animate, easing, callback); 1335 } 1336 }, 1337 1338 animationParalell: function(options) 1339 { 1340 var self = this; 1341 1342 this.settings.is_animating = true; 1343 var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default; 1344 var time_animate = 400 / this.settings.velocity; 1345 1346 this.setActualLevel(); 1347 1348 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 16)); 1349 var width_box = Math.ceil(this.settings.width_skitter / total); 1350 var height_box = this.settings.height_skitter; 1351 1352 for (i = 0; i < total; i++) { 1353 1354 var _bleft = (width_box * (i)); 1355 var _btop = 0; 1356 1357 var box_clone = this.getBoxClone(); 1358 1359 box_clone.css({left:_bleft, top:_btop - this.settings.height_skitter, width:width_box, height:height_box}); 1360 box_clone.find('img').css({left:-(width_box * i), top:0}); 1361 1362 this.addBoxClone(box_clone); 1363 1364 var delay_time; 1365 if (i <= ((total / 2) - 1)) { 1366 delay_time = 1400 - (i * 200); 1367 } 1368 else if (i > ((total / 2) - 1)) { 1369 delay_time = ((i - (total / 2)) * 200); 1370 } 1371 delay_time = delay_time / 2.5; 1372 1373 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1374 box_clone.delay(delay_time).animate({ 1375 top:_btop+'px', left:_bleft+'px', opacity: 'show' 1376 }, time_animate, easing, callback); 1377 } 1378 1379 }, 1380 1381 animationBlind: function(options) 1382 { 1383 var self = this; 1384 1385 var options = $.extend({}, {height: false}, options || {}); 1386 1387 this.settings.is_animating = true; 1388 var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default; 1389 var time_animate = 400 / this.settings.velocity; 1390 1391 this.setActualLevel(); 1392
1393 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 16)); 1394 var width_box = Math.ceil(this.settings.width_skitter / total); 1395 var height_box = this.settings.height_skitter; 1396 1397 for (i = 0; i < total; i++) { 1398 1399 var _bleft = (width_box * (i)); 1400 var _btop = 0; 1401 1402 var box_clone = this.getBoxClone(); 1403 1404 box_clone.css({left:_bleft, top:_btop, width:width_box, height:height_box}); 1405 box_clone.find('img').css({left:-(width_box * i), top:0}); 1406 1407 this.addBoxClone(box_clone); 1408 1409 var delay_time; 1410 1411 if (!options.height) { 1412 if (i <= ((total / 2) - 1)) { 1413 delay_time = 1400 - (i * 200); 1414 } 1415 else if (i > ((total / 2) - 1)) { 1416 delay_time = ((i - (total / 2)) * 200); 1417 } 1418 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1419 } 1420 else { 1421 if (i <= ((total / 2) - 1)) { 1422 delay_time = 200 + (i * 200); 1423 } 1424 else if (i > ((total / 2) - 1)) { 1425 delay_time = (((total / 2) - i) * 200) + (total * 100); 1426 } 1427 var callback = (i == (total / 2)) ? function() { self.finishAnimation(); } : ''; 1428 } 1429 1430 delay_time = delay_time / 2.5; 1431 1432 if (!options.height) { 1433 box_clone.delay(delay_time).animate({ 1434 opacity:'show',top:_btop+'px', left:_bleft+'px', width:'show' 1435 }, time_animate, easing, callback); 1436 } 1437 else { 1438 time_animate = time_animate + (i * 2); 1439 var easing = 'easeOutQuad'; 1440 box_clone.delay(delay_time).animate({ 1441 opacity:'show',top:_btop+'px', left:_bleft+'px', height:'show' 1442 }, time_animate, easing, callback); 1443 } 1444 } 1445 1446 }, 1447 1448 animationBlindDimension: function(options) 1449 { 1450 var self = this; 1451 1452 var options = $.extend({}, {height: true, time_animate: 500, delay: 100}, options || {}); 1453 1454 this.settings.is_animating = true; 1455 var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default; 1456 var time_animate = options.time_animate / this.settings.velocity; 1457 1458 this.setActualLevel(); 1459 1460 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 16)); 1461 var width_box = Math.ceil(this.settings.width_skitter / total); 1462 var height_box = this.settings.height_skitter; 1463 1464 for (i = 0; i < total; i++) { 1465 1466 var _bleft = (width_box * (i)); 1467 var _btop = 0; 1468 1469 var box_clone = this.getBoxClone(); 1470 1471 box_clone.css({left:_bleft, top:_btop, width:width_box, height:height_box}); 1472 box_clone.find('img').css({left:-(width_box * i), top:0}); 1473 1474 this.addBoxClone(box_clone); 1475 1476 var delay_time = options.delay * i; 1477 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1478 1479 if (!options.height) { 1480 box_clone.delay(delay_time).animate({ 1481 opacity:'show',top:_btop+'px', left:_bleft+'px', width:'show' 1482 }, time_animate, easing, callback); 1483 } 1484 else { 1485 var easing = 'easeOutQuad'; 1486 box_clone.delay(delay_time).animate({ 1487 opacity:'show',top:_btop+'px', left:_bleft+'px', height:'show' 1488 }, time_animate, easing, callback); 1489 } 1490 } 1491 1492 }, 1493 1494 animationDirection: function(options) 1495 { 1496 var self = this; 1497 1498 var options = $.extend({}, {direction: 'top', delay_type: 'sequence', total: 7}, options || {}); 1499 1500 this.settings.is_animating = true; 1501 var easing = (this.settings.easing_default == '') ? 'easeInOutExpo' : this.settings.easing_default; 1502 var time_animate = 1200 / this.settings.velocity; 1503 1504 var image_old = this.box_skitter.find('.image_main').attr('src'); 1505 1506 this.setActualLevel(); 1507 1508 this.setLinkAtual(); 1509 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 1510 this.box_skitter.find('.image_main').hide(); 1511 1512 var total = options.total; 1513 1514 for (i = 0; i < total; i++) { 1515 1516 switch (options.direction) 1517 { 1518 default : case 'top' : 1519 1520 var width_box = Math.ceil(this.settings.width_skitter / total); 1521 var height_box = this.settings.height_skitter; 1522 1523 var _itopc = 0; 1524 var _ileftc = (width_box * i); 1525 var _ftopc = -height_box; 1526 var _fleftc = _ileftc; 1527 1528 var _itopn = height_box; 1529 var _ileftn = _ileftc; 1530 var _ftopn = 0; 1531 var _fleftn = _ileftc; 1532 1533 var _vtop_image = 0; 1534 var _vleft_image = -_ileftc; 1535 1536 break; 1537 1538 case 'bottom' : 1539
1540 var width_box = Math.ceil(this.settings.width_skitter / total); 1541 var height_box = this.settings.height_skitter; 1542 1543 var _itopc = 0; 1544 var _ileftc = (width_box * i); 1545 var _ftopc = height_box; 1546 var _fleftc = _ileftc; 1547 1548 var _itopn = -height_box; 1549 var _ileftn = _ileftc; 1550 var _ftopn = 0; 1551 var _fleftn = _ileftc; 1552 1553 var _vtop_image = 0; 1554 var _vleft_image = -_ileftc; 1555 1556 break; 1557 1558 case 'right' : 1559 1560 var width_box = this.settings.width_skitter; 1561 var height_box = Math.ceil(this.settings.height_skitter / total); 1562 1563 var _itopc = (height_box * i); 1564 var _ileftc = 0; 1565 var _ftopc = _itopc; 1566 var _fleftc = width_box; 1567 1568 var _itopn = _itopc; 1569 var _ileftn = -_fleftc; 1570 var _ftopn = _itopc; 1571 var _fleftn = 0; 1572 1573 var _vtop_image = -_itopc; 1574 var _vleft_image = 0; 1575 1576 break; 1577 1578 case 'left' : 1579 1580 var width_box = this.settings.width_skitter; 1581 var height_box = Math.ceil(this.settings.height_skitter / total); 1582 1583 var _itopc = (height_box * i); 1584 var _ileftc = 0; 1585 var _ftopc = _itopc; 1586 var _fleftc = -width_box; 1587 1588 var _itopn = _itopc; 1589 var _ileftn = -_fleftc; 1590 var _ftopn = _itopc; 1591 var _fleftn = 0; 1592 1593 var _vtop_image = -_itopc; 1594 var _vleft_image = 0; 1595 1596 break; 1597 1598 } 1599 1600 switch (options.delay_type) 1601 { 1602 case 'zebra' : default : var delay_time = (i % 2 == 0) ? 0 : 150; break; 1603 case 'random' : var delay_time = 30 * (Math.random() * 30); break; 1604 case 'sequence' : var delay_time = i * 100; break; 1605 } 1606 1607 var box_clone = this.getBoxCloneImgOld(image_old); 1608 box_clone.find('img').css({left:_vleft_image, top:_vtop_image}); 1609 1610 box_clone.css({top:_itopc, left:_ileftc, width:width_box, height:height_box}); 1611 1612 this.addBoxClone(box_clone); 1613 box_clone.show(); 1614 box_clone.delay(delay_time).animate({ top:_ftopc, left:_fleftc }, time_animate, easing); 1615 1616 // Next image 1617 var box_clone_next = this.getBoxClone(); 1618 box_clone_next.find('img').css({left:_vleft_image, top:_vtop_image}); 1619 1620 box_clone_next.css({top:_itopn, left:_ileftn, width:width_box, height:height_box}); 1621 1622 this.addBoxClone(box_clone_next); 1623 box_clone_next.show(); 1624 1625 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : '';
1626 box_clone_next.delay(delay_time).animate({ top:_ftopn, left:_fleftn }, time_animate, easing, callback); 1627 1628 } 1629 }, 1630 1631 animationCubeSpread: function(options) 1632 { 1633 var self = this; 1634 1635 this.settings.is_animating = true; 1636 var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default; 1637 var time_animate = 700 / this.settings.velocity; 1638 1639 this.setActualLevel(); 1640 1641 var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8)); 1642 var division_h = Math.ceil(this.settings.height_skitter / (this.settings.width_skitter / 8)); 1643 var total = division_w * division_h; 1644 1645 var width_box = Math.ceil(this.settings.width_skitter / division_w); 1646 var height_box = Math.ceil(this.settings.height_skitter / division_h); 1647 1648 var init_top = 0; 1649 var init_left = 0; 1650 1651 var col_t = 0; 1652 var col = 0; 1653 var order = new Array; 1654 var spread = new Array; 1655 1656 // Make order 1657 for (i = 0; i < total; i++) { 1658 init_top = (i % 2 == 0) ? init_top : -init_top; 1659 init_left = (i % 2 == 0) ? init_left : -init_left; 1660 var _vtop = init_top + (height_box * col_t); 1661 var _vleft = (init_left + (width_box * col)); 1662 1663 order[i] = [_vtop, _vleft]; 1664 1665 col_t++; 1666 if (col_t == division_h) { 1667 col_t = 0; 1668 col++; 1669 } 1670 } 1671 1672 // Reset col and col_t 1673 col_t = 0; 1674 col = 0; 1675 1676 // Make array for spread 1677 for (i = 0; i < total; i++) { 1678 spread[i] = i; 1679 }; 1680 1681 // Shuffle array 1682 var spread = self.shuffleArray(spread); 1683 1684 for (i = 0; i < total; i++) { 1685 init_top = (i % 2 == 0) ? init_top : -init_top; 1686 init_left = (i % 2 == 0) ? init_left : -init_left; 1687 var _vtop = init_top + (height_box * col_t); 1688 var _vleft = (init_left + (width_box * col)); 1689 var _vtop_image = -(height_box * col_t); 1690 1691 var _vleft_image = -(width_box * col); 1692 var _btop = _vtop; 1693 var _bleft = _vleft; 1694 1695 _vtop = order[spread[i]][0]; 1696 _vleft = order[spread[i]][1]; 1697 1698 var box_clone = this.getBoxClone(); 1699 1700 box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box}); 1701 box_clone.find('img').css({left:_vleft_image, top:_vtop_image}); 1702 1703 this.addBoxClone(box_clone); 1704 1705 var delay_time = 30 * (Math.random() * 30); 1706 if (i == (total-1)) delay_time = 30 * 30; 1707 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1708 box_clone.delay(delay_time).animate({opacity:'show',top:_btop+'px', left:_bleft+'px'}, time_animate, easing, callback); 1709 1710 col_t++; 1711 if (col_t == division_h) { 1712 col_t = 0; 1713 col++; 1714 } 1715 } 1716 }, 1717 1718 animationGlassCube: function(options) 1719 { 1720 var self = this; 1721 1722 this.settings.is_animating = true; 1723 var easing = (this.settings.easing_default == '') ? 'easeOutExpo' : this.settings.easing_default; 1724 var time_animate = 500 / this.settings.velocity; 1725 1726 this.setActualLevel(); 1727 1728 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10)) * 2; 1729 var width_box = Math.ceil(this.settings.width_skitter / total) * 2; 1730 var height_box = (this.settings.height_skitter) / 2; 1731 var col = 0; 1732 1733 for (i = 0; i < total; i++) { 1734 mod = (i % 2) == 0 ? true : false; 1735 1736 var _ileft = (width_box * (col)); 1737 var _itop = (mod) ? -self.settings.height_skitter : self.settings.height_skitter; 1738 1739 var _fleft = (width_box * (col)); 1740 var _ftop = (mod) ? 0 : (height_box); 1741 1742 var _bleft = -(width_box * col); 1743 var _btop = (mod) ? 0 : -(height_box); 1744 1745 var delay_time = 120 * col; 1746 1747 var box_clone = this.getBoxClone(); 1748 box_clone.css({left: _ileft, top:_itop, width:width_box, height:height_box}); 1749 1750 box_clone 1751 .find('img') 1752 .css({left: _bleft + (width_box / 1.5), top: _btop}) 1753 .delay(delay_time) 1754 .animate({left: _bleft, top: _btop}, (time_animate * 1.9), 'easeOutQuad'); 1755 1756 this.addBoxClone(box_clone); 1757 1758 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1759 box_clone.show().delay(delay_time).animate({top:_ftop, left:_fleft}, time_animate, easing, callback); 1760 1761 if ((i % 2) != 0) col++; 1762 } 1763 }, 1764 1765 animationGlassBlock: function(options) 1766 { 1767 var self = this; 1768 1769 this.settings.is_animating = true; 1770 var easing = (this.settings.easing_default == '') ? 'easeOutExpo' : this.settings.easing_default; 1771 var time_animate = 700 / this.settings.velocity; 1772 1773 this.setActualLevel(); 1774
1775 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10)); 1776 var width_box = Math.ceil(this.settings.width_skitter / total); 1777 var height_box = (this.settings.height_skitter); 1778 1779 for (i = 0; i < total; i++) { 1780 var _ileft = (width_box * (i)); 1781 var _itop = 0; 1782 1783 var _fleft = (width_box * (i)); 1784 var _ftop = 0; 1785 1786 var _bleft = -(width_box * (i)); 1787 var _btop = 0; 1788 1789 var delay_time = 100 * i; 1790 1791 var box_clone = this.getBoxClone(); 1792 box_clone.css({left: _ileft, top:_itop, width:width_box, height:height_box}); 1793 1794 box_clone 1795 .find('img') 1796 .css({left: _bleft + (width_box / 1.5), top: _btop}) 1797 .delay(delay_time) 1798 .animate({left: _bleft, top: _btop}, (time_animate * 1.1), 'easeInOutQuad'); 1799 1800 this.addBoxClone(box_clone); 1801 1802 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1803 box_clone.delay(delay_time).animate({top:_ftop, left:_fleft, opacity: 'show'}, time_animate, easing, callback); 1804 1805 } 1806 }, 1807 1808 animationCircles: function(options) 1809 { 1810 var self = this; 1811 1812 this.settings.is_animating = true; 1813 var easing = (this.settings.easing_default == '') ? 'easeInQuad' : this.settings.easing_default; 1814 var time_animate = 500 / this.settings.velocity; 1815 1816 this.setActualLevel(); 1817 1818 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10)); 1819 var size_box = 100; 1820 1821 var radius = Math.sqrt(Math.pow((this.settings.width_skitter), 2) + Math.pow((this.settings.height_skitter), 2)); 1822 var radius = Math.ceil(radius); 1823 1824 for (i = 0; i < total; i++) { 1825 var _ileft = (self.settings.width_skitter / 2) - (size_box / 2); 1826 var _itop = (self.settings.height_skitter / 2) - (size_box / 2); 1827 1828 var _fleft = _ileft; 1829 var _ftop = _itop; 1830 var box_clone = null; 1831 // if ($.browser.mozilla) { 1832 // box_clone = this.getBoxClone(); 1833 // box_clone.css({left: _ileft, top:_itop, width:size_box, height:size_box}).css3({ 1834 // 'border-radius': radius+'px' 1835 // }); 1836 // box_clone.find('img').css({left: -_ileft, top: -_itop}); 1837 // } 1838 // else { 1839 box_clone = this.getBoxCloneBackground({ 1840 image: self.settings.image_atual, 1841 left: _ileft, 1842 top: _itop, 1843 width: size_box, 1844 height: size_box, 1845 position: { 1846 top: -_itop, 1847 left: -_ileft 1848 } 1849 }).css3({ 1850 'border-radius': radius+'px' 1851 }); 1852 // } 1853 1854 // var box_clone = this.getBoxClone(); 1855 // box_clone.css({left: _ileft, top:_itop, width:size_box, height:size_box}).css3({ 1856 // 'border-radius': radius+'px' 1857 // }); 1858 // box_clone.find('img').css({left: -_ileft, top: -_itop}); 1859 1860 size_box += 100; 1861 1862 this.addBoxClone(box_clone); 1863 1864 var delay_time = 70 * i; 1865 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1866 box_clone.delay(delay_time).animate({top: _ftop, left: _fleft, opacity: 'show'}, time_animate, easing, callback); 1867 1868 } 1869 }, 1870 1871 animationCirclesInside: function(options) 1872 { 1873 var self = this; 1874 1875 this.settings.is_animating = true; 1876 var easing = (this.settings.easing_default == '') ? 'easeInQuad' : this.settings.easing_default; 1877 var time_animate = 500 / this.settings.velocity; 1878 1879 var image_old = this.box_skitter.find('.image_main').attr('src'); 1880 1881 this.setActualLevel(); 1882 1883 this.setLinkAtual(); 1884 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 1885 1886 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10)); 1887 1888 var radius = Math.sqrt(Math.pow((this.settings.width_skitter), 2) + Math.pow((this.settings.height_skitter), 2)); 1889 var radius = Math.ceil(radius); 1890 var size_box = radius; 1891 1892 for (i = 0; i < total; i++) { 1893 var _ileft = (self.settings.width_skitter / 2) - (size_box / 2); 1894 var _itop = (self.settings.height_skitter / 2) - (size_box / 2); 1895 1896 var _fleft = _ileft; 1897 var _ftop = _itop; 1898 var box_clone = null; 1899 // if ($.browser.mozilla) { 1900 // box_clone = this.getBoxCloneImgOld(image_old); 1901 // box_clone.css({left: _ileft, top:_itop, width:size_box, height:size_box}).css3({ 1902 // 'border-radius': radius+'px' 1903 // }); 1904 // box_clone.find('img').css({left: -_ileft, top: -_itop}); 1905 // } 1906 // else {
1907 box_clone = this.getBoxCloneBackground({ 1908 image: image_old, 1909 left: _ileft, 1910 top: _itop, 1911 width: size_box, 1912 height: size_box, 1913 position: { 1914 top: -_itop, 1915 left: -_ileft 1916 } 1917 }).css3({ 1918 'border-radius': radius+'px' 1919 }); 1920 // } 1921 1922 // var box_clone = this.getBoxCloneImgOld(image_old); 1923 // box_clone.css({left: _ileft, top:_itop, width:size_box, height:size_box}).css3({ 1924 // 'border-radius': radius+'px' 1925 // }); 1926 // box_clone.find('img').css({left: -_ileft, top: -_itop}); 1927 1928 size_box -= 100; 1929 1930 this.addBoxClone(box_clone); 1931 box_clone.show(); 1932 1933 var delay_time = 70 * i; 1934 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1935 box_clone.delay(delay_time).animate({top: _ftop, left: _fleft, opacity: 'hide'}, time_animate, easing, callback); 1936 1937 } 1938 }, 1939 animationCirclesRotate: function(options) 1940 { 1941 var self = this; 1942 1943 this.settings.is_animating = true; 1944 var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default; 1945 var time_animate = 500 / this.settings.velocity; 1946 1947 var image_old = this.box_skitter.find('.image_main').attr('src'); 1948 1949 this.setActualLevel(); 1950 1951 this.setLinkAtual(); 1952 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 1953 1954 var total = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10)); 1955 1956 var radius = Math.sqrt(Math.pow((this.settings.width_skitter), 2) + Math.pow((this.settings.height_skitter), 2)); 1957 var radius = Math.ceil(radius); 1958 var size_box = radius; 1959 1960 for (i = 0; i < total; i++) { 1961 var _ileft = (self.settings.width_skitter / 2) - (size_box / 2); 1962 var _itop = (self.settings.height_skitter / 2) - (size_box / 2); 1963 1964 var _fleft = _ileft; 1965 var _ftop = _itop; 1966 var box_clone = null; 1967 if ($.browser.mozilla) { 1968 box_clone = this.getBoxCloneImgOld(image_old); 1969 box_clone.css({left: _ileft, top:_itop, width:size_box, height:size_box}).css3({ 1970 'border-radius': radius+'px' 1971 }); 1972 box_clone.find('img').css({left: -_ileft, top: -_itop}); 1973 } 1974 else { 1975 box_clone = this.getBoxCloneBackground({ 1976 image: image_old, 1977 left: _ileft, 1978 top: _itop, 1979 width: size_box, 1980 height: size_box, 1981 position: { 1982 top: -_itop, 1983 left: -_ileft 1984 } 1985 }).css3({ 1986 'border-radius': radius+'px' 1987 }); 1988 } 1989 1990 size_box -= 100; 1991 1992 this.addBoxClone(box_clone); 1993 box_clone.show(); 1994 1995 var delay_time = 100 * i; 1996 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 1997 var _rotate = (i % 2 == 0) ? '20deg' : '-20deg'; 1998 box_clone.delay(delay_time).animate({top: _ftop, left: _fleft, opacity: 'hide', rotate: _rotate}, time_animate, easing, callback); 1999 } 2000 }, 2001 2002 animationCubeShow: function(options) 2003 { 2004 var self = this; 2005 2006 this.settings.is_animating = true; 2007 var easing = (this.settings.easing_default == '') ? 'easeOutQuad' : this.settings.easing_default; 2008 var time_animate = 400 / this.settings.velocity; 2009 2010 this.setActualLevel(); 2011 2012 var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 8)); 2013 var division_h = Math.ceil(this.settings.height_skitter / (this.settings.height_skitter / 4)); 2014 var total = division_w * division_h; 2015 2016 var width_box = Math.ceil(this.settings.width_skitter / division_w); 2017 var height_box = Math.ceil(this.settings.height_skitter / division_h); 2018 2019 var last = false; 2020 2021 var _btop = 0; 2022 var _bleft = 0; 2023 var line = 0; 2024 var col = 0; 2025 2026 for (i = 0; i < total; i++) { 2027 2028 _btop = height_box * line; 2029 _bleft = width_box * col; 2030 2031 var delay_time = 30 * (i); 2032 2033 var box_clone = this.getBoxClone(); 2034 box_clone.css({left:_bleft, top:_btop, width:width_box, height:height_box}).hide(); 2035 box_clone.find('img').css({left:-_bleft, top:-_btop}); 2036 this.addBoxClone(box_clone); 2037 2038 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 2039 box_clone.delay(delay_time).animate({width:'show', height:'show'}, time_animate, easing, callback); 2040 2041 line++; 2042 if (line == division_h) { 2043 line = 0; 2044 col++; 2045 } 2046 } 2047 }, 2048 2049 animationDirectionBars: function(options) 2050 { 2051 var self = this; 2052 2053 var options = $.extend({}, {direction: 'top'}, options || {}); 2054 2055 this.settings.is_animating = true; 2056 var easing = (this.settings.easing_default == '') ? 'easeInOutQuad' : this.settings.easing_default; 2057 var time_animate = 400 / this.settings.velocity; 2058 2059 var image_old = this.box_skitter.find('.image_main').attr('src'); 2060 2061 this.setActualLevel(); 2062 2063 this.setLinkAtual(); 2064 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 2065 2066 var total = 12;
2067 var width_box = Math.ceil(this.settings.width_skitter / total); 2068 var height_box = this.settings.height_skitter; 2069 var _ftop = (options.direction == 'top') ? -height_box : height_box; 2070 2071 for (i = 0; i < total; i++) { 2072 var _vtop = 0; 2073 var _vleft = (width_box * i); 2074 var _vtop_image = 0; 2075 var _vleft_image = -(width_box * i); 2076 var box_clone = this.getBoxCloneImgOld(image_old); 2077 box_clone.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box}); 2078 box_clone.find('img').css({left:_vleft_image, top:_vtop_image}); 2079 2080 this.addBoxClone(box_clone); 2081 box_clone.show(); 2082 2083 var delay_time = 70 * i; 2084 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 2085 2086 box_clone.delay(delay_time).animate({top:_ftop}, time_animate, easing, callback); 2087 } 2088 2089 }, 2090 animationHideBars: function(options) 2091 { 2092 var self = this; 2093 var options = $.extend({}, {random: false}, options || {}); 2094 this.settings.is_animating = true; 2095 var easing = (this.settings.easing_default == '') ? 'easeOutCirc' : this.settings.easing_default; 2096 var time_animate = 700 / this.settings.velocity; 2097 var image_old = this.box_skitter.find('.image_main').attr('src'); 2098 this.setActualLevel(); 2099 this.setLinkAtual(); 2100 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 2101 var division_w = Math.ceil(this.settings.width_skitter / (this.settings.width_skitter / 10)); 2102 var total = division_w; 2103 var width_box = Math.ceil(this.settings.width_skitter / division_w); 2104 var height_box = this.settings.height_skitter; 2105 for (i = 0; i < total; i++) { 2106 var _vtop = 0; 2107 var _vleft = width_box * i; 2108 var _vtop_image = 0; 2109 var _vleft_image = -(width_box * i); 2110 var _fleft = '+='+width_box; 2111 var box_clone = this.getBoxCloneImgOld(image_old); 2112 box_clone.css({left:0, top:0, width:width_box, height:height_box}); 2113 box_clone.find('img').css({left:_vleft_image, top:_vtop_image}); 2114 var box_clone_main = this.getBoxCloneImgOld(image_old); 2115 box_clone_main.css({left:_vleft+'px', top:_vtop+'px', width:width_box, height:height_box}); 2116 box_clone_main.html(box_clone); 2117 this.addBoxClone(box_clone_main); 2118 box_clone.show(); 2119 box_clone_main.show(); 2120 var delay_time = 50 * i; 2121 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 2122 2123 box_clone.delay(delay_time).animate({left:_fleft}, time_animate, easing, callback); 2124 } 2125 }, 2126 animationSwapBars: function(options) 2127 { 2128 var self = this; 2129 2130 var options = $.extend({}, {direction: 'top', delay_type: 'sequence', total: 7, easing: 'easeOutCirc'}, options || {}); 2131 2132 this.settings.is_animating = true; 2133 var easing = (this.settings.easing_default == '') ? options.easing : this.settings.easing_default; 2134 var time_animate = 500 / this.settings.velocity; 2135 2136 var image_old = this.box_skitter.find('.image_main').attr('src'); 2137 2138 this.setActualLevel(); 2139 2140 this.setLinkAtual(); 2141 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 2142 this.box_skitter.find('.image_main').hide(); 2143 2144 var total = options.total; 2145 2146 for (i = 0; i < total; i++) { 2147 var width_box = Math.ceil(this.settings.width_skitter / total); 2148 var height_box = this.settings.height_skitter; 2149 2150 var _itopc = 0; 2151 var _ileftc = (width_box * i); 2152 var _ftopc = -height_box; 2153 var _fleftc = _ileftc + width_box ; 2154 2155 var _itopn = height_box; 2156 var _ileftn = _ileftc; 2157 var _ftopn = 0; 2158 var _fleftn = _ileftc; 2159 2160 var _vtop_image = 0; 2161 var _vleft_image = -_ileftc; 2162 2163 switch (options.delay_type) 2164 { 2165 case 'zebra' : default : var delay_time = (i % 2 == 0) ? 0 : 150; break; 2166 case 'random' : var delay_time = 30 * (Math.random() * 30); break; 2167 case 'sequence' : var delay_time = i * 100; break; 2168 } 2169 // Old image 2170 var box_clone = this.getBoxCloneImgOld(image_old); 2171 box_clone.find('img').css({left:_vleft_image, top:0}); 2172 box_clone.css({top:0, left:0, width:width_box, height:height_box}); 2173 // Next image 2174 var box_clone_next = this.getBoxClone(); 2175 box_clone_next.find('img').css({left:_vleft_image, top:0});
2176 box_clone_next.css({top:0, left:-width_box, width:width_box, height:height_box}); 2177 2178 // Container box images 2179 var box_clone_container = this.getBoxClone(); 2180 box_clone_container.html('').append(box_clone).append(box_clone_next); 2181 box_clone_container.css({top:0, left:_ileftc, width:width_box, height:height_box}); 2182 2183 // Add containuer 2184 this.addBoxClone(box_clone_container); 2185 // Show boxes 2186 box_clone_container.show(); 2187 box_clone.show(); 2188 box_clone_next.show(); 2189 2190 // Callback 2191 var callback = (i == (total - 1)) ? function() { self.finishAnimation(); } : ''; 2192 // Animations 2193 box_clone.delay(delay_time).animate({ left: width_box }, time_animate, easing); 2194 box_clone_next.delay(delay_time).animate({ left:0 }, time_animate, easing, callback); 2195 } 2196 }, 2197 animationSwapBlocks: function(options) 2198 { 2199 var self = this; 2200 2201 var options = $.extend({}, {easing_old: 'easeInOutQuad', easing_new: 'easeOutQuad'}, options || {}); 2202 2203 this.settings.is_animating = true; 2204 var easing_old = (this.settings.easing_default == '') ? options.easing_old : this.settings.easing_default; 2205 var easing_new = (this.settings.easing_default == '') ? options.easing_new : this.settings.easing_default; 2206 var time_animate = 800 / this.settings.velocity; 2207 2208 var image_old = this.box_skitter.find('.image_main').attr('src'); 2209 2210 this.setActualLevel(); 2211 2212 this.setLinkAtual(); 2213 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 2214 this.box_skitter.find('.image_main').hide(); 2215 2216 var total = 2; 2217 var width_box = this.settings.width_skitter; 2218 var height_box = Math.ceil(this.settings.height_skitter / total); 2219 // Old image 2220 var box_clone1 = this.getBoxCloneImgOld(image_old), box_clone2 = this.getBoxCloneImgOld(image_old); 2221 box_clone1.find('img').css({left:0, top:0}); 2222 box_clone1.css({top:0, left:0, width:width_box, height:height_box}); 2223 box_clone2.find('img').css({left:0, top:-height_box}); 2224 box_clone2.css({top:height_box, left:0, width:width_box, height:height_box}); 2225 // Next image 2226 var box_clone_next1 = this.getBoxClone(), box_clone_next2 = this.getBoxClone(); 2227 box_clone_next1.find('img').css({left:0, top:height_box}); 2228 box_clone_next1.css({top:0, left:0, width:width_box, height:height_box}); 2229 box_clone_next2.find('img').css({left:0, top: -(height_box * total) }); 2230 box_clone_next2.css({top:height_box, left:0, width:width_box, height:height_box}); 2231 // Add boxes 2232 this.addBoxClone(box_clone_next1); 2233 this.addBoxClone(box_clone_next2); 2234 this.addBoxClone(box_clone1); 2235 this.addBoxClone(box_clone2); 2236 // Show boxes 2237 box_clone1.show(); 2238 box_clone2.show(); 2239 box_clone_next1.show(); 2240 box_clone_next2.show(); 2241 // Callback 2242 var callback = function() { self.finishAnimation(); }; 2243 // Animations 2244 box_clone1.find('img').animate({ top: height_box }, time_animate, easing_old, function() { 2245 box_clone1.remove(); 2246 }); 2247 box_clone2.find('img').animate({ top: -(height_box * total) }, time_animate, easing_old, function() { 2248 box_clone2.remove(); 2249 }); 2250 box_clone_next1.find('img').animate({ top: 0 }, time_animate, easing_new); 2251 box_clone_next2.find('img').animate({ top: -height_box }, time_animate, easing_new, callback); 2252 }, 2253 animationCut: function(options) 2254 { 2255 var self = this; 2256 2257 var options = $.extend({}, {easing_old: 'easeInOutExpo', easing_new: 'easeInOutExpo'}, options || {}); 2258 2259 this.settings.is_animating = true; 2260 var easing_old = (this.settings.easing_default == '') ? options.easing_old : this.settings.easing_default; 2261 var easing_new = (this.settings.easing_default == '') ? options.easing_new : this.settings.easing_default; 2262 var time_animate = 900 / this.settings.velocity; 2263 2264 var image_old = this.box_skitter.find('.image_main').attr('src'); 2265 2266 this.setActualLevel(); 2267 2268 this.setLinkAtual(); 2269 this.box_skitter.find('.image_main').attr({'src':this.settings.image_atual}); 2270 this.box_skitter.find('.image_main').hide(); 2271 2272 var total = 2; 2273 var width_box = this.settings.width_skitter;
2274 var height_box = Math.ceil(this.settings.height_skitter / total); 2275 // Old image 2276 var box_clone1 = this.getBoxCloneImgOld(image_old), box_clone2 = this.getBoxCloneImgOld(image_old); 2277 box_clone1.find('img').css({left:0, top:0}); 2278 box_clone1.css({top:0, left:0, width:width_box, height:height_box}); 2279 box_clone2.find('img').css({left:0, top:-height_box}); 2280 box_clone2.css({top:height_box, left:0, width:width_box, height:height_box}); 2281 // Next image 2282 var box_clone_next1 = this.getBoxClone(), box_clone_next2 = this.getBoxClone(); 2283 //box_clone_next1.find('img').css({left:0, top:height_box}); 2284 box_clone_next1.find('img').css({left:0, top:0}); 2285 box_clone_next1.css({top:0, left:width_box, width:width_box, height:height_box}); 2286 //box_clone_next2.find('img').css({left:0, top: -(height_box * total) }); 2287 box_clone_next2.find('img').css({left:0, top: -height_box }); 2288 box_clone_next2.css({top:height_box, left:-width_box, width:width_box, height:height_box}); 2289 // Add boxes 2290 this.addBoxClone(box_clone_next1); 2291 this.addBoxClone(box_clone_next2); 2292 this.addBoxClone(box_clone1); 2293 this.addBoxClone(box_clone2); 2294 // Show boxes 2295 box_clone1.show(); 2296 box_clone2.show(); 2297 box_clone_next1.show(); 2298 box_clone_next2.show(); 2299 // Callback 2300 var callback = function() { self.finishAnimation(); }; 2301 // Animations 2302 box_clone1.animate({ left: -width_box }, time_animate, easing_old, function() { 2303 box_clone1.remove(); 2304 }); 2305 box_clone2.animate({ left: width_box }, time_animate, easing_old, function() { 2306 box_clone2.remove(); 2307 }); 2308 box_clone_next1.animate({ left: 0 }, time_animate, easing_new); 2309 box_clone_next2.animate({ left: 0 }, time_animate, easing_new, callback); 2310 }, 2311 2312 // End animations ---------------------- 2313 2314 // Finish animation 2315 finishAnimation: function (options) 2316 { 2317 var self = this; 2318 this.box_skitter.find('.image_main').show(); 2319 this.showBoxText(); 2320 this.settings.is_animating = false; 2321 this.box_skitter.find('.image_main').attr({'src': this.settings.image_atual}); 2322 this.box_skitter.find('.image a').attr({'href': this.settings.link_atual}); 2323 2324 if (!this.settings.is_hover_box_skitter && !this.settings.is_paused && !this.settings.is_blur) { 2325 this.timer = setTimeout(function() { self.completeMove(); }, this.settings.interval); 2326 } 2327 2328 self.startTime(); 2329 }, 2330 // Complete move 2331 completeMove: function () 2332 { 2333 this.clearTimer(true); 2334 this.box_skitter.find('.box_clone').remove(); 2335 if (!this.settings.is_paused && !this.settings.is_blur) this.nextImage(); 2336 }, 2337 // Actual config for animation 2338 setActualLevel: function() { 2339 if ($.isFunction(this.settings.imageSwitched)) this.settings.imageSwitched(this.settings.image_i, this); 2340 this.setImageLink(); 2341 this.addClassNumber(); 2342 this.hideBoxText(); 2343 this.increasingImage(); 2344 }, 2345 // Set image and link 2346 setImageLink: function() 2347 { 2348 var name_image = this.settings.images_links[this.settings.image_i][0]; 2349 var link_image = this.settings.images_links[this.settings.image_i][1]; 2350 var label_image = this.settings.images_links[this.settings.image_i][3]; 2351 var target_link = this.settings.images_links[this.settings.image_i][4]; 2352 2353 this.settings.image_atual = name_image; 2354 this.settings.link_atual = link_image; 2355 this.settings.label_atual = label_image; 2356 this.settings.target_atual = target_link; 2357 }, 2358 // Add class for number 2359 addClassNumber: function () 2360 { 2361 var self = this; 2362 this.box_skitter.find('.image_number_select').animate(self.settings.animateNumberOut, 500).removeClass('image_number_select'); 2363 $('#image_n_'+(this.settings.image_i+1)+'_'+self.number_skitter).animate(self.settings.animateNumberActive, 700).addClass('image_number_select'); 2364 if((this.settings.image_i+1)*81 > this.settings.width_skitter){ 2365 self.box_skitter.find('.info_slide_thumb').animate({left: -(((this.settings.image_i+1)*81)+3 - this.settings.width_skitter)}, 700); 2366 }else{self.box_skitter.find('.info_slide_thumb').animate({left:0},800);} 2367 }, 2368 // Increment image_i 2369 increasingImage: function() 2370 { 2371 this.settings.image_i++; 2372 if (this.settings.image_i == this.settings.images_links.length) { 2373 this.settings.image_i = 0; 2374 } 2375 }, 2376 2377 // Get box clone 2378 getBoxClone: function() 2379 { 2380 if (this.settings.link_atual != '#') { 2381 var img_clone = $('<a href="'+this.settings.link_atual+'"><img src="'+this.settings.image_atual+'" class="img_clone" style="width:'+this.box_skitter.width()+'px;height:'+this.box_skitter.height()+'px" /></a>'); 2382 } 2383 else { 2384 var img_clone = $('<img src="'+this.settings.image_atual+'" class="img_clone" style="width:'+this.box_skitter.width()+'px;height:'+this.box_skitter.height()+'px" />'); 2385 } 2386 2387 img_clone = this.resizeImage(img_clone);
2388 var box_clone = $('<div class="box_clone"></div>'); 2389 box_clone.append(img_clone); 2390 return box_clone; 2391 }, 2392 2393 // Get box clone 2394 getBoxCloneImgOld: function(image_old) 2395 { 2396 if (this.settings.link_atual != '#') { 2397 var img_clone = $('<a href="'+this.settings.link_atual+'"><img src="'+image_old+'" class="img_clone" style="width:'+this.box_skitter.width()+'px;height:'+this.box_skitter.height()+'px" /></a>'); 2398 } 2399 else { 2400 var img_clone = $('<img src="'+image_old+'" class="img_clone" style="width:'+this.box_skitter.width()+'px;height:'+this.box_skitter.height()+'px" />'); 2401 } 2402 2403 img_clone = this.resizeImage(img_clone); 2404 var box_clone = $('<div class="box_clone"></div>'); 2405 box_clone.append(img_clone); 2406 return box_clone; 2407 }, 2408 2409 // Redimensiona imagem 2410 resizeImage: function(img_clone) 2411 { 2412 if (this.settings.fullscreen) { 2413 img_clone.find('img').height(this.settings.height_skitter); 2414 } 2415 return img_clone; 2416 }, 2417 // Add box clone in box_skitter 2418 addBoxClone: function(box_clone) 2419 { 2420 this.box_skitter.find('.container_skitter').append(box_clone); 2421 }, 2422 2423 // Get accepts easing 2424 getEasing: function(easing) 2425 { 2426 var easing_accepts = [ 2427 'easeInQuad', 'easeOutQuad', 'easeInOutQuad', 2428 'easeInCubic', 'easeOutCubic', 'easeInOutCubic', 2429 'easeInQuart', 'easeOutQuart', 'easeInOutQuart', 2430 'easeInQuint', 'easeOutQuint', 'easeInOutQuint', 2431 'easeInSine', 'easeOutSine', 'easeInOutSine', 2432 'easeInExpo', 'easeOutExpo', 'easeInOutExpo', 2433 'easeInCirc', 'easeOutCirc', 'easeInOutCirc', 2434 'easeInElastic', 'easeOutElastic', 'easeInOutElastic', 2435 'easeInBack', 'easeOutBack', 'easeInOutBack', 2436 'easeInBounce', 'easeOutBounce', 'easeInOutBounce', 2437 ]; 2438 2439 if (jQuery.inArray(easing, easing_accepts) > 0) { 2440 return easing; 2441 } 2442 else { 2443 return ''; 2444 } 2445 }, 2446 2447 // Get random number 2448 getRandom: function (i) 2449 { 2450 return Math.floor(Math.random() * i); 2451 }, 2452 // Set value for text 2453 setValueBoxText: function () 2454 { 2455 this.box_skitter.find('.label_skitter').html(this.settings.label_atual); 2456 }, 2457 2458 // Show box text 2459 showBoxText: function () 2460 { 2461 var self = this; 2462 if (this.settings.label_atual != undefined && this.settings.label_atual != '' && self.settings.label) { 2463 self.box_skitter.find('.label_skitter').slideDown(400); 2464 } 2465 }, 2466 2467 // Hide box text 2468 hideBoxText: function () 2469 { 2470 var self = this; 2471 this.box_skitter.find('.label_skitter').slideUp(200, function() { 2472 self.setValueBoxText(); 2473 }); 2474 }, 2475 2476 // Stop time to get over box_skitter 2477 stopOnMouseOver: function () 2478 { 2479 var self = this; 2480 var opacity_elements = self.settings.opacity_elements; 2481 var interval_in_elements = self.settings.interval_in_elements; 2482 var interval_out_elements = self.settings.interval_out_elements; 2483 2484 self.box_skitter.hover(function() { 2485 2486 if (self.settings.stop_over) self.settings.is_hover_box_skitter = true; 2487 2488 if (!self.settings.is_paused_time) { 2489 self.pauseTime(); 2490 } 2491 2492 if (self.settings.hideTools) { 2493 if (self.settings.numbers) { 2494 self.box_skitter 2495 .find('.info_slide') 2496 .show() 2497 .css({opacity:0}) 2498 .animate({opacity: opacity_elements}, interval_in_elements); 2499 } 2500 2501 if (self.settings.navigation) { 2502 self.box_skitter 2503 .find('.prev_button') 2504 .show() 2505 .css({opacity:0}) 2506 .animate({opacity: opacity_elements}, interval_in_elements); 2507 2508 self.box_skitter 2509 .find('.next_button') 2510 .show().css({opacity:0}) 2511 .animate({opacity: opacity_elements}, interval_in_elements); 2512 } 2513 if (self.settings.focus && !self.settings.foucs_active) { 2514 self.box_skitter 2515 .find('.focus_button') 2516 .stop() 2517 .show().css({opacity:0}) 2518 .animate({opacity:opacity_elements}, 200); 2519 } 2520 2521 if (self.settings.controls) { 2522 self.box_skitter 2523 .find('.play_pause_button') 2524 .stop() 2525 .show().css({opacity:0}) 2526 .animate({opacity:opacity_elements}, 200); 2527 } 2528 } 2529 2530 self.clearTimer(true); 2531 2532 if (self.settings.focus && !self.settings.foucs_active && !self.settings.hideTools) { 2533 self.box_skitter 2534 .find('.focus_button') 2535 .stop() 2536 .animate({opacity:1}, 200); 2537 } 2538 2539 if (self.settings.controls && !self.settings.hideTools) { 2540 self.box_skitter 2541 .find('.play_pause_button') 2542 .stop() 2543 .animate({opacity:1}, 200); 2544 } 2545 2546 }, function() { 2547 if (self.settings.stop_over) self.settings.is_hover_box_skitter = false;
2548 2549 if (self.settings.elapsedTime == 0 && !self.settings.is_animating && !self.settings.is_paused) { 2550 self.startTime(); 2551 } 2552 else if (!self.settings.is_paused) { 2553 self.resumeTime(); 2554 } 2555 2556 if (self.settings.hideTools) { 2557 if (self.settings.numbers) { 2558 self.box_skitter 2559 .find('.info_slide') 2560 .queue("fx", []) 2561 .show() 2562 .css({opacity: opacity_elements}) 2563 .animate({opacity:0}, interval_out_elements); 2564 } 2565 2566 if (self.settings.navigation) { 2567 self.box_skitter 2568 .find('.prev_button') 2569 .queue("fx", []) 2570 .show() 2571 .css({opacity: opacity_elements}) 2572 .animate({opacity:0}, interval_out_elements); 2573 2574 self.box_skitter 2575 .find('.next_button') 2576 .queue("fx", []) 2577 .show() 2578 .css({opacity: opacity_elements}) 2579 .animate({opacity:0}, interval_out_elements); 2580 } 2581 if (self.settings.focus && !self.settings.foucs_active) { 2582 self.box_skitter 2583 .find('.focus_button') 2584 .stop() 2585 .css({opacity: opacity_elements}) 2586 .animate({opacity:0}
2586, 200); 2587 } 2588 if (self.settings.controls) { 2589 self.box_skitter 2590 .find('.play_pause_button') 2591 .stop() 2592 .css({opacity: opacity_elements}) 2593 .animate({opacity:0}, 200); 2594 } 2595 } 2596 2597 self.clearTimer(true); 2598 2599 if (!self.settings.is_animating && self.settings.images_links.length > 1) { 2600 self.timer = setTimeout(function() { self.completeMove(); }, self.settings.interval - self.settings.elapsedTime); 2601 self.box_skitter.find('.image_main').attr({'src': self.settings.image_atual}); 2602 self.box_skitter.find('.image a').attr({'href': self.settings.link_atual}); 2603 } 2604 2605 if (self.settings.focus && !self.settings.foucs_active && !self.settings.hideTools) { 2606 self.box_skitter 2607 .find('.focus_button') 2608 .stop() 2609 .animate({opacity:0.3}, 200); 2610 } 2611 2612 if (self.settings.controls && !self.settings.hideTools) { 2613 self.box_skitter 2614 .find('.play_pause_button') 2615 .stop() 2616 .animate({opacity:0.3}, 200); 2617 } 2618 2619 }); 2620 }, 2621 2622 // Stop timer 2623 clearTimer: function (force) { 2624 var self = this; 2625 clearInterval(self.timer); 2626 }, 2627 2628 // Set link atual 2629 setLinkAtual: function() { 2630 if (this.settings.link_atual != '#') { 2631 this.box_skitter.find('.image a').attr({'href': this.settings.link_atual, 'target': this.settings.target_atual}); 2632 } 2633 else { 2634 this.box_skitter.find('.image a').removeAttr('href'); 2635 } 2636 }, 2637 2638 // Hide tools 2639 hideTools: function() { 2640 this.box_skitter.find('.info_slide').hide(); 2641 this.box_skitter.find('.prev_button').hide(); 2642 this.box_skitter.find('.next_button').hide(); 2643 this.box_skitter.find('.label_skitter').hide(); 2644 this.box_skitter.find('.focus_button').hide(); 2645 this.box_skitter.find('.play_pause_button').hide(); 2646 }, 2647 2648 // Focus Skitter 2649 focusSkitter: function() { 2650 var self = this; 2651 2652 var focus_button = $('<a href="#" class="focus_button">focus</a>'); 2653 self.box_skitter.append(focus_button); 2654 2655 var _left = (self.settings.width_skitter - focus_button.width()) / 2; 2656 var _space = 0; 2657 2658 if (self.settings.controls) _left -= 25; 2659 if (self.settings.controls_position == self.settings.focus_position) _space = focus_button.width() + 5; 2660 2661 var cssPosition = {left: _left}; 2662 2663 switch (self.settings.focus_position) 2664 { 2665 case 'leftTop' : cssPosition = {left: 5 + _space, top: 30}; break; 2666 case 'rightTop' : cssPosition = {right: 5 + _space, top: 30}; break; 2667 case 'leftBottom' : cssPosition = {left: 5 + _space, bottom: 5, top: 'auto'}; break; 2668 case 'rightBottom' : cssPosition = {right: 5 + _space, bottom: 5, top: 'auto'}; break; 2669 } 2670 2671 focus_button 2672 .css(cssPosition) 2673 .animate({opacity:0.3}, self.settings.interval_in_elements); 2674 2675 $(document).keypress(function(e) { 2676 var code = (e.keyCode ? e.keyCode : e.which); 2677 if (code == 27) $('#overlay_skitter').trigger('click'); 2678 }); 2679 2680 self.box_skitter.find('.focus_button').click(function() { 2681 self.settings.foucs_active = true; 2682 2683 $(this).stop().animate({opacity:0}
2683, self.settings.interval_out_elements); 2684 2685 var div = $('<div id="overlay_skitter"></div>') 2686 .height( $(document).height() ) 2687 .hide() 2688 .fadeTo(self.settings.interval_in_elements, 0.98); 2689 2690 var _top = $('.box_skitter').offset().top; 2691 var _left = $('.box_skitter').offset().left; 2692 var _topFinal = (($(window).height() - $('.box_skitter').height()) / 2) + $(document).scrollTop(); 2693 var _leftFinal = ($(window).width() - $('.box_skitter').width()) / 2; 2694 2695 self.box_skitter.before('<div id="mark_position"></div>'); 2696 $('body').prepend(div); 2697 $('body').prepend(self.box_skitter); 2698 self.box_skitter 2699 .css({'top':_top, 'left':_left, 'position':'absolute', 'z-index':9999}) 2700 .animate({'top':_topFinal, 'left':_leftFinal}, 2000, 'easeOutExpo'); 2701 2702 $('#mark_position') 2703 .width($('.box_skitter').width()) 2704 .height($('.box_skitter').height()) 2705 .css({'background':'none'}) 2706 .fadeTo(300,0.3); 2707 2708 $('#overlay_skitter').click(function() { 2709 if ($(this).hasClass('finish_overlay_skitter')) return false; 2710 2711 self.settings.foucs_active = false; 2712 $(this).addClass('finish_overlay_skitter'); 2713 2714 $('#mark_position').before($('.box_skitter')); 2715 2716 if (!self.settings.hideTools) self.box_skitter.find('.focus_button').animate({opacity:0.3}, 200); 2717 2718 self.box_skitter 2719 .stop() 2720 .animate({'top':_top, 'left':_left}, 300, 'easeOutExpo', function() { 2721 $(this).css({'position':'relative', 'top':0, 'left': 0}); 2722 $('#mark_position').remove(); 2723 }); 2724 2725 $('#overlay_skitter').fadeTo(self.settings.interval_out_elements, 0, function() { 2726 $(this).remove(); 2727 }); 2728 2729 return false; 2730 }); 2731 2732 return false; 2733 }); 2734 }, 2735 2736 /** 2737 * Controls: play and stop 2738 */ 2739 setControls: function() { 2740 var self = this; 2741 2742 var play_pause_button = $('<a href="#" class="play_pause_button">pause</a>'); 2743 self.box_skitter.append(play_pause_button); 2744 2745 var _left = (self.settings.width_skitter - play_pause_button.width()) / 2; 2746 2747 if (self.settings.focus) _left += 25; 2748 2749 var cssPosition = {left: _left}; 2750 2751 switch (self.settings.controls_position) 2752 { 2753 case 'leftTop' : cssPosition = {left: 5, top: 30}; break; 2754 case 'rightTop' : cssPosition = {right: 5, top: 30}; break; 2755 case 'leftBottom' : cssPosition = {left: 5, bottom: 5, top: 'auto'}; break; 2756 case 'rightBottom' : cssPosition = {right: 5, bottom: 5, top: 'auto'}; break; 2757 } 2758 2759 play_pause_button 2760 .css(cssPosition) 2761 .animate({opacity:0.3}, self.settings.interval_in_elements); 2762 2763 play_pause_button.click(function() { 2764 if (!self.settings.is_paused) { 2765 $(this).html('play'); 2766 $(this).fadeTo(100, 0.5).fadeTo(100, 1); 2767 2768 $(this).addClass('play_button'); 2769 self.pauseTime(); 2770 self.settings.is_paused = true; 2771 self.clearTimer(true); 2772 } 2773 else { 2774 if (!self.settings.is_animating && !self.box_skitter.find('.progressbar').is(':visible')) { 2775 self.settings.elapsedTime = 0; 2776 } 2777 else { 2778 self.resumeTime(); 2779 } 2780 2781 if (!self.settings.progressbar) self.resumeTime(); 2782 2783 self.settings.is_paused = false; 2784 2785 $(this).html('pause'); 2786 $(this).fadeTo(100, 0.5).fadeTo(100, 1); 2787 $(this).removeClass('play_button'); 2788 2789 if (!self.settings.stop_over) { 2790 self.clearTimer(true); 2791 if (!self.settings.is_animating && self.settings.images_links.length > 1) { 2792 self.timer = setTimeout(function() { self.completeMove(); }, self.settings.interval - self.settings.elapsedTime); 2793 self.box_skitter.find('.image_main').attr({'src': self.settings.image_atual}); 2794 self.box_skitter.find('.image a').attr({'href': self.settings.link_atual}); 2795 } 2796 } 2797 } 2798 2799 return false; 2800 }); 2801 }, 2802 2803 /** 2804 * Object size 2805 */ 2806 objectSize: function(obj) { 2807 var size = 0, key; 2808 for (key in obj) { if (obj.hasOwnProperty(key)) size++; } 2809 return size; 2810 }, 2811 2812 /** 2813 * Add progress bar 2814 */ 2815 addProgressBar: function() { 2816 var self = this; 2817 2818 var progressbar = $('<div class="progressbar"></div>'); 2819 self.box_skitter.append(progressbar); 2820 2821 if (self.objectSize(self.settings.progressbar_css) == 0) { 2822 if (parseInt(progressbar.css('width')) > 0) { 2823 self.settings.progressbar_css.width = parseInt(progressbar.css('width')); 2824 } 2825 else { 2826 self.settings.progressbar_css = {width: self.settings.width_skitter, height:5}; 2827 } 2828 } 2829 if (self.objectSize(self.settings.progressbar_css) > 0 && self.settings.progressbar_css.width == undefined) { 2830 self.settings.progressbar_css.width = self.settings.width_skitter; 2831 } 2832 2833 progressbar.css(self.settings.progressbar_css).hide(); 2834 }, 2835 2836 /** 2837 * Start progress bar 2838 */ 2839 startProgressBar: function() { 2840 var self = this; 2841 if (self.settings.is_hover_box_skitter || self.settings.is_paused || self.settings.is_blur || !self.settings.progressbar) return false;
2842 self.box_skitter.find('.progressbar') 2843 .hide() 2844 .dequeue() 2845 .width(self.settings.progressbar_css.width) 2846 .animate({width:'show'}, self.settings.interval, 'linear'); 2847 }, 2848 2849 /** 2850 * Pause progress bar 2851 */ 2852 pauseProgressBar: function() { 2853 var self = this; 2854 if (!self.settings.is_animating) { 2855 self.box_skitter.find('.progressbar').stop(); 2856 } 2857 }, 2858 2859 /** 2860 * Resume progress bar 2861 */ 2862 resumeProgressBar: function() { 2863 var self = this; 2864 2865 if (self.settings.is_hover_box_skitter || self.settings.is_paused || !self.settings.progressbar) return false; 2866 2867 self.box_skitter.find('.progressbar').dequeue().animate({width: self.settings.progressbar_css.width}, (self.settings.interval - self.settings.elapsedTime), 'linear'); 2868 }, 2869 2870 /** 2871 * Hide progress bar 2872 */ 2873 hideProgressBar: function() { 2874 var self = this; 2875 2876 if (!self.settings.progressbar) return false; 2877 2878 self.box_skitter.find('.progressbar').stop().fadeOut(300, function() { 2879 $(this).width(self.settings.progressbar_css.width); 2880 }); 2881 }, 2882 /** 2883 * Start time 2884 */ 2885 startTime: function() { 2886 var self = this; 2887 2888 self.settings.is_paused_time = false; 2889 2890 var date = new Date(); 2891 self.settings.elapsedTime = 0; 2892 self.settings.timeStart = date.getTime(); 2893 2894 // Start progress bar 2895 self.startProgressBar(); 2896 }, 2897 2898 /** 2899 * Pause time 2900 */ 2901 pauseTime: function() { 2902 var self = this; 2903 2904 if (self.settings.is_paused_time) return false; 2905 self.settings.is_paused_time = true; 2906 2907 var date = new Date(); 2908 self.settings.elapsedTime += date.getTime() - self.settings.timeStart; 2909 2910 // Pause progress bar 2911 self.pauseProgressBar(); 2912 }, 2913 2914 /** 2915 * Resume time 2916 */ 2917 resumeTime: function() { 2918 var self = this; 2919 2920 self.settings.is_paused_time = false; 2921 2922 var date = new Date(); 2923 self.settings.timeStart = date.getTime(); 2924 2925 // Resume progress bar 2926 self.resumeProgressBar(); 2927 }, 2928 /** 2929 * Enable navigation keys 2930 */ 2931 enableNavigationKeys: function() { 2932 var self = this; 2933 $(window).keydown(function(e) { 2934 // Next 2935 if (e.keyCode == 39 || e.keyCode == 40) { 2936 self.box_skitter.find('.next_button').trigger('click'); 2937 } 2938 // Prev 2939 else if (e.keyCode == 37 || e.keyCode == 38) { 2940 self.box_skitter.find('.prev_button').trigger('click'); 2941 } 2942 }); 2943 }, 2944 /** 2945 * Get box clone with background image 2946 */ 2947 getBoxCloneBackground: function(options) 2948 { 2949 var box_clone = $('<div class="box_clone"></div>'); 2950 box_clone.css({ 2951 'left': options.left, 2952 'top': options.top, 2953 'width': options.width, 2954 'height': options.height, 2955 'background-image': 'url('+options.image+')', 2956 'background-position': options.position.left+'px '+options.position.top+'px' 2957 }); 2958 return box_clone; 2959 }, 2960 /** 2961 * Shuffle array 2962 * @author Daniel Castro Machado <[email protected]> 2963 */ 2964 shuffleArray: function (arrayOrigem) { 2965 var self = this; 2966 var arrayDestino = new Array(); 2967 var indice; 2968 while (arrayOrigem.length > 0) { 2969 indice = self.randomUnique(0, arrayOrigem.length - 1); 2970 arrayDestino[arrayDestino.length] = arrayOrigem[indice]; 2971 arrayOrigem.splice(indice, 1); 2972 } 2973 return arrayDestino; 2974 }, 2975 2976 /** 2977 * Gera números aleatórios inteiros entre um intervalo 2978 * @author Daniel Castro Machado <[email protected]> 2979 */ 2980 randomUnique: function (valorIni, valorFim) { 2981 var numRandom; 2982 do numRandom = Math.random(); while (numRandom == 1); // Evita gerar o número valorFim + 1 2983 return (numRandom * (valorFim - valorIni + 1) + valorIni) | 0; 2984 }, 2985 2986 /** 2987 * Stop on window focus out 2988 * @author Dan Partac (http://thiagosf.net/projects/jquery/skitter/#comment-355473307) 2989 */ 2990 windowFocusOut: function () { 2991 var self = this; 2992 $(window).bind('blur', function(){ 2993 self.settings.is_blur = true; 2994 self.pauseTime(); 2995 self.clearTimer(true); 2996 }); 2997 $(window).bind('focus', function(){ 2998 if ( self.settings.images_links.length > 1 ) { 2999 self.settings.is_blur = false; 3000 3001 if (self.settings.elapsedTime == 0) { 3002 self.startTime(); 3003 } 3004 else { 3005 self.resumeTime(); 3006 } 3007 3008 if (self.settings.elapsedTime <= self.settings.interval) { 3009 self.clearTimer(true); // Fix bug IE: double next 3010 self.timer = setTimeout(function() { self.completeMove(); }, self.settings.interval - self.settings.elapsedTime); 3011 self.box_skitter.find('.image_main').attr({'src': self.settings.image_atual}); 3012 self.box_skitter.find('.image a').attr({'href': self.settings.link_atual}); 3013 } 3014 } 3015 }); 3016 } 3017 3018 }); 3019 3020 /** 3021 * Helper function for cross-browser CSS3 support, prepends all possible prefixes to all properties passed in 3022 * @param {Object} props Ker/value pairs of CSS3 properties 3023 */ 3024 $.fn.css3 = function(props) { 3025 var css = {}; 3026 var prefixes = ['moz', 'ms', 'o', 'webkit']; 3027 for(var prop in props) { 3028 // Add the vendor specific versions 3029 for(var i=0; i<prefixes.length; i++) 3030 css['-'+prefixes[i]+'-'+prop] = props[prop]; 3031 // Add the actual version 3032 css[prop] = props[prop]; 3033 } 3034 this.css(css); 3035 return this; 3036 }; 3037 3038 // Monkey patch jQuery 1.3.1+ to add support for setting or animating CSS 3039 // scale and rotation independently.
3040 // 2009-2010 Zachary Johnson www.zachstronaut.com 3041 // Updated 2010.11.06 3042 var rotateUnits = 'deg'; 3043 3044 $.fn.rotate = function (val) { 3045 var style = $(this).css('transform') || 'none'; 3046 if (typeof val == 'undefined') { 3047 if (style) { 3048 var m = style.match(/rotate\(([^)]+)\)/); 3049 if (m && m[1]) { 3050 return m[1]; 3051 } 3052 } 3053 return 0; 3054 } 3055 var m = val.toString().match(/^(-?\d+(\.\d+)?)(.+)?$/); 3056 if (m) { 3057 if (m[3]) rotateUnits = m[3]; 3058 $(this).css('transform', 3059 style.replace(/none|rotate\([^)]*\)/, '') + 'rotate(' + m[1] + rotateUnits + ')' 3060 ); 3061 } 3062 3063 return this; 3064 }; 3065 3066 // Note that scale is unitless. 3067 $.fn.scale = function (val, duration, options) { 3068 var style = $(this).css('transform'); 3069 if (typeof val == 'undefined') { 3070 if (style) { 3071 var m = style.match(/scale\(([^)]+)\)/); 3072 if (m && m[1]) { 3073 return m[1]; 3074 } 3075 } 3076 return 1; 3077 } 3078 $(this).css('transform', 3079 style.replace(/none|scale\([^)]*\)/, '') + 'scale(' + val + ')' 3080 ); 3081 return this; 3082 }; 3083 // fx.cur() must be monkey patched because otherwise it would always 3084 // return 0 for current rotate and scale values 3085 var curProxied = $.fx.prototype.cur; 3086 $.fx.prototype.cur = function () { 3087 if (this.prop == 'rotate') { 3088 return parseFloat($(this.elem).rotate()); 3089 } 3090 else if (this.prop == 'scale') { 3091 return parseFloat($(this.elem).scale()); 3092 } 3093 return curProxied.apply(this, arguments); 3094 }; 3095 3096 $.fx.step.rotate = function (fx) { 3097 $(fx.elem).rotate(fx.now + rotateUnits); 3098 }; 3099 3100 $.fx.step.scale = function (fx) { 3101 $(fx.elem).scale(fx.now); 3102 }; 3103 3104 var animateProxied = $.fn.animate; 3105 $.fn.animate = function (prop) { 3106 if (typeof prop['rotate'] != 'undefined') { 3107 var m = prop['rotate'].toString().match(/^(([+-]=)?(-?\d+(\.\d+)?))(.+)?$/); 3108 if (m && m[5]) { 3109 rotateUnits = m[5]; 3110 } 3111 prop['rotate'] = m[1]; 3112 } 3113 3114 return animateProxied.apply(this, arguments); 3115 }; 3116 3117 // Monkey patch jQuery 1.3.1+ css() method to support CSS 'transform' 3118 // property uniformly across Safari/Chrome/Webkit, Firefox 3.5+, IE 9+, and Opera 11+. 3119 // 2009-2011 Zachary Johnson www.zachstronaut.com 3120 // Updated 2011.05.04 (May the fourth be with you!) 3121 function getTransformProperty(element) { 3122 var properties = ['transform', 'WebkitTransform', 'msTransform', 'MozTransform', 'OTransform']; 3123 var p; 3124 while (p = properties.shift()) { 3125 if (typeof element.style[p] != 'undefined') { 3126 return p; 3127 } 3128 } 3129 return 'transform'; 3130 }; 3131 3132 var _propsObj = null; 3133 3134 var proxied = $.fn.css; 3135 $.fn.css = function (arg, val) { 3136 if (_propsObj === null) { 3137 if (typeof $.cssProps != 'undefined') { 3138 _propsObj = $.cssProps; 3139 } 3140 else if (typeof $.props != 'undefined') { 3141 _propsObj = $.props; 3142 } 3143 else { 3144 _propsObj = {}; 3145 } 3146 } 3147 if 3148 ( 3149 typeof _propsObj['transform'] == 'undefined' 3150 && 3151 ( 3152 arg == 'transform' 3153 || 3154 ( 3155 typeof arg == 'object' 3156 && typeof arg['transform'] != 'undefined' 3157 ) 3158 ) 3159 ) { 3160 _propsObj['transform'] = getTransformProperty(this.get(0)); 3161 } 3162 if (_propsObj['transform'] != 'transform') { 3163 // Call in form of css('transform' ...) 3164 if (arg == 'transform') { 3165 arg = _propsObj['transform']; 3166 if (typeof val == 'undefined' && jQuery.style) { 3167 return jQuery.style(this.get(0), arg); 3168 } 3169 } 3170 // Call in form of css({'transform': ...}) 3171 else if 3172 ( 3173 typeof arg == 'object' 3174 && typeof arg['transform'] != 'undefined' 3175 ) { 3176 arg[_propsObj['transform']] = arg['transform']; 3177 delete arg['transform']; 3178 } 3179 } 3180 return proxied.apply(this, arguments); 3181 }; 3182})(jQuery); 3183 3184/* 3185playback timings (ms): 3186 LoadShardBlock: 172.678 (3) 3187 esindex: 0.009 3188 captures_list: 188.886 3189 CDXLines.iter: 11.386 (3) 3190 PetaboxLoader3.datanode: 220.268 (5) 3191 exclusion.robots: 0.324 3192 exclusion.robots.policy: 0.308 3193 RedisCDXSource: 1.639 3194 PetaboxLoader3.resolve: 39.18 (2) 3195 load_resource: 98.691 3196*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.