-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
4,694 additions
and
1,642 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
{ | ||
"extends": ["next/core-web-vitals"], | ||
"extends": ["next/core-web-vitals", "prettier"], | ||
"rules": { | ||
"no-multiple-empty-lines": ["error", { "max": 2 }], | ||
"import/no-duplicates": "error", | ||
"import/order": [ | ||
"error", | ||
{ | ||
"groups": [["builtin", "external"], "internal", ["parent", "sibling", "index"]], | ||
"groups": [ | ||
["builtin", "external"], | ||
"internal", | ||
"index", | ||
["parent", "sibling"] | ||
], | ||
"newlines-between": "always" | ||
} | ||
], | ||
"quotes": ["error", "double"], | ||
"react/jsx-max-props-per-line": ["error", { "maximum": 3 }], | ||
"react/jsx-sort-props": ["error", { "ignoreCase": true }], | ||
// "react/jsx-sort-props": ["error", { "ignoreCase": true }], | ||
"react/self-closing-comp": "error" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"plugins": ["@trivago/prettier-plugin-sort-imports"], | ||
"importOrder": ["^[react]", "^@(?!/)", "^@/", "^[./]"], | ||
"importOrderSeparation": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
pnpm: | ||
npm install pnpm | ||
|
||
install: | ||
pnpm install | ||
|
||
format: | ||
pnpm format | ||
|
||
lint: format | ||
pnpm lint | ||
|
||
local: | ||
pnpm dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
// import Social from './Social'; | ||
import { Header } from './Header'; | ||
import { Header } from "./Header"; | ||
|
||
const Layout = ({ children }) => { | ||
return ( | ||
<div className="flex h-screen bg-gray-100 dark:bg-gray-800"> | ||
<div className="w-1/5 p-8 bg-white dark:bg-gray-900"> | ||
<Header /> | ||
{/* <Social /> */} | ||
</div> | ||
<div className="flex-1 p-8">{children}</div> | ||
</div> | ||
); | ||
return ( | ||
<div className="flex h-screen bg-gray-100 dark:bg-gray-800"> | ||
<div className="w-1/5 p-8 bg-white dark:bg-gray-900"> | ||
<Header /> | ||
{/* <Social /> */} | ||
</div> | ||
<div className="flex-1 p-8">{children}</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Layout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
|
||
const PageTitle = ({ showSidebar, setShowSidebar }) => ( | ||
<div className='flex items-center gap-2 text-primary dark:text-darkPrimary'> | ||
<p><a href="#"><span className='text-lg font-bold'>Amr Abed</span></a></p> | ||
</div> | ||
<div className="flex items-center gap-2 text-primary dark:text-darkPrimary"> | ||
<p> | ||
<a href="#"> | ||
<span className="text-lg font-bold">Amr Abed</span> | ||
</a> | ||
</p> | ||
</div> | ||
); | ||
|
||
export default PageTitle | ||
export default PageTitle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,46 @@ | ||
"use client"; | ||
import React, { Fragment, useState, useEffect, useRef } from "react"; | ||
|
||
import React, { Fragment, useEffect, useRef, useState } from "react"; | ||
|
||
const Section = ({ id, title, children }) => { | ||
const [isVisible, setIsVisible] = useState(false); | ||
const dataRef = useRef(); | ||
const itemRef = useRef(); | ||
|
||
useEffect(() => { | ||
const getScreenWidth = () => | ||
window.innerWidth || | ||
document.documentElement.clientWidth || | ||
document.body.clientWidth; | ||
|
||
const observer = new IntersectionObserver( | ||
([entry]) => { | ||
setIsVisible(entry.isIntersecting); | ||
}, | ||
{ | ||
rootMargin: `${getScreenWidth() <= 700 ? "-100px" : "-250px"}`, | ||
} | ||
); | ||
|
||
observer.observe(dataRef.current); | ||
|
||
if (isVisible) { | ||
itemRef.current.classList.add("pop-up-child"); | ||
} else { | ||
itemRef.current.classList.remove("pop-up-child"); | ||
} | ||
}, [isVisible]); | ||
|
||
return ( | ||
<Fragment> | ||
<section id={id} className='section' ref={dataRef}> | ||
<h2 className='section-heading'>{title}</h2> | ||
<div className='pop-down-child section-body' ref={itemRef}> | ||
{children} | ||
</div> | ||
</section> | ||
</Fragment> | ||
const [isVisible, setIsVisible] = useState(false); | ||
const dataRef = useRef(); | ||
const itemRef = useRef(); | ||
|
||
useEffect(() => { | ||
const getScreenWidth = () => | ||
window.innerWidth || | ||
document.documentElement.clientWidth || | ||
document.body.clientWidth; | ||
|
||
const observer = new IntersectionObserver( | ||
([entry]) => { | ||
setIsVisible(entry.isIntersecting); | ||
}, | ||
{ | ||
rootMargin: `${getScreenWidth() <= 700 ? "-100px" : "-250px"}`, | ||
}, | ||
); | ||
|
||
observer.observe(dataRef.current); | ||
|
||
if (isVisible) { | ||
itemRef.current.classList.add("pop-up-child"); | ||
} else { | ||
itemRef.current.classList.remove("pop-up-child"); | ||
} | ||
}, [isVisible]); | ||
|
||
return ( | ||
<Fragment> | ||
<section id={id} className="section" ref={dataRef}> | ||
<h2 className="section-heading">{title}</h2> | ||
<div className="pop-down-child section-body" ref={itemRef}> | ||
{children} | ||
</div> | ||
</section> | ||
</Fragment> | ||
); | ||
}; | ||
|
||
export default Section; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import React from "react"; | ||
import { FaSun, FaMoon } from "react-icons/fa"; | ||
|
||
import { FaMoon, FaSun } from "react-icons/fa"; | ||
|
||
const ToggleThemeButton = ({ theme, toggleTheme }) => ( | ||
<div className='flex items-center gap-4'> | ||
<button | ||
className='text-primary dark:text-darkPrimary text-2xl font-semibold hover:scale-110' | ||
onClick={toggleTheme} | ||
> | ||
{theme === "dark" ? <FaSun /> : <FaMoon />} | ||
</button> | ||
</div> | ||
<div className="flex items-center gap-4"> | ||
<button | ||
className="text-primary dark:text-darkPrimary text-2xl font-semibold hover:scale-110" | ||
onClick={toggleTheme} | ||
> | ||
{theme === "dark" ? <FaSun /> : <FaMoon />} | ||
</button> | ||
</div> | ||
); | ||
|
||
export default ToggleThemeButton; | ||
export default ToggleThemeButton; |
Oops, something went wrong.