-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
44 lines (36 loc) · 946 Bytes
/
main.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
34
35
36
37
38
39
40
41
42
document.getElementById('top-button').addEventListener('click', function () {
window.scrollTo(0, 0);
});
$(window).scroll(function () {
var threshold = 208;
var op = (($(document).height() - $(window).height()) - $(window).scrollTop()) / threshold;
if (op <= 13) {
$("#top-button").show();
} else {
$("#top-button").hide();
}
});
$('#switch1').on('click', function () {
$('body').toggleClass('night')
})
$(document).ready(function () {
var date = new Date();
var current_time = date.getHours();
if (current_time > 19 || current_time < 6)
document.body.className = "night";
else
document.body.className = "";
});
$(window).load(function () {
$("#top-button").hide();
});
$('.project_used span').on({
mouseover: function () {
event.preventDefault();
$(this).animate({ opacity: 0.25 });
},
mouseout: function () {
event.preventDefault();
$(this).animate({ opacity: 1 });
}
});