Skip to content
Merged
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 src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export default async function HomePage() {
<Main>
<Section title={{ text: "Hi I'm Christian" }}>
<TextEffect>
Full stack web developer from Utah focusing on modern technologies.
Full stack web developer from Utah focusing on modern technologies and
emerging trends.
</TextEffect>
</Section>
<Section title={{ text: "Projects", level: 3 }}>
Expand Down
104 changes: 74 additions & 30 deletions src/components/layout/navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import { cn } from "@/lib/utils";
export function Navigation() {
const pathname = usePathname();
const [isOpen, setIsOpen] = useState(false);
const { icon, background, ul, li } = NAVIGATION_VARIANTS;
const [currentTime, setCurrentTime] = useState("");
const [emoji, setEmoji] = useState("😴");
const { icon, background, ul, li, footer } = NAVIGATION_VARIANTS;

useEffect(() => setIsOpen(false), [pathname]);

Expand All @@ -23,6 +25,36 @@ export function Navigation() {
};
}, [isOpen]);

useEffect(() => {
const getCurrentTime = () => {
const now = new Date();
const hour = Number(
new Intl.DateTimeFormat("en-US", {
timeZone: "America/Denver",
hour: "numeric",
hour12: false,
}).format(now)
);
const timeLabel = new Intl.DateTimeFormat("en-US", {
timeZone: "America/Denver",
hour: "numeric",
minute: "2-digit",
}).format(now);

let emoji = "😴";
if (hour >= 5 && hour < 12) emoji = "🌅";
else if (hour >= 12 && hour < 18) emoji = "🌤️";
else if (hour >= 18 && hour < 22) emoji = "🌙";

setCurrentTime(timeLabel);
setEmoji(emoji);
};

getCurrentTime();
const interval = setInterval(getCurrentTime, 60_000);
return () => clearInterval(interval);
}, []);

return (
<motion.nav className="relative" aria-label="Main navigation">
<motion.button
Expand Down Expand Up @@ -58,41 +90,53 @@ export function Navigation() {
<AnimatePresence initial={false}>
{isOpen && (
<motion.div
className="bg-card fixed inset-0 z-40 flex h-screen w-full flex-col justify-center"
className="bg-card fixed inset-0 z-40 flex h-screen w-full flex-col"
variants={background}
initial="closed"
animate="open"
exit="closed"
>
<motion.ul
className="flex flex-col items-center justify-center gap-6"
variants={ul}
initial="closed"
animate="open"
exit="closed"
>
{NAV_LINKS.map(({ label, link }) => (
<motion.li
key={label}
className="flex flex-row items-center justify-center p-2"
variants={li}
>
<Link
className={cn(
"text-2xl transition ease-in-out",
pathname === link
? "text-foreground hover:text-muted-foreground font-medium"
: "text-muted-foreground hover:text-foreground font-light"
)}
href={link}
onClick={() => pathname === link && setIsOpen(false)}
aria-label={label}
<div className="flex flex-1 flex-col items-center justify-center">
<motion.ul
className="flex flex-col items-center justify-center gap-6"
variants={ul}
initial="closed"
animate="open"
exit="closed"
>
{NAV_LINKS.map(({ label, link }) => (
<motion.li
key={label}
className="flex flex-row items-center justify-center p-2"
variants={li}
>
{label}
</Link>
</motion.li>
))}
</motion.ul>
<Link
className={cn(
"text-2xl transition ease-in-out",
pathname === link
? "text-foreground hover:text-muted-foreground font-medium"
: "text-muted-foreground hover:text-foreground font-light"
)}
href={link}
onClick={() => pathname === link && setIsOpen(false)}
aria-label={label}
>
{label}
</Link>
</motion.li>
))}
</motion.ul>
</div>
<motion.div
className="text-muted-foreground flex w-full items-center justify-center pb-10 text-sm"
variants={footer}
custom={NAV_LINKS.length}
>
<span className="mr-2" aria-hidden="true">
{emoji}
</span>
<span>Utah time: {currentTime}</span>
</motion.div>
</motion.div>
)}
</AnimatePresence>
Expand Down
19 changes: 10 additions & 9 deletions src/lib/config/home.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ export const PROJECTS: Projects[] = [
{
name: "Cli Loaders",
alt: "An image of Christian B. Martinez' Cli Loaders project.",
description: "A collection of cli loaders for the terminal, react, and beyond.",
description:
"A collection of cli loaders for the terminal, react, and beyond.",
link: "https://cliloaders.com/",
src: "/cliloaders.jpg",
id: "project-1",
Expand All @@ -37,19 +38,19 @@ export type WorkExperience = {

export const WORK: WorkExperience[] = [
{
company: "Pointbreak",
title: "Technical Co-Founder",
start: "2025",
company: "Freelance",
title: "Full Stack Developer",
start: "2020",
end: "Present",
link: "https://pointbreakapp.com",
link: "/",
id: "work-1",
},
{
company: "Freelance",
company: "Pointbreak",
title: "Full Stack Developer",
start: "2020",
end: "2024",
link: "/",
start: "2025",
end: "2026",
link: "https://pointbreakapp.com",
id: "work-2",
},
{
Expand Down
18 changes: 18 additions & 0 deletions src/lib/config/motion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type NavigationVariants = {
background: Variants;
ul: Variants;
li: Variants;
footer: Variants;
};

export const NAVIGATION_VARIANTS: NavigationVariants = {
Expand Down Expand Up @@ -72,6 +73,23 @@ export const NAVIGATION_VARIANTS: NavigationVariants = {
},
},
},
footer: {
open: (custom = 0) => ({
y: 0,
opacity: 1,
transition: {
...BASE_TRANSITION,
delay: 0.06 + 0.08 * custom,
},
}),
closed: {
y: -24,
opacity: 0,
transition: {
...BASE_TRANSITION,
},
},
},
};

export const CONTAINER_VARIANTS: Variants = {
Expand Down