Skip to content

🎥 Make videos programmatically with React

design improvements

Patric Salvisbergaa9fe630b744
diff --git a/packages/cli/src/editor/components/RenderModal/InfoTooltip.tsx b/packages/cli/src/editor/components/RenderModal/InfoTooltip.tsx
index 55d7db2b2b..74f690a7e9 100644
--- a/packages/cli/src/editor/components/RenderModal/InfoTooltip.tsx
+++ b/packages/cli/src/editor/components/RenderModal/InfoTooltip.tsx
@@ -1,5 +1,5 @@
import React, {useMemo} from 'react';
-import {BACKGROUND, BORDER_COLOR} from '../../helpers/colors';
+import {BACKGROUND, BORDER_COLOR, INPUT_BACKGROUND} from '../../helpers/colors';
import {VERTICAL_SCROLLBAR_CLASSNAME} from '../Menu/is-menu-item';
import {SHADOW_TOWARDS_BOTTOM, SHADOW_TOWARDS_TOP} from '../Menu/styles';
@@ -33,6 +33,7 @@ export const InfoTooltip: React.FC<{
border: '0.5px solid ' + BORDER_COLOR,
maxHeight: 200,
overflow: 'auto',
+ borderRadius: '4px',
};
}, [arrowDirection]);
return (
@@ -50,7 +51,7 @@ export const InfoTooltip: React.FC<{
<svg viewBox="0 0 14 7" style={arrowDown}>
<path
d={`M 14 0 L 7 7 L 0 0`}
- fill={BACKGROUND}
+ fill={INPUT_BACKGROUND}
strokeLinecap="butt"
stroke={BORDER_COLOR}
strokeWidth={0.5}
@@ -61,7 +62,7 @@ export const InfoTooltip: React.FC<{
<svg viewBox="0 0 14 7" style={arrowUp}>
<path
d={`M 0 7 L 7 0 L 14 7`}
- fill={BACKGROUND}
+ fill={INPUT_BACKGROUND}
strokeLinecap="butt"
stroke={BORDER_COLOR}
strokeWidth={0.5}
diff --git a/packages/cli/src/editor/components/RenderModal/OptionExplainer.tsx b/packages/cli/src/editor/components/RenderModal/OptionExplainer.tsx
index bb07186b0b..83831dfb22 100644
--- a/packages/cli/src/editor/components/RenderModal/OptionExplainer.tsx
+++ b/packages/cli/src/editor/components/RenderModal/OptionExplainer.tsx
@@ -1,5 +1,6 @@
import type {RemotionOption} from '@remotion/renderer';
import React from 'react';
+import {INPUT_BACKGROUND} from '../../helpers/colors';
import {Spacing} from '../layout';
import {MenuDivider} from '../Menu/MenuDivider';
import {CliCopyButton} from './CliCopyButton';
@@ -8,11 +9,12 @@ const container: React.CSSProperties = {
fontSize: 14,
paddingTop: 10,
paddingBottom: 10,
+ backgroundColor: INPUT_BACKGROUND,
};
const padding: React.CSSProperties = {
- paddingLeft: 12,
- paddingRight: 12,
+ paddingLeft: 20,
+ paddingRight: 20,
};
const title: React.CSSProperties = {
@@ -45,6 +47,16 @@ const infoRowLabel: React.CSSProperties = {
color: 'white',
};
+const flexSpacer: React.CSSProperties = {
+ display: 'flex',
+ flex: 1,
+};
+
+const copyWrapper: React.CSSProperties = {
+ display: 'flex',
+ justifyContent: 'flex-end',
+};
+
export const OptionExplainer: React.FC<{
option: RemotionOption;
}> = ({option}) => {
@@ -53,6 +65,10 @@ export const OptionExplainer: React.FC<{
<div style={padding}>
<div>
<strong style={title}>{option.name}</strong>
+ <Spacing x={1} />
+ <a style={link} href={option.docLink} target="_blank">
+ Docs
+ </a>
</div>
<div style={description}>{option.description}</div>
</div>
@@ -61,21 +77,20 @@ export const OptionExplainer: React.FC<{
<Spacing y={0.5} block />
<div>
<div style={infoRow}>
- <div style={infoRowLabel}>CLI flag:</div>
+ <div style={infoRowLabel}>CLI flag</div>
+ <div style={flexSpacer} />
<code>{option.cliFlag}</code>
- <div style={{display: 'flex', justifyContent: 'flex-end', flex: 1}}>
+ <div style={copyWrapper}>
<CliCopyButton valueToCopy={option.cliFlag} />
</div>
</div>
<div style={infoRow}>
- <div style={infoRowLabel}>Node.JS option:</div>
+ <div style={infoRowLabel}>Node.JS option</div>
+ <div style={flexSpacer} />
<code>{option.ssrName}</code>
+ <Spacing x={3.75} />
</div>
- <div style={infoRow}>
- <a style={link} href={option.docLink} target="_blank">
- Docs
- </a>
- </div>
+ <div style={infoRow} />
</div>
</div>
);
diff --git a/packages/cli/src/editor/components/RenderModal/RenderModalPicture.tsx b/packages/cli/src/editor/components/RenderModal/RenderModalPicture.tsx
index 60887e50a4..e77e013f5c 100644
--- a/packages/cli/src/editor/components/RenderModal/RenderModalPicture.tsx
+++ b/packages/cli/src/editor/components/RenderModal/RenderModalPicture.tsx
@@ -154,10 +154,13 @@ export const RenderModalPicture: React.FC<{
) : null}
{qualityControlType === 'bitrate' && renderMode !== 'still' ? (
<div style={optionRow}>
- <div style={label}>Target video bitrate</div>
- <InfoBubble title="Learn more about this option">
- <OptionExplainer option={BrowserSafeApis.options.videoBitrate} />
- </InfoBubble>
+ <div style={label}>
+ Target video bitrate
+ <InfoBubble title="Learn more about this option">
+ <OptionExplainer option={BrowserSafeApis.options.videoBitrate} />
+ </InfoBubble>
+ </div>
+
<div style={rightRow}>
<div>
<RemotionInput