Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Wrapped banner to Companion home page #130

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/videos/wrapped-bg.mp4
Binary file not shown.
62 changes: 49 additions & 13 deletions src/components/companion/CompanionHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { Connection, ConnectionsList } from './connections/connections-list';
import { Badge } from '@/pages/companion/badges';
import NavBarContainer from './navigation/NavBarContainer';
import { CompanionButton } from '../../../src/components/ui/companion-button';
import { AnimatedBorder } from '@/components/ui/animated-border';
import Link from 'next/link';

interface CompanionHomeProps {
isPartner: boolean | undefined,
Expand Down Expand Up @@ -48,6 +50,45 @@ const Counter = ({ value }: { value: number }) => {
);
};

const WrappedBanner = () => {
return (
<Link href="/companion/wrapped" className="block w-full">
<AnimatedBorder className="w-full" padding="0px">
<div className="relative w-full h-[300px] rounded-[11px] overflow-hidden bg-gradient-to-br from-[#030B13] to-[#1E3A8A] cursor-pointer transform transition-transform hover:scale-[1.02]">
{/* Video Background */}
<div className="absolute inset-0">
<video
autoPlay
loop
muted
playsInline
className="w-full h-full object-cover opacity-60"
>
<source
src="/videos/wrapped-bg.mp4"
type="video/mp4"
/>
</video>
<div className="absolute inset-0 bg-gradient-to-t from-black/40 to-transparent" />
</div>

{/* Content */}
<div className="relative z-10 h-full flex flex-col justify-between items-center text-center p-8">
<div /> {/* Empty div for spacing */}
<div className="space-y-2">
<div className="text-lg font-bold text-white">Your <span className="text-[#ADCAF5]">Blue</span>Print Wrapped</div>
<p className="text-white/80">Check out how you got your start.</p>
</div>
<button className="bg-[#4B9CFF] hover:bg-[#3B7FFF] text-white w-fit px-8 py-3 rounded-full font-medium transition-colors">
Let&apos;s go
</button>
</div>
</div>
</AnimatedBorder>
</Link>
);
};

const CompanionHome: React.FC<CompanionHomeProps> = ({
isPartner,
userName,
Expand All @@ -73,19 +114,6 @@ const CompanionHome: React.FC<CompanionHomeProps> = ({
<NavBarContainer isPartner={isPartner}>
{/* Welcome Section */}
<motion.div className="font-[500] p-5 rounded-3xl" variants={itemVariants}>
{!isPartner && (
<div className="w-full flex justify-center">
<div className="p-8 bg-[#030B13] rounded-2xl w-fit">
<div className="flex justify-between items-center mb-4">
<CompanionButton href="/companion/wrapped">
<span className="text-[12px] translate-y-[1px]">🚀 VIEW WRAPPED</span>
<span className="text-lg translate-y-[-3px]">↗</span>
</CompanionButton>
</div>
<div className="h-[1px] bg-white/10 mb-4" />
</div>
</div>
)}
<div className="text-[28px] font-medium mb-3 text-white">
Welcome, <GradientText>{userName}</GradientText>
</div>
Expand Down Expand Up @@ -115,6 +143,14 @@ const CompanionHome: React.FC<CompanionHomeProps> = ({
</div>
</motion.div>

{!isPartner && (
<motion.div variants={itemVariants}>
<div className="w-full">
<WrappedBanner />
</div>
</motion.div>
)}


{/* Badges Section – rendered only if not partner */}
{badges &&
Expand Down