-
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 #3 from remcostoeten/2-add-libs-and-basic-core-setup
2 add libs and basic core setup
- Loading branch information
Showing
25 changed files
with
462 additions
and
37 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 |
---|---|---|
|
@@ -12,6 +12,6 @@ | |
}, | ||
"aliases": { | ||
"components": "@/components", | ||
"utils": "@/lib/utils" | ||
"utils": "@/core/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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,70 @@ | ||
"use client"; | ||
import { cn } from "@/core"; | ||
import React, { ReactNode } from "react"; | ||
|
||
interface AuroraBackgroundProps extends React.HTMLProps<HTMLDivElement> { | ||
children: ReactNode; | ||
showRadialGradient?: boolean; | ||
colorVariant?: 'dark' | 'light' | 'custom' | 'darkMode'; | ||
} | ||
|
||
export const AuroraBackground = ({ | ||
className, | ||
children, | ||
showRadialGradient = true, | ||
colorVariant = 'dark', | ||
...props | ||
}: AuroraBackgroundProps) => { | ||
const colorSchemes = { | ||
dark: ` | ||
[--gradient:repeating-linear-gradient(100deg,var(--black)_0%,var(--black)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--black)_16%)] | ||
[--aurora:repeating-linear-gradient(100deg,var(--blue-500)_10%,var(--indigo-300)_15%,var(--blue-300)_20%,var(--violet-200)_25%,var(--blue-400)_30%)] | ||
`, | ||
light: ` | ||
[--gradient:repeating-linear-gradient(100deg,var(--white)_0%,var(--white)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--white)_16%)] | ||
[--aurora:repeating-linear-gradient(100deg,var(--blue-500)_10%,var(--indigo-300)_15%,var(--blue-300)_20%,var(--violet-200)_25%,var(--blue-400)_30%)] | ||
`, | ||
custom: ` | ||
[--gradient:repeating-linear-gradient(100deg,var(--red-500)_0%,var(--red-500)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--red-500)_16%)] | ||
[--aurora:repeating-linear-gradient(100deg,var(--green-500)_10%,var(--yellow-300)_15%,var(--green-300)_20%,var(--orange-200)_25%,var(--green-400)_30%)] | ||
`, | ||
darkMode: ` | ||
[--gradient:repeating-linear-gradient(100deg,var(--gray-800)_0%,var(--gray-800)_7%,var(--transparent)_10%,var(--transparent)_12%,var(--gray-800)_16%)] | ||
[--aurora:repeating-linear-gradient(100deg,var(--purple-500)_10%,var(--purple-300)_15%,var(--purple-300)_20%,var(--purple-200)_25%,var(--purple-400)_30%)] | ||
`, | ||
}; | ||
|
||
return ( | ||
<main> | ||
<div | ||
className={cn( | ||
"relative flex flex-col h-[100vh] items-center justify-center bg-zinc-700 dark:bg-zinc-900 text-slate-950 transition-bg", | ||
className | ||
)} | ||
{...props} | ||
> | ||
<div className="absolute inset-0 overflow-hidden"> | ||
<div | ||
className={cn( | ||
` | ||
[background-image:var(--gradient),var(--aurora)] | ||
[background-size:300%,_200%] | ||
[background-position:50%_50%,50%_50%] | ||
filter blur-[10px] invert dark:invert-0 | ||
after:content-[""] after:absolute after:inset-0 after:[background-image:var(--gradient),var(--aurora)] | ||
after:[background-size:200%,_100%] | ||
after:animate-aurora after:[background-attachment:fixed] after:mix-blend-difference | ||
pointer-events-none | ||
absolute -inset-[10px] opacity-50 will-change-transform`, | ||
|
||
showRadialGradient && | ||
`[mask-image:radial-gradient(ellipse_at_100%_0%,black_10%,var(--transparent)_70%)]`, | ||
colorSchemes[colorVariant] | ||
)} | ||
></div> | ||
</div> | ||
{children} | ||
</div> | ||
</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
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,26 @@ | ||
"use client"; | ||
|
||
import { motion } from "framer-motion"; | ||
import React from "react"; | ||
import { AuroraBackground } from "@c/effects/aurora-background"; | ||
|
||
export default function BackgroundWrapper({ children }: { children: React.ReactNode; }) { | ||
return ( | ||
<AuroraBackground> | ||
<motion.div | ||
initial={{ opacity: 0.0, y: 40 }} | ||
whileInView={{ opacity: 1, y: 0 }} | ||
transition={{ | ||
delay: 0.3, | ||
duration: 0.8, | ||
ease: "easeInOut", | ||
}} | ||
className="relative flex flex-col gap-4 items-center justify-center px-4" | ||
> | ||
{children} | ||
|
||
</motion.div> | ||
</AuroraBackground> | ||
); | ||
} | ||
|
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,66 @@ | ||
import React from "react"; | ||
import { | ||
motion, | ||
AnimatePresence, | ||
} from "framer-motion"; | ||
import { cn } from "@core/index"; | ||
import Link from "next/link"; | ||
import { siteConfig } from "@/config/site"; | ||
import { ModeToggle } from "../mode-toggle"; | ||
import ShinyButton from "../ui/shiny-button"; | ||
|
||
export const FloatingNav = ({ | ||
navItems, | ||
className, | ||
}: { | ||
navItems: { | ||
name: string; | ||
link: string; | ||
icon?: JSX.Element; | ||
component?: JSX.Element; | ||
}[]; | ||
className?: string; | ||
}) => { | ||
const visible = true; | ||
|
||
return ( | ||
<AnimatePresence mode="wait"> | ||
<motion.div | ||
initial={{ | ||
opacity: 0, | ||
y: -100, | ||
scale: .3, | ||
}} | ||
animate={{ | ||
scale: 1, | ||
y: visible ? 0 : -50, | ||
opacity: visible ? 1 : 0, | ||
}} | ||
transition={{ | ||
duration: 0.6, | ||
ease: [0.16, 1, 0.3, 1], | ||
}} | ||
className={cn( | ||
"flex !opacity-75 max-w-fit fixed top-5 inset-x-0 mx-auto border border-transparent dark:border-white/[0.2] rounded-full dark:bg-black bg-white shadow-[0px_2px_3px_-1px_rgba(0,0,0,0.1),0px_1px_0px_0px_rgba(25,28,33,0.02),0px_0px_0px_1px_rgba(25,28,33,0.08)] z-[5000] pr-2 pl-8 py-2 items-center justify-center space-x-4", | ||
className | ||
)} | ||
> | ||
{navItems.map((navItem: any, idx: number) => ( | ||
<Link | ||
key={`link=${idx}`} | ||
href={navItem.link} | ||
className={cn( | ||
"relative dark:text-neutral-50 items-center flex space-x-1 text-neutral-600 dark:hover:text-neutral-300 hover:text-neutral-500" | ||
)} | ||
> | ||
<span className="block sm:hidden">{navItem.icon}</span> | ||
<span className="hidden sm:block text-sm">{navItem.name}</span> | ||
</Link> | ||
))} | ||
<ShinyButton link={siteConfig.links.github} external>Github</ShinyButton> | ||
<ModeToggle /> | ||
|
||
</motion.div> | ||
</AnimatePresence> | ||
); | ||
}; |
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,16 @@ | ||
"use client"; | ||
import React from "react"; | ||
import { FloatingNav } from "./NavLogic"; | ||
import { IconHome, IconMessage, IconUser } from "@tabler/icons-react"; | ||
export default function Navbar() { | ||
const navItems = [ | ||
{ | ||
name: "Home", | ||
link: "/", | ||
icon: <IconHome className="h-4 w-4 text-neutral-500 dark:text-white" />, | ||
}, | ||
]; | ||
return ( | ||
<FloatingNav navItems={navItems} /> | ||
); | ||
} |
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
Oops, something went wrong.