-
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.
Merge pull request #21 from sabotack/dev
Dev
- Loading branch information
Showing
35 changed files
with
1,440 additions
and
292 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,6 +1,9 @@ | ||
name: Code Quality Checks | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
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,17 @@ | ||
{ | ||
"$schema": "https://ui.shadcn.com/schema.json", | ||
"style": "default", | ||
"rsc": false, | ||
"tsx": true, | ||
"tailwind": { | ||
"config": "tailwind.config.js", | ||
"css": "src/index.css", | ||
"baseColor": "zinc", | ||
"cssVariables": true, | ||
"prefix": "" | ||
}, | ||
"aliases": { | ||
"components": "@/components", | ||
"utils": "@/lib/utils" | ||
} | ||
} |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Header, Hero } from '@/containers'; | ||
|
||
const App = () => { | ||
return ( | ||
<> | ||
<Header /> | ||
<Hero /> | ||
<section | ||
id="projects" | ||
className="w-full h-screen bg-gradient-home-r" | ||
> | ||
<div className="w-full h-full bg-gray-900" /> | ||
</section> | ||
<section | ||
id="contact" | ||
className="w-full h-screen bg-gradient-home-r" | ||
> | ||
<div className="w-full h-full bg-red-500" /> | ||
</section> | ||
</> | ||
); | ||
}; | ||
|
||
export default App; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { useEffect, useState } from 'react'; | ||
import { | ||
Particles as TsParticles, | ||
initParticlesEngine, | ||
} from '@tsparticles/react'; | ||
import { type Container } from '@tsparticles/engine'; | ||
// import { loadAll } from "@/tsparticles/all"; // if you are going to use `loadAll`, install the "@tsparticles/all" package too. | ||
// import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too. | ||
import { loadSlim } from '@tsparticles/slim'; // if you are going to use `loadSlim`, install the "@tsparticles/slim" package too. | ||
import useParticles from '@/hooks/useParticles'; | ||
import { parallaxParticles } from '@/constants'; | ||
// import { loadBasic } from "@tsparticles/basic"; // if you are going to use `loadBasic`, install the "@tsparticles/basic" package too. | ||
|
||
const Particles = () => { | ||
const [init, setInit] = useState(false); | ||
|
||
// this should be run only once per application lifetime | ||
useEffect(() => { | ||
initParticlesEngine(async (engine) => { | ||
// you can initiate the tsParticles instance (engine) here, adding custom shapes or presets | ||
// this loads the tsparticles package bundle, it's the easiest method for getting everything ready | ||
// starting from v2 you can add only the features you need reducing the bundle size | ||
//await loadAll(engine); | ||
//await loadFull(engine); | ||
await loadSlim(engine); | ||
//await loadBasic(engine); | ||
}) | ||
.then(() => { | ||
setInit(true); | ||
}) | ||
.catch((e) => { | ||
console.error(e); | ||
}); | ||
}, []); | ||
|
||
const options = useParticles(parallaxParticles); | ||
|
||
const particlesLoaded = async (container?: Container): Promise<void> => { | ||
console.log(container); | ||
await Promise.resolve(); // Add an await expression here | ||
}; | ||
|
||
if (init) { | ||
return ( | ||
<TsParticles | ||
id="tsparticles" | ||
particlesLoaded={particlesLoaded} | ||
options={options} | ||
className="h-screen w-full absolute top-0 left-0 pointer-events-none" | ||
/> | ||
); | ||
} | ||
|
||
return <></>; | ||
}; | ||
|
||
export default Particles; |
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,54 @@ | ||
import { Theme, ThemeProviderContext } from '@/constants'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
type ThemeProviderProps = { | ||
children: React.ReactNode; | ||
defaultTheme?: Theme; | ||
storageKey?: string; | ||
}; | ||
|
||
const ThemeProvider = ({ | ||
children, | ||
defaultTheme = 'system', | ||
storageKey = 'vite-ui-theme', | ||
...props | ||
}: ThemeProviderProps) => { | ||
const [theme, setTheme] = useState<Theme>( | ||
() => (localStorage.getItem(storageKey) as Theme) || defaultTheme, | ||
); | ||
|
||
useEffect(() => { | ||
const root = window.document.documentElement; | ||
|
||
root.classList.remove('light', 'dark'); | ||
|
||
if (theme === 'system') { | ||
const systemTheme = window.matchMedia( | ||
'(prefers-color-scheme: dark)', | ||
).matches | ||
? 'dark' | ||
: 'light'; | ||
|
||
root.classList.add(systemTheme); | ||
return; | ||
} | ||
|
||
root.classList.add(theme); | ||
}, [theme]); | ||
|
||
const value = { | ||
theme, | ||
setTheme: (theme: Theme) => { | ||
localStorage.setItem(storageKey, theme); | ||
setTheme(theme); | ||
}, | ||
}; | ||
|
||
return ( | ||
<ThemeProviderContext.Provider {...props} value={value}> | ||
{children} | ||
</ThemeProviderContext.Provider> | ||
); | ||
}; | ||
|
||
export default ThemeProvider; |
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 +1,5 @@ | ||
export { default } from './Navbar'; | ||
import Navbar from './Navbar'; | ||
import ThemeProvider from './ThemeProvider'; | ||
import Particles from './Particles'; | ||
|
||
export { Navbar, ThemeProvider, Particles }; |
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,28 @@ | ||
import * as React from 'react'; | ||
import { Slot } from '@radix-ui/react-slot'; | ||
import { type VariantProps } from 'class-variance-authority'; | ||
|
||
import { cn } from '@/lib/utils'; | ||
import { buttonVariants } from '@/constants'; | ||
|
||
export interface ButtonProps | ||
extends React.ButtonHTMLAttributes<HTMLButtonElement>, | ||
VariantProps<typeof buttonVariants> { | ||
asChild?: boolean; | ||
} | ||
|
||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>( | ||
({ className, variant, size, asChild = false, ...props }, ref) => { | ||
const Comp = asChild ? Slot : 'button'; | ||
return ( | ||
<Comp | ||
className={cn(buttonVariants({ variant, size, className }))} | ||
ref={ref} | ||
{...props} | ||
/> | ||
); | ||
}, | ||
); | ||
Button.displayName = 'Button'; | ||
|
||
export { Button }; |
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,31 @@ | ||
import { cva } from 'class-variance-authority'; | ||
|
||
export const buttonVariants = cva( | ||
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', | ||
{ | ||
variants: { | ||
variant: { | ||
default: | ||
'bg-primary text-primary-foreground hover:bg-primary/90', | ||
destructive: | ||
'bg-destructive text-destructive-foreground hover:bg-destructive/90', | ||
outline: | ||
'border border-input bg-background hover:bg-accent hover:text-accent-foreground', | ||
secondary: | ||
'bg-secondary text-secondary-foreground hover:bg-secondary/80', | ||
ghost: 'hover:bg-accent hover:text-accent-foreground', | ||
link: 'text-primary underline-offset-4 hover:underline', | ||
}, | ||
size: { | ||
default: 'h-10 px-4 py-2', | ||
sm: 'h-9 rounded-md px-3', | ||
lg: 'h-11 rounded-md px-8', | ||
icon: 'h-10 w-10', | ||
}, | ||
}, | ||
defaultVariants: { | ||
variant: 'default', | ||
size: 'default', | ||
}, | ||
}, | ||
); |
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,12 @@ | ||
import { navigation } from './navigation'; | ||
import { ThemeProviderContext, Theme } from './themeProvider'; | ||
import { parallaxParticles } from './parallaxParticles'; | ||
import { buttonVariants } from './button'; | ||
|
||
export { | ||
navigation, | ||
parallaxParticles, | ||
buttonVariants, | ||
ThemeProviderContext, | ||
type Theme, | ||
}; |
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,17 @@ | ||
export const navigation = [ | ||
{ | ||
id: '0', | ||
title: 'About', | ||
url: '#about', | ||
}, | ||
{ | ||
id: '1', | ||
title: 'Projects', | ||
url: '#projects', | ||
}, | ||
{ | ||
id: '2', | ||
title: 'Contact', | ||
url: '#contact', | ||
}, | ||
]; |
Oops, something went wrong.