Skip to content

Commit a6a32a2

Browse files
committed
Añadiendo varias features y diseño, guia de la pagina
1 parent 837fea4 commit a6a32a2

File tree

10 files changed

+1297
-105
lines changed

10 files changed

+1297
-105
lines changed

client/public/image/oscar.jpg

88.7 KB
Loading

client/public/image/prize-1.png

2.8 MB
Loading

client/public/image/prize-2.png

2.24 MB
Loading

client/public/image/prize-3.png

2.26 MB
Loading

client/src/layout/header/Header.jsx

Lines changed: 381 additions & 70 deletions
Large diffs are not rendered by default.

client/src/main.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import UserRifas from "./pages/user-rifa/UserRifas.jsx";
1515
import BuyTicket from "./pages/buy-ticket/BuyTicket.jsx";
1616
import RifasAll from "./pages/rifas/RifasAll.jsx";
1717
import SeeTicketsUser from "./pages/buy-ticket/SeeTicketsUser.jsx";
18+
import AboutNew from "./pages/about/AboutNew.jsx";
19+
import Help from "./pages/about/Help.jsx";
1820

1921
createRoot(document.getElementById("root")).render(
2022

@@ -28,8 +30,11 @@ createRoot(document.getElementById("root")).render(
2830
<Route path='/comprar/rifa/:rifaId' element={<BuyTicket />} />
2931
<Route path="/rifas" element={<RifasAll/>}/>
3032
<Route path='/boletos' element={<SeeTicketsUser/>}/>
33+
<Route path="/sobre-nosotros" element={<AboutNew />}/>
34+
<Route path="ayuda" element={<Help />} />
3135
<Route path="*" element={<NotFound />} />
3236

37+
3338
</Routes>
3439
</Layout>
3540
</BrowserRouter>

client/src/pages/about/AboutNew.jsx

Lines changed: 425 additions & 0 deletions
Large diffs are not rendered by default.

client/src/pages/about/Help.jsx

Lines changed: 351 additions & 0 deletions
Large diffs are not rendered by default.

client/src/pages/buy-ticket/BuyTicket.jsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import { paymentIntent } from '../../utils/striper/paymant-intent-utils'
55
import CheckoutForm from './components/CheckForm'
66
import { Elements } from '@stripe/react-stripe-js'
77
import { getRifaById } from '../../api/rifa'
8+
import { FaTicket } from "react-icons/fa6";
9+
10+
811

912
const stripePromise = loadStripe(import.meta.env.VITE_STRIPE_PUBLIC_KEY)
1013

@@ -147,23 +150,24 @@ const BuyTicket = () => {
147150
<label htmlFor="quantity" className="block font-medium text-gray-700 mb-2">
148151
Cantidad de boletos
149152
</label>
150-
<div className="flex rounded-md shadow-sm">
151-
<span className="inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500">
152-
<svg className="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
153-
<path d="M2 6a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 100 4v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2a2 2 0 100-4V6z" />
154-
</svg>
153+
<div className="flex justify-between rounded-md ">
154+
<span className="inline-flex items-center px-1 rounded-l-md bg-gray-50 text-gray-500">
155+
<FaTicket />
155156
</span>
157+
158+
<h1><strong>1</strong></h1>
156159
<input
157160
id="quantity"
158161
type="number"
159162
min="1"
160-
max="10"
163+
max="1"
164+
hidden
161165
value={ticketQuantity}
162166
onChange={(e) => setTicketQuantity(parseInt(e.target.value, 10) || 1)}
163167
className="focus:ring-indigo-500 focus:border-indigo-500 flex-1 block w-full rounded-none rounded-r-md sm:text-sm border-gray-300 py-3"
164168
/>
165169
</div>
166-
<p className="mt-1 text-xs text-gray-500">Máximo 10 boletos por persona</p>
170+
<p className="mt-1 text-xs text-gray-500">En el momento solo se pueden comprar boletos unitarios.</p>
167171
</div>
168172

169173
<div className="border-t border-gray-200 pt-4">

client/src/pages/inicio/Inicio.jsx

Lines changed: 124 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { FaTicketAlt, FaGift, FaCoins, FaDollarSign, FaTrophy, FaChevronRight, FaLock, FaRegLightbulb, FaStar } from "react-icons/fa";
1+
import { FaTicketAlt, FaGift, FaCoins, FaDollarSign, FaTrophy, FaChevronRight, FaLock, FaRegLightbulb, FaStar, FaChevronLeft } from "react-icons/fa";
22
import CardRifa from "./components/CardRifa";
3-
import { useState, useEffect } from "react";
3+
import { useState, useEffect, useCallback } from "react";
44
import { getAllRifas } from "../../api/rifa";
55
import { useNavigate } from "react-router";
66

@@ -9,6 +9,45 @@ const Inicio = () => {
99
const [loading, setLoading] = useState(true);
1010
const [error, setError] = useState(null);
1111
const navigate = useNavigate();
12+
const [currentSlide, setCurrentSlide] = useState(0);
13+
14+
// Array de contenido para el slider (imágenes y frases)
15+
const sliderContent = [
16+
{
17+
title: '¡Gana <span class="text-yellow-300">increíbles</span><br/>premios con solo<br/>un <span class="text-yellow-300">click</span>!',
18+
subtitle: 'Crea o participa en rifas de manera<br/><span class="font-bold text-white">segura, rápida y transparente</span>.',
19+
image: '/image/prize-3.png',
20+
},
21+
{
22+
title: 'Convierte tus <span class="text-yellow-300">sueños</span><br/>en realidad<br/>con <span class="text-yellow-300">TuRifa</span>!',
23+
subtitle: 'Premios exclusivos que<br/><span class="font-bold text-white">están esperando por ti</span>.',
24+
image: '/image/prize-2.png',
25+
},
26+
{
27+
title: 'Cada boleto es una<br/><span class="text-yellow-300">oportunidad</span><br/>de <span class="text-yellow-300">ganar</span>!',
28+
subtitle: 'Miles de ganadores<br/><span class="font-bold text-white">¡El próximo podrías ser tú!</span>',
29+
image: '/image/prize-1.png',
30+
}
31+
];
32+
33+
// Función para avanzar al siguiente slide
34+
const nextSlide = useCallback(() => {
35+
setCurrentSlide((prev) => (prev + 1) % sliderContent.length);
36+
}, [sliderContent.length]);
37+
38+
// Función para retroceder al slide anterior
39+
const prevSlide = useCallback(() => {
40+
setCurrentSlide((prev) => (prev === 0 ? sliderContent.length - 1 : prev - 1));
41+
}, [sliderContent.length]);
42+
43+
// Efecto para el cambio automático de slides
44+
useEffect(() => {
45+
const interval = setInterval(() => {
46+
nextSlide();
47+
}, 5000); // Cambia cada 5 segundos
48+
49+
return () => clearInterval(interval);
50+
}, [nextSlide]);
1251

1352
useEffect(() => {
1453
const fetchRifas = async () => {
@@ -38,54 +77,111 @@ const Inicio = () => {
3877
return (
3978
<div className="font-sans min-h-screen bg-gradient-to-b from-gray-50 to-blue-50">
4079

41-
{/* Hero Section - Mejorado con gradientes y animaciones */}
80+
{/* Hero Section - Ahora con slider/carrusel */}
4281
<section className="bg-gradient-to-r from-blue-600 to-indigo-700 text-white shadow-xl mb-16 overflow-hidden relative py-12">
4382
{/* Decorative elements */}
4483
<div className="absolute top-0 right-0 w-64 h-64 bg-white opacity-10 rounded-full -translate-y-1/2 translate-x-1/4"></div>
4584
<div className="absolute bottom-0 left-0 w-72 h-72 bg-indigo-300 opacity-20 rounded-full translate-y-1/2 -translate-x-1/3"></div>
4685

4786
<div className="container mx-auto flex flex-col md:flex-row items-center justify-between px-6 md:px-10 max-w-6xl relative z-10">
4887
<div className="w-full md:w-1/2 flex flex-col justify-center px-4 md:px-0 py-8 md:py-16">
49-
<h1 className="text-4xl md:text-5xl font-extrabold leading-tight mb-6 text-center md:text-left">
50-
¡Gana <span className="text-yellow-300">increíbles</span>
51-
<br />
52-
premios con solo
53-
<br />
54-
un <span className="text-yellow-300">click</span>!
55-
</h1>
56-
<p className="mt-2 text-lg md:text-xl text-blue-100 font-medium text-center md:text-left leading-relaxed mb-8">
57-
Crea o participa en rifas de manera
58-
<br />
59-
<span className="font-bold text-white">segura, rápida y transparente</span>.
60-
</p>
88+
{/* Contenido del slider - textos */}
89+
<div className="relative overflow-hidden h-48 md:h-70">
90+
{sliderContent.map((slide, index) => (
91+
<div
92+
key={index}
93+
className={`absolute w-full transition-all duration-700 transform ${
94+
index === currentSlide
95+
? "translate-x-0 opacity-100"
96+
: index < currentSlide
97+
? "-translate-x-full opacity-0"
98+
: "translate-x-full opacity-0"
99+
}`}
100+
>
101+
<h1
102+
className="text-4xl md:text-5xl font-extrabold leading-tight mb-6 text-center md:text-left"
103+
dangerouslySetInnerHTML={{ __html: slide.title }}
104+
/>
105+
<p
106+
className="mt-2 text-lg md:text-xl text-blue-100 font-medium text-center md:text-left leading-relaxed mb-8"
107+
dangerouslySetInnerHTML={{ __html: slide.subtitle }}
108+
/>
109+
</div>
110+
))}
111+
</div>
61112

62-
<div className="flex flex-col sm:flex-row gap-4 justify-center md:justify-start">
63-
<button className="bg-white text-indigo-700 hover:bg-yellow-300 py-3 px-8 rounded-full font-bold text-lg shadow-lg transition-all duration-300 hover:shadow-xl flex items-center justify-center">
113+
<div className="flex flex-col sm:flex-row gap-4 justify-center md:justify-start mt-20 md:mt-12">
114+
<button
115+
onClick={() => navigate("/rifas")}
116+
className="bg-white text-indigo-700 hover:bg-yellow-300 py-3 px-8 rounded-full font-bold text-lg shadow-lg transition-all duration-300 hover:shadow-xl flex items-center justify-center">
64117
Explorar Rifas
65118
<FaChevronRight className="ml-2" />
66119
</button>
67120
<button
68-
onClick={()=> navigate("/crear/rifa")}
69-
className="bg-transparent hover:bg-blue-700 border-2 border-white py-3 px-8 rounded-full font-bold text-lg transition-colors duration-300 flex items-center justify-center">
70-
121+
onClick={()=> navigate("/crear/rifa")}
122+
className="bg-transparent hover:bg-blue-700 border-2 border-white py-3 px-8 rounded-full font-bold text-lg transition-colors duration-300 flex items-center justify-center">
71123
Crear Rifa
72124
</button>
73125
</div>
126+
127+
{/* Controles del slider */}
128+
<div className="flex justify-center md:justify-start mt-6 space-x-3">
129+
{sliderContent.map((_, index) => (
130+
<button
131+
key={index}
132+
onClick={() => setCurrentSlide(index)}
133+
className={`w-3 h-3 rounded-full transition-all duration-300 ${
134+
currentSlide === index
135+
? "bg-yellow-300 w-6"
136+
: "bg-white opacity-50 hover:opacity-75"
137+
}`}
138+
aria-label={`Go to slide ${index + 1}`}
139+
/>
140+
))}
141+
</div>
74142
</div>
75143

76144
<div className="w-full md:w-1/2 flex items-center justify-center px-4 md:px-0 mt-8 md:mt-0 relative">
77145
<div className="absolute w-64 h-64 bg-yellow-300 rounded-full filter blur-3xl opacity-30"></div>
78-
<img
79-
className="relative z-10 h-auto max-h-80 w-auto object-contain mx-auto transform hover:scale-105 transition-transform duration-700 bounce-slow"
80-
src="/image/gift.png"
81-
alt="Premio de rifa"
82-
/>
146+
147+
{/* Contenido del slider - imágenes */}
148+
<div className="relative w-full h-80 flex justify-center items-center">
149+
{sliderContent.map((slide, index) => (
150+
<img
151+
key={index}
152+
src={slide.image}
153+
alt={`Slide ${index + 1}`}
154+
className={`absolute max-h-1000 w-auto object-contain mx-auto transform hover:scale-105 transition-all duration-700 bounce-slow
155+
${index === currentSlide
156+
? "opacity-100 scale-100"
157+
: "opacity-0 scale-90"}`}
158+
/>
159+
))}
160+
</div>
161+
162+
{/* Botones adicionales para el control del slider */}
163+
<div className="absolute inset-x-0 top-1/2 transform -translate-y-1/2 flex justify-between items-center px-4 md:px-8">
164+
<button
165+
onClick={prevSlide}
166+
className="bg-white/30 backdrop-blur-sm hover:bg-white/50 rounded-full p-2 text-white transition-all duration-300"
167+
aria-label="Previous slide"
168+
>
169+
<FaChevronLeft className="w-5 h-5" />
170+
</button>
171+
<button
172+
onClick={nextSlide}
173+
className="bg-white/30 backdrop-blur-sm hover:bg-white/50 rounded-full p-2 text-white transition-all duration-300"
174+
aria-label="Next slide"
175+
>
176+
<FaChevronRight className="w-5 h-5" />
177+
</button>
178+
</div>
83179
</div>
84180
</div>
85181
</section>
86182

87183

88-
{/* How it works - Mejorado con tarjetas y transiciones */}
184+
{/* How it works - Sin cambios */}
89185
<section className="max-w-5xl mx-auto mb-20 px-6">
90186
<div className="text-center mb-12">
91187
<span className="bg-blue-100 text-blue-700 text-sm font-medium py-1 px-3 rounded-full">Proceso Sencillo</span>
@@ -225,7 +321,7 @@ const Inicio = () => {
225321
</div>
226322
</section>
227323

228-
{/* Benefits section - New */}
324+
{/* Benefits section - Sin cambios */}
229325
<section className="bg-gradient-to-br from-blue-50 to-indigo-100 py-16">
230326
<div className="max-w-5xl mx-auto px-6">
231327
<div className="text-center mb-12">
@@ -266,7 +362,7 @@ const Inicio = () => {
266362
</div>
267363
</section>
268364

269-
{/* Footer-like info - Improved */}
365+
{/* Footer-like info - Sin cambios */}
270366
<section className="max-w-5xl mx-auto my-12 px-6">
271367
<div className="bg-gradient-to-r from-blue-600 to-indigo-600 rounded-2xl shadow-xl overflow-hidden">
272368
<div className="flex flex-col md:flex-row justify-between items-center p-8 md:p-10">

0 commit comments

Comments
 (0)