implemente a funcionalidade de Favoritar - Follow Up Deployment
Browse files- index.html +165 -1
index.html
CHANGED
|
@@ -137,7 +137,7 @@
|
|
| 137 |
</div>
|
| 138 |
<p class="text-gray-600 mb-6">A maior maratona da América Latina com percursos para todos os níveis.</p>
|
| 139 |
<div class="flex justify-between items-center">
|
| 140 |
-
<button class="text-purple-600 font-medium hover:text-purple-800 transition flex items-center">
|
| 141 |
<i class="fas fa-info-circle mr-2"></i> Detalhes
|
| 142 |
</button>
|
| 143 |
<button class="bg-purple-600 text-white px-4 py-2 rounded-full hover:bg-purple-700 transition flex items-center">
|
|
@@ -501,6 +501,75 @@
|
|
| 501 |
</div>
|
| 502 |
</footer>
|
| 503 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 504 |
<!-- Login Modal -->
|
| 505 |
<div id="loginModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 opacity-0 pointer-events-none transition-opacity duration-300 login-modal">
|
| 506 |
<div class="bg-white rounded-xl shadow-2xl w-full max-w-md transform transition-all duration-300 scale-95">
|
|
@@ -969,6 +1038,42 @@
|
|
| 969 |
document.querySelector('#userDashboard > div').classList.remove('scale-95');
|
| 970 |
});
|
| 971 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 972 |
// Simple countdown timer (for demo purposes)
|
| 973 |
function updateCountdown() {
|
| 974 |
const countdownElements = document.querySelectorAll('#countdown > div');
|
|
@@ -997,6 +1102,65 @@
|
|
| 997 |
}
|
| 998 |
|
| 999 |
setInterval(updateCountdown, 60000); // Update every minute
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1000 |
</script>
|
| 1001 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=mdarlen/runtrack" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 1002 |
</html>
|
|
|
|
| 137 |
</div>
|
| 138 |
<p class="text-gray-600 mb-6">A maior maratona da América Latina com percursos para todos os níveis.</p>
|
| 139 |
<div class="flex justify-between items-center">
|
| 140 |
+
<button class="text-purple-600 font-medium hover:text-purple-800 transition flex items-center" onclick="showEventDetails('Maratona de São Paulo', 'https://images.unsplash.com/photo-1543351611-58f69d7c1781?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1374&q=80', '25 Nov 2023', 'São Paulo, SP', '5K, 10K, 21K', 'Maratona', 'A maior maratona da América Latina com percursos para todos os níveis. Com organização de primeira e estrutura completa para atletas de todos os níveis.', ['06:00 - Credenciamento', '07:00 - Largada 21K', '07:30 - Largada 10K', '08:00 - Largada 5K'])">
|
| 141 |
<i class="fas fa-info-circle mr-2"></i> Detalhes
|
| 142 |
</button>
|
| 143 |
<button class="bg-purple-600 text-white px-4 py-2 rounded-full hover:bg-purple-700 transition flex items-center">
|
|
|
|
| 501 |
</div>
|
| 502 |
</footer>
|
| 503 |
|
| 504 |
+
<!-- Event Details Modal -->
|
| 505 |
+
<div id="eventDetailsModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 opacity-0 pointer-events-none transition-opacity duration-300">
|
| 506 |
+
<div class="bg-white rounded-xl shadow-2xl w-full max-w-4xl max-h-[90vh] overflow-y-auto transform transition-all duration-300 scale-95">
|
| 507 |
+
<div class="p-6">
|
| 508 |
+
<div class="flex justify-between items-center mb-6">
|
| 509 |
+
<h3 class="text-2xl font-bold text-gray-800" id="eventDetailsTitle">Detalhes do Evento</h3>
|
| 510 |
+
<button id="closeEventDetailsModal" class="text-gray-500 hover:text-gray-700">
|
| 511 |
+
<i class="fas fa-times"></i>
|
| 512 |
+
</button>
|
| 513 |
+
</div>
|
| 514 |
+
|
| 515 |
+
<div class="flex flex-col lg:flex-row gap-8">
|
| 516 |
+
<div class="lg:w-1/2">
|
| 517 |
+
<img id="eventDetailsImage" src="" alt="Event image" class="w-full h-64 lg:h-96 object-cover rounded-lg">
|
| 518 |
+
|
| 519 |
+
<div class="mt-6 bg-gray-50 p-4 rounded-lg">
|
| 520 |
+
<h4 class="font-bold text-lg mb-3">Informações</h4>
|
| 521 |
+
<div class="grid grid-cols-2 gap-4">
|
| 522 |
+
<div>
|
| 523 |
+
<p class="text-sm text-gray-500">Data</p>
|
| 524 |
+
<p class="font-medium" id="eventDetailsDate"></p>
|
| 525 |
+
</div>
|
| 526 |
+
<div>
|
| 527 |
+
<p class="text-sm text-gray-500">Local</p>
|
| 528 |
+
<p class="font-medium" id="eventDetailsLocation"></p>
|
| 529 |
+
</div>
|
| 530 |
+
<div>
|
| 531 |
+
<p class="text-sm text-gray-500">Distâncias</p>
|
| 532 |
+
<p class="font-medium" id="eventDetailsDistances"></p>
|
| 533 |
+
</div>
|
| 534 |
+
<div>
|
| 535 |
+
<p class="text-sm text-gray-500">Tipo</p>
|
| 536 |
+
<p class="font-medium" id="eventDetailsType"></p>
|
| 537 |
+
</div>
|
| 538 |
+
</div>
|
| 539 |
+
</div>
|
| 540 |
+
</div>
|
| 541 |
+
|
| 542 |
+
<div class="lg:w-1/2">
|
| 543 |
+
<div class="mb-6">
|
| 544 |
+
<h4 class="font-bold text-lg mb-3">Sobre o Evento</h4>
|
| 545 |
+
<p class="text-gray-600" id="eventDetailsDescription"></p>
|
| 546 |
+
</div>
|
| 547 |
+
|
| 548 |
+
<div class="mb-6">
|
| 549 |
+
<h4 class="font-bold text-lg mb-3">Programação</h4>
|
| 550 |
+
<ul class="space-y-3" id="eventDetailsSchedule">
|
| 551 |
+
<!-- Will be populated by JS -->
|
| 552 |
+
</ul>
|
| 553 |
+
</div>
|
| 554 |
+
|
| 555 |
+
<div class="bg-purple-50 p-4 rounded-lg">
|
| 556 |
+
<h4 class="font-bold text-lg mb-3">Inscrição</h4>
|
| 557 |
+
<p class="text-gray-600 mb-4">Garanta sua vaga neste evento incrível!</p>
|
| 558 |
+
<div class="flex flex-col sm:flex-row gap-3">
|
| 559 |
+
<button class="bg-purple-600 text-white px-6 py-3 rounded-lg font-bold hover:bg-purple-700 transition flex-1" onclick="subscribeToEvent()">
|
| 560 |
+
<i class="fas fa-ticket-alt mr-2"></i> Inscrever-se
|
| 561 |
+
</button>
|
| 562 |
+
<button id="favoriteBtn" class="border border-purple-600 text-purple-600 px-6 py-3 rounded-lg font-bold hover:bg-purple-50 transition flex-1" onclick="toggleFavorite()">
|
| 563 |
+
<i id="favoriteIcon" class="far fa-heart mr-2"></i> <span id="favoriteText">Favoritar</span>
|
| 564 |
+
</button>
|
| 565 |
+
</div>
|
| 566 |
+
</div>
|
| 567 |
+
</div>
|
| 568 |
+
</div>
|
| 569 |
+
</div>
|
| 570 |
+
</div>
|
| 571 |
+
</div>
|
| 572 |
+
|
| 573 |
<!-- Login Modal -->
|
| 574 |
<div id="loginModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 opacity-0 pointer-events-none transition-opacity duration-300 login-modal">
|
| 575 |
<div class="bg-white rounded-xl shadow-2xl w-full max-w-md transform transition-all duration-300 scale-95">
|
|
|
|
| 1038 |
document.querySelector('#userDashboard > div').classList.remove('scale-95');
|
| 1039 |
});
|
| 1040 |
|
| 1041 |
+
// Event Details Modal
|
| 1042 |
+
const eventDetailsModal = document.getElementById('eventDetailsModal');
|
| 1043 |
+
const closeEventDetailsModal = document.getElementById('closeEventDetailsModal');
|
| 1044 |
+
|
| 1045 |
+
function showEventDetails(title, image, date, location, distances, type, description, schedule) {
|
| 1046 |
+
document.getElementById('eventDetailsTitle').textContent = title;
|
| 1047 |
+
document.getElementById('eventDetailsImage').src = image;
|
| 1048 |
+
document.getElementById('eventDetailsDate').textContent = date;
|
| 1049 |
+
document.getElementById('eventDetailsLocation').textContent = location;
|
| 1050 |
+
document.getElementById('eventDetailsDistances').textContent = distances;
|
| 1051 |
+
document.getElementById('eventDetailsType').textContent = type;
|
| 1052 |
+
document.getElementById('eventDetailsDescription').textContent = description;
|
| 1053 |
+
|
| 1054 |
+
const scheduleList = document.getElementById('eventDetailsSchedule');
|
| 1055 |
+
scheduleList.innerHTML = '';
|
| 1056 |
+
schedule.forEach(item => {
|
| 1057 |
+
const li = document.createElement('li');
|
| 1058 |
+
li.className = 'flex items-start';
|
| 1059 |
+
li.innerHTML = `
|
| 1060 |
+
<div class="bg-purple-100 w-6 h-6 rounded-full flex items-center justify-center flex-shrink-0 mt-1 mr-3">
|
| 1061 |
+
<i class="fas fa-circle text-purple-600 text-xs"></i>
|
| 1062 |
+
</div>
|
| 1063 |
+
<span>${item}</span>
|
| 1064 |
+
`;
|
| 1065 |
+
scheduleList.appendChild(li);
|
| 1066 |
+
});
|
| 1067 |
+
|
| 1068 |
+
eventDetailsModal.classList.remove('opacity-0', 'pointer-events-none');
|
| 1069 |
+
document.querySelector('#eventDetailsModal > div').classList.remove('scale-95');
|
| 1070 |
+
}
|
| 1071 |
+
|
| 1072 |
+
closeEventDetailsModal.addEventListener('click', () => {
|
| 1073 |
+
eventDetailsModal.classList.add('opacity-0', 'pointer-events-none');
|
| 1074 |
+
document.querySelector('#eventDetailsModal > div').classList.add('scale-95');
|
| 1075 |
+
});
|
| 1076 |
+
|
| 1077 |
// Simple countdown timer (for demo purposes)
|
| 1078 |
function updateCountdown() {
|
| 1079 |
const countdownElements = document.querySelectorAll('#countdown > div');
|
|
|
|
| 1102 |
}
|
| 1103 |
|
| 1104 |
setInterval(updateCountdown, 60000); // Update every minute
|
| 1105 |
+
|
| 1106 |
+
// Favorite functionality
|
| 1107 |
+
let isFavorited = false;
|
| 1108 |
+
|
| 1109 |
+
function toggleFavorite() {
|
| 1110 |
+
isFavorited = !isFavorited;
|
| 1111 |
+
const icon = document.getElementById('favoriteIcon');
|
| 1112 |
+
const text = document.getElementById('favoriteText');
|
| 1113 |
+
const btn = document.getElementById('favoriteBtn');
|
| 1114 |
+
|
| 1115 |
+
if (isFavorited) {
|
| 1116 |
+
icon.classList.remove('far');
|
| 1117 |
+
icon.classList.add('fas');
|
| 1118 |
+
text.textContent = 'Favoritado';
|
| 1119 |
+
btn.classList.add('bg-purple-100', 'border-purple-700');
|
| 1120 |
+
btn.classList.remove('hover:bg-purple-50');
|
| 1121 |
+
|
| 1122 |
+
// Show confirmation
|
| 1123 |
+
const eventTitle = document.getElementById('eventDetailsTitle').textContent;
|
| 1124 |
+
alert(`"${eventTitle}" foi adicionado aos seus favoritos!`);
|
| 1125 |
+
} else {
|
| 1126 |
+
icon.classList.remove('fas');
|
| 1127 |
+
icon.classList.add('far');
|
| 1128 |
+
text.textContent = 'Favoritar';
|
| 1129 |
+
btn.classList.remove('bg-purple-100', 'border-purple-700');
|
| 1130 |
+
btn.classList.add('hover:bg-purple-50');
|
| 1131 |
+
}
|
| 1132 |
+
}
|
| 1133 |
+
|
| 1134 |
+
// Subscription function
|
| 1135 |
+
function subscribeToEvent() {
|
| 1136 |
+
const eventTitle = document.getElementById('eventDetailsTitle').textContent;
|
| 1137 |
+
|
| 1138 |
+
// Show confirmation modal
|
| 1139 |
+
const modal = document.createElement('div');
|
| 1140 |
+
modal.className = 'fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50';
|
| 1141 |
+
modal.innerHTML = `
|
| 1142 |
+
<div class="bg-white rounded-xl shadow-2xl p-6 w-full max-w-md">
|
| 1143 |
+
<div class="flex justify-between items-center mb-4">
|
| 1144 |
+
<h3 class="text-xl font-bold">Inscrição Confirmada</h3>
|
| 1145 |
+
<button onclick="this.parentElement.parentElement.parentElement.remove()" class="text-gray-500 hover:text-gray-700">
|
| 1146 |
+
<i class="fas fa-times"></i>
|
| 1147 |
+
</button>
|
| 1148 |
+
</div>
|
| 1149 |
+
<p class="mb-6">Sua inscrição para <strong>${eventTitle}</strong> foi confirmada com sucesso!</p>
|
| 1150 |
+
<div class="flex justify-end">
|
| 1151 |
+
<button onclick="this.parentElement.parentElement.parentElement.remove()"
|
| 1152 |
+
class="bg-purple-600 text-white px-4 py-2 rounded-lg hover:bg-purple-700 transition">
|
| 1153 |
+
OK
|
| 1154 |
+
</button>
|
| 1155 |
+
</div>
|
| 1156 |
+
</div>
|
| 1157 |
+
`;
|
| 1158 |
+
|
| 1159 |
+
document.body.appendChild(modal);
|
| 1160 |
+
|
| 1161 |
+
// In a real app, you would send this to your backend API here
|
| 1162 |
+
console.log(`User subscribed to: ${eventTitle}`);
|
| 1163 |
+
}
|
| 1164 |
</script>
|
| 1165 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=mdarlen/runtrack" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 1166 |
</html>
|