diff --git a/app/callout.tsx b/app/callout.tsx new file mode 100644 index 0000000..07af226 --- /dev/null +++ b/app/callout.tsx @@ -0,0 +1,55 @@ +import React, { useState } from 'react'; +import { motion } from 'framer-motion'; + +const CalloutModal = ({ isOpen, onClose, item, onSubmit }) => { + const [tokenId, setTokenId] = useState(''); + + const handleTokenChange = (e) => { + setTokenId(e.target.value); + }; + + const handleSubmit = () => { + onSubmit(tokenId); + onClose(); + }; + + return isOpen ? ( + +
+ +
+

Make a new call!

+ + +
+ +

Type in a tokens short code, that you will think boom anytime soon

+ + +
+
+ ) : null; +}; + +export default CalloutModal; diff --git a/app/globals.css b/app/globals.css index ef506a2..7d4081c 100644 --- a/app/globals.css +++ b/app/globals.css @@ -14,7 +14,7 @@ body { :root { - --glassmorphism-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(0, 0, 0, 0.1) 100%); + --glassmorphism-gradient: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%); --glassmorphism-gradient-hover: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(0, 0, 0, 0.3) 100%); --glassmorphism-bg: rgba(255, 255, 255, 0.03); --glassmorphism-blur: 10px; @@ -60,12 +60,14 @@ body { justify-content: center; /* Center vertically */ align-items: center; /* Center horizontally */ position: relative; - transition: background-image 0.3s ease, box-shadow 0.3s ease, border 0.3s ease, backdrop-filter 0.3s ease; + transition:{duration:1} } .leaderboard-card:hover{ background: var(--glassmorphism-gradient-hover), var(--glassmorphism-bg); + transition:{duration:1} + } @@ -84,4 +86,23 @@ body { justify-content: center; /* Center vertically */ width: 100%; position:relative; /* Adjust padding as needed */ +} + + +.modal { + background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(0, 0, 0, 1) 100%), var(--glassmorphism-bg); + backdrop-filter: blur(var(--glassmorphism-blur)); + border: 1px solid var(--glassmorphism-border); + box-shadow: 0 4px 6px rgba(0, 0, 0, 1); + overflow: hidden; + transition: background 0.3s ease, box-shadow 0.3s ease, border 0.3s ease; +} + +.modal-bg { + background: linear-gradient(135deg, rgba(100, 100, 100, 0.02) 0%, rgba(0, 0, 0, 0.1) 100%), var(--glassmorphism-bg); + backdrop-filter: blur(var(--glassmorphism-blur)); + border: 1px solid var(--glassmorphism-border); + box-shadow: 0 4px 6px rgba(0, 0, 0, 1); + overflow: hidden; + transition: background 0.3s ease, box-shadow 0.3s ease, border 0.3s ease; } \ No newline at end of file diff --git a/app/modal.tsx b/app/modal.tsx index e8ce596..831afa7 100644 --- a/app/modal.tsx +++ b/app/modal.tsx @@ -1,32 +1,80 @@ // Modal.js -import React from 'react'; +import React, { useEffect,useState} from 'react'; +import { motion } from 'framer-motion'; const Modal = ({ isOpen, onClose, item }) => { + + const [details, setDetails] = useState(null); + + useEffect(() => { + if (isOpen && item) { + const fetchDetails = async () => { + try { + const response = await fetch(`https://api.callfi.io/get_user_callouts.php?tag=${item.username}`); + if (!response.ok) { + throw new Error('Network response was not ok'); + } + const data = await response.json(); + setDetails(data); + } catch (error) { + console.error('Failed to fetch user details:', error); + } + }; + + fetchDetails(); + } + }, [isOpen, item]); + if (!isOpen) return null; return ( -
-
+ +
{/* Modal content */} -
+
{/* Header */}
-

{item.username}s Details

- + */}
{/* Body */}
-

{item.username} has {item.points} points.

+

0 ? 'text-green-500' : 'text-red-500' + }`}>Total Gains : {parseFloat(item.points).toFixed(2)} x

+
+ {details != null ? ( +
+ {details.map((detail) => ( +

0 ? 'text-green-500' : 'text-red-400' + }`} + > + {detail.token}: {parseFloat(detail.gains).toFixed(2)}x [ + {parseFloat(detail.price_at_creation).toFixed(8) + ' => ' + parseFloat(detail.price_now).toFixed(8)}] +

+ ))} +
+ ) : ( +

Loading...

+ )} +
+
-
+
); }; diff --git a/app/page.tsx b/app/page.tsx index 46b662d..256d260 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -6,6 +6,10 @@ import { PrivyProvider, usePrivy } from "@privy-io/react-auth"; import { FaTwitter, FaWallet } from "react-icons/fa"; import { CheckIcon } from "@heroicons/react/outline"; import Modal from './modal'; +import CalloutModal from './callout'; + +import { motion } from 'framer-motion'; + // Helper functions to generate pseudo data const generateRandomName = () => { @@ -32,6 +36,7 @@ function Home() { const [leaderboardData, setLeaderboardData] = useState([]); const [isJoined, setIsJoined] = useState(false); const [selectedItem, setSelectedItem] = useState(null); // State to store selected leaderboard item + const [newCallModalOpen, setNewCallModalOpen] = useState(false); // Function to handle opening modal and setting selected item const openModal = (item) => { @@ -45,6 +50,19 @@ function Home() { setModalOpen(false); }; + const openNewCallModal = () => { + setNewCallModalOpen(true); + }; + + const closeNewCallModal = () => { + setNewCallModalOpen(false); + }; + + const handleNewCallSubmit = (tokenId) => { + const twitterIntentURL = `https://x.com/intent/tweet?text=%24${tokenId}%20is%20Booming%20rn%21%20See%20ya%20on%20the%20moon%21%0A%0A%23CallFi%20%23CallingIt`; + window.open(twitterIntentURL, '_blank'); + }; + useEffect(() => { if (darkMode) { document.documentElement.classList.add("dark"); @@ -182,8 +200,8 @@ function Home() {

Feeling Lucky?

Make a callout to a token you believe in!!

-
@@ -217,15 +235,18 @@ function Home() {
{leaderboardData.map((item) => ( +
= 0 ? 'positive' : 'negative'} mx-auto mb-4`} onClick={() => openModal(item)}>

{item["username"]}

{parseFloat(item["points"]).toFixed(2)}x

+
))}
{/* Modal */} + {/* Rest of your Home component */} diff --git a/public/black_back.jpg b/public/black_back.jpg index bf9f6f7..f771cae 100644 Binary files a/public/black_back.jpg and b/public/black_back.jpg differ diff --git a/public/black_backe.jpg b/public/black_backe.jpg new file mode 100644 index 0000000..215103f Binary files /dev/null and b/public/black_backe.jpg differ diff --git a/public/black_backg.jpg b/public/black_backg.jpg new file mode 100644 index 0000000..bf9f6f7 Binary files /dev/null and b/public/black_backg.jpg differ diff --git a/public/black_backs.jpg b/public/black_backs.jpg new file mode 100644 index 0000000..0dce255 Binary files /dev/null and b/public/black_backs.jpg differ