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 feature: Scoll down button #231

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
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ Thank you for your interest in contributing to BioBranch! This guide will help y
npm install
npm start
```
- For frontend changes:
- For frontend changes:cd server

```bash
cd site
npm install
Expand Down
9 changes: 8 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 17 additions & 25 deletions site/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@heroicons/react": "^2.1.5",
"eslint": "8.37.0",
"eslint-config-next": "13.2.4",
"framer-motion": "^11.5.4",
Expand Down
20 changes: 20 additions & 0 deletions site/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@ import Creators from '@/components/Creators'
import DetailsCard from '@/components/DetailsCard'
import Faq from '@/components/Faq'
import Process from '@/components/Process'
import { useRef } from 'react';
import { ChevronDoubleDownIcon } from '@heroicons/react/24/solid';

export default function Home() {

// Scroll to the next section
const scrollToNextSection = () => {
window.scrollBy({
top: window.innerHeight,
behavior: 'smooth',
});
};

return (
<>
<MyHead
Expand All @@ -16,6 +27,15 @@ export default function Home() {
/>

<main className="w-full min-h-screen flex flex-col justify-center items-center">
{/* Scroll down button */}
<button
onClick={scrollToNextSection}
className="fixed top-20 right-4 bg-blue-500 text-white p-2 rounded-full shadow-lg hover:bg-blue-600 transition-all z-10"
title="Scroll down"
>
{/* Double arrow icon */}
<ChevronDoubleDownIcon className="h-6 w-6"/>
</button>
<Creators/>
<DetailsCard/>
<Faq/>
Expand Down