-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
435 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Theme, { Search, Link } from 'rspress/theme'; | ||
import { HomeLayout } from './pages/index'; | ||
|
||
|
||
|
||
export default { | ||
...Theme, | ||
HomeLayout, | ||
}; | ||
|
||
export * from 'rspress/theme'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
.clip { | ||
background: -webkit-linear-gradient(120deg, var(--rp-c-brand) 30%, #f4f468); | ||
-webkit-background-clip: text; | ||
background-clip: text; | ||
-webkit-text-fill-color: var(--rp-home-hero-name-color); | ||
} | ||
|
||
.mask { | ||
position: absolute; | ||
background-image: conic-gradient( | ||
from 180deg at 50% 50%, | ||
#71bedb 0deg, | ||
180deg, | ||
#9589ea 1turn | ||
); | ||
width: 600px; | ||
height: 600px; | ||
border-radius: 100%; | ||
mixblendmode: normal; | ||
opacity: 0.05; | ||
filter: blur(60px); | ||
top: -200px; | ||
transform: translateX(-50%); | ||
z-index: 0; | ||
} | ||
|
||
:global(.dark) .mask { | ||
opacity: 0.25; | ||
} | ||
|
||
:global(.modern-doc-home-hero-image) { | ||
width: 25vw; | ||
height: 25vw; | ||
max-width: 400px; | ||
position: relative; | ||
img { | ||
position: absolute; | ||
width: 100%; | ||
object-fit: cover; | ||
} | ||
} | ||
|
||
@media (max-width: 768px) { | ||
:global(.modern-doc-home-hero-image) { | ||
width: 50vw; | ||
height: 50vw; | ||
} | ||
} | ||
|
||
.imgMask { | ||
position: absolute; | ||
left: 50%; | ||
top: 50%; | ||
transform: translate(-50%, -50%); | ||
width: 75%; | ||
height: 75%; | ||
background-image: conic-gradient( | ||
from 180deg at 50% 50%, | ||
#71bedb 0deg, | ||
180deg, | ||
#9589ea 1turn | ||
); | ||
border-radius: 50%; | ||
filter: blur(72px); | ||
opacity: 0.5; | ||
} | ||
|
||
:global(.dark) .imgMask { | ||
opacity: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { Button } from 'rspress/theme'; | ||
import { normalizeHrefInRuntime } from 'rspress/runtime'; | ||
import styles from './index.module.scss'; | ||
|
||
export interface Hero { | ||
name: string; | ||
text: string; | ||
tagline: string; | ||
image?: { | ||
src: string; | ||
alt: string; | ||
}; | ||
actions: { | ||
text: string; | ||
link: string; | ||
theme: 'brand' | 'alt'; | ||
}[]; | ||
} | ||
|
||
export function HomeHero({ hero }: { hero: Hero }) { | ||
const hasImage = hero.image !== undefined; | ||
return ( | ||
<div | ||
className="m-auto px-6 pb-12 sm:pt-0 sm:px-8 md:px-16 md:pb-16" | ||
style={{ | ||
height: 'calc(100vh - var(--rp-nav-height)))', | ||
}} | ||
> | ||
<div className="max-w-6xl m-auto flex flex-col md:flex-row"> | ||
<div className="m-auto flex flex-col order-2 md:order-1 items-center justify-center text-center"> | ||
<h1 className="text-3xl sm:text-6xl md:text-7xl font-bold pb-3 lg:pb-5 z-10"> | ||
<span className={styles.clip}>{hero.name}</span> | ||
</h1> | ||
{hero.text?.length && ( | ||
<p | ||
className={"pb-2 mx-auto md:m-0 text-3xl sm:text-5xl md:text-6xl font-bold z-10 max-w-xs sm:max-w-xl"} | ||
style={{ lineHeight: '1.15' }} | ||
> | ||
{hero.text} | ||
</p> | ||
)} | ||
|
||
<p className="pt-2 m-auto md:m-0 text-sm sm:text-xl md:text-2xl text-text-2 font-medium z-10 whitespace-pre-wrap"> | ||
{hero.tagline} | ||
</p> | ||
<div className="justify-center gap-3 flex flex-wrap m--1.5 pt-4 z-10"> | ||
{hero.actions.map((action) => ( | ||
<div key={action.link} className="p-1 flex-shrink-0"> | ||
<Button | ||
className="pl-2 pr-2" | ||
type="a" | ||
text={action.text} | ||
href={normalizeHrefInRuntime(action.link)} | ||
theme={action.theme} | ||
/> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
|
||
{hasImage ? ( | ||
<div className="modern-doc-home-hero-image m-auto flex-center md:none lg:flex order-1 md:order-2"> | ||
<div className={styles.imgMask} /> | ||
<img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/dhozeh7vhpebvog/open-garfish/icons/icon.png" alt={hero.image?.alt} /> | ||
</div> | ||
) : null} | ||
</div> | ||
</div> | ||
); | ||
} |
Oops, something went wrong.