-
-
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 #282 from nyomansunima/content-update
update animation and structure
- Loading branch information
Showing
24 changed files
with
607 additions
and
186 deletions.
There are no files selected for viewing
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
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,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> | ||
) | ||
} |
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 * 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> | ||
) | ||
} |
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
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
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 @@ | ||
export * from './support-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
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" | ||
} | ||
] | ||
} |
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,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> | ||
) | ||
} |
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,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> | ||
) | ||
} |
Oops, something went wrong.