From 524cc61272c4dbf8cc87adc3ce4ba41d8f6803bf Mon Sep 17 00:00:00 2001 From: Ayush Nighoskar Date: Mon, 12 Jun 2023 11:46:22 +0530 Subject: [PATCH 1/3] Added Scroll to top functionality Added Scroll to top functionality --- Contributors.md | 3 ++- assets/style.css | 29 +++++++++++++++++++++++++++++ filter_project.js | 13 ++++++++++++- index.html | 21 +++++---------------- script.js | 9 --------- 5 files changed, 48 insertions(+), 27 deletions(-) diff --git a/Contributors.md b/Contributors.md index d8b70847..87b8bf4f 100644 --- a/Contributors.md +++ b/Contributors.md @@ -4,5 +4,6 @@ | --------------------- | ------------------------------------------------------------- | ---------------- | | Raj Kumar | [@raj03kumar](https://github.com/raj03kumar) | | | --------------------- | ------------------------------------------------------------- | ---------------- | -| Debsourya Datta | [@debsouryadatta](https://github.com/debsouryadatta) | | +| Ayush Nighoskar | [@ayushnighoskar](https://github.com/ayushnighoskar) | | | --------------------- | ------------------------------------------------------------- | ---------------- | + diff --git a/assets/style.css b/assets/style.css index 05bab518..da0622ab 100644 --- a/assets/style.css +++ b/assets/style.css @@ -337,3 +337,32 @@ body { line-height: 1.4; word-spacing: 100vw; } + +.to-top { + background: white; + position: fixed; + bottom: 16px; + right:32px; + width:50px; + height:50px; + border-radius:50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 32px; + color: #1f1f1f; + text-decoration: none; + opacity:0; + pointer-events: none; + transition: all .4s; +} +.to-top.active { + bottom: 32px; + pointer-events: auto; + opacity:1; +} +html { + scroll-behavior: smooth; +} + + diff --git a/filter_project.js b/filter_project.js index 56e7807b..8e046fd4 100644 --- a/filter_project.js +++ b/filter_project.js @@ -38,4 +38,15 @@ const displayRequiredProjects = (category, search_value) => { if(!found_card.length) found_card='

Cannot find the project

' card_grid.innerHTML = found_card; -}; \ No newline at end of file +}; + +// Scroll to the top when the button is clicked +const toTop = document.querySelector(".to-top"); + +window.addEventListener("scroll", () => { + if(window.pageYOffset >100) { + toTop.classList.add("active"); + } else { + toTop.classList.remove("active"); + } +}) diff --git a/index.html b/index.html index 561cd3b2..75905885 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ + @@ -206,14 +207,6 @@

An Interactive Maze Game

A CSS Animation Project involving Two Candles

- - -
-
-

Guess Word game

-

A Javascript project containing word guesser game

-
-
@@ -247,16 +240,12 @@

Memory Game

- -
-
-

Order

-

Clothing Shop

-
-
-
+ + + +

IEEE SSIT VIT © 2023

diff --git a/script.js b/script.js index 9682d5e6..283c8809 100644 --- a/script.js +++ b/script.js @@ -1,12 +1,3 @@ - - -var scrollToElement = function(el, ms){ - var speed = (ms) ? ms : 600; - $('html,body').animate({ - scrollTop: $(el).offset().top - }, speed); -} - $(document).ready(function() { $('.nav-link').on('click', function(e) { e.preventDefault(); From d667659fe6590c6f1f78c23c0efd871fe5f4543c Mon Sep 17 00:00:00 2001 From: Ayush Nighoskar Date: Tue, 13 Jun 2023 23:11:07 +0530 Subject: [PATCH 2/3] Updated index.html --- index.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/index.html b/index.html index 75905885..2d455b1d 100644 --- a/index.html +++ b/index.html @@ -207,6 +207,14 @@

An Interactive Maze Game

A CSS Animation Project involving Two Candles

+ + +
+
+

Guess Word game

+

A Javascript project containing word guesser game

+
+
@@ -239,6 +247,13 @@

BlackJack

Memory Game

+ +
+
+

Order

+

Clothing Shop

+
+
From 1370dd8ccfa8ed11ff19b58b110001201f8328b7 Mon Sep 17 00:00:00 2001 From: Ayush Nighoskar Date: Tue, 13 Jun 2023 23:12:38 +0530 Subject: [PATCH 3/3] Updated contributions.md file --- Contributors.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Contributors.md b/Contributors.md index 87b8bf4f..8b7098be 100644 --- a/Contributors.md +++ b/Contributors.md @@ -3,7 +3,10 @@ | Shreya | [@shreyaar12](https://github.com/Shreyaar12) | | | --------------------- | ------------------------------------------------------------- | ---------------- | | Raj Kumar | [@raj03kumar](https://github.com/raj03kumar) | | -| --------------------- | ------------------------------------------------------------- | ---------------- | +| --------------------- | +------------------------------------------------------------- | ---------------- | +| Debsourya Datta | [@debsouryadatta](https://github.com/debsouryadatta) | | +------------------------------------------------------------- | ---------------- | | Ayush Nighoskar | [@ayushnighoskar](https://github.com/ayushnighoskar) | | | --------------------- | ------------------------------------------------------------- | ---------------- |