Skip to content

Commit 3ebcdbf

Browse files
committed
Add lazy image loading
1 parent d3b6316 commit 3ebcdbf

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/pages/About.jsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const TimelineEntry = ({ date, imagePath, imageUrl, imageAlt, title, subheader,
1616
<br />
1717
<div className="timeline_image">
1818
<a href={imageUrl} target="_blank" rel="noopener noreferrer">
19-
<img className="image_thumbnail" src={imagePath} alt={imageAlt} />
19+
<img className="image_thumbnail" src={imagePath} alt={imageAlt} loading="lazy" />
2020
</a>
2121
</div>
2222
</div>
@@ -200,6 +200,7 @@ function About() {
200200
style={{ width: '200px', height: '200px', border: '2px solid var(--white_color)' }}
201201
src="/about/zack_profile_pic.webp"
202202
alt="Zack Goldblum profile picture"
203+
loading="lazy"
203204
/>
204205
<div className="about_text item_container">
205206
I am an engineer and scientist doing research at the intersection of neurotechnology and artificial intelligence.
@@ -217,37 +218,37 @@ function About() {
217218
<div id="affiliations_container">
218219
<div id="left" className="box">
219220
<a href="https://seas.upenn.edu/" target="_blank" rel="noopener noreferrer">
220-
<img src="/about/penn_engineering.webp" alt="Penn Engineering image" width="210" height="80" />
221+
<img src="/about/penn_engineering.webp" alt="Penn Engineering image" width="210" height="80" loading="lazy" />
221222
</a>
222223
</div>
223224
<div id="middle" className="box">
224225
<a href="https://cnt.upenn.edu/" target="_blank" rel="noopener noreferrer">
225-
<img src="/about/cnt.webp" alt="Center for Neuroengineering and Therapeutics image" width="333" height="80" />
226+
<img src="/about/cnt.webp" alt="Center for Neuroengineering and Therapeutics image" width="333" height="80" loading="lazy" />
226227
</a>
227228
</div>
228229
<div id="right" className="box">
229230
<a href="https://sociail.com/" target="_blank" rel="noopener noreferrer">
230-
<img src="/about/sociail.webp" alt="Sociail image" width="144" height="80" />
231+
<img src="/about/sociail.webp" alt="Sociail image" width="144" height="80" loading="lazy" />
231232
</a>
232233
</div>
233234
<div id="right" className="box">
234235
<a href="https://littlab.seas.upenn.edu/" target="_blank" rel="noopener noreferrer">
235-
<img src="/about/littlab.webp" alt="Litt Lab image" width="278" height="80" />
236+
<img src="/about/littlab.webp" alt="Litt Lab image" width="278" height="80" loading="lazy" />
236237
</a>
237238
</div>
238239
<div id="left" className="box">
239240
<a href="https://healthtech.upenn.edu/" target="_blank" rel="noopener noreferrer">
240-
<img src="/about/pennhealthtech.webp" alt="Penn Health-Tech image" width="486" height="80" />
241+
<img src="/about/pennhealthtech.webp" alt="Penn Health-Tech image" width="486" height="80" loading="lazy" />
241242
</a>
242243
</div>
243244
<div id="middle" className="box">
244245
<a href="https://drexel.edu/biomed/resources/alumni/" target="_blank" rel="noopener noreferrer">
245-
<img src="/about/dban.webp" alt="Drexel Biomed Alumni Network image" width="250" height="80" />
246+
<img src="/about/dban.webp" alt="Drexel Biomed Alumni Network image" width="250" height="80" loading="lazy" />
246247
</a>
247248
</div>
248249
<div id="right" className="box">
249250
<a href="https://pintofscience.com/" target="_blank" rel="noopener noreferrer">
250-
<img src="/about/pint_of_science.webp" alt="Pint of Science image" width="250" height="80" />
251+
<img src="/about/pint_of_science.webp" alt="Pint of Science image" width="250" height="80" loading="lazy" />
251252
</a>
252253
</div>
253254
</div>

src/pages/Bookshelf.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const Book = ({ title, author, imageSrc, rating, titlePadTop, authorBottomPositi
1717
<p className="book_title book_title_xs" style={titleStyle}>{title}</p>
1818
<p className="book_author book_author_xs" style={authorStyle}>{author}</p>
1919
<div className="book_img_container_xs">
20-
<img className="book_img book_img_xs" src={imageSrc} alt={`${title} book cover`} />
20+
<img className="book_img book_img_xs" src={imageSrc} alt={`${title} book cover`} loading="lazy" />
2121
</div>
2222
</div>
2323
);
@@ -29,7 +29,7 @@ const Book = ({ title, author, imageSrc, rating, titlePadTop, authorBottomPositi
2929
<p className="book_title" style={titleStyle}>{title}</p><br />
3030
<p className="book_author" style={authorStyle}>{author}</p><br />
3131
<div className="book_img_container">
32-
<img className="book_img" src={imageSrc} alt={`${title} book cover`} /><br />
32+
<img className="book_img" src={imageSrc} alt={`${title} book cover`} loading="lazy" /><br />
3333
</div>
3434
{rating && (
3535
<div className="star_style_container">

src/pages/Projects.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const ProjectEntry = ({ title, description, date, imageSrc, content, additionalI
1616
<span style={{ fontSize: '18px', fontStyle: 'italic', display: 'block', marginBottom: '20px' }}>{date}</span>
1717
<div className="proj_content">
1818
<div className="proj_image">
19+
<img style={{ width: '320px', height: 'auto' }} src={imageSrc} alt={`${title} project`} loading="lazy" />
1920
</div>
2021
<div className="proj_text">
2122
<p className="paragraph" style={{ fontSize: '18px' }} dangerouslySetInnerHTML={{ __html: content }} />

0 commit comments

Comments
 (0)