Skip to content

Commit 0dc5fc7

Browse files
committed
Made the required changes
1 parent a31a24b commit 0dc5fc7

File tree

4 files changed

+64
-33
lines changed

4 files changed

+64
-33
lines changed

archive.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons|Roboto">
4949
<link rel="stylesheet" href="/materialjs/material.min.css" />
5050
<link rel="stylesheet" href="style.css" />
51+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
5152
<script defer src="/materialjs/material.min.js"></script>
5253
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
5354

@@ -148,6 +149,9 @@ <h3>2019</h3>
148149
</ul>
149150
</div>
150151
</div>
152+
153+
<button onclick="topFunction()" id="myBtn" title="Go to top"><i class="fa fa-angle-double-up" aria-hidden="true" style="color: black;font-weight: bolder;"></i></button>
154+
151155
<div class="mdl-cell mdl-cell--6-col">
152156
<div class="nwoc-repo-card">
153157
<img src="https://cdnjs.cloudflare.com/ajax/libs/octicons/8.0.0/svg/mark-github.svg"/>
@@ -1388,4 +1392,27 @@ <h3>Previous Sponsors</h3>
13881392
</main>
13891393
</div>
13901394
</body>
1395+
1396+
<script>
1397+
//Get the button
1398+
var mybutton = document.getElementById("myBtn");
1399+
1400+
// When the user scrolls down 20px from the top of the document, show the button
1401+
window.onscroll = function() {scrollFunction()};
1402+
1403+
function scrollFunction() {
1404+
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
1405+
mybutton.style.display = "block";
1406+
} else {
1407+
mybutton.style.display = "none";
1408+
}
1409+
}
1410+
1411+
// When the user clicks on the button, scroll to the top of the document
1412+
function topFunction() {
1413+
document.body.scrollTop = 0;
1414+
document.documentElement.scrollTop = 0;
1415+
}
1416+
</script>
1417+
13911418
</html>

index.html

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -56,37 +56,7 @@
5656
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
5757
<link rel="stylesheet" href="/materialjs/material.min.css" />
5858
<link rel="stylesheet" href="style.css" />
59-
<style type="text/css">
60-
html {
61-
scroll-behavior: smooth;
62-
}
63-
64-
#myBtn {
65-
display: none;
66-
position: fixed;
67-
bottom: 20px;
68-
right: 30px;
69-
z-index: 99;
70-
font-size: 25px;
71-
border: none;
72-
outline: none;
73-
background-color: #87CEFA;
74-
color: white;
75-
font-color: blue;
76-
cursor: pointer;
77-
padding: 14px;
78-
border-radius: 30%;
79-
}
80-
81-
.fa-angle-double-up {
82-
83-
font-weight: bolder;
84-
}
85-
86-
#myBtn:hover {
87-
background-color: #D3D3D3;
88-
}
89-
</style>
59+
9060
<script defer src="/materialjs/material.min.js"></script>
9161
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
9262

projects.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons|Roboto">
4949
<link rel="stylesheet" href="/materialjs/material.min.css" />
5050
<link rel="stylesheet" href="style.css" />
51+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
5152
<script defer src="/materialjs/material.min.js"></script>
5253
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
5354

@@ -155,6 +156,9 @@ <h3>NWoC 2020 Projects</h3>
155156
</ul>
156157
</div>
157158
</div>
159+
160+
<button onclick="topFunction()" id="myBtn" title="Go to top"><i class="fa fa-angle-double-up" aria-hidden="true" style="color: black;font-weight: bolder;"></i></button>
161+
158162
<div class="mdl-cell mdl-cell--6-col">
159163
<div class="nwoc-repo-card">
160164
<img src="https://cdnjs.cloudflare.com/ajax/libs/octicons/8.0.0/svg/mark-github.svg"/>
@@ -683,4 +687,25 @@ <h3>NWoC 2020 Projects</h3>
683687
</main>
684688
</div>
685689
</body>
690+
<script>
691+
//Get the button
692+
var mybutton = document.getElementById("myBtn");
693+
694+
// When the user scrolls down 20px from the top of the document, show the button
695+
window.onscroll = function() {scrollFunction()};
696+
697+
function scrollFunction() {
698+
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
699+
mybutton.style.display = "block";
700+
} else {
701+
mybutton.style.display = "none";
702+
}
703+
}
704+
705+
// When the user clicks on the button, scroll to the top of the document
706+
function topFunction() {
707+
document.body.scrollTop = 0;
708+
document.documentElement.scrollTop = 0;
709+
}
710+
</script>
686711
</html>

style.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ html {
2626
color: white;
2727
font-color: blue;
2828
cursor: pointer;
29-
padding: 14px;
30-
border-radius: 30%;
29+
padding: 6px;
30+
border-radius: 50%;
31+
height: 50px;
32+
width: 50px;
3133
}
3234

3335
.fa-angle-double-up {
@@ -131,6 +133,13 @@ a {
131133
}
132134
}
133135

136+
@media screen and (max-width: 961px) {
137+
#myBtn {
138+
bottom: 20px;
139+
right: 15px;
140+
}
141+
}
142+
134143
@media screen and (max-width: 960px) {
135144
.mdl-layout__header-row {
136145
padding: 0 10px 0 20px;

0 commit comments

Comments
 (0)