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
+7 -3
View File
@@ -51,10 +51,14 @@ const ProjectsSection: React.FC = () =>
<div className={ cls.descriptions } aria-live="polite" aria-atomic>
{ projects.map((project, 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 */ }
{ project.imageDark &&
<Image src={ project.imageDark } alt="" data-theme="dark" />
<Image src={ project.imageDark } alt="" data-theme="dark" loading="eager" />
}
<h3>{ project.title }</h3>
@@ -80,7 +84,7 @@ const ProjectsSection: React.FC = () =>
</div>
) }
<Image className={ cls.defaultImg } hidden={ selection !== undefined }
src={ projectsImg.src } alt={ projectsImg.alt } />
src={ projectsImg.src } alt={ projectsImg.alt } loading="eager" />
</div>
</section>
);