mirror of
https://github.com/0xShay/ticketchain.git
synced 2026-01-11 13:13:25 +00:00
Front end is Good
This commit is contained in:
73
app/Home.tsx
73
app/Home.tsx
@@ -5,34 +5,51 @@ export default function Home() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Header />
|
<Header />
|
||||||
<div className="bg-gradient-to-b from-blue-900 to-gray-900 min-h-screen pt-16">
|
<div className="relative min-h-screen overflow-hidden">
|
||||||
<div className="container mx-auto p-4">
|
{/* Video Background */}
|
||||||
<input
|
<video
|
||||||
type="text"
|
autoPlay
|
||||||
placeholder="Search events..."
|
loop
|
||||||
className="search-bar mt-4 p-2 border border-gray-300 rounded w-full max-w-md mx-auto"
|
muted
|
||||||
/>
|
className="absolute inset-0 w-full h-full object-cover z-0"
|
||||||
<main>
|
src="BGVid2.mp4"
|
||||||
<section className="mb-8">
|
>
|
||||||
<h2 className="text-2xl font-semibold text-white mb-4">
|
Your browser does not support the video tag.
|
||||||
Featured Events
|
</video>
|
||||||
</h2>
|
|
||||||
<p className="text-gray-300">
|
{/* Dark Overlay for Enhanced Readability */}
|
||||||
No events available at the moment.
|
<div className="absolute inset-0 bg-black opacity-50 z-10"></div>
|
||||||
</p>
|
|
||||||
</section>
|
{/* Page Content Over the Video */}
|
||||||
<section>
|
<div className="relative z-20 min-h-screen bg-gradient-to-b from-transparent to-gray-900 pt-16">
|
||||||
<h2 className="text-2xl font-semibold text-white mb-4">
|
<div className="container mx-auto p-4">
|
||||||
Upcoming Events
|
<input
|
||||||
</h2>
|
type="text"
|
||||||
<ul className="list-disc list-inside text-gray-300">
|
placeholder="Search events..."
|
||||||
<li>Event 1 - Date</li>
|
className="search-bar mt-4 p-2 border border-gray-300 rounded w-full max-w-md mx-auto"
|
||||||
<li>Event 2 - Date</li>
|
/>
|
||||||
<li>Event 3 - Date</li>
|
<main>
|
||||||
</ul>
|
<section className="mb-8">
|
||||||
</section>
|
<h2 className="text-2xl font-semibold text-white mb-4">
|
||||||
</main>
|
Featured Events
|
||||||
<Footer />
|
</h2>
|
||||||
|
<p className="text-gray-300">
|
||||||
|
No events available at the moment.
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<h2 className="text-2xl font-semibold text-white mb-4">
|
||||||
|
Upcoming Events
|
||||||
|
</h2>
|
||||||
|
<ul className="list-disc list-inside text-gray-300">
|
||||||
|
<li>Event 1 - Date</li>
|
||||||
|
<li>Event 2 - Date</li>
|
||||||
|
<li>Event 3 - Date</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
<Footer />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,11 +1,23 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import React from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import Header from '../../components/custom/header'; // Adjust the import path as needed
|
import Header from '../../components/custom/header';
|
||||||
import Footer from '../../components/custom/footer'; // Assuming you have a footer component
|
import Footer from '../../components/custom/footer';
|
||||||
import { useEffect, useState } from 'react';
|
|
||||||
|
// Define the Event interface including new fields
|
||||||
|
interface Event {
|
||||||
|
EventID: number;
|
||||||
|
name: string;
|
||||||
|
date: string;
|
||||||
|
location: string;
|
||||||
|
ticketPrice: string;
|
||||||
|
description: string;
|
||||||
|
capacity: number;
|
||||||
|
ticketsSold: number;
|
||||||
|
imageUrl: string;
|
||||||
|
}
|
||||||
|
|
||||||
// Dummy function to fetch events
|
// Dummy function to fetch events
|
||||||
const fetchEvents = () => {
|
const fetchEvents = (): Event[] => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
EventID: 1,
|
EventID: 1,
|
||||||
@@ -13,6 +25,9 @@ const fetchEvents = () => {
|
|||||||
date: '2023-12-01',
|
date: '2023-12-01',
|
||||||
location: 'New York City',
|
location: 'New York City',
|
||||||
ticketPrice: '$99',
|
ticketPrice: '$99',
|
||||||
|
description: 'An exhilarating rock concert featuring famous bands.',
|
||||||
|
capacity: 5000,
|
||||||
|
ticketsSold: 4500,
|
||||||
imageUrl: 'https://via.placeholder.com/150',
|
imageUrl: 'https://via.placeholder.com/150',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -21,6 +36,9 @@ const fetchEvents = () => {
|
|||||||
date: '2023-11-15',
|
date: '2023-11-15',
|
||||||
location: 'San Francisco',
|
location: 'San Francisco',
|
||||||
ticketPrice: '$55',
|
ticketPrice: '$55',
|
||||||
|
description: 'A showcase of modern art from around the world.',
|
||||||
|
capacity: 300,
|
||||||
|
ticketsSold: 260,
|
||||||
imageUrl: 'https://via.placeholder.com/150',
|
imageUrl: 'https://via.placeholder.com/150',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -29,33 +47,41 @@ const fetchEvents = () => {
|
|||||||
date: '2023-12-10',
|
date: '2023-12-10',
|
||||||
location: 'Chicago',
|
location: 'Chicago',
|
||||||
ticketPrice: '$250',
|
ticketPrice: '$250',
|
||||||
|
description: 'The leading tech summit with top industry speakers.',
|
||||||
|
capacity: 2000,
|
||||||
|
ticketsSold: 1800,
|
||||||
imageUrl: 'https://via.placeholder.com/150',
|
imageUrl: 'https://via.placeholder.com/150',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
interface Event {
|
|
||||||
EventID: number;
|
|
||||||
name: string;
|
|
||||||
date: string;
|
|
||||||
location: string;
|
|
||||||
ticketPrice: string;
|
|
||||||
imageUrl: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
const TicketListing: React.FC = () => {
|
const TicketListing: React.FC = () => {
|
||||||
const [events, setEvents] = useState<Event[]>([]);
|
const [events, setEvents] = useState<Event[]>([]);
|
||||||
|
const [hoveredEventId, setHoveredEventId] = useState<number | null>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// Simulate fetching the events
|
|
||||||
const eventsData = fetchEvents();
|
const eventsData = fetchEvents();
|
||||||
setEvents(eventsData);
|
setEvents(eventsData);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-gradient-to-b from-blue-900 to-gray-900 min-h-screen">
|
<div className="relative min-h-screen overflow-hidden">
|
||||||
<Header />
|
<Header />
|
||||||
<div className="container mx-auto p-4 pt-16">
|
{/* Video Background */}
|
||||||
|
<video
|
||||||
|
autoPlay
|
||||||
|
loop
|
||||||
|
muted
|
||||||
|
className="absolute inset-0 w-full h-full object-cover z-0"
|
||||||
|
src="BGVid1.mp4"
|
||||||
|
>
|
||||||
|
Your browser does not support the video tag.
|
||||||
|
</video>
|
||||||
|
{/* Overlay for Readability */}
|
||||||
|
<div className="absolute inset-0 bg-black opacity-50 z-10"></div>
|
||||||
|
|
||||||
|
{/* Main Content */}
|
||||||
|
<div className="relative z-20 container mx-auto p-4 pt-16">
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
@@ -80,20 +106,34 @@ const TicketListing: React.FC = () => {
|
|||||||
{events.map((event) => (
|
{events.map((event) => (
|
||||||
<div
|
<div
|
||||||
key={event.EventID}
|
key={event.EventID}
|
||||||
className="flex bg-white p-4 rounded-lg shadow-lg"
|
className="relative flex bg-white p-4 rounded-lg shadow-lg"
|
||||||
|
onMouseEnter={() => setHoveredEventId(event.EventID)}
|
||||||
|
onMouseLeave={() => setHoveredEventId(null)}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={event.imageUrl}
|
src={event.imageUrl}
|
||||||
alt={event.name}
|
alt={event.name}
|
||||||
className="w-1/4 rounded-lg"
|
className="w-1/4 rounded-lg"
|
||||||
/>
|
/>
|
||||||
<div className="ml-4">
|
<div className="ml-4 relative">
|
||||||
<h3 className="text-xl font-bold">{event.name}</h3>
|
<h3 className="text-xl font-bold">{event.name}</h3>
|
||||||
<p className="text-gray-600">{event.date}</p>
|
<p className="text-gray-600">{event.date}</p>
|
||||||
<p className="text-gray-600">{event.location}</p>
|
<p className="text-gray-600">{event.location}</p>
|
||||||
<p className="text-gray-800 font-semibold">
|
<p className="text-gray-800 font-semibold">
|
||||||
{event.ticketPrice}
|
{event.ticketPrice}
|
||||||
</p>
|
</p>
|
||||||
|
{event.ticketsSold / event.capacity >= 0.9 && (
|
||||||
|
<div className="mt-2 p-2 bg-yellow-300 text-black rounded">
|
||||||
|
Limited Tickets Remaining!
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="absolute top-0 right-0 flex items-center space-x-2">
|
||||||
|
{hoveredEventId === event.EventID && (
|
||||||
|
<div className="top-0 left-4 w-full bg-white p-4 shadow-lg rounded-lg z-10">
|
||||||
|
<p>{event.description}</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import { Ticket } from 'lucide-react';
|
|
||||||
import TicketListings from './TicketListings';
|
import TicketListings from './TicketListings';
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
|
|||||||
@@ -3,29 +3,38 @@ import React, { useState } from 'react';
|
|||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
const Header = () => {
|
const Header = () => {
|
||||||
const [mouseX, setMouseX] = useState(0);
|
const [mouseX, setMouseX] = useState(-1);
|
||||||
const [mouseY, setMouseY] = useState(0);
|
const [mouseY, setMouseY] = useState(-1);
|
||||||
|
|
||||||
const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
|
const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
|
||||||
setMouseX(e.clientX);
|
setMouseX(e.clientX);
|
||||||
setMouseY(e.clientY);
|
setMouseY(e.clientY);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleMouseLeave = () => {
|
||||||
|
setMouseX(-1);
|
||||||
|
setMouseY(-1);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className="fixed top-0 left-0 right-0 backdrop-blur-md bg-opacity-60 z-50"
|
className="fixed top-0 left-0 right-0 backdrop-blur-md bg-opacity-60 z-50"
|
||||||
onMouseMove={handleMouseMove}
|
onMouseMove={handleMouseMove}
|
||||||
|
onMouseLeave={handleMouseLeave}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="absolute inset-0 pointer-events-none"
|
className="absolute inset-0 pointer-events-none"
|
||||||
style={{
|
style={{
|
||||||
border: '1px solid transparent',
|
border: '1px solid transparent',
|
||||||
background: `radial-gradient(circle at ${mouseX}px ${mouseY}px, rgba(255, 255, 255, 0.4), transparent 20%)`,
|
background:
|
||||||
|
mouseX >= 0 && mouseY >= 0
|
||||||
|
? `radial-gradient(circle at ${mouseX}px ${mouseY}px, rgba(255, 255, 255, 0.4), transparent 20%)`
|
||||||
|
: 'none',
|
||||||
backgroundClip: 'padding-box, border-box',
|
backgroundClip: 'padding-box, border-box',
|
||||||
}}
|
}}
|
||||||
></div>
|
></div>
|
||||||
<div className="container mx-auto px-6 py-5 flex justify-between items-center">
|
<div className="container mx-auto px-6 py-4 flex justify-between items-center">
|
||||||
<h1 className="text-2xl font-bold text-white">Ticket Chain</h1>
|
<h1 className="text-2xl font-Ariel-bold text-white">TicketChain</h1>
|
||||||
<nav className="nav">
|
<nav className="nav">
|
||||||
<ul className="flex space-x-6">
|
<ul className="flex space-x-6">
|
||||||
<li>
|
<li>
|
||||||
@@ -36,11 +45,10 @@ const Header = () => {
|
|||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<Link
|
<Link href="/TicketListings" legacyBehavior>
|
||||||
href="/TicketListings"
|
<a className="text-white hover:text-blue-500 transition-colors duration-300">
|
||||||
className="text-white hover:text-blue-500 transition-colors duration-300"
|
Events
|
||||||
>
|
</a>
|
||||||
Events
|
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
BIN
public/BGVid1.mp4
Normal file
BIN
public/BGVid1.mp4
Normal file
Binary file not shown.
BIN
public/BGVid2.mp4
Normal file
BIN
public/BGVid2.mp4
Normal file
Binary file not shown.
Reference in New Issue
Block a user