@remotion/promo-pages 4.0.306 → 4.0.310

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.
Files changed (174) hide show
  1. package/.turbo/turbo-make.log +2 -2
  2. package/dist/Homepage.js +2 -2
  3. package/dist/homepage/Pricing.js +1 -1
  4. package/package.json +10 -10
  5. package/dist/cn.d.ts +0 -2
  6. package/dist/cn.js +0 -5
  7. package/dist/components/Homepage.d.ts +0 -6
  8. package/dist/components/Homepage.js +0 -20
  9. package/dist/components/homepage/BackgroundAnimation.d.ts +0 -2
  10. package/dist/components/homepage/BackgroundAnimation.js +0 -66
  11. package/dist/components/homepage/ChooseTemplate.d.ts +0 -2
  12. package/dist/components/homepage/ChooseTemplate.js +0 -27
  13. package/dist/components/homepage/CommunityStats.d.ts +0 -3
  14. package/dist/components/homepage/CommunityStats.js +0 -6
  15. package/dist/components/homepage/CommunityStatsItems.d.ts +0 -7
  16. package/dist/components/homepage/CommunityStatsItems.js +0 -58
  17. package/dist/components/homepage/Counter.d.ts +0 -8
  18. package/dist/components/homepage/Counter.js +0 -47
  19. package/dist/components/homepage/Demo/Card.d.ts +0 -15
  20. package/dist/components/homepage/Demo/Card.js +0 -174
  21. package/dist/components/homepage/Demo/Cards.d.ts +0 -15
  22. package/dist/components/homepage/Demo/Cards.js +0 -57
  23. package/dist/components/homepage/Demo/Comp.d.ts +0 -38
  24. package/dist/components/homepage/Demo/Comp.js +0 -71
  25. package/dist/components/homepage/Demo/CurrentCountry.d.ts +0 -9
  26. package/dist/components/homepage/Demo/CurrentCountry.js +0 -48
  27. package/dist/components/homepage/Demo/DemoError.d.ts +0 -2
  28. package/dist/components/homepage/Demo/DemoError.js +0 -10
  29. package/dist/components/homepage/Demo/DemoErrorIcon.d.ts +0 -2
  30. package/dist/components/homepage/Demo/DemoErrorIcon.js +0 -16
  31. package/dist/components/homepage/Demo/DemoRender.d.ts +0 -102
  32. package/dist/components/homepage/Demo/DemoRender.js +0 -95
  33. package/dist/components/homepage/Demo/DigitWheel.d.ts +0 -9
  34. package/dist/components/homepage/Demo/DigitWheel.js +0 -94
  35. package/dist/components/homepage/Demo/DisplayedEmoji.d.ts +0 -5
  36. package/dist/components/homepage/Demo/DisplayedEmoji.js +0 -49
  37. package/dist/components/homepage/Demo/DoneCheckmark.d.ts +0 -2
  38. package/dist/components/homepage/Demo/DoneCheckmark.js +0 -20
  39. package/dist/components/homepage/Demo/DownloadNudge.d.ts +0 -2
  40. package/dist/components/homepage/Demo/DownloadNudge.js +0 -27
  41. package/dist/components/homepage/Demo/DragAndDropNudge.d.ts +0 -3
  42. package/dist/components/homepage/Demo/DragAndDropNudge.js +0 -26
  43. package/dist/components/homepage/Demo/EmojiCard.d.ts +0 -10
  44. package/dist/components/homepage/Demo/EmojiCard.js +0 -119
  45. package/dist/components/homepage/Demo/Minus.d.ts +0 -5
  46. package/dist/components/homepage/Demo/Minus.js +0 -11
  47. package/dist/components/homepage/Demo/PlayPauseButton.d.ts +0 -5
  48. package/dist/components/homepage/Demo/PlayPauseButton.js +0 -47
  49. package/dist/components/homepage/Demo/PlayerControls.d.ts +0 -8
  50. package/dist/components/homepage/Demo/PlayerControls.js +0 -15
  51. package/dist/components/homepage/Demo/PlayerSeekBar.d.ts +0 -11
  52. package/dist/components/homepage/Demo/PlayerSeekBar.js +0 -216
  53. package/dist/components/homepage/Demo/PlayerVolume.d.ts +0 -5
  54. package/dist/components/homepage/Demo/PlayerVolume.js +0 -53
  55. package/dist/components/homepage/Demo/Progress.d.ts +0 -4
  56. package/dist/components/homepage/Demo/Progress.js +0 -14
  57. package/dist/components/homepage/Demo/Spinner.d.ts +0 -5
  58. package/dist/components/homepage/Demo/Spinner.js +0 -37
  59. package/dist/components/homepage/Demo/Switcher.d.ts +0 -6
  60. package/dist/components/homepage/Demo/Switcher.js +0 -25
  61. package/dist/components/homepage/Demo/Temperature.d.ts +0 -6
  62. package/dist/components/homepage/Demo/Temperature.js +0 -21
  63. package/dist/components/homepage/Demo/TemperatureNumber.d.ts +0 -5
  64. package/dist/components/homepage/Demo/TemperatureNumber.js +0 -36
  65. package/dist/components/homepage/Demo/ThemeNudge.d.ts +0 -3
  66. package/dist/components/homepage/Demo/ThemeNudge.js +0 -35
  67. package/dist/components/homepage/Demo/TimeDisplay.d.ts +0 -6
  68. package/dist/components/homepage/Demo/TimeDisplay.js +0 -27
  69. package/dist/components/homepage/Demo/TrendingRepos.d.ts +0 -6
  70. package/dist/components/homepage/Demo/TrendingRepos.js +0 -65
  71. package/dist/components/homepage/Demo/icons.d.ts +0 -10
  72. package/dist/components/homepage/Demo/icons.js +0 -22
  73. package/dist/components/homepage/Demo/index.d.ts +0 -2
  74. package/dist/components/homepage/Demo/index.js +0 -95
  75. package/dist/components/homepage/Demo/math.d.ts +0 -10
  76. package/dist/components/homepage/Demo/math.js +0 -29
  77. package/dist/components/homepage/Demo/types.d.ts +0 -6
  78. package/dist/components/homepage/Demo/types.js +0 -0
  79. package/dist/components/homepage/Editor.d.ts +0 -2
  80. package/dist/components/homepage/Editor.js +0 -37
  81. package/dist/components/homepage/EvaluateRemotion.d.ts +0 -3
  82. package/dist/components/homepage/EvaluateRemotion.js +0 -39
  83. package/dist/components/homepage/FreePricing.d.ts +0 -4
  84. package/dist/components/homepage/FreePricing.js +0 -80
  85. package/dist/components/homepage/GetStartedStrip.d.ts +0 -2
  86. package/dist/components/homepage/GetStartedStrip.js +0 -14
  87. package/dist/components/homepage/GitHubButton.d.ts +0 -2
  88. package/dist/components/homepage/GitHubButton.js +0 -7
  89. package/dist/components/homepage/IconForTemplate.d.ts +0 -6
  90. package/dist/components/homepage/IconForTemplate.js +0 -94
  91. package/dist/components/homepage/IfYouKnowReact.d.ts +0 -3
  92. package/dist/components/homepage/IfYouKnowReact.js +0 -20
  93. package/dist/components/homepage/InfoTooltip.d.ts +0 -6
  94. package/dist/components/homepage/InfoTooltip.js +0 -6
  95. package/dist/components/homepage/MoreTemplatesButton.d.ts +0 -2
  96. package/dist/components/homepage/MoreTemplatesButton.js +0 -10
  97. package/dist/components/homepage/MuxVideo.d.ts +0 -7
  98. package/dist/components/homepage/MuxVideo.js +0 -45
  99. package/dist/components/homepage/NewsletterButton.d.ts +0 -2
  100. package/dist/components/homepage/NewsletterButton.js +0 -38
  101. package/dist/components/homepage/Pricing.d.ts +0 -2
  102. package/dist/components/homepage/Pricing.js +0 -15
  103. package/dist/components/homepage/PricingBulletPoint.d.ts +0 -6
  104. package/dist/components/homepage/PricingBulletPoint.js +0 -19
  105. package/dist/components/homepage/RealMp4Videos.d.ts +0 -2
  106. package/dist/components/homepage/RealMp4Videos.js +0 -32
  107. package/dist/components/homepage/Spacer.d.ts +0 -2
  108. package/dist/components/homepage/Spacer.js +0 -4
  109. package/dist/components/homepage/TemplateIcon.d.ts +0 -5
  110. package/dist/components/homepage/TemplateIcon.js +0 -24
  111. package/dist/components/homepage/TextInput.d.ts +0 -7
  112. package/dist/components/homepage/TextInput.js +0 -34
  113. package/dist/components/homepage/TrustedByBanner.d.ts +0 -2
  114. package/dist/components/homepage/TrustedByBanner.js +0 -32
  115. package/dist/components/homepage/VideoApps.d.ts +0 -4
  116. package/dist/components/homepage/VideoApps.js +0 -72
  117. package/dist/components/homepage/VideoAppsShowcase.d.ts +0 -3
  118. package/dist/components/homepage/VideoAppsShowcase.js +0 -160
  119. package/dist/components/homepage/VideoAppsTitle.d.ts +0 -5
  120. package/dist/components/homepage/VideoAppsTitle.js +0 -7
  121. package/dist/components/homepage/VideoPlayerWithControls.d.ts +0 -20
  122. package/dist/components/homepage/VideoPlayerWithControls.js +0 -104
  123. package/dist/components/homepage/WriteInReact.d.ts +0 -2
  124. package/dist/components/homepage/WriteInReact.js +0 -10
  125. package/dist/components/homepage/YouAreHere.d.ts +0 -2
  126. package/dist/components/homepage/YouAreHere.js +0 -23
  127. package/dist/components/homepage/layout/Button.d.ts +0 -19
  128. package/dist/components/homepage/layout/Button.js +0 -29
  129. package/dist/components/homepage/layout/colors.d.ts +0 -13
  130. package/dist/components/homepage/layout/colors.js +0 -14
  131. package/dist/components/homepage/layout/use-color-mode.d.ts +0 -21
  132. package/dist/components/homepage/layout/use-color-mode.js +0 -22
  133. package/dist/components/homepage/layout/use-el-size.d.ts +0 -5
  134. package/dist/components/homepage/layout/use-el-size.js +0 -40
  135. package/dist/components/homepage/layout/use-mobile-layout.d.ts +0 -1
  136. package/dist/components/homepage/layout/use-mobile-layout.js +0 -6
  137. package/dist/components/icons/blank.d.ts +0 -3
  138. package/dist/components/icons/blank.js +0 -4
  139. package/dist/components/icons/clone.d.ts +0 -2
  140. package/dist/components/icons/clone.js +0 -2
  141. package/dist/components/icons/code-hike.d.ts +0 -3
  142. package/dist/components/icons/code-hike.js +0 -4
  143. package/dist/components/icons/cubes.d.ts +0 -3
  144. package/dist/components/icons/cubes.js +0 -4
  145. package/dist/components/icons/js.d.ts +0 -3
  146. package/dist/components/icons/js.js +0 -4
  147. package/dist/components/icons/music.d.ts +0 -2
  148. package/dist/components/icons/music.js +0 -4
  149. package/dist/components/icons/next.d.ts +0 -4
  150. package/dist/components/icons/next.js +0 -4
  151. package/dist/components/icons/overlay.d.ts +0 -3
  152. package/dist/components/icons/overlay.js +0 -4
  153. package/dist/components/icons/remix.d.ts +0 -3
  154. package/dist/components/icons/remix.js +0 -4
  155. package/dist/components/icons/skia.d.ts +0 -3
  156. package/dist/components/icons/skia.js +0 -4
  157. package/dist/components/icons/stargazer.d.ts +0 -3
  158. package/dist/components/icons/stargazer.js +0 -4
  159. package/dist/components/icons/still.d.ts +0 -3
  160. package/dist/components/icons/still.js +0 -4
  161. package/dist/components/icons/tailwind.d.ts +0 -3
  162. package/dist/components/icons/tailwind.js +0 -4
  163. package/dist/components/icons/tiktok.d.ts +0 -3
  164. package/dist/components/icons/tiktok.js +0 -4
  165. package/dist/components/icons/ts.d.ts +0 -3
  166. package/dist/components/icons/ts.js +0 -4
  167. package/dist/components/icons/tts.d.ts +0 -3
  168. package/dist/components/icons/tts.js +0 -4
  169. package/dist/components/icons/undo.d.ts +0 -3
  170. package/dist/components/icons/undo.js +0 -2
  171. package/dist/components/icons/waveform.d.ts +0 -3
  172. package/dist/components/icons/waveform.js +0 -4
  173. package/dist/main.d.ts +0 -1
  174. package/dist/main.js +0 -6
@@ -1,27 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { FONTS } from '../layout/colors';
3
- const origWidth = 77;
4
- const scale = 0.4;
5
- const Icon = () => {
6
- return (_jsx("svg", { style: {
7
- width: origWidth * scale,
8
- }, viewBox: "0 0 77 160", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M5 154.5C51 121 79 81 69 5", stroke: "currentColor", strokeWidth: "8", strokeLinecap: "round" }) }));
9
- };
10
- export const DownloadNudge = () => {
11
- return (_jsx("div", { style: {
12
- position: 'relative',
13
- flexDirection: 'row',
14
- display: 'flex',
15
- justifyContent: 'flex-end',
16
- textAlign: 'right',
17
- paddingRight: 22,
18
- paddingTop: 20,
19
- }, children: _jsxs("div", { children: [_jsx(Icon, {}), _jsxs("div", { style: {
20
- fontFamily: FONTS.GTPLANAR,
21
- fontSize: 15,
22
- width: 280,
23
- position: 'absolute',
24
- right: 70,
25
- top: 60,
26
- }, children: ["Export the video using", _jsx("br", {}), ' ', _jsx("a", { href: "/lambda", className: "bluelink", children: "Remotion Lambda" }), "."] })] }) }));
27
- };
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- export declare const Icon: React.FC;
3
- export declare const DragAndDropNudge: React.FC;
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { FONTS, PALETTE } from '../layout/colors';
3
- const origWidth = 37;
4
- const scale = 0.4;
5
- export const Icon = () => {
6
- return (_jsx("svg", { style: {
7
- width: origWidth * scale,
8
- overflow: 'visible',
9
- }, viewBox: "0 0 37 59", fill: "none", children: _jsx("path", { d: "M5.00003 5C5.00002 36.5 16 44 32.0002 54", stroke: PALETTE.TEXT_COLOR, strokeWidth: "8", strokeLinecap: "round" }) }));
10
- };
11
- export const DragAndDropNudge = () => {
12
- return (_jsx("div", { style: {
13
- position: 'absolute',
14
- flexDirection: 'row',
15
- display: 'flex',
16
- justifyContent: 'flex-start',
17
- paddingBottom: 5,
18
- marginTop: 50,
19
- }, className: 'ml-4 lg:-ml-5', children: _jsxs("div", { children: [_jsx("div", { style: {
20
- fontFamily: FONTS.GTPLANAR,
21
- fontSize: 15,
22
- width: 280,
23
- paddingBottom: 8,
24
- textWrap: 'balance',
25
- }, className: '-ml-3 lg:-ml-5', children: "Drag and drop the cards to reorder them." }), _jsx(Icon, {})] }) }));
26
- };
@@ -1,10 +0,0 @@
1
- import type { EmojiName } from '@remotion/animated-emoji';
2
- import React from 'react';
3
- export type EmojiCardRef = {
4
- onLeft: () => void;
5
- onRight: () => void;
6
- };
7
- export type EmojiCardProps = {
8
- readonly emojiIndex: EmojiName;
9
- };
10
- export declare const EmojiCard: React.ForwardRefExoticComponent<EmojiCardProps & React.RefAttributes<EmojiCardRef>>;
@@ -1,119 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useCallback, useEffect, useImperativeHandle, useRef, } from 'react';
3
- import { AbsoluteFill, getRemotionEnvironment } from 'remotion';
4
- import { DisplayedEmoji } from './DisplayedEmoji';
5
- const applyTransforms = ({ ref1, ref2, ref3, transforms }) => {
6
- ref1.style.transform = `translateX(${transforms[0]}%)`;
7
- ref2.style.transform = `translateX(${transforms[1]}%)`;
8
- ref3.style.transform = `translateX(${transforms[2]}%)`;
9
- };
10
- const waitForRaq = async () => {
11
- await new Promise((resolve) => {
12
- requestAnimationFrame(resolve);
13
- });
14
- };
15
- const moveLeft = async ({ ref1, ref2, ref3, transforms }) => {
16
- for (let i = 0; i < 20; i++) {
17
- for (const idx in transforms) {
18
- transforms[idx] -= 5;
19
- if (transforms[idx] <= -200) {
20
- transforms[idx] += 300;
21
- }
22
- }
23
- applyTransforms({ ref1, ref2, ref3, transforms });
24
- await waitForRaq();
25
- }
26
- };
27
- const moveRight = async ({ ref1, ref2, ref3, transforms }) => {
28
- for (let i = 0; i < 20; i++) {
29
- for (const idx in transforms) {
30
- transforms[idx] += 5;
31
- if (transforms[idx] >= 100) {
32
- transforms[idx] -= 300;
33
- }
34
- }
35
- applyTransforms({ ref1, ref2, ref3, transforms });
36
- await waitForRaq();
37
- }
38
- };
39
- const emojiStyle = {
40
- width: '100%',
41
- position: 'absolute',
42
- top: 'calc(50% - 50px)',
43
- };
44
- const EmojiCardRefFn = ({ emojiIndex }, ref) => {
45
- const ref1 = useRef(null);
46
- const ref2 = useRef(null);
47
- const ref3 = useRef(null);
48
- const transforms = useRef([-100, 0, 100]);
49
- const onLeft = useCallback(() => {
50
- if (!ref1.current || !ref2.current || !ref3.current) {
51
- return;
52
- }
53
- moveLeft({
54
- ref1: ref1.current,
55
- ref2: ref2.current,
56
- ref3: ref3.current,
57
- transforms: transforms.current,
58
- });
59
- }, []);
60
- const onRight = useCallback(() => {
61
- if (!ref1.current || !ref2.current || !ref3.current) {
62
- return;
63
- }
64
- moveRight({
65
- ref1: ref1.current,
66
- ref2: ref2.current,
67
- ref3: ref3.current,
68
- transforms: transforms.current,
69
- });
70
- }, []);
71
- useEffect(() => {
72
- if (!ref1.current || !ref2.current || !ref3.current) {
73
- return;
74
- }
75
- applyTransforms({
76
- ref1: ref1.current,
77
- ref2: ref2.current,
78
- ref3: ref3.current,
79
- transforms: transforms.current,
80
- });
81
- }, []);
82
- useImperativeHandle(ref, () => {
83
- return {
84
- onLeft,
85
- onRight,
86
- };
87
- }, [onLeft, onRight]);
88
- useEffect(() => {
89
- if (!ref1.current || !ref2.current || !ref3.current) {
90
- return;
91
- }
92
- applyTransforms({
93
- ref1: ref1.current,
94
- ref2: ref2.current,
95
- ref3: ref3.current,
96
- transforms: transforms.current,
97
- });
98
- }, []);
99
- return (_jsxs(AbsoluteFill, { style: {
100
- justifyContent: 'center',
101
- alignItems: 'center',
102
- overflow: 'hidden',
103
- }, children: [_jsx("div", { style: {
104
- color: '#0b84f3',
105
- fontFamily: 'GTPlanar',
106
- fontWeight: '500',
107
- fontSize: 13,
108
- textAlign: 'center',
109
- position: 'absolute',
110
- marginTop: -90,
111
- }, children: "Choose an emoji" }), _jsx("div", { style: {
112
- position: 'absolute',
113
- width: '100%',
114
- display: 'flex',
115
- whiteSpace: 'nowrap',
116
- height: '100%',
117
- }, children: getRemotionEnvironment().isRendering ? (_jsx("div", { style: emojiStyle, children: _jsx(DisplayedEmoji, { emoji: emojiIndex }) })) : (_jsxs(_Fragment, { children: [_jsx("div", { ref: ref1, style: emojiStyle, children: _jsx(DisplayedEmoji, { emoji: 'melting' }) }), _jsx("div", { ref: ref2, style: emojiStyle, children: _jsx(DisplayedEmoji, { emoji: 'partying-face' }) }), _jsx("div", { ref: ref3, style: emojiStyle, children: _jsx(DisplayedEmoji, { emoji: 'fire' }) })] })) })] }));
118
- };
119
- export const EmojiCard = forwardRef(EmojiCardRefFn);
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export declare const Minus: React.FC<{
3
- readonly leftOffset: number;
4
- readonly minusSignOpacity: number;
5
- }>;
@@ -1,11 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- export const Minus = ({ leftOffset, minusSignOpacity }) => {
3
- return (_jsx("div", { style: {
4
- position: 'relative',
5
- marginLeft: -40 - leftOffset,
6
- marginTop: 5,
7
- width: 40,
8
- opacity: minusSignOpacity,
9
- textAlign: 'right',
10
- }, children: "-" }));
11
- };
@@ -1,5 +0,0 @@
1
- import type { PlayerRef } from '@remotion/player';
2
- import React from 'react';
3
- export declare const PlayPauseButton: React.FC<{
4
- readonly playerRef: React.RefObject<PlayerRef | null>;
5
- }>;
@@ -1,47 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import React, { useCallback, useEffect } from 'react';
3
- import { PALETTE } from '../layout/colors';
4
- import { PausedIcon, PlayingIcon } from './icons';
5
- const playerButtonStyle = {
6
- appearance: 'none',
7
- border: 'none',
8
- borderRadius: 0,
9
- background: 'none',
10
- display: 'flex',
11
- justifyContent: 'center',
12
- alignItems: 'center',
13
- paddingRight: 20,
14
- paddingLeft: 20,
15
- cursor: 'pointer',
16
- height: 50,
17
- color: PALETTE.TEXT_COLOR,
18
- };
19
- export const PlayPauseButton = ({ playerRef }) => {
20
- const [playing, setPlaying] = React.useState(true);
21
- useEffect(() => {
22
- const { current } = playerRef;
23
- if (!current) {
24
- return;
25
- }
26
- const onPlay = () => {
27
- setPlaying(true);
28
- };
29
- const onPause = () => {
30
- setPlaying(false);
31
- };
32
- current.addEventListener('play', onPlay);
33
- current.addEventListener('pause', onPause);
34
- return () => {
35
- current.removeEventListener('play', onPlay);
36
- current.removeEventListener('pause', onPause);
37
- };
38
- }, [playerRef]);
39
- const onToggle = useCallback(() => {
40
- var _a;
41
- (_a = playerRef.current) === null || _a === void 0 ? void 0 : _a.toggle();
42
- }, [playerRef]);
43
- const playPauseIconStyle = {
44
- width: 15,
45
- };
46
- return (_jsx("button", { type: "button", style: playerButtonStyle, onClick: onToggle, children: playing ? (_jsx(PlayingIcon, { style: playPauseIconStyle })) : (_jsx(PausedIcon, { style: playPauseIconStyle })) }));
47
- };
@@ -1,8 +0,0 @@
1
- import type { PlayerRef } from '@remotion/player';
2
- import React from 'react';
3
- export declare const PlayerControls: React.FC<{
4
- readonly playerRef: React.RefObject<PlayerRef | null>;
5
- readonly durationInFrames: number;
6
- readonly fps: number;
7
- readonly children: React.ReactNode;
8
- }>;
@@ -1,15 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { PALETTE } from '../layout/colors';
3
- import { PlayerSeekBar } from './PlayerSeekBar';
4
- import { PlayerVolume } from './PlayerVolume';
5
- import { PlayPauseButton } from './PlayPauseButton';
6
- import { TimeDisplay } from './TimeDisplay';
7
- const Separator = () => {
8
- return (_jsx("div", { style: {
9
- borderRight: `2px solid ${PALETTE.BOX_STROKE}`,
10
- height: 50,
11
- } }));
12
- };
13
- export const PlayerControls = ({ playerRef, durationInFrames, fps, children }) => {
14
- return (_jsxs("div", { className: 'flex flex-row items-center bg-pane', children: [_jsx(PlayPauseButton, { playerRef: playerRef }), _jsx(Separator, {}), _jsx(PlayerVolume, { playerRef: playerRef }), _jsx(Separator, {}), _jsx("div", { style: { width: 15 } }), _jsx(TimeDisplay, { playerRef: playerRef, fps: fps }), _jsx("div", { style: { width: 15 } }), _jsx(PlayerSeekBar, { durationInFrames: durationInFrames, playerRef: playerRef, inFrame: null, outFrame: null, onSeekEnd: () => undefined, onSeekStart: () => undefined }), _jsx("div", { style: { width: 20 } }), _jsx(Separator, {}), children] }));
15
- };
@@ -1,11 +0,0 @@
1
- import type { PlayerRef } from '@remotion/player';
2
- import React from 'react';
3
- export declare const useHoverState: (ref: React.RefObject<HTMLDivElement | null>, hideControlsWhenPointerDoesntMove: boolean | number) => boolean;
4
- export declare const PlayerSeekBar: React.FC<{
5
- readonly durationInFrames: number;
6
- readonly onSeekStart: () => void;
7
- readonly onSeekEnd: () => void;
8
- readonly inFrame: number | null;
9
- readonly outFrame: number | null;
10
- readonly playerRef: React.RefObject<PlayerRef | null>;
11
- }>;
@@ -1,216 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
- import { interpolate } from 'remotion';
4
- import { useElementSize } from '../layout/use-el-size';
5
- const getFrameFromX = (clientX, durationInFrames, width) => {
6
- const pos = clientX;
7
- const frame = Math.round(interpolate(pos, [0, width], [0, durationInFrames - 1], {
8
- extrapolateLeft: 'clamp',
9
- extrapolateRight: 'clamp',
10
- }));
11
- return frame;
12
- };
13
- const BAR_HEIGHT = 5;
14
- const KNOB_SIZE = 12;
15
- const VERTICAL_PADDING = 4;
16
- const containerStyle = {
17
- userSelect: 'none',
18
- WebkitUserSelect: 'none',
19
- paddingTop: VERTICAL_PADDING,
20
- paddingBottom: VERTICAL_PADDING,
21
- boxSizing: 'border-box',
22
- cursor: 'pointer',
23
- position: 'relative',
24
- touchAction: 'none',
25
- flex: 1,
26
- };
27
- const barBackground = {
28
- height: BAR_HEIGHT,
29
- backgroundColor: 'rgba(0, 0, 0, 0.25)',
30
- width: '100%',
31
- borderRadius: BAR_HEIGHT / 2,
32
- };
33
- const findBodyInWhichDivIsLocated = (div) => {
34
- let current = div;
35
- while (current.parentElement) {
36
- current = current.parentElement;
37
- }
38
- return current;
39
- };
40
- export const useHoverState = (ref, hideControlsWhenPointerDoesntMove) => {
41
- const [hovered, setHovered] = useState(false);
42
- useEffect(() => {
43
- const { current } = ref;
44
- if (!current) {
45
- return;
46
- }
47
- let hoverTimeout;
48
- const addHoverTimeout = () => {
49
- if (hideControlsWhenPointerDoesntMove) {
50
- clearTimeout(hoverTimeout);
51
- hoverTimeout = setTimeout(() => {
52
- setHovered(false);
53
- }, hideControlsWhenPointerDoesntMove === true
54
- ? 3000
55
- : hideControlsWhenPointerDoesntMove);
56
- }
57
- };
58
- const onHover = () => {
59
- setHovered(true);
60
- addHoverTimeout();
61
- };
62
- const onLeave = () => {
63
- setHovered(false);
64
- clearTimeout(hoverTimeout);
65
- };
66
- const onMove = () => {
67
- setHovered(true);
68
- addHoverTimeout();
69
- };
70
- current.addEventListener('mouseenter', onHover);
71
- current.addEventListener('mouseleave', onLeave);
72
- current.addEventListener('mousemove', onMove);
73
- return () => {
74
- current.removeEventListener('mouseenter', onHover);
75
- current.removeEventListener('mouseleave', onLeave);
76
- current.removeEventListener('mousemove', onMove);
77
- clearTimeout(hoverTimeout);
78
- };
79
- }, [hideControlsWhenPointerDoesntMove, ref]);
80
- return hovered;
81
- };
82
- export const PlayerSeekBar = ({ durationInFrames, onSeekEnd, onSeekStart, inFrame, outFrame, playerRef, }) => {
83
- var _a;
84
- const containerRef = useRef(null);
85
- const barHovered = useHoverState(containerRef, false);
86
- const size = useElementSize(containerRef.current);
87
- const [playing, setPlaying] = useState(false);
88
- const [frame, setFrame] = useState(0);
89
- useEffect(() => {
90
- const { current } = playerRef;
91
- if (!current) {
92
- return;
93
- }
94
- const onFrameUpdate = () => {
95
- setFrame(playerRef.current.getCurrentFrame());
96
- };
97
- current.addEventListener('frameupdate', onFrameUpdate);
98
- return () => {
99
- current.removeEventListener('frameupdate', onFrameUpdate);
100
- };
101
- }, [playerRef]);
102
- useEffect(() => {
103
- const { current } = playerRef;
104
- if (!current) {
105
- return;
106
- }
107
- const onPlay = () => {
108
- setPlaying(true);
109
- };
110
- const onPause = () => {
111
- setPlaying(false);
112
- };
113
- current.addEventListener('play', onPlay);
114
- current.addEventListener('pause', onPause);
115
- return () => {
116
- current.removeEventListener('play', onPlay);
117
- current.removeEventListener('pause', onPause);
118
- };
119
- }, [playerRef]);
120
- const [dragging, setDragging] = useState({
121
- dragging: false,
122
- });
123
- const width = (_a = size === null || size === void 0 ? void 0 : size.width) !== null && _a !== void 0 ? _a : 0;
124
- const onPointerDown = useCallback((e) => {
125
- var _a;
126
- if (e.button !== 0) {
127
- return;
128
- }
129
- const posLeft = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().left;
130
- const _frame = getFrameFromX(e.clientX - posLeft, durationInFrames, width);
131
- playerRef.current.pause();
132
- playerRef.current.seekTo(_frame);
133
- setDragging({
134
- dragging: true,
135
- wasPlaying: playing,
136
- });
137
- onSeekStart();
138
- }, [durationInFrames, width, playerRef, playing, onSeekStart]);
139
- const onPointerMove = useCallback((e) => {
140
- var _a;
141
- if (!size) {
142
- throw new Error('Player has no size');
143
- }
144
- if (!dragging.dragging) {
145
- return;
146
- }
147
- const posLeft = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().left;
148
- const _frame = getFrameFromX(e.clientX - posLeft, durationInFrames, size.width);
149
- playerRef.current.seekTo(_frame);
150
- }, [dragging.dragging, durationInFrames, playerRef, size]);
151
- const onPointerUp = useCallback(() => {
152
- setDragging({
153
- dragging: false,
154
- });
155
- if (!dragging.dragging) {
156
- return;
157
- }
158
- if (dragging.wasPlaying) {
159
- playerRef.current.play();
160
- }
161
- else {
162
- playerRef.current.pause();
163
- }
164
- onSeekEnd();
165
- }, [dragging, onSeekEnd, playerRef]);
166
- useEffect(() => {
167
- if (!dragging.dragging) {
168
- return;
169
- }
170
- const body = findBodyInWhichDivIsLocated(containerRef.current);
171
- body.addEventListener('pointermove', onPointerMove);
172
- body.addEventListener('pointerup', onPointerUp);
173
- return () => {
174
- body.removeEventListener('pointermove', onPointerMove);
175
- body.removeEventListener('pointerup', onPointerUp);
176
- };
177
- }, [dragging.dragging, onPointerMove, onPointerUp]);
178
- const knobStyle = useMemo(() => {
179
- return {
180
- height: KNOB_SIZE,
181
- width: KNOB_SIZE,
182
- borderRadius: KNOB_SIZE / 2,
183
- position: 'absolute',
184
- top: VERTICAL_PADDING - KNOB_SIZE / 2 + 5 / 2,
185
- backgroundColor: 'var(--ifm-font-color-base)',
186
- left: Math.max(0, (frame / Math.max(1, durationInFrames - 1)) * width - KNOB_SIZE / 2),
187
- outline: '2px solid var(--ifm-background-color)',
188
- opacity: Number(barHovered),
189
- transition: 'opacity 0.s ease',
190
- };
191
- }, [barHovered, durationInFrames, frame, width]);
192
- const fillStyle = useMemo(() => {
193
- return {
194
- height: BAR_HEIGHT,
195
- backgroundColor: 'var(--ifm-font-color-base)',
196
- width: ((frame - (inFrame !== null && inFrame !== void 0 ? inFrame : 0)) / (durationInFrames - 1)) * 100 + '%',
197
- marginLeft: ((inFrame !== null && inFrame !== void 0 ? inFrame : 0) / (durationInFrames - 1)) * 100 + '%',
198
- borderRadius: BAR_HEIGHT / 2,
199
- };
200
- }, [durationInFrames, frame, inFrame]);
201
- const active = useMemo(() => {
202
- return {
203
- height: BAR_HEIGHT,
204
- backgroundColor: 'var(--ifm-font-color-base)',
205
- opacity: 0.2,
206
- width: (((outFrame !== null && outFrame !== void 0 ? outFrame : durationInFrames - 1) - (inFrame !== null && inFrame !== void 0 ? inFrame : 0)) /
207
- (durationInFrames - 1)) *
208
- 100 +
209
- '%',
210
- marginLeft: ((inFrame !== null && inFrame !== void 0 ? inFrame : 0) / (durationInFrames - 1)) * 100 + '%',
211
- borderRadius: BAR_HEIGHT / 2,
212
- position: 'absolute',
213
- };
214
- }, [durationInFrames, inFrame, outFrame]);
215
- return (_jsxs("div", { ref: containerRef, onPointerDown: onPointerDown, style: containerStyle, children: [_jsxs("div", { style: barBackground, children: [_jsx("div", { style: active }), _jsx("div", { style: fillStyle })] }), _jsx("div", { style: knobStyle })] }));
216
- };
@@ -1,5 +0,0 @@
1
- import type { PlayerRef } from '@remotion/player';
2
- import React from 'react';
3
- export declare const PlayerVolume: React.FC<{
4
- readonly playerRef: React.RefObject<PlayerRef | null>;
5
- }>;
@@ -1,53 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useRef, useState } from 'react';
3
- import { PALETTE } from '../layout/colors';
4
- import { IsMutedIcon, NotMutedIcon } from './icons';
5
- export const PlayerVolume = ({ playerRef }) => {
6
- const [muted, setIsMuted] = useState(() => { var _a, _b; return (_b = (_a = playerRef.current) === null || _a === void 0 ? void 0 : _a.isMuted()) !== null && _b !== void 0 ? _b : true; });
7
- const [isHovered, setIsHovered] = useState(false);
8
- const timerRef = useRef(null);
9
- useEffect(() => {
10
- const { current } = playerRef;
11
- if (!current) {
12
- return;
13
- }
14
- const onMutedChange = (e) => {
15
- setIsMuted(e.detail.isMuted);
16
- };
17
- current.addEventListener('mutechange', onMutedChange);
18
- return () => {
19
- current.removeEventListener('mutechange', onMutedChange);
20
- };
21
- }, [playerRef]);
22
- useEffect(() => {
23
- if (isHovered) {
24
- document.body.style.userSelect = 'none';
25
- }
26
- else {
27
- document.body.style.userSelect = 'auto';
28
- }
29
- }, [isHovered]);
30
- const onClick = useCallback(() => {
31
- if (timerRef.current !== null) {
32
- clearTimeout(timerRef.current);
33
- timerRef.current = null;
34
- }
35
- if (playerRef.current.isMuted()) {
36
- playerRef.current.unmute();
37
- }
38
- else {
39
- playerRef.current.mute();
40
- }
41
- }, [playerRef]);
42
- return (_jsx("div", { className: 'relative cursor-pointer block pl-4 pr-4 h-full', onMouseEnter: () => setIsHovered(true), children: _jsx("button", { type: "button", onClick: onClick, style: {
43
- background: 'transparent',
44
- border: 0,
45
- cursor: 'pointer',
46
- padding: 0,
47
- display: 'flex',
48
- height: 50,
49
- justifyContent: 'center',
50
- alignItems: 'center',
51
- color: PALETTE.TEXT_COLOR,
52
- }, children: muted ? (_jsx(IsMutedIcon, { style: { height: 20 } })) : (_jsx(NotMutedIcon, { style: { height: 20 } })) }) }));
53
- };
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare const Progress: React.FC<{
3
- readonly progress: number;
4
- }>;
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { makeCircle, makePie } from '@remotion/shapes';
3
- import { PALETTE } from '../layout/colors';
4
- export const Progress = ({ progress }) => {
5
- const inner = makeCircle({
6
- radius: 10,
7
- });
8
- const outer = makePie({
9
- progress,
10
- closePath: false,
11
- radius: 10,
12
- });
13
- return (_jsxs("svg", { viewBox: `0 0 ${inner.width} ${inner.height}`, style: { overflow: 'visible', height: 22 }, children: [_jsx("path", { d: inner.path, stroke: PALETTE.BORDER_COLOR, strokeWidth: 4, fill: "transparent" }), _jsx("path", { d: outer.path, stroke: PALETTE.BRAND, strokeWidth: 4, fill: "transparent", strokeLinecap: "round" })] }));
14
- };
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export declare const Spinner: React.FC<{
3
- readonly size: number;
4
- readonly duration: number;
5
- }>;
@@ -1,37 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- import { PALETTE } from '../layout/colors';
4
- const viewBox = 100;
5
- const lines = 8;
6
- const className = '__remotion_spinner_line';
7
- const remotionSpinnerAnimation = '__remotion_spinner_animation';
8
- // Generated from https://github.com/remotion-dev/template-next/commit/9282c93f7c51ada31a42e18a94680fa09a14eee3
9
- const translated = 'M 44 0 L 50 0 a 6 6 0 0 1 6 6 L 56 26 a 6 6 0 0 1 -6 6 L 50 32 a 6 6 0 0 1 -6 -6 L 44 6 a 6 6 0 0 1 6 -6 Z';
10
- export const Spinner = ({ size, duration }) => {
11
- const style = useMemo(() => {
12
- return {
13
- width: size,
14
- height: size,
15
- };
16
- }, [size]);
17
- return (_jsxs(_Fragment, { children: [_jsx("style", { type: "text/css", children: `
18
- @keyframes ${remotionSpinnerAnimation} {
19
- 0% {
20
- opacity: 1;
21
- }
22
- 100% {
23
- opacity: 0.15;
24
- }
25
- }
26
-
27
- .${className} {
28
- animation: ${remotionSpinnerAnimation} ${duration}s linear infinite;
29
- }
30
- ` }), _jsx("svg", { style: style, viewBox: `0 0 ${viewBox} ${viewBox}`, children: new Array(lines).fill(true).map((_, index) => {
31
- return (_jsx("path", { className: className, style: {
32
- rotate: `${(index * Math.PI * 2) / lines}rad`,
33
- transformOrigin: 'center center',
34
- animationDelay: `${index * (duration / lines) - duration}s`,
35
- }, d: translated, fill: PALETTE.TEXT_COLOR }, index));
36
- }) })] }));
37
- };
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export declare const Switcher: React.FC<{
3
- readonly type: 'left' | 'right';
4
- readonly theme: 'dark' | 'light';
5
- readonly onTap: () => void;
6
- }>;