Skip to content

Commit cd1fed6

Browse files
committed
perf: Optimize image loading, defer Google Analytics, improve font display, update Devicon CDN, and refine hero section styling.
1 parent d19d475 commit cd1fed6

File tree

4 files changed

+23
-6
lines changed

4 files changed

+23
-6
lines changed

src/components/About.astro

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ const stats = [
3131
src={shubhamImage}
3232
alt="Shubham Mathur — Senior Software Engineer"
3333
class="about-image"
34-
width={800}
35-
height={1000}
34+
widths={[320, 400, 640, 800]}
35+
sizes="(max-width: 480px) 280px, (max-width: 992px) 320px, 400px"
3636
loading="lazy"
37-
quality="max"
37+
decoding="async"
38+
quality={100}
3839
/>
3940
</div>
4041

src/components/Hero.astro

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ import { siteConfig } from "../data/site-config";
199199
z-index: 1;
200200
text-align: center;
201201
padding-top: var(--nav-height);
202+
min-height: calc(100vh - 80px);
203+
min-height: calc(100dvh - 80px);
204+
display: flex;
205+
flex-direction: column;
206+
align-items: center;
207+
justify-content: center;
202208
}
203209

204210
.hero-greeting {

src/layouts/Layout.astro

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const pageTitle =
1717
<!doctype html>
1818
<html lang="en" data-theme="dark">
1919
<head>
20-
<!-- Google tag (gtag.js) -->
20+
<!-- Google tag (gtag.js) — deferred to not block rendering -->
2121
<script async src="https://www.googletagmanager.com/gtag/js?id=G-CJHSDRFER0"
2222
></script>
2323
<script is:inline>
@@ -63,6 +63,7 @@ const pageTitle =
6363
<!-- Fonts -->
6464
<link rel="preconnect" href="https://fonts.googleapis.com" />
6565
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
66+
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin />
6667
<link
6768
rel="preload"
6869
as="style"
@@ -84,17 +85,25 @@ const pageTitle =
8485
<!-- Devicons (Asynchronous loading for performance) -->
8586
<link
8687
rel="preload"
87-
href="https://cdn.jsdelivr.net/gh/devicons/devicon@latest/devicon.min.css"
88+
href="https://cdn.jsdelivr.net/gh/devicons/devicon@v2.16.0/devicon.min.css"
8889
as="style"
8990
onload="this.onload=null;this.rel='stylesheet'"
9091
/>
9192
<noscript>
9293
<link
9394
rel="stylesheet"
94-
href="https://cdn.jsdelivr.net/gh/devicons/devicon@latest/devicon.min.css"
95+
href="https://cdn.jsdelivr.net/gh/devicons/devicon@v2.16.0/devicon.min.css"
9596
/>
9697
</noscript>
9798

99+
<!-- Override devicon font-display to prevent render-blocking -->
100+
<style is:inline>
101+
@font-face {
102+
font-family: "devicons";
103+
font-display: swap;
104+
}
105+
</style>
106+
98107
<title>{pageTitle}</title>
99108

100109
<script

src/styles/global.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
--border-radius-md: 10px;
115115
--border-radius-lg: 16px;
116116
--border-radius-xl: 24px;
117+
--border-radius-2xl: 32px;
117118
--border-radius-full: 9999px;
118119
}
119120

0 commit comments

Comments
 (0)