@remotion/promo-pages 4.0.260 → 5.0.0-canary.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Homepage.js +2 -4
- package/package.json +52 -48
- package/.turbo/turbo-lint.log +0 -5
- package/.turbo/turbo-make.log +0 -8
- package/LICENSE.md +0 -49
- package/bundle.ts +0 -46
- package/eslint.config.mjs +0 -7
- package/index.html +0 -13
- package/public/fire.mp3 +0 -0
- package/public/img/cluster.png +0 -0
- package/public/img/code-sample-new.png +0 -0
- package/public/img/freelancers/alex.jpeg +0 -0
- package/public/img/freelancers/antoine.jpeg +0 -0
- package/public/img/freelancers/ayush.png +0 -0
- package/public/img/freelancers/benjamin.jpeg +0 -0
- package/public/img/freelancers/default.png +0 -0
- package/public/img/freelancers/florent.jpeg +0 -0
- package/public/img/freelancers/karel.jpeg +0 -0
- package/public/img/freelancers/lorenzo.jpeg +0 -0
- package/public/img/freelancers/mickael.jpeg +0 -0
- package/public/img/freelancers/mohit.jpeg +0 -0
- package/public/img/freelancers/pramod.jpg +0 -0
- package/public/img/freelancers/pranav.jpg +0 -0
- package/public/img/freelancers/rahul.png +0 -0
- package/public/img/freelancers/ray.jpeg +0 -0
- package/public/img/freelancers/stephen.png +0 -0
- package/public/img/freelancers/umungo.png +0 -0
- package/public/img/freelancers/yehor.jpeg +0 -0
- package/public/img/gt-planar-black.woff2 +0 -0
- package/public/img/gt-planar-bold.woff2 +0 -0
- package/public/img/gt-planar-medium.woff2 +0 -0
- package/public/img/gt-planar-regular.woff2 +0 -0
- package/public/img/logo-small.png +0 -0
- package/public/img/mp4.png +0 -0
- package/public/img/player-demo.mp4 +0 -0
- package/public/img/player-example-dark.png +0 -0
- package/public/img/player-example.png +0 -0
- package/public/img/writeinreact.png +0 -0
- package/public/partyhorn.mp3 +0 -0
- package/public/sad.mp3 +0 -0
- package/src/cn.ts +0 -6
- package/src/components/Homepage.tsx +0 -88
- package/src/components/homepage/BackgroundAnimation.tsx +0 -108
- package/src/components/homepage/ChooseTemplate.tsx +0 -57
- package/src/components/homepage/CodeExample.tsx +0 -89
- package/src/components/homepage/CommunityStats.tsx +0 -54
- package/src/components/homepage/CommunityStatsItems.tsx +0 -304
- package/src/components/homepage/Counter.tsx +0 -110
- package/src/components/homepage/Demo/Card.tsx +0 -273
- package/src/components/homepage/Demo/Cards.tsx +0 -129
- package/src/components/homepage/Demo/Comp.tsx +0 -157
- package/src/components/homepage/Demo/CurrentCountry.tsx +0 -97
- package/src/components/homepage/Demo/DemoError.tsx +0 -18
- package/src/components/homepage/Demo/DemoErrorIcon.tsx +0 -32
- package/src/components/homepage/Demo/DemoRender.tsx +0 -166
- package/src/components/homepage/Demo/DigitWheel.tsx +0 -179
- package/src/components/homepage/Demo/DisplayedEmoji.tsx +0 -81
- package/src/components/homepage/Demo/DoneCheckmark.tsx +0 -39
- package/src/components/homepage/Demo/DownloadNudge.tsx +0 -62
- package/src/components/homepage/Demo/DragAndDropNudge.tsx +0 -57
- package/src/components/homepage/Demo/EmojiCard.tsx +0 -198
- package/src/components/homepage/Demo/Minus.tsx +0 -21
- package/src/components/homepage/Demo/PlayPauseButton.tsx +0 -66
- package/src/components/homepage/Demo/PlayerControls.tsx +0 -48
- package/src/components/homepage/Demo/PlayerSeekBar.tsx +0 -325
- package/src/components/homepage/Demo/PlayerVolume.tsx +0 -83
- package/src/components/homepage/Demo/Progress.tsx +0 -38
- package/src/components/homepage/Demo/Spinner.tsx +0 -60
- package/src/components/homepage/Demo/Switcher.tsx +0 -54
- package/src/components/homepage/Demo/Temperature.tsx +0 -44
- package/src/components/homepage/Demo/TemperatureNumber.tsx +0 -68
- package/src/components/homepage/Demo/ThemeNudge.tsx +0 -72
- package/src/components/homepage/Demo/TimeDisplay.tsx +0 -43
- package/src/components/homepage/Demo/TrendingRepos.tsx +0 -106
- package/src/components/homepage/Demo/icons.tsx +0 -114
- package/src/components/homepage/Demo/index.tsx +0 -158
- package/src/components/homepage/Demo/math.ts +0 -43
- package/src/components/homepage/Demo/types.ts +0 -6
- package/src/components/homepage/Editor.tsx +0 -67
- package/src/components/homepage/EvaluateRemotion.tsx +0 -92
- package/src/components/homepage/FreePricing.tsx +0 -295
- package/src/components/homepage/GetStartedStrip.tsx +0 -77
- package/src/components/homepage/GitHubButton.tsx +0 -23
- package/src/components/homepage/IconForTemplate.tsx +0 -154
- package/src/components/homepage/IfYouKnowReact.tsx +0 -29
- package/src/components/homepage/InfoTooltip.tsx +0 -25
- package/src/components/homepage/MoreTemplatesButton.tsx +0 -29
- package/src/components/homepage/MuxVideo.tsx +0 -68
- package/src/components/homepage/NewsletterButton.tsx +0 -88
- package/src/components/homepage/Pricing.tsx +0 -49
- package/src/components/homepage/PricingBulletPoint.tsx +0 -50
- package/src/components/homepage/RealMp4Videos.tsx +0 -50
- package/src/components/homepage/Spacer.tsx +0 -5
- package/src/components/homepage/TemplateIcon.tsx +0 -36
- package/src/components/homepage/TextInput.tsx +0 -62
- package/src/components/homepage/TrustedByBanner.tsx +0 -194
- package/src/components/homepage/VideoApps.tsx +0 -231
- package/src/components/homepage/VideoAppsShowcase.tsx +0 -276
- package/src/components/homepage/VideoAppsTitle.tsx +0 -24
- package/src/components/homepage/VideoPlayerWithControls.tsx +0 -188
- package/src/components/homepage/WriteInReact.tsx +0 -34
- package/src/components/homepage/YouAreHere.tsx +0 -30
- package/src/components/homepage/custom.css +0 -57
- package/src/components/homepage/layout/Button.tsx +0 -93
- package/src/components/homepage/layout/colors.ts +0 -17
- package/src/components/homepage/layout/use-color-mode.tsx +0 -44
- package/src/components/homepage/layout/use-el-size.ts +0 -51
- package/src/components/homepage/layout/use-mobile-layout.ts +0 -8
- package/src/components/homepage/video-player.css +0 -24
- package/src/components/icons/blank.tsx +0 -13
- package/src/components/icons/clone.tsx +0 -10
- package/src/components/icons/code-hike.tsx +0 -15
- package/src/components/icons/cubes.tsx +0 -13
- package/src/components/icons/js.tsx +0 -17
- package/src/components/icons/next.tsx +0 -64
- package/src/components/icons/overlay.tsx +0 -24
- package/src/components/icons/remix.tsx +0 -24
- package/src/components/icons/skia.tsx +0 -13
- package/src/components/icons/stargazer.tsx +0 -13
- package/src/components/icons/still.tsx +0 -13
- package/src/components/icons/tailwind.tsx +0 -22
- package/src/components/icons/tiktok.tsx +0 -13
- package/src/components/icons/ts.tsx +0 -18
- package/src/components/icons/tts.tsx +0 -13
- package/src/components/icons/undo.tsx +0 -11
- package/src/components/icons/waveform.tsx +0 -13
- package/src/fonts.css +0 -30
- package/src/index.css +0 -74
- package/src/main.tsx +0 -12
- package/tsconfig.json +0 -15
- package/vite.config.ts +0 -9
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import type {EnhancedErrorInfo} from '@remotion/lambda';
|
|
2
|
-
import React, {useCallback} from 'react';
|
|
3
|
-
import {z} from 'zod';
|
|
4
|
-
import {PALETTE} from '../layout/colors';
|
|
5
|
-
import {DemoErrorIcon} from './DemoErrorIcon';
|
|
6
|
-
import {DoneCheckmark} from './DoneCheckmark';
|
|
7
|
-
import {Progress} from './Progress';
|
|
8
|
-
import {Spinner} from './Spinner';
|
|
9
|
-
|
|
10
|
-
const countryPath = z.object({
|
|
11
|
-
d: z.string(),
|
|
12
|
-
class: z.string(),
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const remoteData = z.object({
|
|
16
|
-
repos: z.array(z.string()),
|
|
17
|
-
date: z.string().or(z.number()),
|
|
18
|
-
temperatureInCelsius: z.number(),
|
|
19
|
-
countryLabel: z.string(),
|
|
20
|
-
countryPaths: z.array(countryPath),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const location = z.object({
|
|
24
|
-
country: z.string(),
|
|
25
|
-
city: z.string(),
|
|
26
|
-
latitude: z.number().or(z.string()),
|
|
27
|
-
longitude: z.number().or(z.string()),
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
31
|
-
const data = z.object({
|
|
32
|
-
trending: remoteData,
|
|
33
|
-
location,
|
|
34
|
-
emojiIndex: z.number(),
|
|
35
|
-
theme: z.enum(['light', 'dark']),
|
|
36
|
-
cardOrder: z.array(z.number()),
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
type State =
|
|
40
|
-
| {
|
|
41
|
-
type: 'idle';
|
|
42
|
-
}
|
|
43
|
-
| {
|
|
44
|
-
type: 'invoking';
|
|
45
|
-
}
|
|
46
|
-
| {
|
|
47
|
-
type: 'progress';
|
|
48
|
-
progress: number;
|
|
49
|
-
}
|
|
50
|
-
| {
|
|
51
|
-
type: 'done';
|
|
52
|
-
}
|
|
53
|
-
| {
|
|
54
|
-
type: 'error';
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const style: React.CSSProperties = {
|
|
58
|
-
appearance: 'none',
|
|
59
|
-
border: 'none',
|
|
60
|
-
outline: 'none',
|
|
61
|
-
backgroundColor: 'transparent',
|
|
62
|
-
cursor: 'pointer',
|
|
63
|
-
width: 55,
|
|
64
|
-
height: 50,
|
|
65
|
-
display: 'flex',
|
|
66
|
-
alignItems: 'center',
|
|
67
|
-
justifyContent: 'center',
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export const RenderButton: React.FC<{
|
|
71
|
-
readonly renderData: z.infer<typeof data> | null;
|
|
72
|
-
readonly onError: () => void;
|
|
73
|
-
}> = ({renderData, onError}) => {
|
|
74
|
-
const [state, setState] = React.useState<State>({
|
|
75
|
-
type: 'idle',
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const triggerRender = useCallback(async () => {
|
|
79
|
-
if (renderData === null) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
try {
|
|
84
|
-
setState({type: 'invoking'});
|
|
85
|
-
|
|
86
|
-
const {renderId, bucketName} = await (
|
|
87
|
-
await fetch('https://bugs.remotion.dev/render', {
|
|
88
|
-
method: 'post',
|
|
89
|
-
headers: {'content-type': 'application/json'},
|
|
90
|
-
body: JSON.stringify(renderData),
|
|
91
|
-
})
|
|
92
|
-
).json();
|
|
93
|
-
setState({type: 'progress', progress: 0});
|
|
94
|
-
|
|
95
|
-
let done = false;
|
|
96
|
-
|
|
97
|
-
while (!done) {
|
|
98
|
-
const progress = (await (
|
|
99
|
-
await fetch('https://bugs.remotion.dev/progress', {
|
|
100
|
-
method: 'post',
|
|
101
|
-
headers: {'content-type': 'application/json'},
|
|
102
|
-
body: JSON.stringify({renderId, bucketName}),
|
|
103
|
-
})
|
|
104
|
-
).json()) as {
|
|
105
|
-
overallProgress: number;
|
|
106
|
-
outputFile: string | null;
|
|
107
|
-
errors: EnhancedErrorInfo[];
|
|
108
|
-
fatalErrorEncountered: boolean;
|
|
109
|
-
};
|
|
110
|
-
setState({
|
|
111
|
-
type: 'progress',
|
|
112
|
-
progress: progress.overallProgress,
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
if (progress.outputFile) {
|
|
116
|
-
done = true;
|
|
117
|
-
const a = document.createElement('a');
|
|
118
|
-
a.href = progress.outputFile;
|
|
119
|
-
a.download = 'remotion.dev.mp4';
|
|
120
|
-
a.click();
|
|
121
|
-
setState({type: 'done'});
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (progress.fatalErrorEncountered) {
|
|
125
|
-
done = true;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
} catch {
|
|
129
|
-
setState({type: 'error'});
|
|
130
|
-
onError();
|
|
131
|
-
}
|
|
132
|
-
}, [onError, renderData]);
|
|
133
|
-
|
|
134
|
-
return (
|
|
135
|
-
<button
|
|
136
|
-
type="button"
|
|
137
|
-
onClick={triggerRender}
|
|
138
|
-
style={style}
|
|
139
|
-
disabled={!renderData || state.type !== 'idle'}
|
|
140
|
-
>
|
|
141
|
-
{state.type === 'error' ? (
|
|
142
|
-
<DemoErrorIcon />
|
|
143
|
-
) : state.type === 'done' ? (
|
|
144
|
-
<DoneCheckmark />
|
|
145
|
-
) : state.type === 'progress' ? (
|
|
146
|
-
<Progress progress={state.progress} />
|
|
147
|
-
) : state.type === 'invoking' ? (
|
|
148
|
-
<Spinner size={20} duration={1} />
|
|
149
|
-
) : (
|
|
150
|
-
<svg
|
|
151
|
-
style={{
|
|
152
|
-
width: 18,
|
|
153
|
-
opacity: renderData ? 1 : 0.5,
|
|
154
|
-
}}
|
|
155
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
156
|
-
viewBox="0 0 384 512"
|
|
157
|
-
>
|
|
158
|
-
<path
|
|
159
|
-
fill={PALETTE.TEXT_COLOR}
|
|
160
|
-
d="M214.6 342.6L192 365.3l-22.6-22.6-128-128L18.7 192 64 146.7l22.6 22.6L160 242.7 160 64l0-32 64 0 0 32 0 178.7 73.4-73.4L320 146.7 365.3 192l-22.6 22.6-128 128zM32 416l320 0 32 0 0 64-32 0L32 480 0 480l0-64 32 0z"
|
|
161
|
-
/>
|
|
162
|
-
</svg>
|
|
163
|
-
)}
|
|
164
|
-
</button>
|
|
165
|
-
);
|
|
166
|
-
};
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type {SpringConfig} from 'remotion';
|
|
3
|
-
import {
|
|
4
|
-
AbsoluteFill,
|
|
5
|
-
interpolate,
|
|
6
|
-
spring,
|
|
7
|
-
useCurrentFrame,
|
|
8
|
-
useVideoConfig,
|
|
9
|
-
} from 'remotion';
|
|
10
|
-
import {Minus} from './Minus';
|
|
11
|
-
|
|
12
|
-
const DURATION = 25;
|
|
13
|
-
|
|
14
|
-
const items = 10;
|
|
15
|
-
|
|
16
|
-
export const NUM_WIDTH = 36;
|
|
17
|
-
|
|
18
|
-
export const Wheel: React.FC<{
|
|
19
|
-
readonly delay: number;
|
|
20
|
-
readonly digits: number[];
|
|
21
|
-
readonly renderDigit: (i: number) => React.ReactNode;
|
|
22
|
-
readonly isLeadingDigit: boolean;
|
|
23
|
-
readonly isNegative: boolean[];
|
|
24
|
-
}> = ({delay, digits, renderDigit, isLeadingDigit, isNegative}) => {
|
|
25
|
-
const frame = useCurrentFrame();
|
|
26
|
-
const {fps} = useVideoConfig();
|
|
27
|
-
|
|
28
|
-
const singleDur = DURATION;
|
|
29
|
-
|
|
30
|
-
const progressesMaker = (
|
|
31
|
-
springConfig: Partial<SpringConfig>,
|
|
32
|
-
durationInFrames: number,
|
|
33
|
-
) =>
|
|
34
|
-
new Array(digits.length - 1).fill(true).map((_, i) => {
|
|
35
|
-
const current = digits[i];
|
|
36
|
-
const next = digits[i + 1];
|
|
37
|
-
if (current === next) {
|
|
38
|
-
return 1;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return spring({
|
|
42
|
-
fps,
|
|
43
|
-
frame,
|
|
44
|
-
config: springConfig,
|
|
45
|
-
durationInFrames,
|
|
46
|
-
delay: i * 50 + delay,
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const progresses = progressesMaker(
|
|
51
|
-
{
|
|
52
|
-
mass: 0.7,
|
|
53
|
-
damping: 12,
|
|
54
|
-
},
|
|
55
|
-
singleDur,
|
|
56
|
-
);
|
|
57
|
-
const softProgresses = progressesMaker(
|
|
58
|
-
{
|
|
59
|
-
damping: 200,
|
|
60
|
-
},
|
|
61
|
-
singleDur / 2,
|
|
62
|
-
);
|
|
63
|
-
|
|
64
|
-
const rotations = digits.map((d) => 1 / items + d / 10);
|
|
65
|
-
|
|
66
|
-
const offsets = rotations.map((r, i) => {
|
|
67
|
-
const next = rotations[i + 1];
|
|
68
|
-
if (next === undefined) {
|
|
69
|
-
return 0;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return next - r;
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
const opacity = isLeadingDigit
|
|
76
|
-
? interpolate(
|
|
77
|
-
softProgresses.reduce((a, b) => a + b, 0),
|
|
78
|
-
new Array(digits.length).fill(true).map((_, i) => i),
|
|
79
|
-
digits.map((digit) => (digit === 0 ? 0 : 1)),
|
|
80
|
-
)
|
|
81
|
-
: 1;
|
|
82
|
-
|
|
83
|
-
const minusSignOpacity = isLeadingDigit
|
|
84
|
-
? interpolate(
|
|
85
|
-
softProgresses.reduce((a, b) => a + b, 0),
|
|
86
|
-
new Array(digits.length).fill(true).map((_, i) => i),
|
|
87
|
-
isNegative.map((negative) => (negative ? 1 : 0)),
|
|
88
|
-
)
|
|
89
|
-
: 1;
|
|
90
|
-
|
|
91
|
-
const minusSignMarginLeft = interpolate(minusSignOpacity, [0, 1], [10, 0]);
|
|
92
|
-
|
|
93
|
-
const shiftLeft = isLeadingDigit
|
|
94
|
-
? interpolate(
|
|
95
|
-
softProgresses.reduce((a, b) => a + b, 0),
|
|
96
|
-
new Array(digits.length).fill(true).map((_, i) => i),
|
|
97
|
-
digits.map((digit) => (digit === 0 ? -40 : 0)),
|
|
98
|
-
)
|
|
99
|
-
: 1;
|
|
100
|
-
|
|
101
|
-
const rotation =
|
|
102
|
-
progresses
|
|
103
|
-
.map((p, i) => {
|
|
104
|
-
return p * offsets[i];
|
|
105
|
-
})
|
|
106
|
-
.reduce((a, b) => a + b, 0) + rotations[0];
|
|
107
|
-
|
|
108
|
-
return (
|
|
109
|
-
<div
|
|
110
|
-
style={{
|
|
111
|
-
position: 'relative',
|
|
112
|
-
width: NUM_WIDTH,
|
|
113
|
-
display: 'inline-block',
|
|
114
|
-
height: 80,
|
|
115
|
-
marginLeft: shiftLeft,
|
|
116
|
-
}}
|
|
117
|
-
>
|
|
118
|
-
{isLeadingDigit ? (
|
|
119
|
-
<Minus
|
|
120
|
-
minusSignOpacity={minusSignOpacity}
|
|
121
|
-
leftOffset={shiftLeft + minusSignMarginLeft}
|
|
122
|
-
/>
|
|
123
|
-
) : null}
|
|
124
|
-
<AbsoluteFill
|
|
125
|
-
style={{
|
|
126
|
-
perspective: 5000,
|
|
127
|
-
maskImage: `linear-gradient(to bottom, transparent 0%, #000 28%, #000 80%, transparent 100%)`,
|
|
128
|
-
WebkitMaskImage: `linear-gradient(to bottom, transparent 0%, #000 28%, #000 80%, transparent 100%)`,
|
|
129
|
-
}}
|
|
130
|
-
>
|
|
131
|
-
{new Array(items).fill(true).map((_, i) => {
|
|
132
|
-
const index = i / items + rotation;
|
|
133
|
-
|
|
134
|
-
const z = Math.cos(index * -Math.PI * 2) * 120;
|
|
135
|
-
const y = Math.sin(index * Math.PI * 2) * -120;
|
|
136
|
-
const r = interpolate(index, [0, 1], [0, Math.PI * 2]);
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<AbsoluteFill
|
|
140
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
141
|
-
key={i}
|
|
142
|
-
style={{
|
|
143
|
-
justifyContent: 'center',
|
|
144
|
-
alignItems: 'center',
|
|
145
|
-
fontSize: 60,
|
|
146
|
-
fontVariationSettings: `"wght" 400`,
|
|
147
|
-
transform: `translateZ(${z}px) translateY(${y}px) rotateX(${r}deg)`,
|
|
148
|
-
backfaceVisibility: 'hidden',
|
|
149
|
-
perspective: 1000,
|
|
150
|
-
}}
|
|
151
|
-
>
|
|
152
|
-
<div
|
|
153
|
-
style={{
|
|
154
|
-
transform: `rotateX(-${r}rad)`,
|
|
155
|
-
backfaceVisibility: 'hidden',
|
|
156
|
-
display: 'flex',
|
|
157
|
-
flexDirection: 'row',
|
|
158
|
-
alignItems: 'center',
|
|
159
|
-
justifyContent: 'center',
|
|
160
|
-
opacity,
|
|
161
|
-
}}
|
|
162
|
-
>
|
|
163
|
-
<div
|
|
164
|
-
style={{
|
|
165
|
-
lineHeight: 1,
|
|
166
|
-
display: 'inline',
|
|
167
|
-
fontFeatureSettings: "'ss03' on",
|
|
168
|
-
}}
|
|
169
|
-
>
|
|
170
|
-
{renderDigit(i)}
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
</AbsoluteFill>
|
|
174
|
-
);
|
|
175
|
-
})}
|
|
176
|
-
</AbsoluteFill>
|
|
177
|
-
</div>
|
|
178
|
-
);
|
|
179
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type {EmojiName} from '@remotion/animated-emoji';
|
|
2
|
-
import type {Lottie, LottieAnimationData} from '@remotion/lottie';
|
|
3
|
-
import React, {useEffect, useMemo, useState} from 'react';
|
|
4
|
-
import {
|
|
5
|
-
cancelRender,
|
|
6
|
-
continueRender,
|
|
7
|
-
delayRender,
|
|
8
|
-
useVideoConfig,
|
|
9
|
-
} from 'remotion';
|
|
10
|
-
|
|
11
|
-
type Data = {
|
|
12
|
-
Lottie: typeof Lottie;
|
|
13
|
-
duration: number;
|
|
14
|
-
data: LottieAnimationData;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const DisplayedEmoji: React.FC<{
|
|
18
|
-
readonly emoji: EmojiName;
|
|
19
|
-
}> = ({emoji}) => {
|
|
20
|
-
const [data, setData] = useState<Data | null>(null);
|
|
21
|
-
const {durationInFrames, fps} = useVideoConfig();
|
|
22
|
-
|
|
23
|
-
const src = useMemo(() => {
|
|
24
|
-
if (emoji === 'melting') {
|
|
25
|
-
return 'https://fonts.gstatic.com/s/e/notoemoji/latest/1fae0/lottie.json';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
if (emoji === 'partying-face') {
|
|
29
|
-
return 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f973/lottie.json';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (emoji === 'fire') {
|
|
33
|
-
return 'https://fonts.gstatic.com/s/e/notoemoji/latest/1f525/lottie.json';
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
throw new Error('Unknown emoji');
|
|
37
|
-
}, [emoji]);
|
|
38
|
-
|
|
39
|
-
const [handle] = useState(() => delayRender());
|
|
40
|
-
|
|
41
|
-
useEffect(() => {
|
|
42
|
-
Promise.all([
|
|
43
|
-
import('@remotion/lottie'),
|
|
44
|
-
fetch(src).then((res) => res.json()),
|
|
45
|
-
])
|
|
46
|
-
.then(([{Lottie, getLottieMetadata}, json]) => {
|
|
47
|
-
setData({
|
|
48
|
-
Lottie,
|
|
49
|
-
duration: getLottieMetadata(json)?.durationInSeconds as number,
|
|
50
|
-
data: json,
|
|
51
|
-
});
|
|
52
|
-
continueRender(handle);
|
|
53
|
-
})
|
|
54
|
-
.catch((err) => {
|
|
55
|
-
cancelRender(err);
|
|
56
|
-
});
|
|
57
|
-
}, [handle, src]);
|
|
58
|
-
|
|
59
|
-
if (!data) {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const animDurtion = data.duration;
|
|
64
|
-
const ratio = durationInFrames / fps / animDurtion;
|
|
65
|
-
const closestInteger = ratio;
|
|
66
|
-
const closestRatio = closestInteger / ratio;
|
|
67
|
-
|
|
68
|
-
return (
|
|
69
|
-
<data.Lottie
|
|
70
|
-
style={{
|
|
71
|
-
height: 100,
|
|
72
|
-
width: '100%',
|
|
73
|
-
display: 'flex',
|
|
74
|
-
justifyContent: 'center',
|
|
75
|
-
}}
|
|
76
|
-
loop
|
|
77
|
-
animationData={data.data}
|
|
78
|
-
playbackRate={closestRatio}
|
|
79
|
-
/>
|
|
80
|
-
);
|
|
81
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {PALETTE} from '../layout/colors';
|
|
3
|
-
|
|
4
|
-
export const DoneCheckmark: React.FC = () => {
|
|
5
|
-
return (
|
|
6
|
-
<div
|
|
7
|
-
style={{
|
|
8
|
-
backgroundColor: PALETTE.BRAND,
|
|
9
|
-
height: 26,
|
|
10
|
-
width: 26,
|
|
11
|
-
borderRadius: 13,
|
|
12
|
-
display: 'flex',
|
|
13
|
-
alignItems: 'center',
|
|
14
|
-
justifyContent: 'center',
|
|
15
|
-
animation: 'jump 0.2s ease-out',
|
|
16
|
-
}}
|
|
17
|
-
>
|
|
18
|
-
<svg
|
|
19
|
-
viewBox="0 0 20 20"
|
|
20
|
-
fill="none"
|
|
21
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
22
|
-
style={{
|
|
23
|
-
flexShrink: 0,
|
|
24
|
-
width: 26,
|
|
25
|
-
}}
|
|
26
|
-
>
|
|
27
|
-
<circle cx="10" cy="10" r="10" fill="#0B84F3" />
|
|
28
|
-
<path
|
|
29
|
-
d="M14.7908 7.20505C15.0697 7.47844 15.0697 7.92243 14.7908 8.19583L9.07711 13.795C8.79813 14.0683 8.34505 14.0683 8.06606 13.795L5.20924 10.9954C4.93025 10.722 4.93025 10.278 5.20924 10.0046C5.48823 9.73121 5.9413 9.73121 6.22029 10.0046L8.5727 12.3077L13.7819 7.20505C14.0609 6.93165 14.514 6.93165 14.793 7.20505H14.7908Z"
|
|
30
|
-
fill="white"
|
|
31
|
-
style={{
|
|
32
|
-
transform: 'scale(1.2)',
|
|
33
|
-
transformOrigin: 'center',
|
|
34
|
-
}}
|
|
35
|
-
/>
|
|
36
|
-
</svg>
|
|
37
|
-
</div>
|
|
38
|
-
);
|
|
39
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {FONTS} from '../layout/colors';
|
|
3
|
-
|
|
4
|
-
const origWidth = 77;
|
|
5
|
-
const scale = 0.4;
|
|
6
|
-
|
|
7
|
-
const Icon: React.FC = () => {
|
|
8
|
-
return (
|
|
9
|
-
<svg
|
|
10
|
-
style={{
|
|
11
|
-
width: origWidth * scale,
|
|
12
|
-
}}
|
|
13
|
-
viewBox="0 0 77 160"
|
|
14
|
-
fill="none"
|
|
15
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
16
|
-
>
|
|
17
|
-
<path
|
|
18
|
-
d="M5 154.5C51 121 79 81 69 5"
|
|
19
|
-
stroke="currentColor"
|
|
20
|
-
strokeWidth="8"
|
|
21
|
-
strokeLinecap="round"
|
|
22
|
-
/>
|
|
23
|
-
</svg>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const DownloadNudge: React.FC = () => {
|
|
28
|
-
return (
|
|
29
|
-
<div
|
|
30
|
-
style={{
|
|
31
|
-
position: 'relative',
|
|
32
|
-
flexDirection: 'row',
|
|
33
|
-
display: 'flex',
|
|
34
|
-
justifyContent: 'flex-end',
|
|
35
|
-
textAlign: 'right',
|
|
36
|
-
paddingRight: 22,
|
|
37
|
-
paddingTop: 20,
|
|
38
|
-
}}
|
|
39
|
-
>
|
|
40
|
-
<div>
|
|
41
|
-
<Icon />
|
|
42
|
-
<div
|
|
43
|
-
style={{
|
|
44
|
-
fontFamily: FONTS.GTPLANAR,
|
|
45
|
-
fontSize: 15,
|
|
46
|
-
width: 280,
|
|
47
|
-
position: 'absolute',
|
|
48
|
-
right: 70,
|
|
49
|
-
top: 60,
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
Export the video using
|
|
53
|
-
<br />{' '}
|
|
54
|
-
<a href="/lambda" className="bluelink">
|
|
55
|
-
Remotion Lambda
|
|
56
|
-
</a>
|
|
57
|
-
.
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
);
|
|
62
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {FONTS, PALETTE} from '../layout/colors';
|
|
3
|
-
|
|
4
|
-
const origWidth = 37;
|
|
5
|
-
const scale = 0.4;
|
|
6
|
-
|
|
7
|
-
export const Icon: React.FC = () => {
|
|
8
|
-
return (
|
|
9
|
-
<svg
|
|
10
|
-
style={{
|
|
11
|
-
width: origWidth * scale,
|
|
12
|
-
overflow: 'visible',
|
|
13
|
-
}}
|
|
14
|
-
viewBox="0 0 37 59"
|
|
15
|
-
fill="none"
|
|
16
|
-
>
|
|
17
|
-
<path
|
|
18
|
-
d="M5.00003 5C5.00002 36.5 16 44 32.0002 54"
|
|
19
|
-
stroke={PALETTE.TEXT_COLOR}
|
|
20
|
-
strokeWidth="8"
|
|
21
|
-
strokeLinecap="round"
|
|
22
|
-
/>
|
|
23
|
-
</svg>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export const DragAndDropNudge: React.FC = () => {
|
|
28
|
-
return (
|
|
29
|
-
<div
|
|
30
|
-
style={{
|
|
31
|
-
position: 'absolute',
|
|
32
|
-
flexDirection: 'row',
|
|
33
|
-
display: 'flex',
|
|
34
|
-
justifyContent: 'flex-start',
|
|
35
|
-
paddingBottom: 5,
|
|
36
|
-
marginTop: 50,
|
|
37
|
-
}}
|
|
38
|
-
className={'ml-4 lg:-ml-5'}
|
|
39
|
-
>
|
|
40
|
-
<div>
|
|
41
|
-
<div
|
|
42
|
-
style={{
|
|
43
|
-
fontFamily: FONTS.GTPLANAR,
|
|
44
|
-
fontSize: 15,
|
|
45
|
-
width: 280,
|
|
46
|
-
paddingBottom: 8,
|
|
47
|
-
textWrap: 'balance',
|
|
48
|
-
}}
|
|
49
|
-
className={'-ml-3 lg:-ml-5'}
|
|
50
|
-
>
|
|
51
|
-
Drag and drop the cards to reorder them.
|
|
52
|
-
</div>
|
|
53
|
-
<Icon />
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
);
|
|
57
|
-
};
|