Skip to content

Commit d11efff

Browse files
authored
Merge pull request #21 from alan-turing-institute/hero-image-and-logo
fix responsiveness of hero section
2 parents 96d4960 + 476909c commit d11efff

12 files changed

Lines changed: 577 additions & 37 deletions

File tree

public/images/hero.jpg

-778 KB
Binary file not shown.

public/images/logo.png

28.5 KB
Loading
757 KB
Loading

src/assets/images/hero_foreground.svg

Lines changed: 493 additions & 0 deletions
Loading
Binary file not shown.
Binary file not shown.
-79.9 KB
Binary file not shown.
-190 KB
Binary file not shown.

src/components/common/HeroContent.astro

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,43 @@ import Button from "@ui/Button.astro";
44
const title = "Networks of Cardiovascular Digital Twins";
55
const subTitle =
66
"Pioneering personalised cardiovascular care through interconnected digital twins";
7-
// TODO: Add Hero Image placeholder (_being developed_)
87
const primaryCTA = { text: "Find Out More", href: "/about/project-overview" }; // Astro's Button component will handle base URL prefix
98
const secondaryCTA = { text: "Contact Us", href: "/about/contact" }; // Astro's Button component will handle base URL prefix
109
---
1110

12-
{/* Hero Content */}
13-
<div class="mx-auto max-w-4xl text-left select-none sm:text-center">
14-
<h1
15-
class="block text-4xl text-balance text-slate-800 sm:text-5xl md:text-6xl lg:text-7xl"
16-
>
17-
{title}
18-
</h1>
19-
</div>
11+
<div
12+
class="w-full space-y-5 px-3 pb-4 text-center sm:px-4 md:w-3/5 md:space-y-6 md:pb-0 md:text-left lg:w-1/2"
13+
>
14+
<div class="select-none">
15+
<h1
16+
class="block text-3xl leading-tight font-bold text-pretty text-slate-800 drop-shadow-xl sm:text-4xl md:text-4xl lg:text-5xl xl:text-6xl"
17+
>
18+
{title}
19+
</h1>
20+
</div>
2021

21-
<div class="mx-auto max-w-3xl text-left sm:text-center">
22-
<p class="text-lg text-pretty text-slate-700">
23-
{subTitle}
24-
</p>
25-
</div>
22+
<div>
23+
<p
24+
class="text-base text-pretty text-slate-800 drop-shadow-md md:text-lg"
25+
>
26+
{subTitle}
27+
</p>
28+
</div>
2629

27-
{/* CTA Buttons */}
28-
<div class="flex flex-col justify-center gap-5 sm:flex-row">
29-
{
30-
/* Note: Swapped primary/secondary variants to match the variable renaming */
31-
}
32-
<Button href={primaryCTA.href} variant="primary">{primaryCTA.text}</Button>
33-
<Button href={secondaryCTA.href} variant="secondary"
34-
>{secondaryCTA.text}</Button
30+
{/* CTA Buttons */}
31+
<div
32+
class="flex flex-col justify-center gap-3 pt-2 sm:flex-row md:justify-start md:pt-4"
3533
>
34+
<Button
35+
href={primaryCTA.href}
36+
variant="primary"
37+
className="text-sm shadow-md md:text-base">{primaryCTA.text}</Button
38+
>
39+
<Button
40+
href={secondaryCTA.href}
41+
variant="secondary"
42+
className="bg-white/80 text-sm shadow-sm md:text-base"
43+
>{secondaryCTA.text}</Button
44+
>
45+
</div>
3646
</div>
Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,43 @@
11
---
22
import HeroContent from "@common/HeroContent.astro";
3+
import HeroBackground from "../../assets/images/hero_background.png";
4+
import HeroForeground from "../../assets/images/hero_foreground.svg";
35
---
46

5-
<section class="bg-linear-to-b/oklch from-teal-200 via-transparent to-white">
6-
<div class="mx-auto max-w-[85rem] space-y-8 px-4 pb-12 pt-48 sm:px-6 lg:px-8">
7+
<section
8+
class="hero-section relative min-h-[70vh] bg-cover bg-center pt-20 sm:pt-20 md:min-h-[75vh] md:pt-10 lg:pt-10"
9+
style={`background-image: url(${HeroBackground.src})`}
10+
>
11+
{/* Content container with z-index to position on top of image */}
12+
<div
13+
class="relative z-10 mx-auto flex min-h-[60vh] max-w-[85rem] flex-col items-center px-4 py-6 sm:px-6 md:min-h-[65vh] md:flex-row md:items-center md:py-12 lg:px-8 lg:py-16"
14+
>
15+
<HeroContent />
716

8-
{/* Hero Content */}
9-
<HeroContent />
10-
11-
</div>
17+
<div class="mx-auto mt-6 w-full md:mx-0 md:mt-0 md:w-2/5 md:pl-4">
18+
<img
19+
src={HeroForeground.src}
20+
alt="Cardiovascular Digital Twin Illustration"
21+
class="mx-auto h-auto w-full max-w-full object-contain drop-shadow-xl md:w-full"
22+
/>
23+
</div>
24+
</div>
1225
</section>
26+
27+
<style>
28+
.hero-section::after {
29+
content: "";
30+
position: absolute;
31+
bottom: 0;
32+
left: 0;
33+
width: 100%;
34+
height: 100%;
35+
background: linear-gradient(
36+
to bottom,
37+
rgba(255, 255, 255, 0) 70%,
38+
rgba(255, 255, 255, 0.8) 90%,
39+
rgba(255, 255, 255, 1) 100%
40+
);
41+
pointer-events: none; /* Ensures clicks pass through to elements beneath */
42+
}
43+
</style>

0 commit comments

Comments
 (0)