-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Imrpove home page and slogan (#2940)
* Redo home page * formatting * write translations * responsive layout * Update features & tagline * fmt * no safe
- Loading branch information
Showing
9 changed files
with
664 additions
and
2,597 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
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
Large diffs are not rendered by default.
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
@mixin devices($breakpoint) { | ||
@if $breakpoint == desktop { | ||
@media only screen and (min-width: 700px) { | ||
@content; | ||
} | ||
} | ||
|
||
@if $breakpoint == tablet { | ||
@media only screen and (min-width: 700px) { | ||
@content; | ||
} | ||
} | ||
|
||
@if $breakpoint == mobile { | ||
@media only screen and (min-width: 350px) { | ||
@content; | ||
} | ||
} | ||
} | ||
|
||
.heroHeader { | ||
flex-direction: column; | ||
} | ||
|
||
.heroSubtitle { | ||
@include devices(mobile) { | ||
padding: 1rem; | ||
text-align: center; | ||
} | ||
} | ||
|
||
.header { | ||
display: flex; | ||
padding: var(--ifm-h1-font-size); | ||
gap: calc(var(--ifm-h1-font-size) / 2); | ||
align-items: center; | ||
justify-content: center; | ||
|
||
h1 { | ||
@include devices(desktop) { | ||
--ifm-h1-font-size: calc(var(--ifm-h1-font-size) * 3); | ||
} | ||
@include devices(tablet) { | ||
--ifm-h1-font-size: calc(var(--ifm-h1-font-size) * 1.5); | ||
} | ||
} | ||
|
||
img { | ||
$dimensions: calc(var(--ifm-h1-font-size) * 5); | ||
|
||
@include devices(tablet) { | ||
$dimensions: calc(var(--ifm-h1-font-size) * 3); | ||
} | ||
|
||
width: $dimensions; | ||
height: $dimensions; | ||
} | ||
} | ||
|
||
.callToActions { | ||
display: flex; | ||
flex-direction: column; | ||
|
||
@include devices(desktop) { | ||
flex-direction: row; | ||
} | ||
} | ||
|
||
.features { | ||
h2 { | ||
font-size: calc(var(--ifm-h2-font-size) * 1.5); | ||
|
||
@include devices(mobile) { | ||
font-size: calc(var(--ifm-h2-font-size) * 1.5); | ||
} | ||
} | ||
|
||
.featuresGrid { | ||
$spacing: 2rem; | ||
padding: $spacing; | ||
display: grid; | ||
|
||
grid-template-columns: 1fr; | ||
gap: ($spacing * 2); | ||
|
||
@include devices(tablet) { | ||
grid-template-columns: repeat(3, 1fr); | ||
gap: $spacing; | ||
} | ||
} | ||
} |
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,103 @@ | ||
import React from 'react' | ||
import Layout from '@theme/Layout' | ||
import styles from './index.module.scss' | ||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext' | ||
import clsx from 'clsx' | ||
import IconExternalLink from '@theme/Icon/ExternalLink' | ||
import Link from '@docusaurus/Link' | ||
|
||
const Hero = () => { | ||
const { siteConfig } = useDocusaurusContext() | ||
|
||
return ( | ||
<div className={clsx('hero shadow--lw', styles.heroHeader)}> | ||
<section className={styles.header}> | ||
<img src={siteConfig.favicon} alt="Logo" /> | ||
<h1 className="hero__title">{siteConfig.title}</h1> | ||
</section> | ||
<section className={clsx('hero__subtitle', styles.heroSubtitle)}> | ||
{siteConfig.tagline} | ||
</section> | ||
<section className={styles.callToActions}> | ||
<Link | ||
className="button button--lg button--outline button--primary margin--lg" | ||
to="/docs/getting-started/introduction" | ||
> | ||
Get Started | ||
</Link> | ||
<Link | ||
className="button button--lg button--outline button--link margin--lg" | ||
to="https://play.yew.rs" | ||
target="_blank" | ||
> | ||
Playground | ||
<IconExternalLink /> | ||
</Link> | ||
</section> | ||
</div> | ||
) | ||
} | ||
|
||
const FEATURES = [ | ||
{ | ||
header: 'Component Based', | ||
body: 'Features a component-based framework which makes it easy to create interactive UIs. Developers who have experience with frameworks like React and Elm should feel quite at home when using Yew.', | ||
to: '/docs/next/concepts/function-components', | ||
}, | ||
{ | ||
header: 'HTML macro', | ||
body: 'Features a macro for declaring interactive HTML with Rust expressions. Developers who have experience using JSX in React should feel quite at home when using Yew.', | ||
to: '/docs/next/concepts/html', | ||
}, | ||
{ | ||
header: 'Server Side Rendering', | ||
body: 'Features server side rendering for all the SEO and enhancements of server-rendered app while keeping the feel of an SPA', | ||
to: '/docs/next/advanced-topics/server-side-rendering', | ||
}, | ||
] | ||
|
||
function Feature(props: { feature: typeof FEATURES[number] }) { | ||
return ( | ||
<div className="card-demo"> | ||
<div className="card"> | ||
<div className="card__header"> | ||
<h3>{props.feature.header}</h3> | ||
</div> | ||
<div className="card__body"> | ||
<p>{props.feature.body}</p> | ||
</div> | ||
<div className="card__footer"> | ||
<Link | ||
className="button button--secondary" | ||
to={props.feature.to} | ||
> | ||
Learn more | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
function Features() { | ||
return ( | ||
<article className={clsx('padding--lg', styles.features)}> | ||
<h2>Features</h2> | ||
<section className={styles.featuresGrid}> | ||
{FEATURES.map((it) => ( | ||
<Feature feature={it} /> | ||
))} | ||
</section> | ||
</article> | ||
) | ||
} | ||
|
||
export default function Index() { | ||
const { siteConfig } = useDocusaurusContext() | ||
return ( | ||
<Layout description={siteConfig.tagline}> | ||
<Hero /> | ||
<Features /> | ||
</Layout> | ||
) | ||
} |