1
0
mirror of https://github.com/XFox111/my-website.git synced 2026-04-22 07:28:01 +03:00

chore: replace priority attribute with loading="eager" for images

This commit is contained in:
2025-07-22 14:47:49 +00:00
parent 1b95c8546e
commit d0bd5db044
7 changed files with 15 additions and 11 deletions
+2 -2
View File
@@ -23,8 +23,8 @@ const FrontSection: React.FC = () => (
</div> </div>
<div className={ cls.illustrations }> <div className={ cls.illustrations }>
<Image className={ cls.main } src={ profilePicture.src } alt={ profilePicture.alt } priority /> <Image className={ cls.main } src={ profilePicture.src } alt={ profilePicture.alt } loading="eager" />
<Image className={ cls.secondary } src={ homeDecor.src } alt={ homeDecor.alt } /> <Image className={ cls.secondary } src={ homeDecor.src } alt={ homeDecor.alt } loading="eager" />
</div> </div>
</section> </section>
); );
+1 -1
View File
@@ -9,7 +9,7 @@ const TitleLogo: React.FC = () => (
<Image src={ logo } <Image src={ logo }
alt="A fox jumping down, and a diagonal stripe in the background, forming letters X and F" alt="A fox jumping down, and a diagonal stripe in the background, forming letters X and F"
aria-hidden aria-hidden
priority /> loading="eager" />
<p> <p>
<span>xfox111</span> <span>xfox111</span>
<sub>.net</sub> <sub>.net</sub>
+7 -3
View File
@@ -51,10 +51,14 @@ const ProjectsSection: React.FC = () =>
<div className={ cls.descriptions } aria-live="polite" aria-atomic> <div className={ cls.descriptions } aria-live="polite" aria-atomic>
{ projects.map((project, index) => { projects.map((project, index) =>
<div key={ index } className={ cls.projectItem } hidden={ selection !== index }> <div key={ index } className={ cls.projectItem } hidden={ selection !== index }>
<Image src={ project.image } alt={ project.title } data-theme={ project.imageDark ? "light" : "both" } /> <Image
src={ project.image } alt={ project.title }
data-theme={ project.imageDark ? "light" : "both" }
loading="eager" />
{/* This is a workaround since not all images can be theme-adaptive */ } {/* This is a workaround since not all images can be theme-adaptive */ }
{ project.imageDark && { project.imageDark &&
<Image src={ project.imageDark } alt="" data-theme="dark" /> <Image src={ project.imageDark } alt="" data-theme="dark" loading="eager" />
} }
<h3>{ project.title }</h3> <h3>{ project.title }</h3>
@@ -80,7 +84,7 @@ const ProjectsSection: React.FC = () =>
</div> </div>
) } ) }
<Image className={ cls.defaultImg } hidden={ selection !== undefined } <Image className={ cls.defaultImg } hidden={ selection !== undefined }
src={ projectsImg.src } alt={ projectsImg.alt } /> src={ projectsImg.src } alt={ projectsImg.alt } loading="eager" />
</div> </div>
</section> </section>
); );
+1 -1
View File
@@ -26,7 +26,7 @@ const SkillsSection: React.FC = () =>
{ skills.map((i, index) => { skills.map((i, index) =>
<Image key={ index } <Image key={ index }
src={ i.image.src } alt={ i.image.alt } src={ i.image.src } alt={ i.image.alt }
hidden={ selection !== index } /> hidden={ selection !== index } loading="eager" />
) } ) }
{ selection === 4 && { selection === 4 &&
+2 -2
View File
@@ -5,8 +5,8 @@ import cls from "./loading.module.scss";
const LoadingPage: React.FC = () => ( const LoadingPage: React.FC = () => (
<div className={ cls.root } role="alert" aria-label="Loading page"> <div className={ cls.root } role="alert" aria-label="Loading page">
<Image className={ cls.dark } src={ spinnerDark.src } alt={ spinnerDark.alt } priority unoptimized /> <Image className={ cls.dark } src={ spinnerDark.src } alt={ spinnerDark.alt } loading="eager" unoptimized />
<Image className={ cls.light } src={ spinnerLight.src } alt={ spinnerLight.alt } priority unoptimized /> <Image className={ cls.light } src={ spinnerLight.src } alt={ spinnerLight.alt } loading="eager" unoptimized />
</div> </div>
); );
+1 -1
View File
@@ -24,7 +24,7 @@ const NotFoundPage: React.FC = () => (
<main className={ `${cls.page} not-found` }> <main className={ `${cls.page} not-found` }>
<div className={ cls.illustration }> <div className={ cls.illustration }>
<h1>404...</h1> <h1>404...</h1>
<Image src={ notFoundImage.src } alt={ notFoundImage.alt } priority /> <Image src={ notFoundImage.src } alt={ notFoundImage.alt } loading="eager" />
</div> </div>
<div className={ cls.content }> <div className={ cls.content }>
<div className={ cls.caption }> <div className={ cls.caption }>
+1 -1
View File
@@ -25,7 +25,7 @@ const ResumePage: React.FC = () => (
<Button className={ cls.button } <Button className={ cls.button }
href={ `/resume/download?type=${i.key}` } download href={ `/resume/download?type=${i.key}` } download
icon={ icon={
<Image className={ cls.image } src={ i.image.src } priority draggable={ false } <Image className={ cls.image } src={ i.image.src } loading="eager" draggable={ false }
aria-hidden alt={ i.image.alt } /> aria-hidden alt={ i.image.alt } />
}> }>