Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back to top button #124

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions dark/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<!-- CSS-->

<link rel="stylesheet" type="text/CSS" href="assets/css/styles.css" />
<link rel="stylesheet" type="text/CSS" href="./assets/css/styles.css" />

<!-- Edo Font -->

Expand All @@ -71,7 +71,7 @@
</head>

<body>
<!-- Navigation Bar -->
<!-- Navigation Bar -->
YoshithaRathnayake marked this conversation as resolved.
Show resolved Hide resolved

<nav class="nav-bar container-fluid responsive">
<label
Expand Down Expand Up @@ -112,7 +112,6 @@

<section id="home-section">
<!-- Main Heading -->

<center>
<header>
<a id="header" href="../"
Expand Down Expand Up @@ -227,7 +226,6 @@ <h3>ABOUT <span class="text-info">ME</span></h3>
</section>

<!-- Contact Section -->

<section id="contact-section">
<h1>CONTACT ME</h1>
<h3>CONTACT <span class="text-info">ME</span></h3>
Expand All @@ -240,10 +238,9 @@ <h3>CONTACT <span class="text-info">ME</span></h3>
<p>Contact me via Email, Message or connect me with social media accounts.
Also send me any inquiries by filling in the form given just below.</p>
</center>

YoshithaRathnayake marked this conversation as resolved.
Show resolved Hide resolved
</section>
</section>

<!-- JavaScript -->

<script src="assets/js/app.js"></script>
Expand All @@ -269,6 +266,7 @@ <h3>CONTACT <span class="text-info">ME</span></h3>
></script>

<!-- Nav-bar Scroll Animation -->
<button onclick="topFunction()" style="bottom: 20px;position: sticky;" id="myBtn" title="Go to top">Top</button>

<script>
// Auto Typing Effect Script
Expand Down Expand Up @@ -296,6 +294,26 @@ <h3>CONTACT <span class="text-info">ME</span></h3>
menu_toggle.classList.toggle("is-active");
sidebar.classList.toggle("is-active");
});
// Get the button:
let mybutton = document.getElementById("myBtn");

// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};

function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
mybutton.style.display = "block";
} else {
mybutton.style.display = "none";
}
}

// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
}
</script>

</body>
</html>
1 change: 0 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@


<body>

<section class="main">

<!-- Background Video -->
Expand Down
1 change: 0 additions & 1 deletion light/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@


<body>

<!-- Horizontal Bar Pre-Loader -->

<div class="bar-preloader">
Expand Down