Skip to content

Commit 1bec5b8

Browse files
committed
Update hero img to render for AIUK + text visibility updates
1 parent d9f29c4 commit 1bec5b8

File tree

3 files changed

+24
-26
lines changed

3 files changed

+24
-26
lines changed

public/images/hero-image.png

1.34 MB
Loading

src/components/widgets/Hero.astro

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,54 +18,48 @@ const {
1818
bg = await Astro.slots.render('bg'),
1919
} = Astro.props;
2020
21-
const background_image_style =
22-
image !== null
23-
? // ? "background-color: #020e59; background-repeat: no-repeat; background-position: center ; background-image: url(" + image + "); background-size: cover;"
24-
'background-repeat: no-repeat; background-position: center ; background-image: url(' +
25-
image +
26-
'); background-size: cover;'
21+
const background_image_class =
22+
image !== undefined
23+
? 'after:absolute after:inset-0 dark:after:bg-gradient-to-b dark:after:from-transparent dark:after:to-black'
24+
: '';
25+
26+
const background_text_style =
27+
image !== undefined
28+
? 'z-10 bg-gray-200/40 dark:bg-gray-500/20 rounded-lg backdrop-blur-xs'
2729
: '';
2830
2931
const headerHeight_sm = '72px';
3032
const headerHeight_md = '112px';
3133
const headerHeight_lg = '140px';
3234
---
3335

34-
<section class=`relative md:-mt-[76px] not-prose ${backgroundColor}` {...id ? { id } : {}}>
36+
<section class="relative md:-mt-[76px] not-prose ${backgroundColor}" {...id ? { id } : {}}>
3537
<div class="absolute inset-0 pointer-events-none" aria-hidden="true">
3638
<slot name="bg">
3739
{bg ? <Fragment set:html={bg} /> : null}
3840
</slot>
3941
</div>
40-
<div class="relative mx-auto px-4 sm:px-6" style={background_image_style}>
42+
<div
43+
class={`relative mx-auto px-4 sm:px-6 bg-center bg-no-repeat bg-cover ${background_image_class}`}
44+
style={`background-image: url(${image}); background-size: cover;`}
45+
>
4146
<div class="pt-0 md:pt-[76px] pointer-events-none"></div>
42-
<div
43-
class=`min-h-[82.5vh] sm:min-h-[calc(100vh-${headerHeight_sm})] md:min-h-[calc(100vh-${headerHeight_md}-76px)] lg:min-h-[calc(100vh-${headerHeight_lg})]`
44-
>
45-
<div class="text-center pb-10 md:pb-16 md:pt-16 max-w-5xl md:mt-5 m-auto">
47+
<div class="min-h-[82.5vh] sm:min-h-[calc(100vh-${headerHeight_sm})] md:min-h-[calc(100vh-${headerHeight_md}-76px)] lg:min-h-[calc(100vh-${headerHeight_lg})]">
48+
<div class={`text-center p-10 md:p-12 max-w-5xl md:mt-5 m-auto relative ${background_text_style}`}>
4649
{
4750
tagline && (
48-
<p
49-
class="text-base text-secondary dark:text-blue-200 font-bold tracking-wide uppercase intersect-once intersect-quarter motion-safe:md:opacity-0 motion-safe:md:intersect:animate-fade"
50-
set:html={tagline}
51-
/>
51+
<p class="text-base text-secondary dark:text-blue-200 font-bold tracking-wide uppercase intersect-once intersect-quarter motion-safe:md:opacity-0 motion-safe:md:intersect:animate-fade" set:html={tagline} />
5252
)
5353
}
5454
{
5555
title && (
56-
<h1
57-
class="text-5xl md:text-6xl font-bold leading-tighter tracking-tighter mb-4 font-heading dark:text-gray-200 intersect-once intersect-quarter motion-safe:md:opacity-0 motion-safe:md:intersect:animate-fade"
58-
set:html={title}
59-
/>
56+
<h1 class="text-5xl md:text-6xl font-bold leading-tighter tracking-tighter mb-4 font-heading dark:text-white text-shadow-sm intersect-once intersect-quarter motion-safe:md:opacity-0 motion-safe:md:intersect:animate-fade" set:html={title} />
6057
)
6158
}
6259
<div class="max-w-3xl mx-auto">
6360
{
6461
subtitle && (
65-
<p
66-
class="text-xl text-muted mb-6 dark:text-slate-300 intersect-once intersect-quarter motion-safe:md:opacity-0 motion-safe:md:intersect:animate-fade"
67-
set:html={subtitle}
68-
/>
62+
<p class="text-xl mb-6 dark:text-white intersect-once intersect-quarter motion-safe:md:opacity-0 motion-safe:md:intersect:animate-fade" set:html={subtitle} />
6963
)
7064
}
7165
{
@@ -74,7 +68,7 @@ const headerHeight_lg = '140px';
7468
{Array.isArray(actions) ? (
7569
actions.map((action) => (
7670
<div class="flex w-full sm:w-auto">
77-
<Button {...(action || {})} class="w-full sm:mb-0" />
71+
<Button {...(action || {})} class="w-full sm:mb-0 text-white bg-primary dark:bg-primary-light hover:bg-primary-dark dark:hover:bg-primary-dark" />
7872
</div>
7973
))
8074
) : (
@@ -89,3 +83,4 @@ const headerHeight_lg = '140px';
8983
</div>
9084
</div>
9185
</section>
86+

src/pages/index.astro

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ const images = import.meta.glob<{ default: ImageMetadata }>('/src/assets/images/
8080
<Note />
8181

8282
<!-- About IceNet Widget *************** -->
83-
<Hero id="about-us" tagline="About us">
83+
<Hero
84+
id="about-us"
85+
tagline="About us"
86+
>
8487
<Fragment slot="title">
8588
About IceNet <br />
8689
</Fragment>

0 commit comments

Comments
 (0)