Skip to content
This repository was archived by the owner on Jan 11, 2020. It is now read-only.

Commit 43ac063

Browse files
neerajd007prateek76
authored andcommitted
C2branch (#363)
* Fixed Issue #355 - Added Leaderboard link in Navbar * Fixes Issue #355 * Fixed Issue #356 Added go to top button
1 parent b620b61 commit 43ac063

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

css/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ body{
225225
border: none;
226226
outline: none;
227227
background-color: white;
228-
color: black;
228+
color: red;
229229
cursor: pointer;
230230
padding: 8px;
231231
border-radius: 2px;

index.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161

6262

6363
<a class=" ribbn-ref" href="https://github.com/opencodeiiita/Opencode-Collaborative-19" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
64-
<button onclick="topFunction()" id="myBtn" title="Go to top" class="dark-scrl-btn"><i class="fas fa-arrow-up"></i></button>
64+
6565
<!-- Navigation -->
6666

6767

@@ -1009,6 +1009,7 @@ <h2 class="my-4">Issues</h2>
10091009
<div class="container night-footer-ref">
10101010
<p class="m-0 text-center text-white">Copyright &copy; OpenCode'19</p>
10111011
</div>
1012+
<button onclick="topFunction()" id="myBtn" title="Go to top" class="dark-scrl-btn"><i class="fas fa-arrow-up"></i></button>
10121013
<!-- /.container -->
10131014
</footer>
10141015

@@ -1055,6 +1056,20 @@ <h2 class="my-4">Issues</h2>
10551056
var scrolled = (winScroll / height) * 100;
10561057
document.getElementById("myBar").style.width = scrolled + "%";
10571058
}
1059+
window.onscroll = function() {scrollFunction()};
1060+
1061+
function scrollFunction() {
1062+
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
1063+
document.getElementById("myBtn").style.display = "block";
1064+
} else {
1065+
document.getElementById("myBtn").style.display = "none";
1066+
}
1067+
}
1068+
1069+
function topFunction() {
1070+
document.body.scrollTop = 0;
1071+
document.documentElement.scrollTop = 0;
1072+
}
10581073
</script>
10591074

10601075
</html>

0 commit comments

Comments
 (0)