|
@@ -1,11 +1,12 @@
|
|
|
import React from "react";
|
|
import React from "react";
|
|
|
-import { Composition, Sequence, AbsoluteFill, Audio, staticFile, Img } from "remotion";
|
|
|
|
|
|
|
+import { Composition, Sequence, AbsoluteFill, Audio, staticFile, Img, useCurrentFrame, interpolate } from "remotion";
|
|
|
import type { TemplateType, AspectRatio } from "@pipeline/shared";
|
|
import type { TemplateType, AspectRatio } from "@pipeline/shared";
|
|
|
import type { WordTimestamp } from "@pipeline/shared";
|
|
import type { WordTimestamp } from "@pipeline/shared";
|
|
|
import NewsScene from "./news/index";
|
|
import NewsScene from "./news/index";
|
|
|
import KnowledgeScene from "./knowledge/index";
|
|
import KnowledgeScene from "./knowledge/index";
|
|
|
import OpinionScene from "./opinion/index";
|
|
import OpinionScene from "./opinion/index";
|
|
|
import MarketingScene from "./marketing/index";
|
|
import MarketingScene from "./marketing/index";
|
|
|
|
|
+import { THEMES } from "./base/theme/colors";
|
|
|
|
|
|
|
|
export interface RemotionScene {
|
|
export interface RemotionScene {
|
|
|
id: string;
|
|
id: string;
|
|
@@ -127,6 +128,7 @@ const TemplateComposition: React.FC<RemotionProps> = (props) => {
|
|
|
</Sequence>
|
|
</Sequence>
|
|
|
);
|
|
);
|
|
|
})}
|
|
})}
|
|
|
|
|
+ <GlobalProgressBar totalFrames={totalFrames} color={THEMES[props.template].primary} />
|
|
|
</AbsoluteFill>
|
|
</AbsoluteFill>
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
@@ -228,7 +230,36 @@ const OutroScene: React.FC<{
|
|
|
);
|
|
);
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-import { useCurrentFrame, interpolate } from "remotion";
|
|
|
|
|
|
|
+const GlobalProgressBar: React.FC<{
|
|
|
|
|
+ totalFrames: number;
|
|
|
|
|
+ color: string;
|
|
|
|
|
+}> = ({ totalFrames, color }) => {
|
|
|
|
|
+ const frame = useCurrentFrame();
|
|
|
|
|
+ const progress = interpolate(frame, [0, totalFrames], [0, 100], {
|
|
|
|
|
+ extrapolateRight: "clamp",
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ return (
|
|
|
|
|
+ <div
|
|
|
|
|
+ style={{
|
|
|
|
|
+ position: "absolute",
|
|
|
|
|
+ bottom: 0,
|
|
|
|
|
+ left: 0,
|
|
|
|
|
+ width: "100%",
|
|
|
|
|
+ height: 4,
|
|
|
|
|
+ backgroundColor: "rgba(255,255,255,0.1)",
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ <div
|
|
|
|
|
+ style={{
|
|
|
|
|
+ width: `${progress}%`,
|
|
|
|
|
+ height: "100%",
|
|
|
|
|
+ backgroundColor: color,
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ );
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
const defaultProps: RemotionProps = {
|
|
const defaultProps: RemotionProps = {
|
|
|
scenes: [
|
|
scenes: [
|