-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
101 lines (84 loc) · 2.71 KB
/
script.js
File metadata and controls
101 lines (84 loc) · 2.71 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
$(document).ready(function(){
$('#menu').click(function(){
$(this).toggleClass('fa-times');
$('.navbar').toggleClass('nav-toggle');
});
$(window).on('scroll load',function(){
$('#menu').removeClass('fa-times');
$('.navbar').removeClass('nav-toggle');
if(window.scrollY>60){
document.querySelector('#scroll-top').classList.add('active');
}else{
document.querySelector('#scroll-top').classList.remove('active');
}
});
});
// scroll spy
$('section').each(function () {
let height = $(this).height();
let offset = $(this).offset().top - 200;
let top = $(window).scrollTop();
let id = $(this).attr('id');
if (top > offset && top < offset + height) {
$('.navbar ul li a').removeClass('active');
$('.navbar').find(`[href="#${id}"]`).addClass('active');
}
});
// });
// smooth scrolling
$('a[href*="#"]').on('click', function (e) {
e.preventDefault();
$('html, body').animate({
scrollTop: $($(this).attr('href')).offset().top,
}, 500, 'linear')
});
/* ===== SCROLL REVEAL ANIMATION ===== */
const srtop = ScrollReveal({
origin: 'top',
distance: '80px',
duration: 1000,
reset: true
});
/* SCROLL EXPERIENCE */
srtop.reveal('.experience .timeline',{delay: 400});
srtop.reveal('.experience .timeline .container',{interval: 400});
// Start of Tawk.to Live Chat
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/60df10bf7f4b000ac03ab6a8/1f9jlirg6';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
// End of Tawk.to Live Chat
// disable developer mode
// document.onkeydown = function(e) {
// if(e.keyCode == 123) {
// return false;
// }
// if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) {
// return false;
// }
// if(e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)) {
// return false;
// }
// if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) {
// return false;
// }
// if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) {
// return false;
// }
// }
document.addEventListener('visibilitychange',
function () {
if (document.visibilityState === "visible") {
document.title = "DevRoy-Portfolio";
$("#favicon").attr("href", "images/first.jpg");
}
else {
document.title = "Come Back To Portfolio";
$("#favicon").attr("href", "images/favhand.png");
}
});