Skip to content

🎥 Make videos programmatically with React

nice

Jonny Burger5d8a087c7afc
diff --git a/packages/docs/static/img/recorder.png b/packages/docs/static/img/recorder.png
new file mode 100644
index 0000000000..e81d7ef865
Binary files /dev/null and b/packages/docs/static/img/recorder.png differ
diff --git a/packages/docs/static/img/webcodecs.png b/packages/docs/static/img/webcodecs.png
new file mode 100644
index 0000000000..a3a7dd61d8
Binary files /dev/null and b/packages/docs/static/img/webcodecs.png differ
diff --git a/packages/promo-pages/public/img/media-parser.png b/packages/promo-pages/public/img/media-parser.png
new file mode 100644
index 0000000000..e708b54e50
Binary files /dev/null and b/packages/promo-pages/public/img/media-parser.png differ
diff --git a/packages/promo-pages/public/img/recorder.png b/packages/promo-pages/public/img/recorder.png
new file mode 100644
index 0000000000..e81d7ef865
Binary files /dev/null and b/packages/promo-pages/public/img/recorder.png differ
diff --git a/packages/promo-pages/public/img/webcodecs.png b/packages/promo-pages/public/img/webcodecs.png
new file mode 100644
index 0000000000..a3a7dd61d8
Binary files /dev/null and b/packages/promo-pages/public/img/webcodecs.png differ
diff --git a/packages/promo-pages/src/components/Homepage.tsx b/packages/promo-pages/src/components/Homepage.tsx
index c2b78c22bf..ead0bf96af 100644
--- a/packages/promo-pages/src/components/Homepage.tsx
+++ b/packages/promo-pages/src/components/Homepage.tsx
@@ -70,7 +70,7 @@ export const NewLanding: React.FC<{
<br />
<br />
<br />
- <SectionTitle>More video power to developers</SectionTitle>
+ <SectionTitle>Even more video power to developers</SectionTitle>
<MoreVideoPowerSection />
<br />
<br />
diff --git a/packages/promo-pages/src/components/homepage/MoreVideoPowerSection.tsx b/packages/promo-pages/src/components/homepage/MoreVideoPowerSection.tsx
index 4987945e7b..541d762d1c 100644
--- a/packages/promo-pages/src/components/homepage/MoreVideoPowerSection.tsx
+++ b/packages/promo-pages/src/components/homepage/MoreVideoPowerSection.tsx
@@ -1,13 +1,10 @@
import React from 'react';
-import {BlueButton} from './layout/Button';
const StepTitle: React.FC<{
readonly children: React.ReactNode;
}> = ({children}) => {
return (
- <div className="text-center text-xl font-semibold fontbrand mt-2">
- {children}
- </div>
+ <div className="text-left text-xl font-semibold fontbrand">{children}</div>
);
};
@@ -15,7 +12,7 @@ const Subtitle: React.FC<{
readonly children: React.ReactNode;
}> = ({children}) => {
return (
- <div className="text-center text-base fontbrand text-[var(--subtitle)]">
+ <div className="text-left text-base fontbrand text-[var(--subtitle)]">
{children}
</div>
);
@@ -26,56 +23,73 @@ const Pane: React.FC<{
readonly className?: string;
}> = ({children, className}) => {
return (
- <div className={`border-effect bg-pane flex-1 p-3 min-h-[300px] flex flex-col text-center ${className || ''}`}>
+ <div
+ className={`border-effect bg-pane flex-1 flex flex-col ${className || ''}`}
+ >
{children}
</div>
);
};
+const FeatureCard: React.FC<{
+ readonly title: string;
+ readonly subtitle: string;
+ readonly image: string;
+ readonly link: string;
+}> = ({title, subtitle, image, link}) => {
+ return (
+ <a
+ href={link}
+ className="group lg:border-r-2 border-b lg:border-b-0 border-[var(--border)] cursor-pointer hover:bg-[var(--hover)] transition-colors no-underline text-inherit"
+ >
+ <div className="relative">
+ <img src={image} alt={title} className="w-full h-auto" />
+ </div>
+ <div className="p-4">
+ <div className="flex items-center gap-2">
+ <StepTitle>{title}</StepTitle>
+ <svg
+ width="16"
+ viewBox="0 0 448 512"
+ fill="currentColor"
+ className="opacity-0 group-hover:opacity-100 transition-opacity"
+ >
+ <path d="M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z" />
+ </svg>
+ </div>
+ <Subtitle>{subtitle}</Subtitle>
+ <br />
+ <div className="flex-1" />
+ </div>
+ </a>
+ );
+};
+
export const MoreVideoPowerSection: React.FC = () => {
return (
<div className="w-full">
- <div className={'flex flex-col lg:flex-row'}>
- <Pane className="lg:border-r border-black">
- <StepTitle>Media Parser</StepTitle>
- <Subtitle>A new multimedia library for the web</Subtitle>
- <br />
- <div className="flex-1" />
- <div>
- <a href="/media-parser" style={{textDecoration: 'none'}}>
- <BlueButton className="w-full" loading={false} size="sm">
- Learn more
- </BlueButton>
- </a>
- </div>
- </Pane>
- <Pane className="lg:border-r border-black border-t lg:border-t-0">
- <StepTitle>WebCodecs</StepTitle>
- <Subtitle>Read, process, transform and create videos on the frontend</Subtitle>
- <br />
- <div className="flex-1" />
- <div>
- <a href="/webcodecs" style={{textDecoration: 'none'}}>
- <BlueButton className="w-full" loading={false} size="sm">
- Learn more
- </BlueButton>
- </a>
- </div>
- </Pane>
- <Pane className="border-t lg:border-t-0">
- <StepTitle>Recorder</StepTitle>
- <Subtitle>Produce engaging screencasts end-to-end in JavaScript</Subtitle>
- <br />
- <div className="flex-1" />
- <div>
- <a href="/recorder" style={{textDecoration: 'none'}}>
- <BlueButton className="w-full" loading={false} size="sm">
- Learn more
- </BlueButton>
- </a>
- </div>
- </Pane>
- </div>
+ <Pane className="overflow-hidden">
+ <div className="grid grid-cols-1 lg:grid-cols-3 h-full">
+ <FeatureCard
+ title="Media Parser"
+ subtitle="A new multimedia library for the web"
+ image="/img/media-parser.png"
+ link="/media-parser"
+ />
+ <FeatureCard
+ title="WebCodecs"
+ subtitle="Read, process, transform and create videos on the frontend"
+ image="/img/webcodecs.png"
+ link="/webcodecs"
+ />
+ <FeatureCard
+ title="Recorder"
+ subtitle="Produce engaging screencasts end-to-end in JavaScript"
+ image="/img/recorder.png"
+ link="/recorder"
+ />
+ </div>
+ </Pane>
</div>
);
-};
\ No newline at end of file
+};
diff --git a/packages/promo-pages/src/components/homepage/NewsletterButton.tsx b/packages/promo-pages/src/components/homepage/NewsletterButton.tsx
index f4ced6fe02..d655c63cbe 100644
--- a/packages/promo-pages/src/components/homepage/NewsletterButton.tsx
+++ b/packages/promo-pages/src/components/homepage/NewsletterButton.tsx
@@ -44,7 +44,7 @@ export const NewsletterButton: React.FC<{}> = () => {
<div>
<div className="flex flex-col">
<div className={'w-full'}>
- <div className={'border-effect bg-pane flex flex-col flex-1 p-5'}>
+ <div className={'flex flex-col flex-1'}>
<div className={'text-2xl font-bold fontbrand'}>Newsletter</div>
<form
onSubmit={handleSubmit}