Skip to content

Commit

Permalink
Merge pull request #282 from nyomansunima/content-update
Browse files Browse the repository at this point in the history
update animation and structure
  • Loading branch information
nyomansunima authored Dec 6, 2024
2 parents 25b8097 + 9ed79eb commit c1ca26c
Show file tree
Hide file tree
Showing 24 changed files with 607 additions and 186 deletions.
212 changes: 107 additions & 105 deletions CHANGELOG.md

Large diffs are not rendered by default.

Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"lenis": "^1.1.6",
"motion": "^11.13.1",
"next": "15.0.3",
"next-mdx-remote-client": "^1.0.3",
"next-themes": "^0.4.3",
"posthog-js": "^1.194.0",
"react": "19.0.0-rc.1",
Expand Down
4 changes: 4 additions & 0 deletions src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,9 @@ export default function sitemap(): MetadataRoute.Sitemap {
url: `${BASE_URL}/works`,
lastModified: new Date().toISOString(),
},
{
url: `${BASE_URL}/support`,
lastModified: new Date().toISOString(),
},
]
}
27 changes: 27 additions & 0 deletions src/app/support/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as React from 'react'
import { Metadata } from 'next'
import * as defaultMetadata from '@shared/libs/shared-metadata'
import { SupportSection } from '@features/support'

export const metadata: Metadata = {
title: 'Support Me (Donate)',
description: 'Support me by donating for projects and contents or goodies',
openGraph: {
...defaultMetadata.openGraph,
title: 'Support me (Donate)',
description: 'Support me by donating for projects and contents or goodies',
},
twitter: {
...defaultMetadata.twitter,
title: 'Support me (Donate)',
description: 'Support me by donating for projects and contents or goodies',
},
}

export default function SupportPage(): React.ReactElement {
return (
<div className="flex flex-col">
<SupportSection />
</div>
)
}
57 changes: 57 additions & 0 deletions src/app/works/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import * as React from 'react'
import { Metadata, ResolvingMetadata } from 'next'
import * as defaultMetadata from '@shared/libs/shared-metadata'
import { WorkDetailContent, workService } from '@features/works'

interface Params {
slug: string
}

interface WorkDetailPageProps {
params: Promise<Params>
}

export async function generateMetadata(
{ params }: WorkDetailPageProps,
parent: ResolvingMetadata,
): Promise<Metadata> {
const { slug } = await params
const meta = await workService.getWorkMetadata(slug)
const previousOgImages = (await parent).openGraph?.images || []
const previousTwitterImages = (await parent).twitter?.images || []

return {
title: meta.title,
description: meta.description,
openGraph: {
...defaultMetadata.openGraph,
title: meta.title,
description: meta.description,
images: [meta.image, ...previousOgImages],
},
twitter: {
...defaultMetadata.twitter,
title: meta.title,
description: meta.description,
images: [meta.image, ...previousTwitterImages],
},
}
}

export async function generateStaticParams(): Promise<Params[]> {
const workPaths = await workService.getWorkPaths()

return workPaths.map((slug) => ({ slug }))
}

export default async function WorkDetailPage({
params,
}: WorkDetailPageProps): Promise<React.ReactElement> {
const { slug } = await params

return (
<div className="flex flex-col gap-20 tablet:gap-36">
<WorkDetailContent slug={slug} />
</div>
)
}
18 changes: 15 additions & 3 deletions src/features/crafts/craft-item.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use client'

import * as React from 'react'
import Image from 'next/image'
import Link from 'next/link'
import { motion } from 'motion/react'

const MotionLink = motion.create(Link)

export interface CraftData {
title: string
Expand All @@ -18,10 +23,17 @@ export function CraftItem({ craft }: CraftItemProps): React.ReactElement {
const { title, description, publisher, image, link } = craft

return (
<Link
<MotionLink
initial={{ y: 200, opacity: 0 }}
whileInView={{ y: 0, opacity: 1 }}
whileHover={{ y: -4 }}
transition={{ type: 'spring', duration: '1.2', delay: 0.1 }}
viewport={{
once: true,
}}
href={link}
target="_blank"
className="flex flex-col p-3 rounded-2xl border border-border bg-surface relative group transition-all duration-300 hover:-translate-y-1"
className="flex flex-col p-3 rounded-2xl border border-border bg-surface relative group"
>
<div className="flex gap-3">
<div className="block">
Expand All @@ -45,6 +57,6 @@ export function CraftItem({ craft }: CraftItemProps): React.ReactElement {
<div className="hidden w-7 h-7 rounded-lg bg-secondary/30 border border-border group-hover:flex justify-center items-center absolute top-3 right-3">
<i className="fi fi-rr-arrow-small-right -rotate-45" />
</div>
</Link>
</MotionLink>
)
}
13 changes: 10 additions & 3 deletions src/features/crafts/crafts-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,30 @@
{
"title": "Weebo",
"description": "Unlimited web design for startups, agency, and enterprises",
"publisher": "tryweebo.one",
"publisher": "Business",
"image": "https://cdn.hashnode.com/res/hashnode/image/upload/v1729704496490/7d3949ae-e901-4714-8df9-b4e0355d6d90.png",
"link": "https://tryweebo.one?ref=nyomansunima"
},
{
"title": "Moono",
"description": "Apps collections for my works, contain simple and useful apps",
"publisher": "moono.space",
"publisher": "Business",
"image": "https://cdn.hashnode.com/res/hashnode/image/upload/v1729706783589/06a931f0-e37b-4672-a97d-4e7d99eecf1f.png",
"link": "https://moono.space?ref=nyomansunima"
},
{
"title": "Weecraft",
"description": "Tiny resources for developer that create tools, ui, and goodies",
"publisher": "weecraft.club",
"publisher": "Projects",
"image": "https://cdn.hashnode.com/res/hashnode/image/upload/v1729706888234/066b8470-3aab-4e11-9d38-82284e607f1a.png",
"link": "https://weecraft.club?ref=nyomansunima"
},
{
"title": "Brook Code Theme",
"description": "Simple, clean and elegant code editor theme that support zed, vscode, and jetbrains",
"publisher": "Projects",
"image": "https://cdn.hashnode.com/res/hashnode/image/upload/v1733478371769/4ec2ddcb-440c-4cbe-b8a1-3e8d457ad8f5.png",
"link": "https://brookcodetheme.vercel.app?ref=nyomansunima"
}
]
}
57 changes: 36 additions & 21 deletions src/features/home/hero-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,47 @@ import { motion } from 'motion/react'

function OpenWorkBadge(): React.ReactElement {
return (
<div className="mb-10">
<TooltipProvider>
<Tooltip>
<TooltipTrigger>
<Link
href={'/contact'}
className="flex justify-center items-center px-3 h-9 rounded-full bg-fuchsia-100 dark:bg-fuchsia-400/10 border border-fuchsia-200 dark:border-fuchsia-200/20 text-fuchsia-800 dark:text-fuchsia-400 text-xs gap-2 font-medium transition-all duration-300 hover:scale-95 cursor-pointer"
>
Open to work
</Link>
</TooltipTrigger>
<TooltipContent>Looking for solid works & teams</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
<TooltipProvider>
<Tooltip>
<TooltipTrigger className="">
<Link
href={'/contact'}
className="flex justify-center items-center px-3 h-9 rounded-xl bg-fuchsia-100 dark:bg-fuchsia-400/10 border border-fuchsia-200 dark:border-fuchsia-200/20 text-fuchsia-800 dark:text-fuchsia-400 text-xs gap-2 font-medium transition-all duration-300 hover:scale-95 cursor-pointer"
>
<i className="fi fi-rr-coffee-heart" />
Open to work
</Link>
</TooltipTrigger>
<TooltipContent>Looking for solid works & teams</TooltipContent>
</Tooltip>
</TooltipProvider>
)
}

function NewBadge(): React.ReactElement {
return (
<Link
href={'/crafts'}
className="flex gap-5 justify-between h-9 px-4 items-center rounded-xl bg-orange-100 text-orange-700 text-xs font-medium border border-orange-200
dark:bg-orange-400/10 dark:text-orange-400 dark:border-orange-200/20 transition-all duration-300 hover:scale-95"
>
<span>New craft: Brook code theme</span>
<i className="fi fi-rr-broken-chain-link-wrong" />
</Link>
)
}

export function HeroSection(): React.ReactElement {
return (
<section className="flex flex-col">
<OpenWorkBadge />
<div className="flex items-center gap-3 flex-wrap">
<OpenWorkBadge />
<NewBadge />
</div>

<div className="flex flex-col text-2xl tablet:text-3xl laptop:text-3xl !leading-normal font-medium gap-6 laptop:gap-12">
<div className="flex flex-col text-2xl tablet:text-3xl laptop:text-3xl !leading-normal font-medium gap-6 laptop:gap-12 mt-12">
<motion.h2
initial={{ opacity: 0.1 }}
initial={{ opacity: 0 }}
whileInView={{ y: 0, opacity: 1 }}
transition={{ type: 'spring', duration: '1.2', delay: 0.1 }}
viewport={{
Expand All @@ -60,7 +75,7 @@ export function HeroSection(): React.ReactElement {
loves to craft solutions for global audiences.
</motion.h2>
<motion.h2
initial={{ opacity: 0.1 }}
initial={{ opacity: 0 }}
whileInView={{ y: 0, opacity: 1 }}
transition={{ type: 'spring', duration: '1.2', delay: 0.1 }}
viewport={{
Expand All @@ -72,7 +87,7 @@ export function HeroSection(): React.ReactElement {
help people solve their problems.
</motion.h2>
<motion.h2
initial={{ opacity: 0.1 }}
initial={{ opacity: 0 }}
whileInView={{ y: 0, opacity: 1 }}
transition={{ type: 'spring', duration: '1.2', delay: 0.1 }}
viewport={{
Expand All @@ -84,7 +99,7 @@ export function HeroSection(): React.ReactElement {
development, product shipping, and business.
</motion.h2>
<motion.h2
initial={{ opacity: 0.1 }}
initial={{ opacity: 0 }}
whileInView={{ y: 0, opacity: 1 }}
transition={{ type: 'spring', duration: '1.2', delay: 0.1 }}
viewport={{
Expand Down
2 changes: 1 addition & 1 deletion src/features/journeys/journeys-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
{
"title": "Launching brook code theme",
"description": "Create simple and elegant code editor theme that support vscode, zed and others, comes with simplicity for developers.",
"image": "https://cdn.hashnode.com/res/hashnode/image/upload/v1732697877111/1d2058fb-5e79-4161-8eb4-d8499c417862.png",
"image": "https://cdn.hashnode.com/res/hashnode/image/upload/v1733491606862/875c0d92-370d-4dd2-84e4-dbe2f6a89d1b.png",
"date": "Nov 2024",
"category": "Work",
"url": "https://brookcodetheme.vercel.app"
Expand Down
5 changes: 5 additions & 0 deletions src/features/resources/resources-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
"title": "Hoppscotch",
"description": "Hoppscotch is a free, fast and beautiful API request builder.",
"url": "https://hoppscotch.com?ref=nyomansunima"
},
{
"title": "Vite",
"description": "Vite is a build tool for modern web projects.",
"url": "https://vite.dev?ref=nyomansunima"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/features/stories/recent-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as React from 'react'
import Link from 'next/link'
import { motion } from 'motion/react'

const MotionLink = motion(Link)
const MotionLink = motion.create(Link)

export interface RecentData {
title: string
Expand Down
1 change: 1 addition & 0 deletions src/features/support/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './support-section'
18 changes: 18 additions & 0 deletions src/features/support/support-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"supports": [
{
"icon": "fi fi-rr-square-code",
"title": "Donate coding projects",
"description": "Help me to create better open source projects.",
"url": "https://github.com/sponsors/nyomansunima?ref=nyomansunima",
"publisher": "Github Sponsors"
},
{
"icon": "fi fi-rr-coffee-heart",
"title": "Donate produce content",
"description": "Support me to produce more great content for free.",
"url": "https://ko-fi.com/nyomansunima?ref=nyomansunima",
"publisher": "Ko-fi"
}
]
}
45 changes: 45 additions & 0 deletions src/features/support/support-item.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import Link from 'next/link'
import * as React from 'react'

export interface SupportData {
icon: string
title: string
description: string
url: string
publisher: string
}

interface SupportItemProps {
data: SupportData
}

export function SupportItem({ data }: SupportItemProps): React.ReactElement {
const { icon, title, description, url, publisher } = data

return (
<Link
href={url}
target="_blank"
className="flex flex-col gap-3 bg-surface p-3 border border-border rounded-2xl transition-all duration-300 hover:-translate-y-1 cursor-pointer relative group"
>
<div className="flex items-center gap-2">
<i className={`${icon} h-9 w-9 rounded-lg bg-secondary`} />
<div className="flex flex-col flex-grow gap-1">
<h3 className="text-sm font-medium text-wrap">{title}</h3>

<span className="text-xs text-foreground/60 !leading-tight font-medium">
{publisher}
</span>
</div>
</div>

<p className="text-sm text-foreground/60 !leading-relaxed">
{description}
</p>

<div className="hidden w-7 h-7 rounded-lg bg-secondary/30 border border-border group-hover:flex justify-center items-center absolute top-3 right-3">
<i className="fi fi-rr-arrow-small-right -rotate-45" />
</div>
</Link>
)
}
27 changes: 27 additions & 0 deletions src/features/support/support-section.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import * as React from 'react'
import { SupportData, SupportItem } from './support-item'
import data from './support-data.json'

const supports = data.supports as SupportData[]

export function SupportSection(): React.ReactElement {
return (
<section className="flex">
<div className="flex flex-col">
<h3 className="text-lg font-medium !leading-tight flex-grow tablet:flex-grow-0">
Support me to produce more
<br />
good things.
</h3>

<div className="flex mt-16">
<div className="grid grid-cols-1 tablet:grid-cols-2 gap-3">
{supports.map((support, index) => (
<SupportItem data={support} key={index} />
))}
</div>
</div>
</div>
</section>
)
}
Loading

0 comments on commit c1ca26c

Please sign in to comment.