Skip to content

Commit

Permalink
adjusting and finishing the animations in the third layout , it looks…
Browse files Browse the repository at this point in the history
… great !
  • Loading branch information
ZakGmd committed Mar 22, 2024
1 parent 1ab86f0 commit d5cf015
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 82 deletions.
32 changes: 4 additions & 28 deletions app/third/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Image from "next/image";
import Link from "next/link";
import Card from "../ui/card";
import Text from "../ui/text";



export default function Third(){
Expand All @@ -11,7 +11,7 @@ export default function Third(){
<div className="absolute top-[-200px] left-[440px] w-[790px] shadow-[0_210px_430px_30px_rgba(84,88,223,0.17)] h-[200px] z-10 rounded-full">
</div>
<div className="w-full items-center justify-center flex flex-col overflow-hidden ">
<div className=" px-[436px] pt-[78px] flex flex-col gap-9 items-start ">
<div className=" px-[436px] pt-[78px] flex flex-col gap-9 items-start ">
<div className="flex flex-col w-full items-center justify-center gap-6">
<div className="py-[6px] px-3 rounded-[56px] border-[0.5px] border-white bg-gradient-to-b from-[#ffffff14] from-74.55% to-[#40404014] to-131.94% shadow-[0px_1px_2px_0px_rgba(0, 0, 0, 0.10), 0px_3px_7px_1px_rgba(0, 0, 0, 0.20) inset] text-white text-center text-[13px] font-medium leading-5 tracking-[-0.26px] ">New Update <span className="text-[#8B8B8B]">Joe,Sales artisan</span></div>
<div className="max-w-[568px] text-center text-[48px] font-medium leading-[60px] tracking-[-1.44px] bg-clip-text text-transparent bg-gradient-to-b from-white from-14.91% to-[#676767] to-148.91% ">Crafting Digital Artisans & World-Class Software</div>
Expand All @@ -20,32 +20,8 @@ export default function Third(){
<div className="flex items-center justify-center w-full">
<Link href={""} className="flex justify-center items-center gap-[10px] rounded-[56px] py-[12px] px-6 bg-gradient-to-br from-[#5834BD] from-[74.55%] to-[#2E1C62] to-[131.94%] text-white text-[18px] font-medium leading-[20px] tracking-[-0.36px]">Hire Ava</Link>
</div>

</div>
<div className="w-full relative flex flex-col items-center justify-center mt-[64px] ">
<div className="absolute top-[100px] w-[588px] h-[323px] shrink-0 rounded-[16px] bg-[#5458dfb3] blur-[242px] -z-10"></div>
<div className="max-w-[631px] w-full h-[340px] shrink-0 rounded-2xl border border-white/15 bg-gradient-to-b from-[#1c1926f5] from-[-10.57%] to-[#000000f5] to-133.78% shadow-[0px_5px_4px_-1px_rgba(0, 0, 0, 0.15), 0px_0px_20px_0px_rgba(255, 255, 255, 0.03)]">
<div className="flex flex-col gap-[26px] items-start ">
<div className="px-[60px] pt-[31px] w-full flex flex-col gap-[23px] ">
<div className="text-center text-[13px] font-medium leading-5 tracking-[-0.26px] text-white/80 ">Today <span className="text-white/50">04:20 PM</span></div>
<div className="pt-[5px] inline-flex items-center gap-4 pl-1 ">
<div className="max-w-[430px] w-full text-right text-[16px] font-normal leading-5 tracking-[-0.32px] text-white/90 ">I need some leads!</div>
<Image src={"avatar.svg"} alt={"avatarLogoEmpty"} width={28} height={28}/>
</div>
<div className="max-w-[400px] flex items-start gap-4 ">
<Image src={"aiAvatar.svg"} alt={"avatar for ai"} width={28} height={28} />
<Text />
</div>
</div>
<div className="flex items-start gap-[21px] ml-[-60px]">
<Card title={"Bryn Booker"} comment={"CEO @bookerai"} src={"cardAvatar1.svg"} classname={"-rotate-2 hover:rotate-[-4deg] "} />
<Card title={"Drik Horton"} comment={"Founder of @horton"} src={"cardAvatar2.svg"} classname={"rotate-1 hover:rotate-[0deg] "} />
<Card title={"Adam Kramer"} comment={"Founder of Listup.ai"} src={"cardAvatar3.svg"} classname={"hover:rotate-[4deg] rotate-3 "}/>
</div>

</div>
</div>
</div>
</div>
<Card/>
</div>

</>
Expand Down
35 changes: 35 additions & 0 deletions app/ui/aiText.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use client"
import Image from "next/image";
import { useRef } from "react";
import gsap from "gsap";
import { useGSAP } from "@gsap/react";
import SplitText from "gsap-trial/SplitText" ;

gsap.registerPlugin(useGSAP);
gsap.registerPlugin(SplitText) ;

export default function AiText(){
const text = useRef(null) ;
const aiAvatar = useRef(null) ;

useGSAP(() => {
var splitText = new SplitText(text.current,{type: "chars"});
const tl = gsap.timeline() ;
tl.from(aiAvatar.current,{
autoAlpha: 0 ,
y:30 ,
ease: "power2.out" ,
duration: 0.4 ,
},"+=1.3").from(splitText.chars ,{
autoAlpha: 0 ,
stagger: 0.02 ,
})

})
return(
<div className="max-w-[400px] flex items-start gap-4 ">
<Image src={"aiAvatar.svg"} alt={"avatar for ai"} width={28} height={28} ref={aiAvatar} />
<div className=" flex-1 text-white/70 text-[16px] leading-5 tracking-[-0.32px] " ref={text}>Absolutely, I can help with that! I&apos;ve just scoured the internet for potential leads that align with our targets.</div>
</div>
)
}
71 changes: 43 additions & 28 deletions app/ui/card.tsx
Original file line number Diff line number Diff line change
@@ -1,39 +1,54 @@
"use client"
import Image from 'next/image'
import { gsap } from 'gsap';
import Cards from "../ui/cards";
import Text from "../ui/aiText";
import Prompt from "../ui/prompt";
import AiText from "../ui/aiText";
import { useRef } from "react";
import {useGSAP} from '@gsap/react'
import gsap from "gsap";
import { useGSAP } from "@gsap/react";
gsap.registerPlugin(useGSAP);

interface CardProps{
title: string ;
comment: string ;
src: string ;
classname: string ;
}




export default function Card({title , comment , src , classname}: CardProps){
export default function Card(){
const container = useRef(null) ;

useGSAP(()=>{
const tl = gsap.timeline() ;
tl.from(container.current,{
autoAlpha: 0 ,
y:200 ,
ease: "power2.out" ,
duration: 1 ,
}).from(".date",{
autoAlpha: 0,
duration:0.8 ,
ease: "power2.out" ,
y:-20 ,
}).from(".shape",{
autoAlpha: 0,
duration:0.8 ,
ease: "power2.out" ,
})

}) ;

})
return(
<div ref={container}>
<div className={` ${classname} w-[232px] h-[248px] px-[14px] pt-[20px] z-10 shrink-0 rounded-2xl border border-white/15 bg-gradient-to-b from-[#1c1926f5] from-[-10.57%] to-[#000000f5] to-133.78% shadow-[0px_5px_4px_-1px_rgba(0, 0, 0, 0.15), 0px_0px_20px_0px_rgba(255, 255, 255, 0.03)] hover:transform hover:transition hover:duration-700 hover:ease-in-out hover:translate-y-[-15px] cursor-pointer `}>
<div className="flex flex-col gap-[14px] ">
<div className=" pl-[9.16px] inline-flex items-center gap-[10.74px] ">
<Image src={src} alt={""} width={36} height={36}/>
<div className={`flex flex-col items-start `}>
<div className="text-[16px] font-medium leading-5 tracking-[-0.32px] text-white/90">Bryn Booker</div>
<div className="text-[12px] font-normal leading-[16px] tracking-[-0.12px] text-white/50 ">CEO @bookerai</div>
</div>
<div className="w-full relative flex flex-col items-center justify-center mt-[64px]" ref={container}>
<div className="absolute shape top-[100px] w-[588px] h-[323px] shrink-0 rounded-[16px] bg-[#5458dfb3] blur-[242px] -z-10"></div>
<div className="max-w-[631px] w-full h-[340px] shrink-0 rounded-2xl border border-white/15 bg-gradient-to-b from-[#1c1926f5] from-[-10.57%] to-[#000000f5] to-133.78% shadow-[0px_5px_4px_-1px_rgba(0, 0, 0, 0.15), 0px_0px_20px_0px_rgba(255, 255, 255, 0.03)]">
<div className="flex flex-col gap-[26px] items-start ">
<div className="px-[60px] pt-[31px] w-full flex flex-col gap-[23px] ">
<div className="text-center date text-[13px] font-medium leading-5 tracking-[-0.26px] text-white/80 ">Today <span className="text-white/50">04:20 PM</span></div>
<Prompt />
<AiText />
</div>
<div className="flex items-start gap-[21px] ml-[-60px]">
<Cards title={"Bryn Booker"} comment={"CEO @bookerai"} src={"cardAvatar1.svg"} classname={"-rotate-2 hover:rotate-[-4deg] "} />
<Cards title={"Drik Horton"} comment={"Founder of @horton"} src={"cardAvatar2.svg"} classname={"rotate-1 hover:rotate-[0deg] "} />
<Cards title={"Adam Kramer"} comment={"Founder of Listup.ai"} src={"cardAvatar3.svg"} classname={"hover:rotate-[4deg] rotate-3 "}/>
</div>

</div>
</div>
<div className={`w-[208px] h-[52px] shrink-0 rounded-md bg-[#ffffff08] `}></div>
</div>
</div>
</div>

)
}
43 changes: 43 additions & 0 deletions app/ui/cards.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
"use client"
import Image from 'next/image'
import { gsap } from 'gsap';
import { useRef } from "react";
import {useGSAP} from '@gsap/react' ;
gsap.registerPlugin(useGSAP);

interface CardProps{
title: string ;
comment: string ;
src: string ;
classname: string ;
}

export default function Cards({title , comment , src , classname}: CardProps){
const card = useRef(null) ;
useGSAP(()=>{
const tl = gsap.timeline() ;
tl.from(card.current,{
duration: 1 ,
autoAlpha: 0,
y:90 ,
ease: "power2.out" ,
},"+=3")
})
return(
<div ref={card} >
<div className={`cards ${classname} w-[232px] h-[248px] px-[14px] pt-[20px] z-10 shrink-0 rounded-2xl border border-white/15 bg-gradient-to-b from-[#1c1926f5] from-[-10.57%] to-[#000000f5] to-133.78% shadow-[0px_5px_4px_-1px_rgba(0, 0, 0, 0.15), 0px_0px_20px_0px_rgba(255, 255, 255, 0.03)] hover:transform hover:transition hover:duration-700 hover:ease-in-out hover:translate-y-[-15px] cursor-pointer `}>
<div className="flex flex-col gap-[14px] ">
<div className=" pl-[9.16px] inline-flex items-center gap-[10.74px] ">
<Image src={src} alt={""} width={36} height={36}/>
<div className={`flex flex-col items-start `}>
<div className="text-[16px] font-medium leading-5 tracking-[-0.32px] text-white/90">{title}</div>
<div className="text-[12px] font-normal leading-[16px] tracking-[-0.12px] text-white/50 ">{comment}</div>
</div>
</div>
<div className={`w-[208px] h-[52px] shrink-0 rounded-md bg-[#ffffff08] `}></div>
</div>
</div>
</div>

)
}
27 changes: 27 additions & 0 deletions app/ui/prompt.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"use client"
import { useRef } from "react";
import gsap from "gsap";
import { useGSAP } from "@gsap/react";
import Image from "next/image" ;
gsap.registerPlugin(useGSAP);

export default function Prompt(){
const prompt = useRef(null) ;

useGSAP(()=>{
const tl = gsap.timeline() ;
tl.from(prompt.current,{
autoAlpha: 0 ,
y: 100 ,
duration: 0.4 ,
ease: "power2.out",
},"+=0.96")
})

return(
<div className="pt-[5px] inline-flex items-center gap-4 pl-1 " ref={prompt}>
<div className="textAnimate max-w-[430px] w-full text-right text-[16px] font-normal leading-5 tracking-[-0.32px] text-white/90 ">I need some leads!</div>
<Image src={"avatar.svg"} alt={"avatarLogoEmpty"} width={28} height={28} className="avatarAnimate"/>
</div>
)
}
26 changes: 0 additions & 26 deletions app/ui/text.tsx

This file was deleted.

0 comments on commit d5cf015

Please sign in to comment.