Skip to content

Commit a3fc9e7

Browse files
heiskrCopilot
andauthored
New home hero design (#58364)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent e1e38bc commit a3fc9e7

File tree

8 files changed

+54
-371
lines changed

8 files changed

+54
-371
lines changed
205 KB
Loading

content/copilot/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ featuredLinks:
2929
- '{% ifversion ghec %}/copilot/tutorials/roll-out-at-scale/enable-developers/drive-adoption{% endif %}'
3030
- '{% ifversion ghec %}/copilot/tutorials/roll-out-at-scale/enable-developers/integrate-ai-agents{% endif %}'
3131
layout: discovery-landing
32-
heroImage: /assets/images/banner-images/hero-6.png
32+
heroImage: /assets/images/banner-images/hero-6
3333
versions:
3434
feature: copilot
3535
children:

content/copilot/tutorials/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ children:
3030
redirect_from:
3131
- /copilot/using-github-copilot/guides-on-using-github-copilot
3232
contentType: tutorials
33-
heroImage: /assets/images/banner-images/hero-3.png
33+
heroImage: /assets/images/banner-images/hero-3
3434
layout: bespoke-landing
3535
sidebarLink:
3636
text: All tutorials
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.section {
2+
height: 21rem;
3+
background-image: image-set(
4+
url("/assets/images/banner-images/hero-home.webp") type("image/webp"),
5+
url("/assets/images/banner-images/hero-home.png") type("image/png")
6+
);
7+
background-size: cover;
8+
background-position: center right;
9+
background-repeat: no-repeat;
10+
}
11+
12+
.section h1 {
13+
font-size: 4rem;
14+
line-height: 1.2;
15+
}
16+
17+
.content {
18+
backdrop-filter: blur(1rem);
19+
background-color: color-mix(
20+
in srgb,
21+
var(--color-canvas-subtle) 70%,
22+
transparent
23+
);
24+
}

src/landings/components/HomePageHero.tsx

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
import { OctocatHeader } from '@/landings/components/OctocatHeader'
21
import { useTranslation } from '@/languages/components/useTranslation'
2+
import styles from './HomePageHero.module.scss'
3+
import cx from 'classnames'
34

45
export const HomePageHero = () => {
56
const { t } = useTranslation(['header', 'homepage'])
67

78
return (
8-
<section id="landing" className="color-bg-subtle p-6">
9-
<div className="container-xl px-xl-6">
10-
<div className="gutter gutter-xl-spacious d-lg-flex flex-row-reverse flex-items-center">
11-
<div className="col-lg-6 col-xl-7 mb-4 mb-lg-0">
12-
<OctocatHeader />
13-
</div>
14-
<div className="col-lg-6 col-xl-5">
15-
<h1 id="title-h1">{t('github_docs')}</h1>
16-
<p className="color-fg-muted f2 mb-0">{t('description')}</p>
17-
</div>
18-
</div>
9+
<section
10+
id="landing"
11+
className={cx(
12+
'border-bottom color-border-muted color-bg-subtle',
13+
'd-flex flex-justify-center flex-column',
14+
'text-center',
15+
styles.section,
16+
)}
17+
>
18+
<div className={cx('mx-auto px-4 rounded-3', styles.content)}>
19+
<h1 id="title-h1" className="text-semibold">
20+
{t('github_docs')}
21+
</h1>
22+
<p className="f3 color-fg-muted">{t('description')}</p>
1923
</div>
2024
</section>
2125
)

src/landings/components/OctocatHeader.tsx

Lines changed: 0 additions & 346 deletions
This file was deleted.

src/landings/components/shared/LandingHero.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ type LandingHeroProps = {
99
introLinks?: Record<string, string> | null
1010
}
1111

12+
function heroBackgroundCss(heroImage: string | undefined) {
13+
if (!heroImage) return {}
14+
return {
15+
backgroundImage: `image-set(
16+
url("${heroImage}.webp") type('image/webp'),
17+
url("${heroImage}.png") type('image/png')
18+
)`,
19+
}
20+
}
21+
1222
export const LandingHero = ({ title, intro, heroImage, introLinks }: LandingHeroProps) => {
1323
const { t } = useTranslation(['product_landing'])
1424

@@ -17,16 +27,7 @@ export const LandingHero = ({ title, intro, heroImage, introLinks }: LandingHero
1727
const secondaryAction = linkEntries[1]
1828

1929
return (
20-
<div
21-
className={styles.landingHero}
22-
style={
23-
heroImage
24-
? {
25-
backgroundImage: `url("${heroImage}")`,
26-
}
27-
: undefined
28-
}
29-
>
30+
<div className={styles.landingHero} style={heroBackgroundCss(heroImage)}>
3031
<div className={styles.heroContent}>
3132
<div className={styles.heroText}>
3233
<h1 className={styles.heroHeading}>{title}</h1>

src/landings/context/LandingContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const getLandingContextFromRequest = async (
7878
renderedPage: req.context.renderedPage,
7979
currentLearningTrack: req.context.currentLearningTrack,
8080
currentLayout: req.context.currentLayoutName,
81-
heroImage: page.heroImage || '/assets/images/banner-images/hero-1.png',
81+
heroImage: page.heroImage || '/assets/images/banner-images/hero-1',
8282
introLinks: page.introLinks || null,
8383
recommended,
8484
journeyTracks,

0 commit comments

Comments
 (0)