Skip to content

🎥 Make videos programmatically with React

Fix homepage license video contrast in dark mode

Igor Samokhovetsda6234b0071f
diff --git a/packages/brand/src/HomepageAssets/LicenseQuestionsGraphic.tsx b/packages/brand/src/HomepageAssets/LicenseQuestionsGraphic.tsx
index 5dfb092150..d38883a8c2 100644
--- a/packages/brand/src/HomepageAssets/LicenseQuestionsGraphic.tsx
+++ b/packages/brand/src/HomepageAssets/LicenseQuestionsGraphic.tsx
@@ -9,7 +9,9 @@ import {
useCurrentFrame,
} from 'remotion';
-export const LicenseQuestionsGraphic: React.FC = () => {
+export const LicenseQuestionsGraphic: React.FC<{
+ readonly lineColor: string;
+}> = ({lineColor}) => {
const frame = useCurrentFrame();
return (
@@ -54,7 +56,7 @@ export const LicenseQuestionsGraphic: React.FC = () => {
<path
d="M280 540H590"
fill="none"
- stroke="black"
+ stroke={lineColor}
strokeDasharray="28 28"
strokeDashoffset={interpolate(frame, [55, 132], [0, -138], {
extrapolateLeft: 'clamp',
diff --git a/packages/brand/src/Root.tsx b/packages/brand/src/Root.tsx
index f9579f4974..7d66560531 100644
--- a/packages/brand/src/Root.tsx
+++ b/packages/brand/src/Root.tsx
@@ -407,6 +407,7 @@ export const RemotionRoot: React.FC = () => {
<Composition
id="LicenseQuestionsGraphic"
component={LicenseQuestionsGraphic}
+ defaultProps={{lineColor: 'black'}}
durationInFrames={180}
fps={30}
width={1080}
diff --git a/packages/docs/static/img/license-questions-dark.mp4 b/packages/docs/static/img/license-questions-dark.mp4
new file mode 100644
index 0000000000..766cdbfb02
Binary files /dev/null and b/packages/docs/static/img/license-questions-dark.mp4 differ
diff --git a/packages/docs/static/img/license-questions-dark.webm b/packages/docs/static/img/license-questions-dark.webm
new file mode 100644
index 0000000000..8b050acd02
Binary files /dev/null and b/packages/docs/static/img/license-questions-dark.webm differ
diff --git a/packages/promo-pages/public/img/license-questions-dark.mp4 b/packages/promo-pages/public/img/license-questions-dark.mp4
new file mode 100644
index 0000000000..766cdbfb02
Binary files /dev/null and b/packages/promo-pages/public/img/license-questions-dark.mp4 differ
diff --git a/packages/promo-pages/public/img/license-questions-dark.webm b/packages/promo-pages/public/img/license-questions-dark.webm
new file mode 100644
index 0000000000..8b050acd02
Binary files /dev/null and b/packages/promo-pages/public/img/license-questions-dark.webm differ
diff --git a/packages/promo-pages/src/components/homepage/EvaluateRemotion.tsx b/packages/promo-pages/src/components/homepage/EvaluateRemotion.tsx
index bda302d1ad..017c500c01 100644
--- a/packages/promo-pages/src/components/homepage/EvaluateRemotion.tsx
+++ b/packages/promo-pages/src/components/homepage/EvaluateRemotion.tsx
@@ -1,11 +1,19 @@
import React from 'react';
+import {useColorMode} from './layout/use-color-mode';
import {MakeVideosLinks} from './MakeVideosLinks';
import {useTransparentVideoSource} from './use-transparent-video-source';
const EvaluateRemotionSection: React.FC = () => {
+ const {colorMode} = useColorMode();
const licenseVideoSrc = useTransparentVideoSource({
- fallbackVideoSrc: '/img/license-questions.mp4',
- videoSrc: '/img/license-questions.webm',
+ fallbackVideoSrc:
+ colorMode === 'dark'
+ ? '/img/license-questions-dark.mp4'
+ : '/img/license-questions.mp4',
+ videoSrc:
+ colorMode === 'dark'
+ ? '/img/license-questions-dark.webm'
+ : '/img/license-questions.webm',
});
const expertsVideoSrc = useTransparentVideoSource({
fallbackVideoSrc: '/img/experts-graphic.mp4',