Skip to content

Commit 91e6c4a

Browse files
authored
Merge pull request #57 from HusseinSerag/FEAT-landing-page
Create new Landing Page
2 parents 02f687f + 9b22138 commit 91e6c4a

File tree

11 files changed

+88
-239
lines changed

11 files changed

+88
-239
lines changed

package-lock.json

Lines changed: 0 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@
2323
"@typescript-eslint/eslint-plugin": "^5.60.1",
2424
"@vitejs/plugin-react": "^4.2.1",
2525
"file-saver": "^2.0.5",
26-
"i18next-browser-languagedetector": "^8.0.0",
27-
"i18next-http-backend": "^2.6.1",
2826
"jszip": "^3.10.1",
2927
"lucide-react": "^0.376.0",
3028
"prop-types": "^15.8.1",
3129
"react": "^18.2.0",
3230
"react-chatbotify": "^2.0.0-beta.3",
3331
"react-dom": "^18.2.0",
34-
"react-i18next": "^15.0.1",
3532
"react-loading-skeleton": "^3.4.0",
3633
"react-router-dom": "^6.2.2",
3734
"uuid": "^9.0.1",
54.4 KB
Loading
17 KB
Loading
69 KB
Loading
84 KB
Loading
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Link } from "react-router-dom";
2+
3+
export default function HeroSection() {
4+
return (
5+
<div className='py-[57px] flex items-center gap-3 justify-center flex-col px-5'>
6+
<h1 className='text-accent-600 text-lg sm:text-xl font-semibold'>React ChatBotify</h1>
7+
<h2 className='text-accent-900 font-bold text-3xl sm:text-5xl'>Theme Gallery</h2>
8+
<h3 className='text-accent-600 sm:text-base text-sm text-center w-[250px]'>
9+
Browse, rate and share themes for your chatbot today and more!
10+
</h3>
11+
<div className="flex mt-6 flex-col items-center sm:flex-row gap-2">
12+
13+
14+
<Link to={"/themes"}>
15+
<button className='bg-accent-900 hover:bg-gradient-to-r hover:from-secondary-900 px-2 py-1 text-[14px] hover:to-primary-600 transition-colors duration-300 hover:text-accent-900 sm:px-4 sm:py-2 sm:text-lg rounded-lg'>
16+
Themes
17+
</button>
18+
</Link>
19+
<Link to={"/plugins"}>
20+
<button className='bg-accent-900 hover:bg-gradient-to-r hover:from-secondary-900 px-2 py-1 text-[14px] hover:to-primary-600 transition-colors duration-300 hover:text-accent-900 sm:px-4 sm:py-2 sm:text-lg rounded-lg'>
21+
Plugins
22+
</button>
23+
</Link>
24+
<Link to={"https://react-chatbotify.com"}>
25+
<button className='bg-accent-900 hover:bg-gradient-to-r hover:from-secondary-900 px-2 py-1 text-[14px] hover:to-primary-600 transition-colors duration-300 hover:text-accent-900 sm:px-4 sm:py-2 sm:text-lg rounded-lg'>
26+
Documentation
27+
</button>
28+
</Link>
29+
</div>
30+
</div>
31+
)
32+
}
33+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import img1 from './../../assets/images/LandingPage/theme-1.png'
2+
import img2 from './../../assets/images/LandingPage/theme-2.png'
3+
import img3 from './../../assets/images/LandingPage/theme-3.png'
4+
import img4 from './../../assets/images/LandingPage/theme-4.png'
5+
export default function ImageHeroSection() {
6+
return (
7+
<div className='flex justify-center gap-6'>
8+
<img src={img1} className='w-[127px] h-[120px] -rotate-6 rounded-lg bg-cover' />
9+
<img src={img2} className='w-[127px] h-[120px] rotate-6 rounded-lg bg-cover' />
10+
<img src={img3} className='w-[127px] h-[120px] -rotate-6 rounded-lg bg-cover' />
11+
<img src={img4} className='w-[127px] h-[120px] rotate-6 rounded-lg bg-cover' />
12+
</div>
13+
)
14+
}
15+

src/components/NavigationBar/NavigationBar.tsx

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState } from 'react';
1+
import { useEffect, useRef, useState } from 'react';
22
import { Link, useNavigate } from 'react-router-dom';
33

44
import { handleLogin } from '../../services/authService';
@@ -21,6 +21,8 @@ type DropdownProps = {
2121
/**
2222
* Navigation bar for users to navigate between pages.
2323
*/
24+
25+
const navBarClass = "sticky top-0 w-full z-50 text-white py-2 px-6 flex justify-between items-center"
2426
const NavigationBar = () => {
2527
// context for handling user data
2628
const { isLoggedIn, setIsLoggedIn, setUserData } = useAuth()
@@ -35,6 +37,21 @@ const NavigationBar = () => {
3537
setMenuOpen(!menuOpen)
3638
}
3739

40+
41+
const navbarRef = useRef<HTMLDivElement>(null)
42+
43+
useEffect(function(){
44+
window.addEventListener('scroll',function(e){
45+
if(navbarRef.current) {
46+
if(window.scrollY >= 50) {
47+
navbarRef.current.className = navBarClass + ' opacity-80 bg-black'
48+
} else {
49+
navbarRef.current.className = navBarClass
50+
}
51+
}
52+
})
53+
},[])
54+
3855
const { t, i18n } = useTranslation();
3956

4057
const changeLanguage = (lang: string) => {
@@ -76,21 +93,20 @@ const NavigationBar = () => {
7693

7794
return (
7895
<nav
79-
className="fixed top-0 w-full z-50 opacity-80 bg-black
80-
text-white py-2 px-6 flex justify-between items-center"
96+
className={navBarClass}
8197
style={{ height: '8vh' }}
98+
ref={navbarRef}
8299
>
83-
<Link to="/" className="flex items-center">
100+
<Link to="/">
84101
{' '}
85102
{/* Wrap logo and title with Link */}
86103
<img src={logo} alt="Logo" className="w-8 h-8 mr-2" />
87-
<h1 className="text-lg font-bold">{SiteConfig.siteName}</h1>
88104
</Link>
89105

90106
<div className="relative">
91107
<button
92108
onClick={toggleMenu}
93-
className="block md:hidden"
109+
className="block lg:hidden"
94110
type="button"
95111
aria-label="Menu"
96112
>
@@ -238,7 +254,7 @@ const NavigationBar = () => {
238254
)}
239255
</div>
240256

241-
<ul className="hidden md:flex pr-20">
257+
<ul className="hidden lg:flex pr-20">
242258
{/* needs improvement */}
243259
<li className="mr-8">
244260
<Link to="/about" className="hover:text-blue-500">

0 commit comments

Comments
 (0)