-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
06a0210
commit 9dfa62d
Showing
31 changed files
with
548 additions
and
100 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,3 +1,4 @@ | ||
import './src/styles/code-highlight.css'; | ||
import './src/styles/animation.css'; | ||
import '@/styles/code-highlight.css'; | ||
import '@/styles/globals.css'; | ||
import 'material-symbols/rounded.css'; |
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,42 @@ | ||
import { Actions } from 'gatsby'; | ||
|
||
const perPage = 8; | ||
|
||
export const generatePaginatedPage = ( | ||
totalItems: number, | ||
basePath: string, | ||
component: string, | ||
title: string, | ||
createPage: Actions['createPage'], | ||
) => { | ||
const totalPages = Math.ceil(totalItems / perPage); | ||
Array.from({ length: totalPages }).forEach((_, i) => { | ||
createPage({ | ||
path: i === 0 ? `/${basePath}` : `/${basePath}/p/${i + 1}`, | ||
component, | ||
context: { | ||
title, | ||
type: basePath, | ||
limit: perPage, | ||
skip: i * perPage, | ||
maxPages: totalPages, | ||
currentPage: i + 1, | ||
}, | ||
}); | ||
}); | ||
}; | ||
|
||
export const generateMetadataPages = ( | ||
items: Set<string>, | ||
pathPrefix: string, | ||
template: string, | ||
createPage: Actions['createPage'], | ||
) => { | ||
items.forEach(item => { | ||
createPage({ | ||
path: `/${pathPrefix}/${item}`.toLowerCase(), | ||
component: template, | ||
context: { [pathPrefix]: item }, | ||
}); | ||
}); | ||
}; |
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
2 changes: 2 additions & 0 deletions
2
src/components/about/footer/styles.css.ts → src/components/about/Footer/styles.css.ts
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,10 +1,12 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
import { theme } from '@/styles/theme.css'; | ||
import { rem } from '@/utils/pxto'; | ||
|
||
export const root = style({}); | ||
|
||
export const date = style({ | ||
...theme.typographies.profile_sub, | ||
marginTop: rem(30), | ||
color: theme.colors.gray.mid, | ||
}); |
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 { clsx } from 'clsx'; | ||
import { Link } from 'gatsby'; | ||
import React from 'react'; | ||
|
||
import { theme } from '@/styles/theme.css'; | ||
|
||
import * as styles from './styles.css'; | ||
|
||
type PaginationProps = { | ||
currentPage: number; | ||
maxPages: number; | ||
prefix: string; | ||
}; | ||
|
||
const Pagination = ({ currentPage, maxPages, prefix }: PaginationProps) => { | ||
return ( | ||
<nav className={styles.root}> | ||
<ul className={styles.container}> | ||
{currentPage > 1 && ( | ||
<li key="pagination-left"> | ||
<Link | ||
className={clsx(styles.item, 'material-symbols-rounded')} | ||
to={`/${prefix}/${currentPage - 1 === 1 ? '' : `p/${currentPage - 1}`}`} | ||
aria-label="Previous page" | ||
> | ||
chevron_left | ||
</Link> | ||
</li> | ||
)} | ||
|
||
{Array.from({ length: maxPages }, (_, i) => ( | ||
<li | ||
key={`pagination-number-${i + 1}`} | ||
className={clsx(styles.item, i + 1 === currentPage && styles.active)} | ||
style={{ fontFamily: theme.fonts.mono }} | ||
> | ||
<Link to={`/${prefix}/${i === 0 ? '' : `p/${i + 1}`}`}>{i + 1}</Link> | ||
</li> | ||
))} | ||
|
||
{currentPage < maxPages && ( | ||
<li key="pagination-right"> | ||
<Link | ||
className={clsx(styles.item, 'material-symbols-rounded')} | ||
to={`/${prefix}/p/${currentPage + 1}`} | ||
aria-label="Next page" | ||
> | ||
chevron_right | ||
</Link> | ||
</li> | ||
)} | ||
</ul> | ||
</nav> | ||
); | ||
}; | ||
|
||
export default Pagination; |
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,43 @@ | ||
import { globalStyle, style } from '@vanilla-extract/css'; | ||
|
||
import { theme } from '@/styles/theme.css'; | ||
import { rem } from '@/utils/pxto'; | ||
|
||
export const root = style({ | ||
...theme.layouts.center, | ||
width: '100%', | ||
paddingBlock: rem(65), | ||
}); | ||
|
||
export const container = style({ | ||
...theme.layouts.centerY, | ||
padding: 0, | ||
margin: 0, | ||
listStyle: 'none', | ||
userSelect: 'none', | ||
}); | ||
|
||
export const item = style({ | ||
...theme.layouts.center, | ||
width: rem(28), | ||
height: rem(28), | ||
color: theme.colors.gray.mid, | ||
fontWeight: 400, | ||
cursor: 'pointer', | ||
borderRadius: rem(4), | ||
backgroundColor: 'transparent', | ||
transition: 'color 0.3s, background-color 0.3s', | ||
|
||
':hover': { color: theme.colors.gray.accent, backgroundColor: theme.colors.gray.hover }, | ||
':active': { color: theme.colors.gray.accent, backgroundColor: theme.colors.border }, | ||
}); | ||
|
||
export const active = style({ | ||
color: theme.colors.gray.accent, | ||
backgroundColor: theme.colors.border, | ||
}); | ||
|
||
globalStyle(`${item} > a`, { | ||
width: '100%', | ||
textAlign: 'center', | ||
}); |
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
Oops, something went wrong.