Skip to content

Commit

Permalink
Improving scroll to top button elegent and clean design
Browse files Browse the repository at this point in the history
  • Loading branch information
Hashir-Akbar committed Feb 2, 2025
1 parent 8993195 commit b920d5c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
7 changes: 4 additions & 3 deletions components/buttons/ScrollButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, { useEffect, useState } from 'react';
import Image from "next/image";

/**
* @returns {JSX.Element} The ScrollButton component
Expand Down Expand Up @@ -26,13 +27,13 @@ function ScrollButton() {
};

return (
<div className='fixed bottom-14 right-4 z-40 h-16 w-12'>
<div className='fixed bottom-6 right-6 m-0 flex z-40 w-12'>
{backToTopButton && (
<button
className='rounded-full bg-white shadow-md transition-all duration-300 ease-in-out hover:scale-110 hover:bg-[#8851FB]'
className='rounded-full bg-white shadow-darkGunMetal border border-black/25'
onClick={scrollUp}
>
<img src={scrollImage} alt='scroll to top' />
<Image src={scrollImage} alt='scroll to top' width={120} height={120} />
</button>
)}
</div>
Expand Down
30 changes: 16 additions & 14 deletions public/img/loaders/scroll.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b920d5c

Please sign in to comment.