feat: updated UI for rewind.

This commit is contained in:
sai80082 committed 2024-12-03 21:56:51 +05:30
1 parent 8312fc183d
commit 37da0ed69b
2 files changed
+50 -29

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@ import React from 'react';
import { Composition } from 'remotion'; import { Composition } from 'remotion';
import { IntroComposition, Scene } from './Composition'; import { IntroComposition, Scene } from './Composition';
const scenes: Scene[] = [ export const scenes: Scene[] = [
{ message: "Welcome Varun!", { message: "Welcome Varun!",
type: "WELCOME", type: "WELCOME",
emoji: "👋", emoji: "👋",
+49 -28
View File
@@ -1,33 +1,54 @@
import React from 'react' import { Player } from "@remotion/player";
import { Player } from '@remotion/player'; import { IntroComposition } from "../../remotion/Composition";
import { scenes } from "../../remotion/Root";
import { Button } from "@/components/ui/button";
import { IntroComposition } from '../../remotion/Composition';
const scenes = [
{ message: "Welcome to Immich Replay Varun!" },
{ message: "2024! So much memories!" },
{ message: "You've been to 10 new countries!" },
{ message: "And 25 new cities!" },
{ message: "Here are some of my favorite memories from this year!" },
{ message: "The most memory filled album of all time!" },
{ message: "You made so much memory with Soundarapandian"},
]
export default function RewindPage() { export default function RewindPage() {
const playerProps = {
component: IntroComposition,
inputProps: { scenes },
durationInFrames: scenes.length * 120,
compositionWidth: 720,
compositionHeight: 1280,
fps: 30,
controls: true,
autoPlay: true
};
const renderButton = (className = "") => (
<Button
size="lg"
className={`bg-gradient-to-r from-purple-600 to-blue-600 hover:from-purple-700 hover:to-blue-700 text-white rounded-full font-semibold ${className}`}
>
Render My Rewind 🎬
</Button>
);
return ( return (
<div> <div className="min-h-screen text-white flex flex-col">
<Player <h1 className="text-4xl font-bold text-center mt-4">Your 2024 Rewind</h1>
component={IntroComposition} <div className="flex-1 flex flex-col lg:flex-row h-full p-4 gap-4">
inputProps={{ scenes: scenes }}
durationInFrames={scenes.length * 30} <div className="flex-1 relative bg-gray-900 rounded-lg shadow-xl">
compositionWidth={1280} <Player
compositionHeight={720} {...playerProps}
fps={30} style={{
style={{ width: "100%",
width: 1280, height: "100%",
height: 720, position: "absolute",
}} top: 0,
controls left: 0,
/> }}
/>
</div>
<div className="flex-1 flex flex-col justify-center items-center p-4 lg:p-8 bg-gray-900 rounded-lg shadow-xl">
<h2 className="text-2xl font-semibold mb-4">Ready to create your video?</h2>
<p className="text-gray-300 mb-6 text-center">
Click the button below to render your personalized 2024 rewind video!
</p>
{renderButton("w-full lg:w-auto px-8 py-4")}
</div>
</div>
</div> </div>
) );
} }