CHOOSE YOUR DESTINATION
{
ticket.addEventListener('click', () => {
// Get the width of the clicked ticket
const ticketWidth = ticket.offsetWidth;
// Loop through all tickets
tickets.forEach((otherTicket) => {
if (otherTicket === ticket) {
// Slide the clicked ticket fully off-screen to the right
otherTicket.style.transform = `translateX(${window.innerWidth + ticketWidth}px)`;
} else {
// Slide all other tickets fully off-screen to the left
otherTicket.style.transform = `translateX(-${window.innerWidth + ticketWidth}px)`;
}
});
});
});