Skip to content

Commit fa70f97

Browse files
Update index.html
1 parent c5edb99 commit fa70f97

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

Website/index.html

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
content="A curated collection of diverse machine learning repositories available on GitHub, presented by the RecodeHive community" />
2222
<title>Machine Learning Repositories</title>
2323
<!-- <link rel="canonical" href="url-here" /> define base(root) link of deployment here -->
24+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
2425
<link rel="stylesheet" href="css/styles.css" />
2526
<link rel="icon" href="/assets/recode-hive.png" type="image/png"> <!-- Added favicon -->
2627
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
@@ -117,6 +118,35 @@
117118

118119
.dark-mode .paragraph {
119120
color: #555;
121+
122+
body {
123+
font-family: 'Poppins', sans-serif;
124+
min-height: 2000px; /* Add some height to enable scrolling */
125+
margin: 0;
126+
padding: 0;
127+
}
128+
129+
/* Scroll to Top Button Styles */
130+
.top-btn {
131+
display: none;
132+
width: 50px;
133+
height: 50px;
134+
position: fixed;
135+
bottom: 23px;
136+
right: 44px;
137+
background-color: #ab45e7;
138+
color: #ffffff;
139+
border: none;
140+
border-radius: 50%;
141+
cursor: pointer;
142+
font-size: 18px;
143+
align-items: center;
144+
justify-content: center;
145+
}
146+
147+
.top-btn:hover {
148+
background-color: #0056b3;
149+
        }
120150
}
121151
</style>
122152
</head>
@@ -742,7 +772,24 @@ <h4 class="h46">Contact</h4>
742772
</div>
743773

744774

775+
<button class="top-btn" id="goToTopBtn" onclick="goToTop()">
776+
<i class="fa-solid fa-chevron-up"></i>
777+
</button>
745778

779+
<script>
780+
const goToTopBtn = document.getElementById("goToTopBtn");
781+
782+
window.onscroll = function () {
783+
if (window.scrollY > 100) {
784+
goToTopBtn.style.display = "flex"; // Use "flex" to center the icon
785+
} else {
786+
goToTopBtn.style.display = "none";
787+
}
788+
};
789+
function goToTop() {
790+
window.scrollTo({ top: 0, behavior: "smooth" });
791+
 }
792+
    </script>
746793
<script>
747794
const year = new Date().getFullYear();
748795
document.getElementById("year").textContent = year;
@@ -757,4 +804,4 @@ <h4 class="h46">Contact</h4>
757804
</script>
758805
</body>
759806

760-
</html>
807+
</html>

0 commit comments

Comments
 (0)