-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
62 lines (53 loc) · 1.93 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
$(document).ready(function () {
$(".gallery-slider").owlCarousel({
pagination: true,
autoPlay: 5000,
itemsDesktop: [1500, 4],
itemsDesktopSmall: [979, 3]
});
// Gallery Popup
$('.image-popup').magnificPopup({
type: 'image'
});
// animation scroll js
var html_body = $('html, body');
$('.page-scroll').on('click', function () { //use page-scroll class in any HTML tag for scrolling
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
html_body.animate({
scrollTop: target.offset().top - 0
}, 1500, "easeInOutExpo");
return false;
}
}
});
// easeInOutExpo Declaration
jQuery.extend(jQuery.easing, {
easeInOutExpo: function (x, t, b, c, d) {
if (t == 0) return b;
if (t == d) return b + c;
if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
}
});
//switch words effect
var titleLeft = ['LovesMatter', 'DoneIsTheGoal', 'WorksGoodIsAMust', 'SecurityIsImportant', 'GoodUXMatter', 'NiceUIMatter', 'UsabilityIsTheKey', 'FasterBetter'];
var titleRight = ['MobileApps', 'Company Website', 'ERP Dashboard', 'BookingApps', 'Micro Payments', 'HRIS', 'Point of Sales', 'Your Business', 'Billing Topup'];
$wordLeft = $('.title-left');
$wordRight = $('.title-right');
setInterval(function (){
$wordLeft.fadeOut(function () {
$wordLeft.text('#'+titleLeft[rnd(0,titleLeft.length-1)]).fadeIn();
});
}, 3000);
setInterval(function (){
$wordRight.fadeOut(function () {
$wordRight.text(titleRight[rnd(0,titleRight.length-1)]).fadeIn();
});
}, 5000);
function rnd(min,max){
return Math.floor(Math.random()*(max-min+1)+min);;
}
});