Skip to content

Visualize Your Ideas With Code

docs: update homepage (#735)

Jacobaa20d7dd7841
diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.js
index 691c45c4..620cf1b0 100644
--- a/packages/docs/docusaurus.config.js
+++ b/packages/docs/docusaurus.config.js
@@ -3,7 +3,8 @@
/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Motion Canvas',
- tagline: 'Visualize complex ideas programmatically',
+ tagline:
+ 'A TypeScript library for creating animated videos using the Canvas API.',
url: 'https://motioncanvas.io',
baseUrl: '/',
onBrokenLinks: 'throw',
diff --git a/packages/docs/src/components/Homepage/Features.tsx b/packages/docs/src/components/Homepage/Features.tsx
index 69bf64d5..5a266fb3 100644
--- a/packages/docs/src/components/Homepage/Features.tsx
+++ b/packages/docs/src/components/Homepage/Features.tsx
@@ -1,5 +1,4 @@
import React from 'react';
-import clsx from 'clsx';
import styles from './styles.module.css';
import CodeBlock from '@theme/CodeBlock';
@@ -35,90 +34,88 @@ type FeatureItem = {
function Feature({content, children}: FeatureItem) {
return (
- <div className={clsx(styles.feature, 'row')}>
- <div className="col col--6 col--offset-1">
- <div className={styles.preview}>{content}</div>
+ <div className={styles.feature}>
+ <div className={styles.preview}>{content}</div>
+ <div className={styles.wrapper}>
+ <div className={styles.content}>{children}</div>
</div>
- <div className="col col--4 padding-top--lg">{children}</div>
</div>
);
}
export default function HomepageFeatures(): JSX.Element {
return (
- <section className={styles.features}>
- <div className="container">
- <Feature content={<UI />}>
- <h3>
- Best of <b>Both</b> Worlds
- </h3>
- <p>
- Some things are easier with a mouse. Write animations in TypeScript
- with your favorite IDE; Use a web-based editor to sync them with
- audio.
- </p>
- <p>
- Powered by{' '}
- <a href="https://vitejs.dev/" target="_blank">
- Vite
- </a>
- , a real-time preview of your animation automatically updates upon
- any changes.
- </p>
- <p>
- <a
- className="button button--outline button--lg"
- href="/editor/quickstart"
- target="_blank"
- >
- Try the Editor
- </a>
- </p>
- </Feature>
- <Feature content={<CodeBlock language="tsx">{CodeSample}</CodeBlock>}>
- <h3>
- <b>Procedural</b> for a Change
- </h3>
- <p>
- Let the execution of your code define the animation. Write generator
- functions that describe what should happen - step by step.
- </p>
- <p>
- Focus on duration, speed and acceleration instead of hardcoded key
- frames.
- </p>
- <p>
- <Link
- className="button button--outline button--lg"
- to="/docs/quickstart"
- >
- Learn More
- </Link>
- </p>
- </Feature>
- <Feature
- content={
- <YouTubeVideo src="https://www.youtube.com/embed/R6vQ9VmMz2w" />
- }
- >
- <h3>
- <b>Tested</b> in Combat
- </h3>
- <p>
- The road ahead is still long, but you can already use Motion Canvas
- to create production-quality animations.
- </p>
- <p>
- <a
- className="button button--outline button--lg"
- href="https://github.com/motion-canvas/examples"
- target="_blank"
- >
- Video Source Code
- </a>
- </p>
- </Feature>
- </div>
+ <section>
+ <Feature content={<UI />}>
+ <h3>
+ Best of <b>Both</b> Worlds
+ </h3>
+ <p>
+ Some things are easier with a mouse. Write animations in TypeScript
+ with your favorite IDE; Use a web-based editor to sync them with
+ audio.
+ </p>
+ <p>
+ Powered by{' '}
+ <a href="https://vitejs.dev/" target="_blank">
+ Vite
+ </a>
+ , a real-time preview of your animation automatically updates upon any
+ changes.
+ </p>
+ <p>
+ <a
+ className="button button--outline button--lg"
+ href="/editor/quickstart"
+ target="_blank"
+ >
+ Try the Editor
+ </a>
+ </p>
+ </Feature>
+ <Feature content={<CodeBlock language="tsx">{CodeSample}</CodeBlock>}>
+ <h3>
+ <b>Procedural</b> for a Change
+ </h3>
+ <p>
+ Let the execution of your code define the animation. Write generator
+ functions that describe what should happen - step by step.
+ </p>
+ <p>
+ Focus on duration, speed and acceleration instead of hardcoded key
+ frames.
+ </p>
+ <p>
+ <Link
+ className="button button--outline button--lg"
+ to="/docs/quickstart"
+ >
+ Learn More
+ </Link>
+ </p>
+ </Feature>
+ <Feature
+ content={
+ <YouTubeVideo src="https://www.youtube.com/embed/R6vQ9VmMz2w" />
+ }
+ >
+ <h3>
+ <b>Tested</b> in Combat
+ </h3>
+ <p>
+ The road ahead is still long, but you can already use Motion Canvas to
+ create production-quality animations.
+ </p>
+ <p>
+ <a
+ className="button button--outline button--lg"
+ href="https://github.com/motion-canvas/examples"
+ target="_blank"
+ >
+ Video Source Code
+ </a>
+ </p>
+ </Feature>
</section>
);
}
diff --git a/packages/docs/src/components/Homepage/Header.tsx b/packages/docs/src/components/Homepage/Header.tsx
index 52f0c988..d1630cca 100644
--- a/packages/docs/src/components/Homepage/Header.tsx
+++ b/packages/docs/src/components/Homepage/Header.tsx
@@ -1,24 +1,32 @@
import React from 'react';
import clsx from 'clsx';
-import styles from './styles.module.css';
import Link from '@docusaurus/Link';
+import ThemedImage from '@theme/ThemedImage';
+import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
+import {ThemeConfig} from '@docusaurus/preset-classic';
+import styles from './styles.module.css';
export default function HomepageHeader() {
+ const {siteConfig} = useDocusaurusContext();
+ const logo = (siteConfig.themeConfig as ThemeConfig).navbar.logo;
+
return (
- <>
- <header className={styles.banner}>
+ <div className={clsx(styles.feature, styles.banner)}>
+ <ThemedImage
+ sources={{
+ dark: logo.srcDark,
+ light: logo.src,
+ }}
+ alt={logo.alt}
+ className={clsx(styles.logo, logo.className)}
+ />
+ <div className={styles.content}>
<h1 className={styles.title}>
- Visualize Complex
- <br />
- Ideas <b>Programmatically</b>
- </h1>
- <h1 className={clsx(styles.title, styles.mobile)}>
- Visualize
- <br />
- Complex Ideas
+ <b>Visualize</b> Your
<br />
- <b>Programmatically</b>
+ <b>Ideas</b> With Code
</h1>
+ <p className={styles.description}>{siteConfig.tagline}</p>
<div className={styles.buttons}>
<Link className="button button--primary button--lg" to="/docs">
Get Started
@@ -31,7 +39,7 @@ export default function HomepageHeader() {
Contribute
</a>
</div>
- </header>
- </>
+ </div>
+ </div>
);
}
diff --git a/packages/docs/src/components/Homepage/styles.module.css b/packages/docs/src/components/Homepage/styles.module.css
index e083b596..58e0b913 100644
--- a/packages/docs/src/components/Homepage/styles.module.css
+++ b/packages/docs/src/components/Homepage/styles.module.css
@@ -1,19 +1,31 @@
-.title {
- font-family: var(--ifm-font-family-monospace);
- font-size: min(3rem, 5.5vw);
+.feature {
+ display: flex;
+ flex-direction: column-reverse;
+ align-items: center;
+ padding: 0 var(--ifm-spacing-horizontal);
+ margin-bottom: 4rem;
}
-.title.mobile {
- font-size: min(3rem, 7.5vw);
- display: none;
+.feature b {
+ color: var(--ifm-color-primary);
}
.banner {
- background: transparent;
- padding: 4rem 0;
text-align: center;
- position: relative;
- overflow: hidden;
+ flex-direction: column;
+ margin-top: 2rem;
+}
+
+.logo {
+ max-width: 15rem;
+}
+
+.title {
+ font-size: 2rem;
+}
+
+.description {
+ font-size: 1.25rem;
}
.buttons {
@@ -24,25 +36,14 @@
justify-content: center;
}
-.features {
- display: flex;
- align-items: center;
- margin-bottom: 2rem;
+.wrapper {
width: 100%;
+ max-width: 40rem;
}
-.feature {
- flex-wrap: wrap-reverse;
- padding: 2rem 0;
-}
-
-.title b,
-.feature b {
- color: var(--ifm-color-primary);
-}
-
-.feature.flip {
- flex-direction: row-reverse;
+.content {
+ width: 100%;
+ max-width: 30rem;
}
.preview {
@@ -50,6 +51,8 @@
border-radius: var(--ifm-global-radius);
border: 1px solid var(--ifm-color-emphasis-100);
--ifm-leading: 0;
+ width: 100%;
+ max-width: 40rem;
}
.preview iframe {
@@ -79,35 +82,41 @@
}
}
-@media screen and (max-width: 996px) {
- .feature {
- flex-wrap: wrap-reverse;
- padding: 1rem 0;
+@media screen and (min-width: 640px) {
+ .logo {
+ max-width: 20rem;
}
-}
-@media screen and (max-width: 540px) {
- .banner {
- padding: 2rem;
+ .title {
+ font-size: 3rem;
}
- :global(.button) {
- --ifm-button-size-multiplier: 1;
+ .description {
+ font-size: 1.5rem;
}
}
-@media screen and (max-width: 400px) {
- .title {
- display: none;
+@media screen and (min-width: 960px) {
+ .feature {
+ flex-direction: row;
+ align-items: start;
+ justify-content: center;
+ gap: 2rem;
}
- .title.mobile {
- font-size: min(3rem, 7.5vw);
- display: block;
+ .banner {
+ align-items: center;
+ text-align: start;
+ margin-top: 4rem;
+ margin-bottom: 6rem;
}
.buttons {
- flex-direction: column;
- align-items: stretch;
+ justify-content: start;
+ }
+
+ .wrapper {
+ margin-top: 2rem;
+ max-width: 26rem;
}
}