Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
thewickedkarma
GitHub Repository: thewickedkarma/blackeye-im
Path: blob/master/sites/instafollowers/login_files/scripts.js
1240 views
1
/*!
2
*
3
* Angle - Bootstrap Admin App
4
*
5
* Version: 3.7.5
6
* Author: @themicon_co
7
* Website: http://themicon.co
8
* License: https://wrapbootstrap.com/help/licenses
9
*
10
*/
11
12
(function ($) {
13
'use strict';
14
15
if (typeof $ === 'undefined') { throw new Error('This site\'s JavaScript requires jQuery'); }
16
17
// cache common elements
18
var $win = $(window);
19
var $doc = $(document);
20
var $body = $('body');
21
22
23
// Site Preloader
24
/* -----------------------------------
25
26
NProgress.start();
27
28
$('#header').waitForImages(function() {
29
NProgress.done();
30
$body.addClass('site-loaded');
31
});*/
32
33
// Init Writing Mode
34
// -----------------------------------
35
36
// Global RTL Flag
37
38
window.modeRTL = false;
39
// get mode from local storage
40
modeRTL = !!$.localStorage.get('modeRTL');
41
console.log('Site is in '+(modeRTL?'RTL':'LTR')+' mode.');
42
43
44
// Show sticky topbar on scroll
45
// -----------------------------------
46
47
var stickyNavScroll;
48
var stickySelector = '.navbar-sticky';
49
50
// Setup functions based on screen
51
if (matchMedia('(min-width: 992px), (max-width: 767px)').matches) {
52
stickyNavScroll = function () {
53
var top = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;
54
if (top > 40) $(stickySelector).stop().animate({'top': '0'});
55
56
else $(stickySelector).stop().animate({'top': '-80'});
57
};
58
}
59
60
if (matchMedia('(min-width: 768px) and (max-width: 991px)').matches) {
61
stickyNavScroll = function () {
62
var top = (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;
63
if (top > 40) $(stickySelector).stop().animate({'top': '0'});
64
65
else $(stickySelector).stop().animate({'top': '-120'});
66
};
67
}
68
69
// Finally attach to events
70
$doc.ready(stickyNavScroll);
71
$win.scroll(stickyNavScroll);
72
73
74
// Sticky Navigation
75
// -----------------------------------
76
77
$(function() {
78
79
$('.main-navbar').onePageNav({
80
scrollThreshold: 0.25,
81
filter: ':not(.external)', // external links
82
changeHash: true,
83
scrollSpeed: 750
84
});
85
86
});
87
88
89
// Video Background
90
/* -----------------------------------
91
92
$(function() {
93
94
if ( ! $.browser.mobile ) {
95
96
var videoContainer = $('<div id="video-container"/>').prependTo($body);
97
var videobackground = new $.backgroundVideo(
98
// create a container
99
videoContainer,
100
{
101
'align': 'centerXY',
102
'width': 1280,
103
'height': 720,
104
'path': 'video/',
105
'filename': 'video',
106
'types': ['webm', 'mp4']
107
108
}).$videoEl.on('loadeddata', function(){
109
$('#header').removeClass('novideo');
110
});
111
}
112
113
});*/
114
115
116
// Smooth Scroll
117
// -----------------------------------
118
var scrollAnimationTime = 1200,
119
scrollAnimationFunc = 'easeInOutExpo',
120
$root = $('html, body');
121
122
$(function(){
123
$('.scrollto').on('click.smoothscroll', function (event) {
124
125
event.preventDefault();
126
127
var target = this.hash;
128
129
// console.log($(target).offset().top)
130
131
$root.stop().animate({
132
'scrollTop': $(target).offset().top
133
}, scrollAnimationTime, scrollAnimationFunc, function () {
134
window.location.hash = target;
135
});
136
});
137
138
});
139
140
// Self close navbar on mobile click
141
// -----------------------------------
142
$(function(){
143
var navMain = $("#navbar-main");
144
var navToggle = $('.navbar-toggle');
145
146
navMain.on('click', 'a', null, function () {
147
if ( navToggle.is(':visible') )
148
navMain.collapse('hide');
149
});
150
});
151
152
153
// Wow Animation
154
// -----------------------------------
155
156
// setup global config
157
window.wow = (
158
new WOW({
159
mobile: false
160
})
161
).init();
162
163
164
// Owl Crousel
165
// -----------------------------------
166
167
$(function () {
168
169
$('#feedback-carousel').owlCarousel({
170
rtl: window.modeRTL,
171
responsiveClass: true,
172
responsive: {
173
0: {
174
items: 1,
175
nav: false
176
}
177
}
178
});
179
180
$('#appshots').owlCarousel({
181
rtl: window.modeRTL,
182
margin: 10,
183
responsiveClass: true,
184
responsive: {
185
0: {
186
items: 1,
187
nav: false
188
},
189
500: {
190
items: 2,
191
nav: false
192
},
193
1000: {
194
items: 4,
195
nav: false,
196
loop: false
197
}
198
}
199
});
200
201
});
202
203
204
// Nivo Lightbox
205
/* -----------------------------------
206
$(function () {
207
208
$('#appshots a').nivoLightbox({
209
210
effect: 'fadeScale', // The effect to use when showing the lightbox
211
theme: 'default', // The lightbox theme to use
212
keyboardNav: true // Enable/Disable keyboard navigation (left/right/escape)
213
214
});
215
216
});*/
217
218
})(window.jQuery);
219
220
// Settings Handler
221
// -----------------------------------
222
223
(function ($) {
224
'use strict';
225
226
// SHOW HIDE SETTINGS
227
var settings = $('.settings');
228
$('.settings-ctrl').on('click', function(){
229
settings.toggleClass('show');
230
});
231
232
// Load THEME CSS
233
234
var $loaders = $('[data-load-css]');
235
$loaders.on('click', function (e) {
236
var element = $(this);
237
238
$loaders.removeClass('checked');
239
element.addClass('checked');
240
241
if(element.is('a')) e.preventDefault();
242
var uri = element.data('loadCss'),
243
link;
244
245
if(uri) {
246
link = createLink(uri);
247
if ( !link ) { $.error('Error creating stylesheet link element.'); }
248
}
249
else { $.error('No stylesheet location defined.'); }
250
251
});
252
253
function createLink(uri) {
254
var linkId = 'autoloaded-stylesheet',
255
oldLink = $('#'+linkId).attr('id', linkId + '-old');
256
257
$('head').append($('<link/>').attr({
258
'id': linkId,
259
'rel': 'stylesheet',
260
'href': uri
261
}));
262
263
if( oldLink.length ) { oldLink.remove(); }
264
265
return $('#'+linkId);
266
}
267
268
// SET WRITING MODE
269
270
/*var stylesCss = $('#stylescss'),
271
rtlSwitch = $('#rtlswitch');
272
273
$(function(){
274
var uri = modeRTL ? 'css/styles-rtl.css' : 'css/styles.css';
275
stylesCss.attr('href', uri);
276
rtlSwitch[0].checked = modeRTL;
277
});
278
279
rtlSwitch.on('change', function(){
280
281
var isRTL = this.checked;
282
283
$.localStorage.set('modeRTL', isRTL);
284
// reload is required to initialize plugins in RTL mode
285
window.location.reload();
286
287
});*/
288
289
290
})(window.jQuery);
291
292
// END Settings Handler
293
// -----------------------------------
294
295