1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-10-05 13:06:10 +02:00

Compare commits

...

5 Commits

Author SHA1 Message Date
semantic-release-bot
5f3dfad988
chore(release): 3.2.5 [skip ci] 2024-05-16 08:09:25 +00:00
b231381cb3
fix: client-side age calculation, more glanular check for isMounted
Allows to render as much as possible on the server side.
While keeping the calculation of the age on the client side to avoid hydratation mismatch.
2024-05-16 10:06:43 +02:00
bbb2e56512
fix: usage of correct heading levels and html tags 2024-05-16 09:56:19 +02:00
66cf6d7438
fix: add scroll behavior: smooth 2024-05-16 09:32:20 +02:00
2a635bf3ba
fix: add hover effects 2024-05-16 09:26:05 +02:00
16 changed files with 107 additions and 100 deletions

View File

@ -57,10 +57,13 @@ const RootLayout = (props: RootLayoutProps): JSX.Element => {
return ( return (
<html <html
lang={i18n.locale} lang={i18n.locale}
className={classNames({ className={classNames(
{
dark: theme === "dark", dark: theme === "dark",
light: theme === "light", light: theme === "light",
})} },
"scroll-smooth",
)}
style={{ style={{
colorScheme: theme, colorScheme: theme,
}} }}

View File

@ -9,20 +9,16 @@ export const BlogPosts = async (): Promise<JSX.Element> => {
return ( return (
<div className="flex w-full items-center justify-center p-8"> <div className="flex w-full items-center justify-center p-8">
<div className="w-[1600px]" data-cy="blog-posts"> <ul className="w-[1600px]" data-cy="blog-posts">
{posts.map((post, index) => { {posts.map((post) => {
const postPublishedOn = date.format( const postPublishedOn = date.format(
new Date(post.frontmatter.publishedOn), new Date(post.frontmatter.publishedOn),
"DD/MM/YYYY", "DD/MM/YYYY",
) )
return ( return (
<Link <li key={post.slug}>
href={`/blog/${post.slug}`} <Link href={`/blog/${post.slug}`} locale="en" data-cy={post.slug}>
key={index} <ShadowContainer className="cursor-pointer p-6 transition-all duration-300 ease-in-out hover:scale-[1.02]">
locale="en"
data-cy={post.slug}
>
<ShadowContainer className="cursor-pointer p-6 transition duration-200 ease-in-out hover:-translate-y-2">
<h2 <h2
data-cy="blog-post-title" data-cy="blog-post-title"
className="text-xl font-semibold text-primary dark:text-primary-dark" className="text-xl font-semibold text-primary dark:text-primary-dark"
@ -37,9 +33,10 @@ export const BlogPosts = async (): Promise<JSX.Element> => {
</p> </p>
</ShadowContainer> </ShadowContainer>
</Link> </Link>
</li>
) )
})} })}
</div> </ul>
</div> </div>
) )
} }

View File

@ -14,8 +14,11 @@ export const Header = (): JSX.Element => {
return ( return (
<header className="sticky top-0 z-50 flex w-full justify-between border-b-2 border-gray-600 bg-white px-6 py-2 dark:border-gray-400 dark:bg-black"> <header className="sticky top-0 z-50 flex w-full justify-between border-b-2 border-gray-600 bg-white px-6 py-2 dark:border-gray-400 dark:bg-black">
<Link href="/"> <h1>
<h1 className="flex items-center justify-center"> <Link
href="/"
className="flex items-center justify-center transition-all duration-300 ease-in-out hover:scale-[1.03]"
>
<Image <Image
quality={100} quality={100}
className="size-16" className="size-16"
@ -26,8 +29,8 @@ export const Header = (): JSX.Element => {
<strong className="ml-1 hidden font-headline font-semibold text-primary dark:text-primary-dark sm:block sm:text-xl"> <strong className="ml-1 hidden font-headline font-semibold text-primary dark:text-primary-dark sm:block sm:text-xl">
Théo LUDWIG Théo LUDWIG
</strong> </strong>
</h1>
</Link> </Link>
</h1>
<div className="flex justify-between"> <div className="flex justify-between">
<div className="flex flex-col items-center justify-center px-6"> <div className="flex flex-col items-center justify-center px-6">
<Link <Link

View File

@ -20,14 +20,11 @@ export const InterestParagraph = (
const { title, description } = props const { title, description } = props
return ( return (
<> <div className="my-6 text-center text-gray dark:text-gray-dark">
<p className="my-6 text-center text-gray dark:text-gray-dark"> <h3 className="text-lg font-semibold text-primary dark:text-primary-dark">
<strong className="text-lg font-semibold text-primary dark:text-primary-dark">
{title} {title}
</strong> </h3>
<br /> <p className="my-2">{htmlParser(description)}</p>
<span>{htmlParser(description)}</span> </div>
</p>
</>
) )
} }

View File

@ -16,8 +16,8 @@ export const Interests = (): JSX.Element => {
return ( return (
<div className="max-w-full"> <div className="max-w-full">
{paragraphs.map((paragraph, index) => { {paragraphs.map((paragraph) => {
return <InterestParagraph key={index} {...paragraph} /> return <InterestParagraph key={paragraph.id} {...paragraph} />
})} })}
<InterestsList /> <InterestsList />
</div> </div>

View File

@ -11,16 +11,18 @@ export const Repository = (props: RepositoryProps): JSX.Element => {
const { name, description, href } = props const { name, description, href } = props
return ( return (
<ShadowContainer className="relative !mb-4 max-h-32 cursor-pointer p-6 transition-transform duration-200 ease-in-out hover:-translate-y-2"> <li>
<a href={href} target="_blank" rel="noopener noreferrer"> <a href={href} target="_blank" rel="noopener noreferrer">
<div className="flex"> <ShadowContainer className="relative !mb-4 max-h-32 cursor-pointer p-6 transition-all duration-300 ease-in-out hover:scale-[1.03]">
<h3 className="flex">
<GitHubIcon className="mr-2 h-6" /> <GitHubIcon className="mr-2 h-6" />
<span className="font-semibold text-primary dark:text-primary-dark"> <span className="font-semibold text-primary dark:text-primary-dark">
{name} {name}
</span> </span>
</div> </h3>
<p className="my-4">{description}</p> <p className="my-4">{description}</p>
</a>
</ShadowContainer> </ShadowContainer>
</a>
</li>
) )
} }

View File

@ -10,7 +10,7 @@ export const OpenSource = (): JSX.Element => {
<p className="text-center"> <p className="text-center">
{i18n.translate("home.open-source.description")} {i18n.translate("home.open-source.description")}
</p> </p>
<div className="my-6 grid grid-cols-1 gap-6 md:w-10/12 md:grid-cols-2"> <ul className="my-6 grid grid-cols-1 gap-6 md:w-10/12 md:grid-cols-2">
<Repository <Repository
name="nodejs/node" name="nodejs/node"
description="Node.js JavaScript runtime ✨🐢🚀✨" description="Node.js JavaScript runtime ✨🐢🚀✨"
@ -31,7 +31,7 @@ export const OpenSource = (): JSX.Element => {
description="The React Framework" description="The React Framework"
href="https://github.com/vercel/next.js/commits?author=theoludwig" href="https://github.com/vercel/next.js/commits?author=theoludwig"
/> />
</div> </ul>
</div> </div>
) )
} }

View File

@ -13,7 +13,7 @@ export const PortfolioItem = (props: PortfolioItemProps): JSX.Element => {
const { title, description, link, image } = props const { title, description, link, image } = props
return ( return (
<ShadowContainer className="relative cursor-pointer items-center sm:ml-10"> <li>
<a <a
className="group inline-flex justify-center" className="group inline-flex justify-center"
target="_blank" target="_blank"
@ -21,6 +21,7 @@ export const PortfolioItem = (props: PortfolioItemProps): JSX.Element => {
href={link} href={link}
aria-label={title} aria-label={title}
> >
<ShadowContainer className="relative cursor-pointer items-center sm:ml-10">
<div className="flex justify-center"> <div className="flex justify-center">
<Image <Image
quality={100} quality={100}
@ -37,7 +38,8 @@ export const PortfolioItem = (props: PortfolioItemProps): JSX.Element => {
</h3> </h3>
<p className="mx-4 my-6 font-semibold">{description}</p> <p className="mx-4 my-6 font-semibold">{description}</p>
</div> </div>
</a>
</ShadowContainer> </ShadowContainer>
</a>
</li>
) )
} }

View File

@ -12,10 +12,10 @@ export const Portfolio = (): JSX.Element => {
} }
return ( return (
<div className="flex w-full flex-wrap justify-center px-3"> <ul className="flex w-full flex-wrap justify-center px-3">
{items.map((item, index) => { {items.map((item) => {
return <PortfolioItem key={index} {...item} /> return <PortfolioItem key={item.title} {...item} />
})} })}
</div> </ul>
) )
} }

View File

@ -30,14 +30,17 @@ export const ProfileList = (props: ProfileListProps): JSX.Element => {
title={i18n.translate("home.about.pronouns")} title={i18n.translate("home.about.pronouns")}
value={i18n.translate("home.about.pronouns-value")} value={i18n.translate("home.about.pronouns-value")}
/> />
{isMounted ? (
<ProfileItem <ProfileItem
title={i18n.translate("home.about.birth-date")} title={i18n.translate("home.about.birth-date")}
value={`${BIRTH_DATE_STRING} (${age} ${i18n.translate( value={
isMounted
? `${BIRTH_DATE_STRING} (${age} ${i18n.translate(
"home.about.years-old", "home.about.years-old",
)})`} )})`
: BIRTH_DATE_STRING
}
/> />
) : null}
<ProfileItem <ProfileItem
title={i18n.translate("home.about.nationality")} title={i18n.translate("home.about.nationality")}
value="Alsace, France" value="Alsace, France"

View File

@ -13,7 +13,7 @@ export const SocialMediaItem = (props: SocialMediaItemProps): JSX.Element => {
aria-label={ariaLabel} aria-label={ariaLabel}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
className="relative inline-block bg-transparent" className="relative inline-block bg-transparent transition-all duration-300 ease-in-out hover:scale-110"
> >
{children} {children}
</a> </a>

View File

@ -27,13 +27,13 @@ export const SkillComponent = (props: SkillComponentProps): JSX.Element => {
} }
return ( return (
<li>
<a <a
href={skillProperties.link} href={skillProperties.link}
className="mx-2 max-w-xl text-primary hover:underline dark:text-primary-dark" className="mx-2 flex max-w-xl flex-col items-center justify-center text-center text-primary hover:underline dark:text-primary-dark"
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
> >
<div className="text-center">
<Image <Image
className="inline size-16" className="inline size-16"
quality={100} quality={100}
@ -43,7 +43,7 @@ export const SkillComponent = (props: SkillComponentProps): JSX.Element => {
src={getImage()} src={getImage()}
/> />
<p className="mt-1 font-semibold">{skill}</p> <p className="mt-1 font-semibold">{skill}</p>
</div>
</a> </a>
</li>
) )
} }

View File

@ -18,7 +18,7 @@ export const SkillsSection = (props: SkillsSectionProps): JSX.Element => {
{title} {title}
</h3> </h3>
</div> </div>
<div className="flex flex-wrap justify-around">{children}</div> <ul className="flex flex-wrap justify-around">{children}</ul>
</div> </div>
</div> </div>
</div> </div>

View File

@ -57,8 +57,8 @@ export const Section = (props: SectionProps): JSX.Element => {
</p> </p>
) : null} ) : null}
<div className="w-full px-3"> <div className="w-full px-3">
<ShadowContainer> <ShadowContainer className="w-full px-2 py-4 leading-8 sm:px-16">
<div className="w-full px-16 py-4 leading-8">{children}</div> {children}
</ShadowContainer> </ShadowContainer>
</div> </div>
</section> </section>

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "theoludwig", "name": "theoludwig",
"version": "3.2.4", "version": "3.2.5",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "theoludwig", "name": "theoludwig",
"version": "3.2.4", "version": "3.2.5",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@fontsource/montserrat": "5.0.17", "@fontsource/montserrat": "5.0.17",

View File

@ -1,6 +1,6 @@
{ {
"name": "theoludwig", "name": "theoludwig",
"version": "3.2.4", "version": "3.2.5",
"private": true, "private": true,
"repository": { "repository": {
"type": "git", "type": "git",