|
| 1 | +--- |
| 2 | +import DangoLogo from "./DangoLogo.astro"; |
| 3 | +
|
| 4 | +const ticketOptions = [ |
| 5 | + { |
| 6 | + image: "/images/boletos/arema.jpg", |
| 7 | + label: "AREMA", |
| 8 | + href: "https://arema.mx/e/16435/Festival-Dango-2026", |
| 9 | + }, |
| 10 | + { |
| 11 | + image: "/images/boletos/puntos_venta.jpg", |
| 12 | + label: "PUNTOS DE VENTA", |
| 13 | + href: "#", // Placeholder if no specific link |
| 14 | + }, |
| 15 | +]; |
| 16 | +--- |
| 17 | + |
1 | 18 | <section id="boletos" class="tickets-section"> |
2 | 19 | <div |
3 | 20 | class="container mx-auto px-4 h-full flex flex-col relative z-10 pt-20 pb-20 md:pb-0" |
|
14 | 31 | <div |
15 | 32 | class="w-full flex flex-col md:flex-row justify-center items-center gap-6 flex-grow" |
16 | 33 | > |
17 | | - <!-- Placeholder 1 --> |
18 | | - <div class="ticket-placeholder"> |
19 | | - <!-- Empty for now --> |
20 | | - </div> |
| 34 | + { |
| 35 | + ticketOptions.map((ticket) => ( |
| 36 | + <a |
| 37 | + href={ticket.href} |
| 38 | + target={ticket.href.startsWith("http") ? "_blank" : "_self"} |
| 39 | + rel={ticket.href.startsWith("http") ? "noopener noreferrer" : ""} |
| 40 | + class="ticket-card group relative block overflow-hidden w-full max-w-[350px] aspect-[3/4]" |
| 41 | + > |
| 42 | + {/* Image */} |
| 43 | + <img |
| 44 | + src={ticket.image} |
| 45 | + alt={ticket.label} |
| 46 | + class="w-full h-full object-cover transition-transform duration-700 group-hover:scale-105" |
| 47 | + /> |
| 48 | + |
| 49 | + {/* Dark Overlay (removes on hover) */} |
| 50 | + <div class="absolute inset-0 bg-black/40 transition-opacity duration-300 group-hover:opacity-0" /> |
| 51 | + |
| 52 | + {/* Logo Top Left */} |
| 53 | + <div class="absolute top-6 left-6 w-16 text-white z-10 opacity-90"> |
| 54 | + <DangoLogo /> |
| 55 | + </div> |
21 | 56 |
|
22 | | - <!-- Placeholder 2 --> |
23 | | - <div class="ticket-placeholder"> |
24 | | - <!-- Empty for now --> |
25 | | - </div> |
| 57 | + {/* Text Bottom Left */} |
| 58 | + <div class="absolute bottom-6 left-6 z-10"> |
| 59 | + <span class="text-white font-bold text-3xl font-outfit tracking-widest drop-shadow-lg"> |
| 60 | + {ticket.label} |
| 61 | + </span> |
| 62 | + </div> |
| 63 | + </a> |
| 64 | + )) |
| 65 | + } |
26 | 66 | </div> |
27 | 67 | </div> |
28 | 68 | </section> |
|
35 | 75 | document.addEventListener("astro:page-load", () => { |
36 | 76 | const section = document.querySelector(".tickets-section"); |
37 | 77 | const title = section?.querySelector(".section-title"); |
38 | | - const placeholders = section?.querySelectorAll(".ticket-placeholder"); |
| 78 | + const cards = section?.querySelectorAll(".ticket-card"); |
39 | 79 |
|
40 | | - if (!section || !title || !placeholders) return; |
| 80 | + if (!section || !title || !cards) return; |
41 | 81 |
|
42 | 82 | const tl = gsap.timeline({ |
43 | 83 | scrollTrigger: { |
44 | 84 | trigger: section, |
45 | | - start: "top 80%", // Start when top of section hits 80% viewport height |
| 85 | + start: "top 80%", |
46 | 86 | toggleActions: "play none none reverse", |
47 | 87 | }, |
48 | 88 | }); |
|
55 | 95 | ease: "power3.out", |
56 | 96 | }); |
57 | 97 |
|
58 | | - // Animate Placeholders (Staggered) |
| 98 | + // Animate Cards (Staggered) |
59 | 99 | tl.from( |
60 | | - placeholders, |
| 100 | + cards, |
61 | 101 | { |
62 | 102 | y: 100, |
63 | 103 | opacity: 0, |
64 | 104 | duration: 1, |
65 | 105 | stagger: 0.2, |
66 | 106 | ease: "power3.out", |
67 | 107 | }, |
68 | | - "-=0.5", // Overlap with title animation |
| 108 | + "-=0.5", |
69 | 109 | ); |
70 | 110 | }); |
71 | 111 | </script> |
|
89 | 129 | .section-title span { |
90 | 130 | color: #fff; |
91 | 131 | } |
92 | | - |
93 | | - /* Image Placeholders */ |
94 | | - .ticket-placeholder { |
95 | | - width: 100%; |
96 | | - max-width: 350px; |
97 | | - aspect-ratio: 3/4; |
98 | | - background-color: #1a1a1a; |
99 | | - /* Borders removed */ |
100 | | - position: relative; |
101 | | - } |
102 | | - |
103 | | - .ticket-placeholder::after { |
104 | | - content: "Imagen"; |
105 | | - position: absolute; |
106 | | - top: 50%; |
107 | | - left: 50%; |
108 | | - transform: translate(-50%, -50%); |
109 | | - color: #333; |
110 | | - font-family: var(--font-outfit); |
111 | | - text-transform: uppercase; |
112 | | - font-size: 1.5rem; |
113 | | - } |
114 | 132 | </style> |
0 commit comments