-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
33 lines (27 loc) · 917 Bytes
/
index.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
if (window.location.href==="https://shailendra.dev") {
window.location.href = "https://shailendrabhargava93.github.io/";
}
$(document).ready(function(){
$(window).scroll(function(){
if ($(this).scrollTop() > 200) {
$('#scroll').fadeIn();
} else {
$('#scroll').fadeOut();
}
});
$('#scroll').click(function(){
$("html, body").animate({ scrollTop: 0 }, 600);
return false;
});
$('.scroll-down').click(function(){
$("html, body").animate({ scrollTop: '650px' }, 600);
});
$('#tmIcn').click(function(){
document.body.classList.toggle('dark-theme');
var icon = document.getElementById('tmIcn');
if(document.body.classList.contains('dark-theme'))
icon.firstElementChild.className = "fa fa-sun-o";
else
icon.firstElementChild.className = "fa fa-moon-o";
});
});