-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscripts.js
More file actions
52 lines (38 loc) · 1.87 KB
/
Copy pathscripts.js
File metadata and controls
52 lines (38 loc) · 1.87 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
/* -----------------------------------------------------------------------
Made with code and care in Paris by Codingk8 - 2019 - Twitter: @codingk8
Project made for the freeCodeCamp curriculum, "Responsive Web Design" Certification
Project #4 - Technical Documentation
Title: Markdown up and running - An extended cheatsheet
------------------------------------------------------------ */
/* --------------------------------------------------------------------------------------- */
/* --- Makes the "back to top" arrow appear after scroll and disappear when back up => --- */
/* --------------------------------------------------------------------------------------- */
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 125 || document.documentElement.scrollTop > 125) {
document.getElementById("btticon").style.display = "block";
} else if (document.body.scrollBottom > 125 || document.documentElement.scrollBottom > 125) {
document.getElementById("btticon").style.display = "none";
} else {
document.getElementById("btticon").style.display = "none";
}
}
/* ---------------------------------------------------------- */
/* --- jQuery Bounce effect on the "back to top" arrow => --- */
/* ---------------------------------------------------------- */
$(document).ready(function(){
$( "#btticon" ).on("mouseenter", function() {
$(this).effect( "bounce", { times: 3 }, "slow" );
})
})
/* ------------------------------------------ */
/* --- "Light mode | Dark mode" effect => --- */
/* ------------------------------------------ */
function toggleDarkLight() {
let container = document.getElementById("container");
let currentClass = container.className;
container.className = currentClass == "dark" ? "light" : "dark";
}
/* ------------------ */
/* End of js file ;o) */
/* ------------------ */