-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathppjs.js
More file actions
63 lines (51 loc) · 1.93 KB
/
ppjs.js
File metadata and controls
63 lines (51 loc) · 1.93 KB
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
63
let icons = document.getElementsByTagName('i');
console.log(icons)
for (let icon of icons){
icon.addEventListener('mouseenter', function (){
this.style.fontSize = "80px";
});
icon.addEventListener('mouseleave', function (){
this.style.fontSize = "50px";
});
}
var scroll = new SmoothScroll('a[href*="#"]');
(function($) {
/**
* Copyright 2012, Digital Fusion
* Licensed under the MIT license.
* http://teamdf.com/jquery-plugins/license/
*
* @author Sam Sehnert
* @desc A small plugin that checks whether elements are within
* the user visible viewport of a web browser.
* only accounts for vertical position, not horizontal.
*/
$.fn.visible = function(partial) {
var $t = $(this),
$w = $(window),
viewTop = $w.scrollTop(),
viewBottom = viewTop + $w.height(),
_top = $t.offset().top,
_bottom = _top + $t.height(),
compareTop = partial === true ? _bottom : _top,
compareBottom = partial === true ? _top : _bottom;
return ((compareBottom <= viewBottom) && (compareTop >= viewTop));
};
})(jQuery);
$(document).ready(function(){
$(window).scroll(function() { // check if scroll event happened
if ($(document).scrollTop() > 50) { // check if user scrolled more than 50 from top of the browser window
$('.navbar').removeClass('navbar-dark');
$('.navbar').addClass('bg-dark navbar-dark');
} else {
$('.navbar').removeClass('bg-dark navbar-dark');
$('.navbar').addClass('navbar-dark');
}
$("i").each(function(i, el) {
var el = $(el);
if (el.visible(true)) {
el.addClass("animate fadeIn");
}
});
});
});