@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,72 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import { BlueButton } from './layout/Button';
4
- import { useColorMode } from './layout/use-color-mode';
5
- import { Spacer } from './Spacer';
6
- import { YouAreHere } from './YouAreHere';
7
- const row = {
8
- display: 'flex',
9
- flexDirection: 'row',
10
- };
11
- const flex = {
12
- flex: 1,
13
- };
14
- const list = {
15
- listStyleType: 'none',
16
- textAlign: 'center',
17
- paddingLeft: 0,
18
- display: 'flex',
19
- flexDirection: 'column',
20
- alignItems: 'center',
21
- };
22
- const hr = {
23
- width: 20,
24
- textAlign: 'center',
25
- borderTop: 0,
26
- marginTop: 10,
27
- marginBottom: 10,
28
- };
29
- const docsButton = {
30
- textDecoration: 'none',
31
- };
32
- const StepTitle = ({ children }) => {
33
- return (_jsx("div", { className: "text-center text-xl font-semibold fontbrand mt-2", children: children }));
34
- };
35
- const Subtitle = ({ children }) => {
36
- return (_jsx("div", { className: "text-center text-base fontbrand text-[var(--subtitle)]", children: children }));
37
- };
38
- const Pane = ({ children }) => {
39
- return (_jsx("div", { className: "border-effect bg-pane flex-1 p-3 rounded-lg min-h-[500px] flex flex-col text-center", children: children }));
40
- };
41
- export const VideoApps = ({ active }) => {
42
- const { colorMode } = useColorMode();
43
- const [src, setSrc] = useState('/img/player-example.png');
44
- const [src2, setSrc2] = useState('/img/player-example-dark.png');
45
- useEffect(() => {
46
- if (colorMode === 'dark') {
47
- setSrc('/img/player-example-dark.png');
48
- }
49
- else {
50
- setSrc('/img/player-example.png');
51
- }
52
- }, [colorMode]);
53
- useEffect(() => {
54
- setSrc2(colorMode === 'dark' ? '/img/cluster-dark.png' : '/img/cluster.png');
55
- }, [colorMode]);
56
- return (_jsx("div", { className: "w-full", children: _jsxs("div", { className: 'flex flex-col lg:flex-row gap-2', children: [_jsxs(Pane, { children: [active === 'remotion' ? _jsx(YouAreHere, {}) : null, _jsx(StepTitle, { children: "Remotion" }), _jsx(Subtitle, { children: "Make videos programmatically" }), _jsx("br", {}), _jsx("div", { style: {
57
- display: 'flex',
58
- justifyContent: 'center',
59
- alignItems: 'center',
60
- flex: 1,
61
- }, children: _jsx("img", { className: "max-w-[300px]", src: "/img/writeinreact.png" }) }), _jsxs("ul", { style: list, children: [_jsx("li", { children: "Use the Web to create graphics" }), _jsx("hr", { style: hr }), _jsx("li", { children: "Consume user input and APIs" }), _jsx("hr", { style: hr }), _jsx("li", { children: "Render real MP4 videos" })] }), _jsxs("div", { style: row, children: [active === 'remotion' ? null : (_jsxs(_Fragment, { children: [_jsx("div", { style: flex, children: _jsx("a", { style: docsButton, href: "/", children: _jsx(BlueButton, { loading: false, size: "sm", children: "Learn more" }) }) }), _jsx(Spacer, {}), _jsx(Spacer, {})] })), _jsx("div", { style: flex, children: _jsx("a", { style: docsButton, href: "/docs", children: _jsx(BlueButton, { className: "w-full", loading: false, size: "sm", children: "Read docs" }) }) })] })] }), _jsxs(Pane, { children: [active === 'player' ? _jsx(YouAreHere, {}) : null, _jsx(StepTitle, { children: "Remotion Player" }), _jsx(Subtitle, { children: "Embeddable interactive videos" }), _jsx("br", {}), _jsx("div", { style: {
62
- display: 'flex',
63
- justifyContent: 'center',
64
- alignItems: 'center',
65
- flex: 1,
66
- }, children: _jsx("img", { className: "max-w-[300px]", src: src }) }), _jsxs("ul", { style: list, children: [_jsx("li", { children: "Preview videos in the browser" }), _jsx("hr", { style: hr }), _jsx("li", { children: "React to user input" }), _jsx("hr", { style: hr }), _jsx("li", { children: "Customize look and behavior" })] }), _jsxs("div", { style: row, children: [active === 'player' ? null : (_jsxs(_Fragment, { children: [_jsx("div", { style: flex, children: _jsx("a", { style: docsButton, href: "/player", children: _jsx(BlueButton, { className: "w-full", loading: false, size: "sm", children: "Learn more" }) }) }), _jsx(Spacer, {}), _jsx(Spacer, {})] })), _jsx("div", { style: flex, children: _jsx("a", { style: docsButton, href: "/docs/player", children: _jsx(BlueButton, { className: "w-full", loading: false, size: "sm", children: "Read docs" }) }) })] })] }), _jsxs(Pane, { children: [active === 'lambda' ? _jsx(YouAreHere, {}) : null, _jsx(StepTitle, { children: "Remotion Lambda" }), _jsx(Subtitle, { children: "Render at scale" }), _jsx("br", {}), _jsx("div", { style: {
67
- display: 'flex',
68
- justifyContent: 'center',
69
- alignItems: 'center',
70
- flex: 1,
71
- }, children: _jsx("img", { className: "max-w-[300px]", src: src2 }) }), _jsx("div", { className: "flex-1" }), _jsxs("ul", { style: list, children: [_jsx("li", { children: "Render videos in the cloud" }), _jsx("hr", { style: hr }), _jsx("li", { children: "Scale according to your volume" }), _jsx("hr", { style: hr }), _jsx("li", { children: "Fast because distributed" })] }), _jsxs("div", { style: row, children: [active === 'lambda' ? null : (_jsxs(_Fragment, { children: [_jsx("div", { style: flex, children: _jsx("a", { style: docsButton, href: "/lambda", children: _jsx(BlueButton, { className: "w-full", loading: false, size: "sm", children: "Learn more" }) }) }), _jsx(Spacer, {}), _jsx(Spacer, {})] })), _jsx("div", { style: flex, children: _jsx("a", { style: docsButton, href: "/docs/lambda", children: _jsx(BlueButton, { className: "w-full", loading: false, size: "sm", children: "Read docs" }) }) })] })] })] }) }));
72
- };
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const VideoAppsShowcase: React.FC;
3
- export default VideoAppsShowcase;
@@ -1,160 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useRef, useState } from 'react';
3
- import { BlueButton } from './layout/Button';
4
- import { MuxVideo } from './MuxVideo';
5
- import { SectionTitle } from './VideoAppsTitle';
6
- const tabs = [
7
- 'Music visualization',
8
- 'Captions',
9
- 'Screencast',
10
- 'Year in review',
11
- ];
12
- const videoApps = [
13
- {
14
- title: 'Banger.Show',
15
- description: 'The all-in-one 3D visual creation tool for ambitious artists. Seamlessly craft visuals that match your sound and propel your brand forward.',
16
- link: 'https://banger.show?ref=remotion',
17
- videoWidth: 1080,
18
- videoHeight: 1080,
19
- muxId: 'riYdneJ2zu1Vqiayoe1qAZXcSIRq0201tHgSBbh9JbtlU',
20
- buttonText: 'Banger.Show website',
21
- },
22
- {
23
- title: 'Submagic',
24
- description: 'A video editor for creating short-form content fast. Designed for creators, teams and agencies, it accelerates video editing with AI-powered features such as descriptions, zooms, sound effects and music.',
25
- additionalInfo: '',
26
- link: 'https://www.submagic.co/?ref=remotion',
27
- videoWidth: 540,
28
- videoHeight: 1080,
29
- muxId: 'pxqGEjlBBntnXrEe4v00pYUBw3FPgUPKumfhSym00Vs004',
30
- buttonText: 'Submagic website',
31
- },
32
- {
33
- title: 'Remotion Recorder',
34
- description: 'The Remotion Recorder is a video production tool built entirely in JavaScript. Create high-quality videos that feel native on each platform while only editing them once.',
35
- link: 'https://www.remotion.pro/recorder',
36
- videoWidth: 1080,
37
- videoHeight: 1080,
38
- muxId: 'pHlwqDZFUH00Aubo9M001ty3gZ6YW8z689XTd9R479ayE',
39
- buttonText: 'More infos',
40
- },
41
- {
42
- title: 'GitHub Unwrapped',
43
- description: 'Your coding year in review. Get a personalized video of your GitHub activity.',
44
- additionalInfo: 'Uncover your go-to language, peak productivity hours, and track your GitHub impact – all in one video.',
45
- link: 'https://githubunwrapped.com/',
46
- videoWidth: 1080,
47
- videoHeight: 1080,
48
- muxId: 'OwQFvqomOR00q6yj5SWwaA7DBg01NaCPKcOvczoZqCty00',
49
- buttonText: 'GitHub Unwrapped website',
50
- },
51
- ];
52
- const VideoAppsShowcase = () => {
53
- const [activeTab, setActiveTab] = useState(0);
54
- const [isMuted, setIsMuted] = useState(true);
55
- const videoRef = useRef(null);
56
- const containerRef = useRef(null);
57
- useEffect(() => {
58
- const observer = new IntersectionObserver((entries) => {
59
- if (entries[0].isIntersecting) {
60
- if (videoRef.current && videoRef.current.paused) {
61
- videoRef.current.muted = true; // Ensure video is muted before autoplay
62
- setIsMuted(true); // Update state to reflect muted status
63
- videoRef.current
64
- .play()
65
- .then(() => { })
66
- .catch((error) => {
67
- // eslint-disable-next-line no-console
68
- console.error('Playback error:', error);
69
- });
70
- }
71
- }
72
- else if (videoRef.current && !videoRef.current.paused) {
73
- videoRef.current.pause();
74
- }
75
- }, { threshold: 0.5 });
76
- const currentContainer = containerRef.current;
77
- if (currentContainer) {
78
- observer.observe(currentContainer);
79
- }
80
- return () => {
81
- if (currentContainer) {
82
- observer.unobserve(currentContainer);
83
- }
84
- };
85
- }, []);
86
- useEffect(() => {
87
- const video = videoRef.current;
88
- if (video) {
89
- video.pause();
90
- video.currentTime = 0;
91
- video.load();
92
- // Check if the video is visible and play it if it is
93
- const observer = new IntersectionObserver((entries) => {
94
- if (entries[0].isIntersecting) {
95
- // Introduce a delay before playing the video
96
- if (video) {
97
- video.muted = true; // Ensure video is muted before autoplay
98
- setIsMuted(true); // Update state to reflect muted status
99
- video
100
- .play()
101
- .then(() => { })
102
- .catch((error) => {
103
- // eslint-disable-next-line no-console
104
- console.error('Playback error:', error);
105
- });
106
- }
107
- }
108
- }, { threshold: 0.5 });
109
- observer.observe(video);
110
- return () => {
111
- observer.disconnect();
112
- video.muted = false; // Unmute the video when it's no longer visible
113
- if (video) {
114
- video.pause();
115
- video.currentTime = 0;
116
- video.load();
117
- }
118
- };
119
- }
120
- }, [activeTab]);
121
- const handlePlayPause = () => {
122
- if (videoRef.current) {
123
- if (videoRef.current.paused) {
124
- const playPromise = videoRef.current.play();
125
- if (playPromise !== undefined) {
126
- playPromise
127
- .then(() => {
128
- // Playback started successfully
129
- })
130
- .catch((error) => {
131
- // Auto-play was prevented or there was an error
132
- // eslint-disable-next-line no-console
133
- console.error('Playback error:', error);
134
- });
135
- }
136
- }
137
- else {
138
- videoRef.current.pause();
139
- }
140
- }
141
- };
142
- const handleMuteToggle = () => {
143
- if (videoRef.current) {
144
- const newMutedState = !videoRef.current.muted;
145
- videoRef.current.muted = newMutedState;
146
- setIsMuted(newMutedState);
147
- }
148
- };
149
- return (_jsxs("div", { ref: containerRef, children: [_jsx(SectionTitle, { children: "Use Cases" }), _jsx("div", { className: 'grid justify-center grid-flow-col grid-rows-1 gap-2.5 justify-self-center mb-4 w-[90vw] md:w-auto', children: tabs.map((tab, index) => (_jsx("button", { type: "button", "data-active": index === activeTab, className: `bg-transparent border-none m-0 p-0 lg:mx-3 my-4 cursor-pointer text-base fontbrand font-bold transition-colors text-muted data-[active=true]:text-brand`, onClick: () => setActiveTab(index), children: tab }, tab))) }), _jsx("div", { className: 'card flex p-0 overflow-hidden', children: _jsxs("div", { className: 'flex-1 flex flex-col lg:flex-row justify-center', children: [_jsxs("div", { className: 'w-full max-w-[500px] aspect-square relative overflow-hidden bg-[#eee]', onClick: handlePlayPause, children: [_jsx(MuxVideo, { ref: videoRef, muxId: videoApps[activeTab].muxId, className: 'absolute left-0 top-0 w-full h-full object-contain rounded-lg rounded-tr-none rounded-br-none', loop: true, playsInline: true, muted: isMuted }), isMuted && (_jsx("button", { type: "button", className: 'absolute bottom-2.5 right-2.5 bg-white text-black rounded-full w-8 h-8 flex justify-center items-center text-base cursor-pointer transition-colors border-2 border-black border-solid', onClick: (e) => {
150
- e.stopPropagation();
151
- handleMuteToggle();
152
- }, children: _jsx("svg", { style: { width: 24 }, viewBox: "0 0 576 512", children: _jsx("path", { fill: "black", d: "M0 160L0 352l128 0L272 480l48 0 0-448-48 0L128 160 0 160zm441 23l-17-17L390.1 200l17 17 39 39-39 39-17 17L424 345.9l17-17 39-39 39 39 17 17L569.9 312l-17-17-39-39 39-39 17-17L536 166.1l-17 17-39 39-39-39z" }) }) }))] }), _jsxs("div", { className: 'pl-4 flex-1 lg:pl-4 flex flex-col h-full pt-8 pb-6', children: [_jsx("div", { className: "text-4xl font-bold fontbrand", children: videoApps[activeTab].title }), _jsx("div", { className: "text-muted mt-4 text-base fontbrand", children: videoApps[activeTab].description }), videoApps[activeTab].additionalInfo ? (_jsx("div", { className: "text-muted mt-4 text-base fontbrand", children: videoApps[activeTab].additionalInfo })) : null, _jsx("div", { className: "h-5" }), _jsx("a", { target: "_blank", href: videoApps[activeTab].link, style: { textDecoration: 'none' }, children: _jsx(BlueButton, { loading: false, size: "sm", children: videoApps[activeTab].buttonText }) })] })] }) }), _jsx("div", { style: {
153
- marginTop: '1rem',
154
- justifyContent: 'center',
155
- display: 'flex',
156
- }, children: _jsxs("div", { style: {
157
- fontFamily: 'GTPlanar',
158
- }, children: ["For more examples see our", ' ', _jsx("a", { href: "/showcase", className: "bluelink", children: "Showcase page" }), "."] }) })] }));
159
- };
160
- export default VideoAppsShowcase;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export declare const VideoAppsTitle: React.FC;
3
- export declare const SectionTitle: React.FC<{
4
- readonly children: React.ReactNode;
5
- }>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const VideoAppsTitle = () => {
3
- return (_jsxs("div", { className: 'text-center', children: [_jsxs("h2", { className: 'fontbrand text-4xl', children: ["Build video ", _jsx("span", { className: 'fontbrand', children: "apps" })] }), _jsx("p", { children: "Use our suite of tools to build apps that lets others create videos." })] }));
4
- };
5
- export const SectionTitle = ({ children, }) => {
6
- return (_jsx("div", { className: 'text-center', children: _jsx("h2", { className: 'fontbrand text-4xl', children: children }) }));
7
- };
@@ -1,20 +0,0 @@
1
- import type Plyr from 'plyr';
2
- import 'plyr/dist/plyr.css';
3
- import './video-player.css';
4
- export interface HTMLVideoElementWithPlyr extends HTMLVideoElement {
5
- plyr: Plyr;
6
- }
7
- type Props = {
8
- readonly playbackId: string;
9
- readonly poster: string;
10
- readonly currentTime?: number;
11
- readonly onLoaded: () => void;
12
- readonly onError: (error: ErrorEvent) => void;
13
- readonly onSize: (dim: {
14
- width: number;
15
- height: number;
16
- }) => void;
17
- readonly autoPlay?: boolean;
18
- };
19
- export declare const VideoPlayerWithControls: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLVideoElementWithPlyr>>;
20
- export {};
@@ -1,104 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /* eslint-disable no-console */
3
- /* eslint-disable react/require-default-props */
4
- import Hls from 'hls.js';
5
- import 'plyr/dist/plyr.css';
6
- import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
7
- import './video-player.css';
8
- const useCombinedRefs = function (...refs) {
9
- const targetRef = useRef(null);
10
- useEffect(() => {
11
- refs.forEach((ref) => {
12
- if (!ref)
13
- return;
14
- if (typeof ref === 'function') {
15
- ref(targetRef.current);
16
- }
17
- else {
18
- ref.current = targetRef.current;
19
- }
20
- });
21
- }, [refs]);
22
- return targetRef;
23
- };
24
- export const VideoPlayerWithControls = forwardRef(({ playbackId, poster, currentTime, onLoaded, onError, onSize, autoPlay }, ref) => {
25
- const videoRef = useRef(null);
26
- const metaRef = useCombinedRefs(ref, videoRef);
27
- const playerRef = useRef(null);
28
- const [playerInitTime] = useState(Date.now());
29
- const videoError = useCallback((event) => onError(event), [onError]);
30
- const onImageLoad = useCallback((event) => {
31
- const [w, h] = [event.target.width, event.target.height];
32
- if (w && h) {
33
- onSize({ width: w, height: h });
34
- onLoaded();
35
- }
36
- else {
37
- onLoaded();
38
- console.error('Error getting img dimensions', event);
39
- }
40
- }, [onLoaded, onSize]);
41
- /*
42
- * See comment above -- we're loading the poster image just so we can grab the dimensions
43
- * which determines styles for the player
44
- */
45
- useEffect(() => {
46
- const img = new Image();
47
- img.onload = (evt) => onImageLoad(evt);
48
- img.src = poster;
49
- }, [onImageLoad, poster]);
50
- useEffect(() => {
51
- const video = videoRef.current;
52
- const src = `https://stream.mux.com/${playbackId}.m3u8`;
53
- let hls;
54
- hls = null;
55
- if (video) {
56
- video.addEventListener('error', videoError);
57
- const Plyr = require('plyr');
58
- playerRef.current = new Plyr(video, {
59
- previewThumbnails: {
60
- enabled: true,
61
- src: `https://image.mux.com/${playbackId}/storyboard.vtt`,
62
- },
63
- storage: { enabled: false },
64
- fullscreen: {
65
- iosNative: true,
66
- },
67
- captions: { active: true, language: 'auto', update: true },
68
- });
69
- if (video.canPlayType('application/vnd.apple.mpegurl')) {
70
- // This will run in safari, where HLS is supported natively
71
- video.src = src;
72
- }
73
- else if (Hls.isSupported()) {
74
- // This will run in all other modern browsers
75
- hls = new Hls();
76
- hls.loadSource(src);
77
- hls.attachMedia(video);
78
- hls.on(Hls.Events.ERROR, (_event, data) => {
79
- if (data.fatal) {
80
- videoError(new ErrorEvent('HLS.js fatal error'));
81
- }
82
- });
83
- }
84
- else {
85
- console.error('This is an old browser that does not support MSE https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API');
86
- }
87
- }
88
- return () => {
89
- if (video) {
90
- video.removeEventListener('error', videoError);
91
- }
92
- if (hls) {
93
- hls.destroy();
94
- }
95
- };
96
- }, [playbackId, playerInitTime, videoError, videoRef]);
97
- useEffect(() => {
98
- const video = videoRef.current;
99
- if (currentTime && video) {
100
- video.currentTime = currentTime;
101
- }
102
- }, [currentTime]);
103
- return (_jsx("div", { className: "video-container", children: _jsx("video", { ref: metaRef, autoPlay: autoPlay, poster: poster, controls: true, playsInline: true }) }));
104
- });
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const WriteInReact: React.FC;
@@ -1,10 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ChooseTemplate } from './ChooseTemplate';
3
- import { GetStarted } from './GetStartedStrip';
4
- export const WriteInReact = () => {
5
- return (_jsxs("div", { children: [_jsx("h1", { className: "text-5xl lg:text-[5em] text-center fontbrand font-black leading-none ", style: {
6
- textShadow: '0 5px 30px var(--background)',
7
- }, children: "Make videos programmatically." }), _jsxs("p", { style: {
8
- textShadow: '0 5px 30px var(--background)',
9
- }, className: "font-medium text-center text-lg", children: ["Create real MP4 videos with React. ", _jsx("br", {}), "Parametrize content, render server-side and build applications."] }), _jsx("br", {}), _jsx("div", { children: _jsx(GetStarted, {}) }), _jsx("br", {}), _jsx("br", {}), _jsx(ChooseTemplate, {})] }));
10
- };
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const YouAreHere: React.FC;
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- const container = {
3
- width: '100%',
4
- display: 'inline-flex',
5
- justifyContent: 'center',
6
- position: 'relative',
7
- };
8
- const label = {
9
- backgroundColor: 'var(--ifm-color-primary)',
10
- fontWeight: 'bold',
11
- color: 'white',
12
- paddingLeft: 8,
13
- paddingRight: 8,
14
- paddingTop: 4,
15
- paddingBottom: 4,
16
- borderRadius: 6,
17
- fontSize: 13,
18
- position: 'absolute',
19
- marginTop: -25,
20
- };
21
- export const YouAreHere = () => {
22
- return (_jsx("div", { style: container, children: _jsx("div", { style: label, children: "YOU ARE HERE" }) }));
23
- };
@@ -1,19 +0,0 @@
1
- import type { ButtonHTMLAttributes, DetailedHTMLProps } from 'react';
2
- import React from 'react';
3
- type ExtraProps = {
4
- readonly size: Size;
5
- readonly background: string;
6
- readonly hoverColor?: string;
7
- readonly color: string;
8
- readonly loading: boolean;
9
- };
10
- type Size = 'sm' | 'bg';
11
- type Props = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> & ExtraProps;
12
- type MandatoryProps = Omit<ExtraProps, 'background' | 'color' | 'hoverColor'>;
13
- type PrestyledProps = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement> & MandatoryProps;
14
- export declare const Button: React.FC<Props>;
15
- export declare const BlueButton: React.FC<PrestyledProps>;
16
- export declare const PlainButton: React.FC<PrestyledProps>;
17
- export declare const RedButton: React.FC<PrestyledProps>;
18
- export declare const ClearButton: React.FC<PrestyledProps>;
19
- export {};
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { opacify } from 'polished';
3
- import { cn } from '../../../cn';
4
- import { RED, UNDERLAY_RED } from './colors';
5
- export const Button = (props) => {
6
- var _a, _b, _c;
7
- const { children, loading, hoverColor, color, size, className, ...other } = props;
8
- const actualDisabled = other.disabled || loading;
9
- return (_jsx("button", { type: "button", className: cn('text-base rounded-lg font-bold appearance-none border-2 border-solid border-black border-b-4 font-sans flex flex-row items-center justify-center ', className), disabled: actualDisabled, ...other, style: {
10
- ...((_a = props.style) !== null && _a !== void 0 ? _a : {}),
11
- padding: (_c = (_b = props.style) === null || _b === void 0 ? void 0 : _b.padding) !== null && _c !== void 0 ? _c : (props.size === 'sm' ? '10px 16px' : '16px 22px'),
12
- color: props.color,
13
- cursor: props.disabled ? 'default' : 'pointer',
14
- backgroundColor: props.background,
15
- opacity: props.disabled ? 0.7 : 1,
16
- }, children: children }));
17
- };
18
- export const BlueButton = (props) => {
19
- return _jsx(Button, { ...props, background: "var(--blue-underlay)", color: "white" });
20
- };
21
- export const PlainButton = (props) => {
22
- return (_jsx(Button, { ...props, background: "var(--plain-button)", color: "var(--text-color)" }));
23
- };
24
- export const RedButton = (props) => {
25
- return (_jsx(Button, { ...props, background: UNDERLAY_RED, hoverColor: opacify(0.1, UNDERLAY_RED), color: RED }));
26
- };
27
- export const ClearButton = (props) => {
28
- return (_jsx(Button, { ...props, background: "transparent", color: "var(--text-color)", hoverColor: "var(--clear-hover)" }));
29
- };
@@ -1,13 +0,0 @@
1
- export declare const PALETTE: {
2
- BOX_STROKE: string;
3
- TEXT_COLOR: string;
4
- BORDER_COLOR: string;
5
- BRAND: string;
6
- };
7
- export declare const FONTS: {
8
- GTPLANAR: string;
9
- };
10
- export declare const UNDERLAY_BLUE: string;
11
- export declare const RED = "#e74c3c";
12
- export declare const UNDERLAY_RED: string;
13
- export declare const BLUE_TEXT: string;
@@ -1,14 +0,0 @@
1
- import { darken, transparentize } from 'polished';
2
- export const PALETTE = {
3
- BOX_STROKE: 'var(--box-stroke)',
4
- TEXT_COLOR: 'var(--text-color)',
5
- BORDER_COLOR: 'var(--border-color)',
6
- BRAND: 'var(--ifm-color-primary)',
7
- };
8
- export const FONTS = {
9
- GTPLANAR: 'GTPlanar',
10
- };
11
- export const UNDERLAY_BLUE = transparentize(0.85, '#42e9f5');
12
- export const RED = '#e74c3c';
13
- export const UNDERLAY_RED = transparentize(0.9, RED);
14
- export const BLUE_TEXT = darken(0.3, '#42e9f5');
@@ -1,21 +0,0 @@
1
- /**
2
- * Copyright (c) Facebook, Inc. and its affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
- import React, { type ReactNode } from 'react';
8
- type ContextValue = {
9
- /** Current color mode. */
10
- readonly colorMode: ColorMode;
11
- /** Set new color mode. */
12
- readonly setColorMode: (colorMode: ColorMode) => void;
13
- };
14
- export type ColorMode = 'light' | 'dark';
15
- export declare const ColorModeProvider: ({ children, colorMode, setColorMode, }: {
16
- readonly children: React.ReactNode;
17
- readonly setColorMode: (colorMode: ColorMode) => void;
18
- readonly colorMode: ColorMode;
19
- }) => ReactNode;
20
- export declare function useColorMode(): ContextValue;
21
- export {};
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- /**
3
- * Copyright (c) Facebook, Inc. and its affiliates.
4
- *
5
- * This source code is licensed under the MIT license found in the
6
- * LICENSE file in the root directory of this source tree.
7
- */
8
- import React, { useContext, useMemo } from 'react';
9
- const Context = React.createContext(undefined);
10
- export const ColorModeProvider = ({ children, colorMode, setColorMode, }) => {
11
- const value = useMemo(() => {
12
- return { colorMode, setColorMode };
13
- }, [colorMode, setColorMode]);
14
- return _jsx(Context.Provider, { value: value, children: children });
15
- };
16
- export function useColorMode() {
17
- const context = useContext(Context);
18
- if (context === null || context === undefined) {
19
- throw new Error('ColorModeProvider');
20
- }
21
- return context;
22
- }
@@ -1,5 +0,0 @@
1
- export type Size = {
2
- width: number;
3
- height: number;
4
- };
5
- export declare const useElementSize: (ref: HTMLElement | null) => Size | null;
@@ -1,40 +0,0 @@
1
- import { useCallback, useEffect, useMemo, useState } from 'react';
2
- export const useElementSize = (ref) => {
3
- const [size, setSize] = useState(null);
4
- const observer = useMemo(() => {
5
- if (typeof ResizeObserver === 'undefined') {
6
- return;
7
- }
8
- return new ResizeObserver((entries) => {
9
- setSize({
10
- width: entries[0].contentRect.width,
11
- height: entries[0].contentRect.height,
12
- });
13
- });
14
- }, []);
15
- const updateSize = useCallback(() => {
16
- if (ref === null) {
17
- return;
18
- }
19
- const rect = ref.getClientRects();
20
- setSize({
21
- width: rect[0].width,
22
- height: rect[0].height,
23
- });
24
- }, [ref]);
25
- useEffect(() => {
26
- updateSize();
27
- if (!observer) {
28
- return;
29
- }
30
- if (ref) {
31
- observer.observe(ref);
32
- }
33
- return () => {
34
- if (ref) {
35
- observer.unobserve(ref);
36
- }
37
- };
38
- }, [observer, ref, updateSize]);
39
- return size;
40
- };
@@ -1 +0,0 @@
1
- export declare const useMobileLayout: () => boolean;
@@ -1,6 +0,0 @@
1
- import { useElementSize } from './use-el-size';
2
- export const useMobileLayout = () => {
3
- var _a;
4
- const containerSize = useElementSize(typeof document === 'undefined' ? null : document.body);
5
- return ((_a = containerSize === null || containerSize === void 0 ? void 0 : containerSize.width) !== null && _a !== void 0 ? _a : Infinity) < 900;
6
- };
@@ -1,3 +0,0 @@
1
- import type { SVGProps } from 'react';
2
- import React from 'react';
3
- export declare const Blank: React.FC<SVGProps<SVGSVGElement>>;
@@ -1,4 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- export const Blank = (props) => {
3
- return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 384 512", ...props, children: _jsx("path", { fill: "currentColor", d: "M0 64C0 28.65 28.65 0 64 0H220.1C232.8 0 245.1 5.057 254.1 14.06L369.9 129.9C378.9 138.9 384 151.2 384 163.9V448C384 483.3 355.3 512 320 512H64C28.65 512 0 483.3 0 448V64zM352 192H240C213.5 192 192 170.5 192 144V32H64C46.33 32 32 46.33 32 64V448C32 465.7 46.33 480 64 480H320C337.7 480 352 465.7 352 448V192zM347.3 152.6L231.4 36.69C229.4 34.62 226.8 33.18 224 32.48V144C224 152.8 231.2 160 240 160H351.5C350.8 157.2 349.4 154.6 347.3 152.6z" }) }));
4
- };
@@ -1,2 +0,0 @@
1
- import type { SVGProps } from 'react';
2
- export declare const CloneIcon: React.FC<SVGProps<SVGSVGElement>>;
@@ -1,2 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- export const CloneIcon = (props) => (_jsx("svg", { ...props, viewBox: "0 0 512 512", children: _jsx("path", { fill: "currentcolor", d: "M288 448L64 448l0-224 64 0 0-64-64 0c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l224 0c35.3 0 64-28.7 64-64l0-64-64 0 0 64zm-64-96l224 0c35.3 0 64-28.7 64-64l0-224c0-35.3-28.7-64-64-64L224 0c-35.3 0-64 28.7-64 64l0 224c0 35.3 28.7 64 64 64z" }) }));
@@ -1,3 +0,0 @@
1
- import type { SVGProps } from 'react';
2
- import React from 'react';
3
- export declare const CodeHike: React.FC<SVGProps<SVGSVGElement>>;
@@ -1,4 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const CodeHike = (props) => {
3
- return (_jsxs("svg", { ...props, viewBox: "-100 -100 200 200", fill: "currentColor", children: [_jsx("path", { d: "M 70 60 L 42 -27 L 72 -27 L 100 60 Z" }), _jsx("path", { d: "M 20.419540229885058 40.05357142857142 L 42 -27 L 72 -27 L 50.41954022988506 40.05357142857142 Z" }), _jsx("path", { d: "M 20.419540229885058 40.05357142857142 L -15 -70 L 15 -70 L 50.41954022988506 40.05357142857142 Z" }), _jsx("path", { d: "M -50.41954022988506 40.05357142857142 L -15 -70 L 15 -70 L -20.419540229885058 40.05357142857142 Z" }), _jsx("path", { d: "M -50.41954022988506 40.05357142857142 L -72 -27 L -42 -27 L -20.419540229885058 40.05357142857142 Z" }), _jsx("path", { d: "M -100 60 L -72 -27 L -42 -27 L -70 60 Z" })] }));
4
- };