Skip to content

Commit

Permalink
chore: implement website redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
SethFalco committed May 17, 2024
1 parent 47c3328 commit 8b8956e
Show file tree
Hide file tree
Showing 23 changed files with 1,303 additions and 126 deletions.
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const config = {
i18n: {
defaultLocale: "en",
locales: [
"en"
"en"
],
},
markdown: {
Expand Down
4 changes: 2 additions & 2 deletions src/components/DefaulBadge/index.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.badge {
padding: .3em .6em;
border-radius: 1em;
padding: .3rem .6rem;
border-radius: 1rem;
color: var(--svgo-pill-fg-color);
background-color: var(--svgo-pill-bg-color);
}
64 changes: 39 additions & 25 deletions src/components/HomepageFeatures/index.jsx
Original file line number Diff line number Diff line change
@@ -1,62 +1,76 @@
import React from 'react';
import clsx from 'clsx';
import styles from './index.module.css';
import UndrawMountain from '../../vectors/undraw_mountain.svg';
import UndrawReact from '../../vectors/undraw_react.svg';
import UndrawTree from '../../vectors/undraw_tree.svg';
import SvgoHackerman from '../../vectors/svgo_hackerman.svg';
import SvgoIntegrations from '../../vectors/svgo_integrations.svg';
import SvgoOss from '../../vectors/svgo_oss.svg';

const FeatureList = [
{
title: 'Easy to Use',
Svg: UndrawMountain,
Svg: SvgoHackerman,
description: (
<>
Easy to use through both the command-line interface and JavaScript
API.
SVGO can be used through both the command-line interface and JavaScript
API, with help pages and documentation available for both.
</>
),
},
{
title: 'Integrations',
Svg: UndrawTree,
Svg: SvgoIntegrations,
description: (
<>
Many applications and frameworks depend on or have supported integrations
for SVGO already, like Docusaurus and Webpack.
Many libraries, frameworks, or tools bundle or have integrations available
for SVGO already, like Docusaurus, PostCSS, and webpack.
</>
),
},
{
title: 'Open-Source',
Svg: UndrawReact,
Svg: SvgoOss,
description: (
<>
We welcome contributions, so feel free to join us on GitHub!
We welcome contributions! Feel free to to file a bug report, feature
request, or open pull requests on GitHub.
</>
),
)
},
];

function Feature({Svg, title, description}) {
function Feature({ Svg, title, description }) {
return (
<div className={clsx('card', styles.feature)}>
<div className="text--center">
<Svg className={styles.featureSvg} role="img" aria-hidden="true"/>
</div>
<div className="text--center padding-horiz--md">
<h2>{title}</h2>
<p>{description}</p>
<div className={clsx(styles.featureWrapper)}>
<div className={clsx(styles.featureBackground)}></div>
<div className={clsx(styles.feature)}>
<div className="text--center">
<Svg className={clsx(styles.featureSvg)} role="img" aria-hidden="true" />
</div>
<div className={clsx(styles.featureText, "padding-horiz--md")}>
<h2 className={clsx(styles.featureTitle)}>{title}</h2>
<p className={clsx(styles.featureDescription)}>{description}</p>
</div>
</div>
</div>
);
}

export default function HomepageFeatures() {
return (
<section className={styles.features}>
{FeatureList.map((props, idx) => (
<Feature key={idx} {...props} />
))}
</section>
<>
<svg height="0" width="0">
<clipPath id="featureMobilePath" clipPathUnits="objectBoundingBox">
<path d="M 0 .4 Q .4 .2 1 .1 V 1 H 0" />
</clipPath>
<clipPath id="featureDesktopPath" clipPathUnits="objectBoundingBox">
<path d="M 0 .25 Q .2 -.1 .4 .1 T .8 .2 1 0 V 1 H 0" />
</clipPath>
</svg>
<section className={clsx(styles.features)}>
{FeatureList.map((props, idx) => (
<Feature key={idx} {...props} />
))}
</section>
</>
);
}
81 changes: 72 additions & 9 deletions src/components/HomepageFeatures/index.module.css
Original file line number Diff line number Diff line change
@@ -1,19 +1,82 @@
.features {
display: flex;
flex-wrap: wrap;
flex-direction: column;
align-items: center;
}

.featureWrapper {
margin-top: -4rem;
padding: 4rem 1rem 4rem 1rem;
position: relative;
width: 100%;
display: flex;
justify-content: center;
align-items: stretch;
padding: 2rem 0;
margin: -1em .5em;
}

.featureWrapper:nth-child(2) .feature {
flex-direction: row-reverse;
}

.feature {
width: 360px;
max-width: 360px;
margin: 1em;
max-width: var(--svgo-global-width);
width: 100%;
justify-content: space-around;
}

.featureBackground::after {
content: "";
top: 0;
left: 0;
z-index: -1;
height: 100%;
width: calc(100vw - (100vw - 100%));
position: absolute;
background: linear-gradient(to bottom, #367fc126, #39aee400);
clip-path: url(#featureMobilePath);
}

@media (prefers-color-scheme: dark) {
.featureBackground::after {
background: linear-gradient(to bottom, #39aee440, #39aee400);
}
}

.featureWrapper:nth-child(2) .featureBackground::after {
transform: scaleX(-1);
}

.featureText {
display: flex;
flex-direction: column;
justify-content: center;
}

.featureTitle {
font-size: 2rem;
font-weight: 700;
}

.featureDescription {
font-size: 1.4rem;
}

.featureSvg {
height: 200px;
width: 200px;
max-height: 250px;
margin-bottom: 2rem;
}

@media (min-width: 997px) {
.featureBackground::after {
clip-path: url(#featureDesktopPath);
}

.feature {
display: flex;
flex-direction: row;
}

.featureSvg {
height: 350px;
max-height: 350px;
}
}
2 changes: 1 addition & 1 deletion src/components/PluginParams/index.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.leftMargin {
margin-left: 1em;
margin-left: 1rem;
}
58 changes: 38 additions & 20 deletions src/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
:root {
--svgo-font-mono: 'Liberation Mono', Monaco, Cousine, Consolas, monospace;
--svgo-font-sans: 'Nimbus Sans', Helvetica, Arial, Roboto, 'Liberation Sans', 'DejaVu Sans', Arimo, sans-serif;
--svgo-global-width: 1400px;
--svgo-pri-fg-color: #1d1d1b;
--svgo-pri-bg-color: #f9f9fa;
--svgo-sec-bg-color: #f6f5f4;
--svgo-tir-bg-color: #e8e8e8;
--svgo-pill-fg-color: #0b5cad;
--svgo-global-width: 1200px;
--svgo-pill-bg-color: #cbe2f9;
--svgo-pill-fg-color: #0b5cad;
--svgo-pri-bg-color: #fff;
--svgo-pri-fg-color: #153243;
--svgo-search-bg-color: var(--svgo-tir-bg-color);
--svgo-search-bg-hover: #dbdbdb;
--ifm-navbar-background-color: var(--svgo-sec-bg-color);
--svgo-sec-bg-color: #f6f5f4;
--svgo-tir-bg-color: #e8e8e8;
--svgo-logo-fg-color: #1d1d1b;
--svgo-button-hover-background-color: #1b4055;
--ifm-background-color: var(--svgo-pri-bg-color) !important;
--ifm-footer-link-hover-color: #3578e5;
--ifm-color-primary: #216be2;
--ifm-card-background-color: var(--svgo-sec-bg-color);
--ifm-code-font-size: 95%;
--ifm-footer-padding-horizontal: 1em;
--ifm-color-primary: #216be2;
--ifm-container-width-xl: var(--svgo-global-width);
--ifm-footer-padding-horizontal: 1rem;
--ifm-navbar-background-color: var(--svgo-pri-bg-color);
--ifm-navbar-shadow: 0 1rem 1rem 0 #0a1e291a;
--ifm-spacing-horizontal: 1rem;
--search-local-hit-background: var(--svgo-sec-bg-color);

font-family: var(--svgo-font-sans);
Expand All @@ -26,18 +29,31 @@

@media (prefers-color-scheme: dark) {
:root {
--svgo-pri-fg-color: #fff;
--svgo-pri-bg-color: #283643;
--svgo-sec-bg-color: #1c262d;
--svgo-tir-bg-color: #5a6a74;
--svgo-pill-fg-color: #cbe2f9;
--svgo-pill-bg-color: #0b5cad;
--svgo-pill-fg-color: #cbe2f9;
--svgo-pri-bg-color: #142631;
--svgo-pri-fg-color: #fff;
--svgo-search-bg-color: #5a6a74;
--svgo-search-bg-hover: #647682;
--svgo-sec-bg-color: #1c262d;
--svgo-tir-bg-color: #5a6a74;
--svgo-logo-fg-color: #fff;
--svgo-button-hover-background-color: #e6e6e6;
--ifm-color-primary: #66b5ff;
--ifm-navbar-shadow: 0 1rem 1rem 0 #0a1e29;
}
}

/* Button overrides */
.button {
--ifm-button-color: var(--svgo-pri-bg-color);
--ifm-button-background-color: var(--svgo-pri-fg-color);
--ifm-button-border-color: var(--svgo-pri-fg-color);
}
.button:hover {
--ifm-button-background-color: var(--svgo-button-hover-background-color);
}

/* Navbar overrides */
.navbar__inner {
max-width: var(--svgo-global-width);
Expand Down Expand Up @@ -73,9 +89,11 @@ nav div kbd {

/* Footer overrides */
footer {
--ifm-footer-color: var(--svgo-pri-fg-color);
--ifm-footer-title-color: var(--svgo-pri-fg-color);
--ifm-footer-link-color: var(--svgo-pri-fg-color);
--ifm-footer-link-hover-color: var(--ifm-color-primary);
--ifm-footer-background-color: var(--svgo-sec-bg-color);
--ifm-link-color: #fff;
--ifm-link-hover-color: #cac4ce;
--ifm-footer-background-color: none;
--ifm-footer-color: #fff;
--ifm-footer-link-color: #fff;
--ifm-footer-link-hover-color: #cac4ce;
--ifm-footer-title-color: #fff;
}
56 changes: 33 additions & 23 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,48 @@ import Layout from '@theme/Layout';
import CopyIcon from '@theme/Icon/Copy';
import SuccessIcon from '@theme/Icon/Success';
import Head from '@docusaurus/Head';
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import HomepageFeatures from '../../src/components/HomepageFeatures';
import styles from './index.module.css';
import SvgoTrixie from '../vectors/svgo_trixie.svg';

const INSTALL_COMMAND = "npm i -g svgo";

const onClick = async () => {
navigator.clipboard.writeText("npx svgo");
navigator.clipboard.writeText(INSTALL_COMMAND);
}

function HomepageHeader() {
const { siteConfig } = useDocusaurusContext();

return (
<header className={clsx('hero--primary', styles.heroBanner)}>
<div className="container">
<h1 className={clsx(styles.heroTitle)}>{siteConfig.title}</h1>
<p className="hero__subtitle">{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
to="/docs/introduction">
Get Started
</Link>
<header className={clsx(styles.hero)}>
<div className={clsx("container", styles.heroSplit)}>
<div className={clsx(styles.infoSection)}>
<p className={clsx(styles.tagline)}>
SVG Optimizer for Node.js and CLI
</p>
<p className={clsx(styles.subtitle)}>
SVGO and its various integrations will enable you to optimize
SVGs and serve your web applications faster.
</p>
<div className={styles.buttons}>
<Link
className="button button--lg"
to="/docs/introduction">
Get Started
</Link>
</div>
<div className={clsx(styles.installInstructions)} onClick={onClick}>
$ {INSTALL_COMMAND}
<span className={clsx(styles.cursor)}></span>
<span className={clsx(styles.icon, styles.copyIcon)}>
<CopyIcon height="1em"/>
</span>
<span className={clsx(styles.icon, styles.successIcon)}>
<SuccessIcon height="1em"/>
</span>
</div>
</div>
<div className={clsx(styles.installInstructions)} onClick={onClick}>
$ npx svgo
<span className={clsx(styles.cursor)}></span>
<span className={clsx(styles.icon, styles.copyIcon)}>
<CopyIcon height="1em"/>
</span>
<span className={clsx(styles.icon, styles.successIcon)}>
<SuccessIcon height="1em"/>
</span>
<div className={clsx(styles.mascotSection)}>
<SvgoTrixie className={clsx(styles.mascot)}/>
</div>
</div>
</header>
Expand Down
Loading

0 comments on commit 8b8956e

Please sign in to comment.