Skip to content

Commit 969d503

Browse files
FIX: Hero background pattern on wide screens (#644)
1 parent 99f3623 commit 969d503

3 files changed

Lines changed: 29 additions & 20 deletions

File tree

Lines changed: 14 additions & 0 deletions
Loading

apps/website/src/components/staff-agmentation/Hero.astro

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Picture } from "astro:assets";
33
import { getCollection } from "astro:content";
44
import classnames from "classnames";
55
import hero from "../../assets/mobile-staff-hero.svg";
6+
import heroWide from "../../assets/wide-staff-hero.svg";
67
import Pill from "../../components/Pill.astro";
78
import Section from "../../components/Section.astro";
89
import { grid_classes } from "../../components/_grid";
@@ -15,7 +16,7 @@ const staff = (await getCollection("staff_members")) as {
1516
}[];
1617
1718
const contentVariantID = String(
18-
Astro.url.searchParams.get("id") || "backfill-your-developer-gap",
19+
Astro.url.searchParams.get("id") || "backfill-your-developer-gap"
1920
);
2021
2122
const staffContent = (await getCollection("staff_augmentation")) as {
@@ -43,31 +44,18 @@ if (!content) {
4344
>
4445
<div
4546
class={classnames(
46-
"mx-auto xl:px-0 bg-[#FFF1E1] rounded-b-4xl md:rounded-b-[96px] relative overflow-hidden",
47+
"mx-auto xl:px-0 bg-[#FFF1E1] rounded-b-4xl md:rounded-b-[96px] relative overflow-hidden"
4748
)}
4849
>
49-
<!-- Fills the empty left gap on wide screens.
50-
Simulates `background-repeat`, because we can’t use
51-
an SVG as background-image in combination with background-repeat
52-
because it gets blurry. -->
5350
<Picture
5451
src={hero}
5552
alt=""
56-
class="w-[1400px] h-full absolute top-0 -translate-x-full left-[calc(50%-800px)] z-[1] bg-[#FFF1E1] hidden min-[1600px]:block"
53+
class="xl:min-w-[1400px] h-full absolute top-0 left-1/2 -translate-x-1/2 z-[1] bg-[#FFF1E1] min-[1600px]:hidden"
5754
/>
58-
<!-- Fills the empty right gap on wide screens.
59-
Simulates `background-repeat`, because we can’t use
60-
an SVG as background-image in combination with background-repeat
61-
because it gets blurry. -->
6255
<Picture
63-
src={hero}
64-
alt=""
65-
class="w-[1400px] h-full absolute top-0 left-[calc((50%-600px)+1400px)] z-[1] bg-[#FFF1E1] hidden min-[1600px]:block"
66-
/>
67-
<Picture
68-
src={hero}
56+
src={heroWide}
6957
alt=""
70-
class="w-[1400px] h-full absolute top-0 left-1/2 -translate-x-1/2 z-[1] bg-[#FFF1E1]"
58+
class="h-full absolute top-0 left-0 z-[1] bg-[#FFF1E1] hidden min-[1600px]:block"
7159
/>
7260
<div
7361
class={`${grid_classes} md:max-w-[var(--max-width)] px-4 md:px-7 !pt-[75px] md:mx-auto relative z-[2]`}

apps/website/src/components/staff-agmentation/StaffMember.astro

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type Props = {
1313
const { name, imagePath, role, idx } = Astro.props;
1414
1515
const images = import.meta.glob<{ default: ImageMetadata }>(
16-
"/src/assets/staff/*.{jpg, png}",
16+
"/src/assets/staff/*.{jpg, png}"
1717
);
1818
---
1919

@@ -29,7 +29,14 @@ const images = import.meta.glob<{ default: ImageMetadata }>(
2929
"rotate-z-[15deg]": idx === 2,
3030
})}
3131
>
32-
<Image width={230} height={230} src={images[imagePath]()} alt="" />
32+
<Image
33+
width={230}
34+
height={230}
35+
src={images[imagePath]()}
36+
alt=""
37+
widths={[320, 640]}
38+
sizes={"320px"}
39+
/>
3340
</div>
3441
<div
3542
class={classnames("absolute w-full h-full top-0 left-0", {

0 commit comments

Comments
 (0)