-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a7aff8
commit a3df2d9
Showing
5 changed files
with
185 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
import { auth } from "@/lib/firebase"; | ||
import { onAuthStateChanged } from "firebase/auth"; | ||
import { useState, useEffect } from "react"; | ||
import { CardComponent } from "./home" | ||
import Image from "next/image"; | ||
import Logo from "@/public/png/logo-no-background.png"; | ||
import Typewriter from "typewriter-effect"; | ||
import local from "@/public/png/logo-black.png"; | ||
export const CardCarousel = () => { | ||
const [showResponse, setShowResponse] = useState(false); | ||
const [showCard, setShowCard] = useState(false); | ||
const [text, setText] = useState(true); | ||
const [user, setUser] = useState(auth.currentUser); | ||
|
||
useEffect(() => { | ||
const unsubscribe = onAuthStateChanged(auth, (currentUser) => { | ||
setUser(currentUser); | ||
}); | ||
|
||
return () => unsubscribe(); | ||
}, []); | ||
|
||
const image = user?.photoURL || local; | ||
const robotText = `Hi ${user?.displayName}, Yes! I found a great one nearby. Check it out and book now.`; | ||
return ( | ||
<div className="flex gap-12 items-center"> | ||
<div className="relative bg-[#34343677] w-full max-w-[30rem] h-[21rem]"> | ||
<div className=" p-4 rounded-lg"> | ||
<div className="flex gap-2"> | ||
<Image | ||
src={Logo} | ||
alt="Loca logo" | ||
width={50} | ||
height={50} | ||
className="flex self-start" | ||
/> | ||
|
||
<div className="space-y-4"> | ||
{!showResponse && text && ( | ||
<div className="mt-32 ml-20"> | ||
<h1 className="animate-pulse bg-clip-text text-transparent bg-gradient-to-r from-blue-700 to-red-600 text-6xl"> | ||
Loca AI | ||
</h1> | ||
</div> | ||
)} | ||
{showResponse && ( | ||
<div className="text-[#caccce]"> | ||
<Typewriter | ||
onInit={(t) => { | ||
t.typeString(robotText) | ||
.callFunction(() => { | ||
setShowCard(true); | ||
}) | ||
.start(); | ||
}} | ||
/> | ||
</div> | ||
)} | ||
{showCard && <CardComponent />} | ||
</div> | ||
</div> | ||
</div> | ||
<div className="flex gap-2 p-6 items-center absolute -bottom-14 right-0 bg-[#131314] rounded-lg"> | ||
<Image | ||
src={image} | ||
alt="Loca logo" | ||
width={50} | ||
height={50} | ||
className="rounded-full" | ||
/> | ||
<div className="text-[#caccce] font-semibold"> | ||
<Typewriter | ||
onInit={(t) => { | ||
t.typeString( | ||
`<p className="text-[#caccce] font-semibold"> Hey <b>Loca</b>, any plumber near <br /> me in Texas</p>` | ||
) | ||
// .pauseFor(2500) | ||
.callFunction(() => { | ||
setShowResponse(true); | ||
setText(false); | ||
}) | ||
.start(); | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="relative lg:hidden xl:block hidden bg-[#34343677] w-full max-w-[30rem] h-80"> | ||
<div className=" p-4 rounded-lg"> | ||
<div className="flex gap-2"> | ||
<Image | ||
src={Logo} | ||
alt="Loca logo" | ||
width={50} | ||
height={50} | ||
className="flex self-start" | ||
/> | ||
|
||
<div className="space-y-4"> | ||
{!showResponse && text && ( | ||
<div className="mt-32 ml-20"> | ||
<h1 className="animate-pulse bg-clip-text text-transparent bg-gradient-to-r from-blue-700 to-red-600 text-6xl"> | ||
Loca AI | ||
</h1> | ||
</div> | ||
)} | ||
{showResponse && ( | ||
<div className="text-[#caccce]"> | ||
<Typewriter | ||
onInit={(t) => { | ||
t.typeString(robotText) | ||
.callFunction(() => { | ||
setShowCard(true); | ||
}) | ||
.start(); | ||
}} | ||
/> | ||
</div> | ||
)} | ||
{showCard && <CardComponent />} | ||
</div> | ||
</div> | ||
</div> | ||
<div className="flex gap-2 p-6 items-center absolute -bottom-14 right-0 bg-[#131314] rounded-lg"> | ||
<Image | ||
src={image} | ||
alt="Loca logo" | ||
width={50} | ||
height={50} | ||
className="rounded-full" | ||
/> | ||
<div className="text-[#caccce] font-semibold"> | ||
<Typewriter | ||
onInit={(t) => { | ||
t.typeString( | ||
`<p className="text-[#caccce] font-semibold"> Hey <b>Loca</b>, any plumber near <br /> me in Texas</p>` | ||
) | ||
// .pauseFor(2500) | ||
.callFunction(() => { | ||
setShowResponse(true); | ||
setText(false); | ||
}) | ||
.start(); | ||
}} | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Button } from "@/components/ui/button"; | ||
import { Link } from "lucide-react"; | ||
|
||
export const LocalServiceCard: React.FC<LocalServiceCardProps> = ({ | ||
name, | ||
address, | ||
rating, | ||
user_ratings_total, | ||
place_id, | ||
}) => { | ||
return ( | ||
<div className=" border-[2px] border-[#caccce] border-dotted p-4 space-y-2 mb-4 w-full lg:max-w-[410px] text-left"> | ||
<h3 className="text-white space-x-2 "><span className="text-primary-foreground font-semibold">Name:</span> {name}</h3> | ||
<p className="text-white space-x-2"><span className="text-primary-foreground font-semibold">Address:</span> {address}</p> | ||
<p className="text-white space-x-2"> | ||
<span className="text-primary-foreground font-semibold">Rating:</span> {rating} ({user_ratings_total} reviews) | ||
</p> | ||
<Button className="bg-blue-400 rounded-full p-6 hover:bg-blue-300 text-black" > | ||
{/* <Link | ||
href={`https://www.google.com/maps/place/?q=place_id:${place_id}`} | ||
className="text-black" | ||
> | ||
Book Now | ||
</Link> */} | ||
Book Now | ||
</Button> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.