Skip to content

Commit

Permalink
website: cover
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Jan 3, 2025
1 parent cb2cccb commit a5e4cfb
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 48 deletions.
4 changes: 4 additions & 0 deletions docs/headingsDetached.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ const headingsDetached: HeadingDetachedDefinition[] = [
title: 'Banner',
url: '/banner'
},
{
title: 'Cover',
url: '/banner/cover'
},
{
title: 'vue-i18n',
url: '/vue-i18n'
Expand Down
49 changes: 2 additions & 47 deletions docs/pages/banner/+Page.tsx
Original file line number Diff line number Diff line change
@@ -1,53 +1,8 @@
export { Page }

// For generating a 600x315 banner.png from this page see: https://gist.github.com/brillout/e7d0a5585471c4ea40d43d2caaadafad

import React from 'react'
import { heroBgColor, HeroTagline } from '../index/sections/hero/Hero'
import vikeLogo from '../../assets/logo/vike.svg'
import { Banner } from './Banner'

function Page() {
return (
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: '100vh',
background: heroBgColor
}}
>
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
// Needs to have the right size upon 600x315 (that's the viewport we use to generate banner.png as explained in the HOW-TO above)
scale: '1.3'
}}
>
<div
style={{
display: 'flex',
alignItems: 'center',
marginBottom: -14
}}
>
<img src={vikeLogo} style={{ marginRight: 12, height: 48, objectFit: 'contain' }} />
<span
style={{
fontSize: '2.7em',
fontWeight: 450,
color: 'black',
opacity: 0.75,
lineHeight: '1em'
}}
>
Vike
</span>
</div>
<HeroTagline />
</div>
</div>
)
return <Banner showLogo={true} />
}
53 changes: 53 additions & 0 deletions docs/pages/banner/Banner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
export { Banner }

import React from 'react'
import { heroBgColor, HeroTagline } from '../index/sections/hero/Hero'
import vikeLogo from '../../assets/logo/vike.svg'

function Banner({ showLogo }: { showLogo: boolean }) {
return (
<div
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
height: '100vh',
background: heroBgColor
}}
>
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
// Needs to have the right size upon 600x315 (that's the viewport we use to generate banner.png as explained in the HOW-TO above)
scale: '1.3'
}}
>
{showLogo && (
<div
style={{
display: 'flex',
alignItems: 'center',
marginBottom: -14
}}
>
<img src={vikeLogo} style={{ marginRight: 12, height: 48, objectFit: 'contain' }} />
<span
style={{
fontSize: '2.7em',
fontWeight: 450,
color: 'black',
opacity: 0.75,
lineHeight: '1em'
}}
>
Vike
</span>
</div>
)}
<HeroTagline />
</div>
</div>
)
}
8 changes: 8 additions & 0 deletions docs/pages/banner/cover/+Page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export { Page }

import React from 'react'
import { Banner } from '../Banner'

function Page() {
return <Banner showLogo={false} />
}
4 changes: 3 additions & 1 deletion docs/pages/press/+Page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import './press.css'

<img src="/banner.jpg" height="250" />

<img src="https://i.imgur.com/1rCTNcM.png" height="250" />

> Generated from:
> - Source: <a href="/banner" rel="external">`/banner`</a>
> - Source: <a href="/banner" rel="external">`/banner`</a> and <a href="/banner/cover" rel="external">`/banner/cover`</a>
> - [Instructions](https://gist.github.com/brillout/e7d0a5585471c4ea40d43d2caaadafad) for generating a 1200x630 `banner.jpg`

0 comments on commit a5e4cfb

Please sign in to comment.