Skip to content

🎥 Make videos programmatically with React

do more

Jonny Burger69acb7cb4301
diff --git a/packages/docs/src/components/DoMoreHero/DoMoreHero.tsx b/packages/docs/src/components/DoMoreHero/DoMoreHero.tsx
index 5286d0f8c2..0f1a2a03c0 100644
--- a/packages/docs/src/components/DoMoreHero/DoMoreHero.tsx
+++ b/packages/docs/src/components/DoMoreHero/DoMoreHero.tsx
@@ -23,6 +23,7 @@ import {
translateY,
translateZ,
} from "./matrix";
+import styles from "./more.module.css";
const InFrameLogo: React.FC<{
background: string;
@@ -114,41 +115,7 @@ const InFrameLogo: React.FC<{
);
};
-const gradientSteps = [
- 0, 0.013, 0.049, 0.104, 0.175, 0.259, 0.352, 0.45, 0.55, 0.648, 0.741, 0.825,
- 0.896, 0.951, 0.987,
-];
-
-const gradientOpacities = [
- 0, 8.1, 15.5, 22.5, 29, 35.3, 41.2, 47.1, 52.9, 58.8, 64.7, 71, 77.5, 84.5,
- 91.9,
-];
-
-const globalGradientOpacity = 1;
-
export const DoMoreHero: React.FC = () => {
- const { colorMode } = useColorMode();
-
- const targetColor =
- colorMode === "dark" ? "hsl(240deg, 4%, 11%)" : "hsl(0, 0%, 100%)";
-
- const steps =
- colorMode === "dark"
- ? gradientSteps
- .map((g, i) => {
- return `hsla(240deg, 4%, 11%, ${g}) ${
- gradientOpacities[i] * globalGradientOpacity
- }%`;
- })
- .join(", ")
- : gradientSteps
- .map((g, i) => {
- return `hsla(0, 0%, 100%, ${g}) ${
- gradientOpacities[i] * globalGradientOpacity
- }%`;
- })
- .join(", ");
-
const mobile = useMobileLayout();
const theme = useColorMode();
@@ -186,12 +153,12 @@ export const DoMoreHero: React.FC = () => {
inputProps={inputProps}
/>
<div
+ className={styles.gradient}
style={{
height: "20vw",
marginTop: "-20vw",
width: "100%",
position: "absolute",
- backgroundImage: `linear-gradient(to bottom, ${steps}, ${targetColor} 100%)`,
}}
/>
</div>
diff --git a/packages/docs/src/components/DoMoreHero/more.module.css b/packages/docs/src/components/DoMoreHero/more.module.css
new file mode 100644
index 0000000000..7dcc1a6808
--- /dev/null
+++ b/packages/docs/src/components/DoMoreHero/more.module.css
@@ -0,0 +1,7 @@
+.gradient {
+ background-image: linear-gradient(to bottom, hsla(0, 0%, 100%, 0) 0%, hsla(0, 0%, 100%, 0.013) 8.1%, hsla(0, 0%, 100%, 0.049) 15.5%, hsla(0, 0%, 100%, 0.104) 22.5%, hsla(0, 0%, 100%, 0.175) 29%, hsla(0, 0%, 100%, 0.259) 35.3%, hsla(0, 0%, 100%, 0.352) 41.2%, hsla(0, 0%, 100%, 0.45) 47.1%, hsla(0, 0%, 100%, 0.55) 52.9%, hsla(0, 0%, 100%, 0.648) 58.8%, hsla(0, 0%, 100%, 0.741) 64.7%, hsla(0, 0%, 100%, 0.825) 71%, hsla(0, 0%, 100%, 0.896) 77.5%, hsla(0, 0%, 100%, 0.951) 84.5%, hsla(0, 0%, 100%, 0.987) 91.9%, hsl(0, 0%, 100%) 100%);
+}
+
+[data-theme="dark"] .gradient {
+ background-image: linear-gradient(to bottom, hsla(240deg, 4%, 11%, 0) 0%, hsla(240deg, 4%, 11%, 0.013) 8.1%, hsla(240deg, 4%, 11%, 0.049) 15.5%, hsla(240deg, 4%, 11%, 0.104) 22.5%, hsla(240deg, 4%, 11%, 0.175) 29%, hsla(240deg, 4%, 11%, 0.259) 35.3%, hsla(240deg, 4%, 11%, 0.352) 41.2%, hsla(240deg, 4%, 11%, 0.45) 47.1%, hsla(240deg, 4%, 11%, 0.55) 52.9%, hsla(240deg, 4%, 11%, 0.648) 58.8%, hsla(240deg, 4%, 11%, 0.741) 64.7%, hsla(240deg, 4%, 11%, 0.825) 71%, hsla(240deg, 4%, 11%, 0.896) 77.5%, hsla(240deg, 4%, 11%, 0.951) 84.5%, hsla(240deg, 4%, 11%, 0.987) 91.9%, hsl(240deg, 4%, 11%) 100%)
+}
diff --git a/packages/docs/src/pages/4/v4.module.css b/packages/docs/src/pages/4/v4.module.css
index aca277e6bc..aafdcbda9c 100644
--- a/packages/docs/src/pages/4/v4.module.css
+++ b/packages/docs/src/pages/4/v4.module.css
@@ -134,3 +134,4 @@
border: 2px solid black;
margin-top: -30px;
}
+