1/* 2* 3* Custom js snippets for Startuply v1.1 4* by Vivaco 5* 6*/ 7(function(){ 8 "use strict"; 9 // Init global DOM elements, functions and arrays 10 window.app = {el : {}, fn : {}}; 11 app.el['window'] = $(window); 12 app.el['document'] = $(document); 13 app.el['loader'] = $('#loader'); 14 app.el['mask'] = $('#mask'); 15 16 app.fn.screenSize = function() { 17 var size, width = app.el['window'].width(); 18 if(width < 320) size = "Not supported"; 19 else if(width < 480) size = "Mobile portrait"; 20 else if(width < 768) size = "Mobile landscape"; 21 else if(width < 960) size = "Tablet"; 22 else size = "Desktop"; 23 // $('#screen').html( size + ' - ' + width ); 24 // console.log( size, width ); 25 }; 26 27 //Preloader 28 app.el['loader'].delay(700).fadeOut(); 29 app.el['mask'].delay(1200).fadeOut("slow"); 30 31 // Resized based on screen size 32 app.el['window'].resize(function() { 33 app.fn.screenSize(); 34 }); 35 36 //Flexislider for testimonials 37 if($('.testimonials-slider').length != 0) { 38 $('.testimonials-slider').flexslider({ 39 manualControls: '.flex-manual .switch', 40 nextText: "", 41 prevText: "", 42 startAt: 1, 43 slideshow: false, 44 direction: "horizontal", 45 animation: "slide" 46 }); 47 }; 48 49 // Navigation Scroll 50 $('.navigation-bar').onePageNav({ 51 currentClass: 'active', 52 changeHash: true, 53 scrollSpeed: 750, 54 scrollThreshold: 0.5, 55 easing: 'swing' 56 }); 57 58 // Animated Appear Element 59 if (app.el['window'].width() > 1024){ 60 61 $('.animated').appear(function() { 62 var element = $(this); 63 var animation = element.data('animation'); 64 var animationDelay = element.data('delay'); 65 if(animationDelay) { 66 setTimeout(function(){ 67 element.addClass( animation + " visible" ); 68 element.removeClass('hiding'); 69 }, animationDelay); 70 } else { 71 element.addClass( animation + " visible" ); 72 element.removeClass('hiding'); 73 } 74 75 }, {accY: -150}); 76 77 } else { 78 79 $('.animated').css('opacity', 1); 80 81 } 82 83 // fade in .back-to-top 84 $(window).scroll(function () { 85 if ($(this).scrollTop() > 500) { 86 $('.back-to-top').fadeIn(); 87 } else { 88 $('.back-to-top').fadeOut(); 89 } 90 }); 91 92 // scroll body to 0px on click 93 $('.back-to-top').click(function () { 94 $('html, body').animate({ 95 scrollTop: 0, 96 easing: 'swing' 97 }, 750); 98 return false; 99 }); 100 101 // Form validation - sign up 102 toastr.options = {"positionClass": "toast-top-full-width"}; 103 if( $('.form-register').length ) { 104 $('.form-register').validate({ 105 rules: { 106 password: { 107 minlength: 5 108 }, 109 confirmPassword: { 110 minlength: 5, 111 equalTo: "#password" 112 } 113 }, 114 messages: { 115 fullname: "Please enter your fullname", 116 password: { 117 required: "Please provide a password", 118 minlength: "Your password must be at least 5 characters long" 119 }, 120 confirmPassword: { 121 required: "Please provide a password", 122 minlength: "Your password must be at least 5 characters long", 123 equalTo: "Please enter the same password as above" 124 }, 125 email: "Please enter a valid email address" 126 }, 127 submitHandler: function(form) { 128 var $this = $(form); 129 $.ajax({ 130 url: $this.attr('action'), 131 type: 'POST', 132 data: $this.serialize(), 133 }) 134 .done(function(msg) { 135 if( msg == 'ok' ) { 136 toastr.success('Thank you for signing up.'); 137 $this[0].reset(); 138 } else { 139 toastr.error('An error occured. Please try again later.'); 140 } 141 }) 142 .fail(function() { 143 toastr.error('An error occured. Please try again later.'); 144 }); 145 } 146 }); 147 } 148})(); 149 150/* 151 Name: View - Home 152 Written by: Crivos - (http://www.crivos.com) 153 Version: 2.0 154 */ 155 156(function() { 157 158 "use strict"; 159 160 var Home = { 161 162 initialized: false, 163 164 initialize: function() { 165 166 if (this.initialized) return; 167 this.initialized = true; 168 169 this.build(); 170 171 }, 172 173 build: function() { 174 175 176 // Revolution Slider Initialize 177 if($("#revolutionSlider").get(0)) { 178 var rev = $("#revolutionSlider").revolution({ 179 delay:9000, 180 startheight:700, 181 startwidth:960, 182 183 hideThumbs:10, 184 185 thumbWidth:100,
186 thumbHeight:50, 187 thumbAmount:5, 188 189 navigationType:"both", 190 navigationArrows:"verticalcentered", 191 navigationStyle:"round", 192 193 touchenabled:"on", 194 onHoverStop:"on", 195 196 navOffsetHorizontal:0, 197 navOffsetVertical:20, 198 199 stopAtSlide:-1, 200 stopAfterLoops:-1, 201 202 shadow:1, 203 fullWidth:"on", 204 205 fullScreen: "on", 206 fullScreenOffset: "0px" 207 }); 208 209 $("#revolutionSlider .tp-caption").on("mousedown", function(e) { 210 e.preventDefault(); 211 rev.revpause(); 212 return false; 213 }); 214 215 } 216 217 } 218 219 }; 220 221 Home.initialize(); 222 223})();
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.