Skip to content

Commit 5ef6016

Browse files
committed
build: improve lighthouse scores on desktop
1 parent 5504a9e commit 5ef6016

File tree

11 files changed

+79
-51
lines changed

11 files changed

+79
-51
lines changed

index.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@
5050
<link rel="me" href="https://mastodon.online/@scim" />
5151

5252
<!-- Mobile Links -->
53-
<link rel=manifest href=https://spencer.imbleau.com/static/site.webmanifest />
54-
<link rel=mask-icon href=https://spencer.imbleau.com/static/safari-pinned-tab.svg color=#0099FF />
55-
<link rel=apple-touch-icon href=https://spencer.imbleau.com/static/apple-touch-icon.png sizes=180x180 />
56-
<link rel=icon href=https://spencer.imbleau.com/static/favicon-32x32.png sizes=32x32 type=image/png />
57-
<link rel=icon href=https://spencer.imbleau.com/static/favicon-16x16.png sizes=16x16 type=image/png />
53+
<link rel=manifest href=/static/site.webmanifest />
54+
<link rel=mask-icon href=/static/safari-pinned-tab.svg color=#0099FF />
55+
<link rel=apple-touch-icon href=/static/apple-touch-icon.png sizes=180x180 />
56+
<link rel=icon href=/static/favicon-32x32.png sizes=32x32 type=image/png />
57+
<link rel=icon href=/static/favicon-16x16.png sizes=16x16 type=image/png />
5858

5959
<!-- Links -->
60-
<link rel=icon type=image/x-icon href="https://spencer.imbleau.com/static/favicon.ico" />
60+
<link rel=icon type=image/x-icon href=/static/favicon.ico />
6161
<link rel=canonical href="https://spencer.imbleau.com" />
62-
<link rel="sitemap" type="application/xml" href="/sitemap.xml">
63-
<link rel=css data-trunk href="css/fonts.css" />
64-
<link rel=copy-dir data-trunk href="static/" />
65-
<link rel=copy-file data-trunk href="static/robots.txt" />
66-
<link rel=copy-file data-trunk href="static/sitemap.xml" />
62+
<link rel="sitemap" type=application/xml href=/sitemap.xml>
63+
<link rel=css data-trunk href=css/fonts.css />
64+
<link rel=copy-dir data-trunk href=static/ />
65+
<link rel=copy-file data-trunk href=/static/robots.txt />
66+
<link rel=copy-file data-trunk href=/static/sitemap.xml />
6767
<link rel=rust data-trunk />
6868
</head>
6969

src/components/icons/mask.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pub enum IconMask {
1010
Git,
1111
Robot,
1212
Share,
13+
Download,
1314
LinkedIn,
1415
Mastodon,
1516
GitHub,
@@ -27,6 +28,7 @@ impl IconMask {
2728
IconMask::Git => (0., 0., 448., 512.),
2829
IconMask::Robot => (0., 0., 640., 512.),
2930
IconMask::Share => (0., 0., 16., 16.),
31+
IconMask::Download => (0., 0., 512., 512.),
3032
IconMask::LinkedIn => (0., 0., 448., 512.),
3133
IconMask::Mastodon => (0., 0., 448., 512.),
3234
IconMask::GitHub => (0., 0., 512., 512.),
@@ -65,6 +67,9 @@ impl IconMask {
6567
IconMask::Share => {
6668
r#"M10.99 13.99h-9v-9h4.76l2-2H.99c-.55 0-1 .45-1 1v11c0 .55.45 1 1 1h11c.55 0 1-.45 1-1V7.24l-2 2v4.75zm4-14h-5c-.55 0-1 .45-1 1s.45 1 1 1h2.59L7.29 7.28a1 1 0 00-.3.71 1.003 1.003 0 001.71.71l5.29-5.29V6c0 .55.45 1 1 1s1-.45 1-1V1c0-.56-.45-1.01-1-1.01z"#
6769
}
70+
IconMask::Download => {
71+
r#"M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"#
72+
}
6873
IconMask::LinkedIn => {
6974
r#"M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"#
7075
}

src/components/iframe.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use yew::prelude::*;
66

77
#[derive(Properties, PartialEq)]
88
pub struct IFrameProps {
9+
pub title: AttrValue,
910
pub class: Option<Classes>,
1011
pub src: AttrValue,
1112
}
@@ -69,6 +70,7 @@ pub fn view(props: &IFrameProps) -> Html {
6970
</div>
7071
<iframe
7172
onload={ show }
73+
title={ props.title.clone() }
7274
src={ props.src.clone() }
7375
class={iframe_css}
7476
/>

src/components/links/external_link.rs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,19 @@ pub fn view(props: &ExternalLinkProps) -> Html {
5353
/>
5454
}
5555
{ props.children.clone() }
56-
<Icon
57-
data_aui_id="linkicon"
58-
mask={ IconMask::Share }
59-
class={classes!(css!("align-self: baseline; margin-left: 3px;"))}
60-
/>
56+
if props.download.is_some() {
57+
<Icon
58+
data_aui_id="linkicon"
59+
mask={ IconMask::Download }
60+
class={classes!(css!("align-self: baseline; margin-left: 3px;"))}
61+
/>
62+
} else {
63+
<Icon
64+
data_aui_id="linkicon"
65+
mask={ IconMask::Share }
66+
class={classes!(css!("align-self: baseline; margin-left: 3px;"))}
67+
/>
68+
}
6169
</a>
6270
</div>
6371
}

src/components/pfp.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ pub fn ProfilePicture(props: &ProfilePictureProps) -> Html {
1515

1616
let img_css = css! {
1717
border-radius: 50%;
18-
width: 300px;
19-
max-width: 600px;
20-
height: 300px;
21-
max-height: 600px;
18+
min-width: 300px;
19+
width: min(40vh, 40vw);
20+
max-width: 450px;
21+
min-height: 300px;
22+
height: min(40vh, 40vw);
23+
max-height: 450px;
2224
object-fit: scale-down;
2325

2426
/* Outline */

src/components/tap_target.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use yew::prelude::*;
99
#[derive(Properties, PartialEq)]
1010
pub struct Props {
1111
pub mask: IconMask,
12+
pub aria_label: AttrValue,
1213
#[prop_or_default]
1314
pub color: Option<HexColor>,
1415
#[prop_or_default]
@@ -76,8 +77,10 @@ pub fn view(props: &Props) -> Html {
7677
};
7778

7879
html! {
79-
<button class={ classes!(style, props.class.clone()) }
80+
<button
81+
class={ classes!(style, props.class.clone()) }
8082
onclick={ props.onclick.clone() }
83+
aria-label={ props.aria_label.clone() }
8184
>
8285
<Icon
8386
mask={ props.mask }

src/components/theme_switcher.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pub fn view() -> Html {
2525

2626
html! {
2727
<TapTarget
28+
aria_label="Switch Theme"
2829
mask={match theme.kind() {
2930
ThemeChoice::Light => IconMask::Moon,
3031
ThemeChoice::Dark => IconMask::Sun,

src/page_components/home.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ pub fn view() -> Html {
2525
<EmailButton email_base64={"c3BlbmNlckBpbWJsZWF1LmNvbQ=="} />
2626
<br/>
2727
<div class={ css!("display: inline-flex; & > * {margin: 0 10px;}") }>
28-
<a href="https://www.linkedin.com/in/simbleau/" target="_blank">
29-
<TapTarget mask={IconMask::LinkedIn} />
28+
<a href="https://www.linkedin.com/in/simbleau/" target="_blank" alt="Go to LinkedIn">
29+
<TapTarget mask={IconMask::LinkedIn} aria_label="LinkedIn" />
3030
</a>
31-
<a rel="me" href="https://mastodon.online/@scim" target="_blank">
32-
<TapTarget mask={IconMask::Mastodon} />
31+
<a rel="me" href="https://mastodon.online/@scim" target="_blank" alt="Go to Mastodon">
32+
<TapTarget mask={IconMask::Mastodon} aria_label="Mastodon" />
3333
</a>
34-
<a href="https://www.github.com/simbleau/" target="_blank">
35-
<TapTarget mask={IconMask::GitHub} />
34+
<a href="https://www.github.com/simbleau/" target="_blank" alt="Go to GitHub">
35+
<TapTarget mask={IconMask::GitHub} aria_label="GitHub" />
3636
</a>
3737
</div>
3838
<Footer />

src/page_components/resume.rs

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,41 +47,48 @@ pub fn view() -> Html {
4747
"#
4848
);
4949

50+
let tap_target_css = css!("margin: 10px;");
51+
5052
html! {
5153
<div align="center" class={container_style}>
54+
5255
<div>
53-
{"this résumé is "}
5456
<ExternalLink
55-
icon={IconMask::Git}
56-
to={"https://github.com/simbleau/resume"}
57-
target={"_blank"}
58-
>
59-
{"source controlled"}
60-
</ExternalLink>
61-
{" and "}
62-
<ExternalLink
63-
icon={IconMask::Robot}
64-
to={"https://github.com/simbleau/resume/actions"}
65-
target={"_blank"}
57+
to={"https://github.com/simbleau/resume/releases/download/latest/resume.pdf"}
58+
download={"Spencer_Imbleau_Resume.pdf"} // downloads the file as this name
6659
>
67-
{"automated"}
60+
{"click to download résumé"}
6861
</ExternalLink>
6962
</div>
7063
<br />
7164
<IFrame
65+
title="Résumé"
7266
class={classes!(resume_css)}
7367
src="https://simbleau.github.io/resume/embed.html"
7468
/>
7569
<br />
76-
<div>
77-
<ExternalLink
78-
to={"https://github.com/simbleau/resume/releases/download/latest/resume.pdf"}
79-
download={"Spencer_Imbleau_Resume.pdf"} // downloads the file as this name
80-
>
81-
{"click here"}
82-
</ExternalLink>
83-
{" to download"}
84-
</div>
70+
<span>
71+
{"this résumé is "}
72+
<span class={tap_target_css.clone()}>
73+
<ExternalLink
74+
icon={IconMask::Git}
75+
to={"https://github.com/simbleau/resume"}
76+
target={"_blank"}
77+
>
78+
{"source controlled"}
79+
</ExternalLink>
80+
</span>
81+
{" and "}
82+
<span class={tap_target_css}>
83+
<ExternalLink
84+
icon={IconMask::Robot}
85+
to={"https://github.com/simbleau/resume/actions"}
86+
target={"_blank"}
87+
>
88+
{"released continuously"}
89+
</ExternalLink>
90+
</span>
91+
</span>
8592
</div>
8693
}
8794
}

static/images/me.webp

-113 KB
Loading

0 commit comments

Comments
 (0)