Skip to content

🎥 Make videos programmatically with React

add edge blur testcase and remove font load

Jonny Burgerda4c59587bf1
diff --git a/packages/example/src/EdgeBlur/EdgeBlur.tsx b/packages/example/src/EdgeBlur/EdgeBlur.tsx
new file mode 100644
index 0000000000..e07baa68d3
--- /dev/null
+++ b/packages/example/src/EdgeBlur/EdgeBlur.tsx
@@ -0,0 +1,38 @@
+import {AbsoluteFill, Img} from 'remotion';
+
+const edgeBlurWithOffset = (offset: number): React.CSSProperties => {
+ return {
+ backdropFilter: `blur(${offset}px)`,
+ inset: offset,
+ width: `calc(100% - ${offset * 2}px)`,
+ height: `calc(100% - ${offset * 2}px)`,
+ };
+};
+
+export const EdgeBlur: React.FC = () => {
+ return (
+ <AbsoluteFill>
+ <Img src="https://images.pexels.com/photos/8361426/pexels-photo-8361426.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2" />
+ <AbsoluteFill
+ style={{
+ clipPath: `inset(${40}px ${40}px ${40}px ${40}px)`,
+ }}
+ >
+ <AbsoluteFill
+ style={{
+ position: 'relative',
+ }}
+ >
+ <Img src="https://images.pexels.com/photos/8361426/pexels-photo-8361426.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=2" />
+ <AbsoluteFill
+ style={{
+ backgroundColor: `rgba(255,255,255, 0.5)`,
+ inset: 40,
+ ...edgeBlurWithOffset(200),
+ }}
+ ></AbsoluteFill>
+ </AbsoluteFill>
+ </AbsoluteFill>
+ </AbsoluteFill>
+ );
+};
diff --git a/packages/example/src/LoadFontBasedOnInfo.ts b/packages/example/src/LoadFontBasedOnInfo.ts
index 9c289d767d..e69de29bb2 100644
--- a/packages/example/src/LoadFontBasedOnInfo.ts
+++ b/packages/example/src/LoadFontBasedOnInfo.ts
@@ -1,8 +0,0 @@
-import {getInfo} from '@remotion/google-fonts/InterTight';
-import {loadFontFromInfo} from '@remotion/google-fonts/from-info';
-
-const info = getInfo();
-const {fontFamily, waitUntilDone} = loadFontFromInfo(info, 'italic');
-
-console.log(fontFamily);
-waitUntilDone();
diff --git a/packages/example/src/Root.tsx b/packages/example/src/Root.tsx
index dce19bc0df..84a3c5624d 100644
--- a/packages/example/src/Root.tsx
+++ b/packages/example/src/Root.tsx
@@ -38,7 +38,6 @@ import {HlsDemo} from './Hls/HlsDemo';
import {HugeImage} from './HugeImage';
import {HugePayload, hugePayloadSchema} from './HugePayload';
import {Layers} from './Layers';
-import './LoadFontBasedOnInfo';
import {ManyAudio} from './ManyAudio';
import {HandleAudioRenderError} from './MediaErrorHandling/HandleAudioRenderError';
import {InfiniteAudio} from './MediaErrorHandling/InfiniteAudio';
@@ -122,6 +121,7 @@ import {
whatIsRemotionCalculateMetadata,
whatIsRemotionSchema,
} from './Compose/WhatIsRemotion';
+import {EdgeBlur} from './EdgeBlur/EdgeBlur';
import {Empty} from './Empty';
import {LoopedOffthreadRemoteVideo} from './OffthreadRemoteVideo/LoopedOffthreadRemoteVideo';
import {ParseAndDownloadMedia} from './ParseAndDownloadMedia';
@@ -546,6 +546,14 @@ export const Index: React.FC = () => {
width={1080}
height={1080}
/>
+ <Folder name="edge-blur">
+ <Still
+ width={1000}
+ height={1500}
+ component={EdgeBlur}
+ id="edge-blur"
+ ></Still>
+ </Folder>
</Folder>
<Folder name="creatives">
<Composition