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

Added a scroll up and down button #62

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ This is a beginner-friendly repo, where you can be as creative as you can with H

## Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork this repository.
2. Clone your forked copy of the project (`git clone https://github.com/Sajiyah-Salat/BlogWeb.git`)
Expand Down
3 changes: 2 additions & 1 deletion public/css/blog.css
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ h2 {

.home-article-content {
font-weight: bold;
}
}

31 changes: 31 additions & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,37 @@ aside h4 {



.scroll-up,
.scroll-down {
position: fixed;
bottom: 20px;
right: 20px;
width: 40px;
height: 40px;
border-radius: 50%;
background-color: #333;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
z-index: 9999;
}

.scroll-up:hover,
.scroll-down:hover {
background-color: #555;
}










.about-img {
width: 400px;
height: 250px;
Expand Down
28 changes: 25 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/search.css">
<link rel="stylesheet" href="css/footer.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
</head>

<body>
Expand All @@ -20,8 +21,8 @@
<div class="cont-1">
<div class="site-heading">
<div class="iBlog">
<img src="images/favicon.png" alt="">
<h1>iBlog</h1>
<a href="index.html"><img src="images/favicon.png" alt="logo"></a>
<a href="index.html"><h1>iBlog</h1></a>
</div>
<h6>The Heaven for bloggers</h6>
</div>
Expand All @@ -41,7 +42,14 @@ <h6>The Heaven for bloggers</h6>
</form>
</div>
</header>

<!-- scroll down and up button -->

<div class="scroll-up" onclick="scrollToTop()">
<i class="fas fa-chevron-up"></i>
</div>
<div class="scroll-down" onclick="scrollToBottom()">
<i class="fas fa-chevron-down"></i>
</div>
<!-- Main container -->
<div class="main-container">
<main>
Expand Down Expand Up @@ -164,6 +172,20 @@ <h1>About Us</h1>
</div>
</div>




<!-- Your webpage content goes here -->

<script>
function scrollToTop() {
window.scrollTo({ top: 0, behavior: 'smooth' });
}

function scrollToBottom() {
window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' });
}
</script>
<!-- Footer -->

<footer class="footer">
Expand Down