fixed metamask button

This commit is contained in:
ayomaska18
2024-10-26 23:04:06 +01:00
13 changed files with 331 additions and 43 deletions

View File

@@ -0,0 +1,51 @@
'use client';
import React from 'react';
import {
Card,
CardHeader,
CardFooter,
CardTitle,
CardDescription,
CardContent,
} from '@/components/ui/card';
interface props {
name: string;
description: string;
location: string;
eventStartDate: number;
eventHost: string;
imageURL: string | null;
}
const FeaturedEvent = ({
name,
description,
location,
eventStartDate,
eventHost,
imageURL,
}: props) => {
return (
<Card>
<CardHeader>
{imageURL && <img src={imageURL} alt={name}></img>}
<CardTitle>{name}</CardTitle>
<CardDescription>
{location}
<br />
{new Date(eventStartDate * 1000).toLocaleString()}
</CardDescription>
</CardHeader>
<CardContent>{description}</CardContent>
<CardFooter>
<i>
Host: {eventHost.substring(0, 8)}...
{eventHost.substring(eventHost.length - 3)}
</i>
</CardFooter>
</Card>
);
};
export default FeaturedEvent;

View File

@@ -3,8 +3,8 @@ import React from 'react';
const Footer = () => {
return (
<footer className="text-center mt-8">
<p className="text-gray-500">
&copy; 2024 Ticket Chain. All rights reserved.
<p className="text-light-purple text-opacity-75">
&copy; 2024 TicketChain. All rights reserved.
</p>
</footer>
);

View File

@@ -36,14 +36,16 @@ const Header = () => {
></div>
<div className="container mx-auto px-6 py-4 flex justify-between items-center">
<Link href="/" legacyBehavior>
<a className="text-2xl font-semibold text-white">TicketChain</a>
<a className="text-2xl font-semibold text-white hover:text-light-purple hover:text-opacity-75 transition-colors duration-300">
TicketChain
</a>
</Link>
<nav className="nav">
<ul className="flex space-x-6">
<li>
<Link href="/" legacyBehavior>
<a
className="text-white hover:text-blue-500 transition-colors duration-300"
className="text-white hover:text-light-purple hover:text-opacity-75 transition-colors duration-300"
style={{ textShadow: '1px 1px 2px rgba(0, 0, 0, 0.5)' }}
>
Home
@@ -53,7 +55,7 @@ const Header = () => {
<li>
<Link href="/events" legacyBehavior>
<a
className="text-white hover:text-blue-500 transition-colors duration-300"
className="text-white hover:text-light-purple hover:text-opacity-75 transition-colors duration-300"
style={{ textShadow: '1px 1px 2px rgba(0, 0, 0, 0.5)' }}
>
Events
@@ -63,7 +65,7 @@ const Header = () => {
<li>
<Link href="/contact" legacyBehavior>
<a
className="text-white hover:text-blue-500 transition-colors duration-300"
className="text-white hover:text-light-purple hover:text-opacity-75 transition-colors duration-300"
style={{ textShadow: '1px 1px 2px rgba(0, 0, 0, 0.5)' }}
>
Contact

View File

@@ -0,0 +1,98 @@
'use client';
import React, { useCallback, useEffect, useState } from 'react';
import { AnimatePresence, motion } from 'framer-motion';
import { cn } from '@/lib/utils';
export const FlipWords = ({
words,
duration = 3000,
className,
}: {
words: string[];
duration?: number;
className?: string;
}) => {
const [currentWord, setCurrentWord] = useState(words[0]);
const [isAnimating, setIsAnimating] = useState<boolean>(false);
// thanks for the fix Julian - https://github.com/Julian-AT
const startAnimation = useCallback(() => {
const word = words[words.indexOf(currentWord) + 1] || words[0];
setCurrentWord(word);
setIsAnimating(true);
}, [currentWord, words]);
useEffect(() => {
if (!isAnimating)
setTimeout(() => {
startAnimation();
}, duration);
}, [isAnimating, duration, startAnimation]);
return (
<AnimatePresence
onExitComplete={() => {
setIsAnimating(false);
}}
>
<motion.div
initial={{
opacity: 0,
y: 10,
}}
animate={{
opacity: 1,
y: 0,
}}
transition={{
type: 'spring',
stiffness: 100,
damping: 10,
}}
exit={{
opacity: 0,
y: -40,
x: 40,
filter: 'blur(8px)',
scale: 2,
position: 'absolute',
}}
className={cn(
'z-10 inline-block relative text-left text-neutral-900 dark:text-neutral-100 px-2',
className
)}
key={currentWord}
>
{/* edit suggested by Sajal: https://x.com/DewanganSajal */}
{currentWord.split(' ').map((word, wordIndex) => (
<motion.span
key={word + wordIndex}
initial={{ opacity: 0, y: 10, filter: 'blur(8px)' }}
animate={{ opacity: 1, y: 0, filter: 'blur(0px)' }}
transition={{
delay: wordIndex * 0.3,
duration: 0.3,
}}
className="inline-block whitespace-nowrap"
>
{word.split('').map((letter, letterIndex) => (
<motion.span
key={word + letterIndex}
initial={{ opacity: 0, y: 10, filter: 'blur(8px)' }}
animate={{ opacity: 1, y: 0, filter: 'blur(0px)' }}
transition={{
delay: wordIndex * 0.3 + letterIndex * 0.05,
duration: 0.2,
}}
className="inline-block"
>
{letter}
</motion.span>
))}
<span className="inline-block">&nbsp;</span>
</motion.span>
))}
</motion.div>
</AnimatePresence>
);
};