1
+ /*
2
+ This file handle custom fuctions for the template.
3
+ @version - 1.0
4
+ */
5
+
6
+ ; ( function ( $ ) {
7
+ "use strict" ;
8
+
9
+ //* mainNavbar
10
+ function mainNavbar ( ) {
11
+ if ( $ ( '#main_navbar' ) . length ) {
12
+ $ ( '#main_navbar' ) . affix ( {
13
+ offset : {
14
+ top : 10 ,
15
+ bottom : function ( ) {
16
+ return ( this . bottom = $ ( '.footer' ) . outerHeight ( true ) )
17
+ }
18
+ }
19
+ } ) ;
20
+ } ;
21
+ } ;
22
+
23
+ //* nav_searchFrom
24
+ function searchFrom ( ) {
25
+ if ( $ ( '.nav_searchFrom' ) . length ) {
26
+ $ ( '.nav_searchFrom' ) . on ( 'click' , function ( ) {
27
+ $ ( '.searchForm' ) . toggleClass ( 'show' ) ;
28
+ return false
29
+ } ) ;
30
+ $ ( '.form_hide' ) . on ( 'click' , function ( ) {
31
+ $ ( '.searchForm' ) . removeClass ( 'show' )
32
+ } ) ;
33
+ } ;
34
+ } ;
35
+
36
+ //* Main slider js
37
+ function home_main_slider ( ) {
38
+ if ( $ ( '.slider_inner' ) . length ) {
39
+ $ ( '.slider_inner' ) . camera ( {
40
+ loader : true ,
41
+ navigation : true ,
42
+ autoPlay :false ,
43
+ time : 4000 ,
44
+ playPause : false ,
45
+ pagination : false ,
46
+ thumbnails : false ,
47
+ overlayer : true ,
48
+ hover : false ,
49
+ minHeight : '500px' ,
50
+ } ) ;
51
+ }
52
+ }
53
+
54
+ //* Isotope Js
55
+ function portfolio_isotope ( ) {
56
+ if ( $ ( '.portfolio_item, .portfolio_2 .portfolio_filter ul li' ) . length ) {
57
+ // Activate isotope in container
58
+ $ ( ".portfolio_item" ) . imagesLoaded ( function ( ) {
59
+ $ ( ".portfolio_item" ) . isotope ( {
60
+ itemSelector : ".single_facilities" ,
61
+ layoutMode : 'masonry' ,
62
+ percentPosition :true ,
63
+ masonry : {
64
+ columnWidth : ".grid-sizer, .grid-sizer-2"
65
+ }
66
+ } ) ;
67
+ } ) ;
68
+
69
+ // Activate isotope in container
70
+ $ ( ".portfolio_2" ) . imagesLoaded ( function ( ) {
71
+ $ ( ".portfolio_2" ) . isotope ( {
72
+ itemSelector : ".single_facilities" ,
73
+ layoutMode : 'fitRows' ,
74
+ } ) ;
75
+ } ) ;
76
+ // Add isotope click function
77
+ $ ( ".portfolio_filter ul li" ) . on ( 'click' , function ( ) {
78
+ $ ( ".portfolio_filter ul li" ) . removeClass ( "active" ) ;
79
+ $ ( this ) . addClass ( "active" ) ;
80
+
81
+ var selector = $ ( this ) . attr ( "data-filter" ) ;
82
+ $ ( ".portfolio_item, .portfolio_2" ) . isotope ( {
83
+ filter : selector ,
84
+ animationOptions : {
85
+ duration : 450 ,
86
+ easing : "linear" ,
87
+ queue : false ,
88
+ }
89
+ } ) ;
90
+ return false ;
91
+ } ) ;
92
+ }
93
+ } ;
94
+
95
+ //* Stellar
96
+ $ ( function ( ) {
97
+ $ . stellar ( {
98
+ horizontalScrolling : false ,
99
+ verticalOffset : 40
100
+ } ) ;
101
+ } ) ;
102
+
103
+ //* counterUp JS
104
+ function counterUp ( ) {
105
+ if ( $ ( '.counter' ) . length ) {
106
+ $ ( '.counter' ) . counterUp ( {
107
+ delay : 10 ,
108
+ time : 900 ,
109
+ } ) ;
110
+ }
111
+ } ;
112
+
113
+ //* Testimonial Carosel
114
+ function testimonialsCarosel ( ) {
115
+ if ( $ ( '.testimonial_carosel' ) . length ) {
116
+ $ ( '.testimonial_carosel' ) . owlCarousel ( {
117
+ loop :true ,
118
+ items :1 ,
119
+ autoplay :false ,
120
+ } ) ;
121
+ } ;
122
+ } ;
123
+ //* Testimonial Carosel
124
+ function partnersCarosel ( ) {
125
+ if ( $ ( '.partners' ) . length ) {
126
+ $ ( '.partners' ) . owlCarousel ( {
127
+ loop :true ,
128
+ items :5 ,
129
+ margin :110 ,
130
+ autoplay :true ,
131
+ response :true ,
132
+ responsive :{
133
+ 300 :{
134
+ items :1 ,
135
+ margin :0 ,
136
+ } ,
137
+ 500 :{
138
+ items :3 ,
139
+ } ,
140
+ 700 :{
141
+ items :3 ,
142
+ } ,
143
+ 800 :{
144
+ items :4 ,
145
+ margin :40 ,
146
+ } ,
147
+ 1000 :{
148
+ items :5 ,
149
+ } ,
150
+ }
151
+ } ) ;
152
+ } ;
153
+ } ;
154
+
155
+ //* waypoint JS
156
+ function ourSkrill ( ) {
157
+ if ( $ ( '.our_skill_inner' ) . length ) {
158
+ $ ( ".our_skill_inner" ) . each ( function ( ) {
159
+ $ ( this ) . waypoint ( function ( ) {
160
+ var progressBar = $ ( ".progress-bar" ) ;
161
+ progressBar . each ( function ( indx ) {
162
+ $ ( this ) . css ( "width" , $ ( this ) . attr ( "aria-valuenow" ) + "%" )
163
+ } )
164
+ } ,
165
+ {
166
+ triggerOnce : true ,
167
+ offset : 'bottom-in-view'
168
+
169
+ } ) ;
170
+ } ) ;
171
+ }
172
+ } ;
173
+
174
+ //* counterUp 2 JS
175
+ function counterUp2 ( ) {
176
+ if ( $ ( '.counter2' ) . length ) {
177
+ $ ( '.counter2' ) . counterUp ( {
178
+ delay : 10 ,
179
+ time : 200 ,
180
+ } ) ;
181
+ }
182
+ } ;
183
+
184
+ //* Hide Loading Box (Preloader)
185
+ function preloader ( ) {
186
+ if ( $ ( '.preloader' ) . length ) {
187
+ $ ( window ) . load ( function ( ) {
188
+ $ ( '.preloader' ) . delay ( 500 ) . fadeOut ( 'slow' ) ;
189
+ $ ( 'body' ) . delay ( 500 ) . css ( { 'overflow' :'visible' } ) ;
190
+ } ) ;
191
+ }
192
+ } ;
193
+
194
+ /*Function Calls*/
195
+ searchFrom ( ) ;
196
+ new WOW ( ) . init ( ) ;
197
+ home_main_slider ( ) ;
198
+ testimonialsCarosel ( ) ;
199
+ portfolio_isotope ( ) ;
200
+ counterUp ( ) ;
201
+ partnersCarosel ( ) ;
202
+ ourSkrill ( ) ;
203
+ counterUp2 ( ) ;
204
+ mainNavbar ( ) ;
205
+ preloader ( ) ;
206
+
207
+ } ) ( jQuery ) ;
208
+
209
+ ! function ( a ) {
210
+ "use strict" ;
211
+ a ( 'a.js-scroll-trigger[href*="#"]:not([href="#"])' ) . click ( function ( ) {
212
+ if ( location . pathname . replace ( / ^ \/ / , "" ) == this . pathname . replace ( / ^ \/ / , "" ) && location . hostname == this . hostname ) {
213
+ var o = a ( this . hash ) ;
214
+ if ( ( o = o . length ? o : a ( "[name=" + this . hash . slice ( 1 ) + "]" ) ) . length ) return a ( "html, body" ) . animate ( {
215
+ scrollTop : o . offset ( ) . top - 54
216
+ } , 1e3 , "easeInOutExpo" ) , ! 1
217
+ }
218
+ } ) , a ( ".js-scroll-trigger" ) . click ( function ( ) {
219
+ a ( ".navbar-collapse" ) . collapse ( "hide" )
220
+ } ) , a ( "body" ) . scrollspy ( {
221
+ target : "#mainNav" ,
222
+ offset : 56
223
+ } ) ;
224
+ var o = function ( ) {
225
+ a ( "#mainNav" ) . offset ( ) . top > 100 ? a ( "#mainNav" ) . addClass ( "navbar-shrink" ) : a ( "#mainNav" ) . removeClass ( "navbar-shrink" )
226
+ } ;
227
+ o ( ) , a ( window ) . scroll ( o ) , a ( ".portfolio-modal" ) . on ( "show.bs.modal" , function ( o ) {
228
+ a ( ".navbar" ) . addClass ( "d-none" )
229
+ } ) , a ( ".portfolio-modal" ) . on ( "hidden.bs.modal" , function ( o ) {
230
+ a ( ".navbar" ) . removeClass ( "d-none" )
231
+ } )
232
+ } ( jQuery ) ;
0 commit comments