File size: 30,967 Bytes
74c3733 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Classroom - Contest Prizes Setup</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap" rel="stylesheet">
<style>
@import url('https://fonts.googleapis.com/css2?family=Helvetica:wght@700&display=swap');
body {
font-family: 'Inter', sans-serif;
color: #1E293B;
}
h1, h2, h3 {
font-family: 'Helvetica', sans-serif;
}
.gradient-btn {
background: linear-gradient(90deg, #CABDFF 0%, #A6C8FF 100%);
transition: all 0.3s ease;
}
.gradient-btn:hover {
background: linear-gradient(90deg, #B8A8FF 0%, #95B8FF 100%);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.modal-overlay {
background-color: rgba(0, 0, 0, 0.5);
transition: opacity 0.3s ease;
}
.modal-content {
transition: all 0.3s ease;
transform: translateY(20px);
}
.modal-enter {
opacity: 0;
}
.modal-enter-active {
opacity: 1;
}
.modal-exit {
opacity: 1;
}
.modal-exit-active {
opacity: 0;
}
.prize-card {
transition: all 0.3s ease;
}
.prize-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.fade-in {
animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.slide-up {
animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
from { transform: translateY(20px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
</style>
</head>
<body class="bg-white min-h-screen">
<div class="container mx-auto px-[72px] py-[48px]">
<!-- Header -->
<header class="mb-12">
<h1 class="text-[32px] font-bold mb-2">Contest Prizes Setup</h1>
<p class="text-[20px] text-gray-600">Upload and manage prizes for your upcoming contest</p>
</header>
<!-- Main Content Area -->
<main>
<!-- Step Indicator -->
<div class="flex items-center mb-12">
<div class="flex-1 h-1 bg-gray-200">
<div id="progress-bar" class="h-1 bg-gradient-to-r from-[#CABDFF] to-[#A6C8FF] transition-all duration-500" style="width: 50%"></div>
</div>
<div class="flex justify-between w-full absolute px-[72px]">
<div class="flex flex-col items-center">
<div class="w-8 h-8 rounded-full bg-[#CABDFF] flex items-center justify-center text-white font-medium">1</div>
<span class="mt-2 text-[18px]">Upload Prizes</span>
</div>
<div class="flex flex-col items-center">
<div class="w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center text-gray-500 font-medium">2</div>
<span class="mt-2 text-[18px] text-gray-500">Preview & Publish</span>
</div>
</div>
</div>
<!-- Prize Upload Section -->
<section id="prize-upload-section" class="fade-in">
<h2 class="text-[24px] font-bold mb-6">Upload Contest Prizes</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8">
<!-- Prize Cards will be added here dynamically -->
<div id="prize-card-1" class="prize-card bg-white rounded-xl shadow-md overflow-hidden cursor-pointer border-2 border-dashed border-gray-300 hover:border-[#CABDFF] transition-all" onclick="openPrizeModal(1)">
<div class="h-40 bg-gray-100 flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
</svg>
</div>
<div class="p-4">
<h3 class="text-[20px] font-semibold mb-1">First Prize</h3>
<p class="text-[18px] text-gray-600">Click to add prize details</p>
</div>
</div>
<div id="prize-card-2" class="prize-card bg-white rounded-xl shadow-md overflow-hidden cursor-pointer border-2 border-dashed border-gray-300 hover:border-[#CABDFF] transition-all" onclick="openPrizeModal(2)">
<div class="h-40 bg-gray-100 flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
</svg>
</div>
<div class="p-4">
<h3 class="text-[20px] font-semibold mb-1">Second Prize</h3>
<p class="text-[18px] text-gray-600">Click to add prize details</p>
</div>
</div>
<div id="prize-card-3" class="prize-card bg-white rounded-xl shadow-md overflow-hidden cursor-pointer border-2 border-dashed border-gray-300 hover:border-[#CABDFF] transition-all" onclick="openPrizeModal(3)">
<div class="h-40 bg-gray-100 flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
</svg>
</div>
<div class="p-4">
<h3 class="text-[20px] font-semibold mb-1">Third Prize</h3>
<p class="text-[18px] text-gray-600">Click to add prize details</p>
</div>
</div>
<!-- Additional prize cards can be added here -->
</div>
<div class="flex justify-between items-center">
<button class="flex items-center text-[#1E293B] text-[18px] font-medium" onclick="addMorePrizes()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 mr-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
</svg>
Add More Prizes
</button>
<button id="next-btn" class="gradient-btn text-white px-6 py-3 rounded-lg text-[18px] font-medium" onclick="showPreviewSection()">
Next: Preview & Publish
</button>
</div>
</section>
<!-- Preview & Publish Section (Hidden by default) -->
<section id="preview-section" class="hidden slide-up">
<h2 class="text-[24px] font-bold mb-6">Contest Preview</h2>
<div class="bg-white rounded-xl shadow-md p-6 mb-8">
<h3 class="text-[20px] font-semibold mb-4">Prize List</h3>
<div id="preview-prizes-container" class="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">
<!-- Prize previews will be added here dynamically -->
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
<div class="bg-gray-50 p-4 rounded-lg">
<h4 class="text-[18px] font-medium mb-2">Contest Timing</h4>
<p class="text-[18px] text-gray-600">Not specified</p>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<h4 class="text-[18px] font-medium mb-2">Questions Summary</h4>
<p class="text-[18px] text-gray-600">No questions added yet</p>
</div>
</div>
</div>
<div class="flex justify-between items-center sticky bottom-0 bg-white py-4 border-t">
<button class="text-[#1E293B] text-[18px] font-medium px-6 py-3 rounded-lg border border-gray-300" onclick="backToPrizeUpload()">
Back to Prize Upload
</button>
<div class="flex space-x-4">
<button class="text-[#1E293B] text-[18px] font-medium px-6 py-3 rounded-lg border border-gray-300" onclick="saveAsDraft()">
Save as Draft
</button>
<button class="gradient-btn text-white px-6 py-3 rounded-lg text-[18px] font-medium" onclick="confirmPublish()">
Publish Contest
</button>
</div>
</div>
</section>
</main>
</div>
<!-- Prize Upload Modal -->
<div id="prize-modal" class="fixed inset-0 z-50 flex items-center justify-center modal-overlay opacity-0 pointer-events-none transition-opacity">
<div class="modal-content bg-white rounded-xl w-full max-w-md mx-4 overflow-hidden shadow-xl transform">
<div class="p-6">
<div class="flex justify-between items-center mb-4">
<h3 class="text-[24px] font-bold" id="modal-title">Add Prize Details</h3>
<button onclick="closePrizeModal()" class="text-gray-500 hover:text-gray-700">
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
<div class="mb-4">
<label class="block text-[18px] font-medium mb-2">Prize Image</label>
<div class="border-2 border-dashed border-gray-300 rounded-lg p-4 text-center cursor-pointer hover:border-[#CABDFF] transition-colors" onclick="document.getElementById('prize-image-upload').click()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 mx-auto text-gray-400 mb-2" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>
<p class="text-[18px] text-gray-600">Click to upload an image</p>
<input type="file" id="prize-image-upload" class="hidden" accept="image/*" onchange="previewImage(this)">
</div>
<div id="image-preview" class="mt-2 hidden">
<img id="preview-image" src="" alt="Preview" class="max-h-40 mx-auto">
</div>
</div>
<div class="mb-4">
<label for="prize-title" class="block text-[18px] font-medium mb-2">Prize Title</label>
<input type="text" id="prize-title" class="w-full px-4 py-2 border border-gray-300 rounded-lg text-[18px] focus:outline-none focus:ring-2 focus:ring-[#CABDFF] focus:border-transparent" placeholder="Enter prize title">
</div>
<div class="mb-6">
<label for="prize-description" class="block text-[18px] font-medium mb-2">Prize Description</label>
<textarea id="prize-description" rows="3" class="w-full px-4 py-2 border border-gray-300 rounded-lg text-[18px] focus:outline-none focus:ring-2 focus:ring-[#CABDFF] focus:border-transparent" placeholder="Enter detailed description of the prize"></textarea>
</div>
<div class="flex justify-end space-x-3">
<button onclick="closePrizeModal()" class="px-4 py-2 border border-gray-300 rounded-lg text-[18px] font-medium text-gray-700 hover:bg-gray-50">
Cancel
</button>
<button onclick="savePrizeDetails()" class="gradient-btn text-white px-6 py-3 rounded-lg text-[18px] font-medium">
Save Prize
</button>
</div>
</div>
</div>
</div>
<!-- Publish Confirmation Modal -->
<div id="publish-modal" class="fixed inset-0 z-50 flex items-center justify-center modal-overlay opacity-0 pointer-events-none transition-opacity">
<div class="modal-content bg-white rounded-xl w-full max-w-md mx-4 overflow-hidden shadow-xl transform">
<div class="p-6">
<div class="flex justify-center mb-4">
<div class="bg-[#CABDFF] bg-opacity-20 p-3 rounded-full">
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-[#1E293B]" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
</svg>
</div>
</div>
<h3 class="text-[24px] font-bold text-center mb-2">Confirm Publish</h3>
<p class="text-[18px] text-gray-600 text-center mb-6">Are you sure you want to publish this contest? You won't be able to edit after publishing.</p>
<div class="flex justify-center space-x-4">
<button onclick="closePublishModal()" class="px-6 py-2 border border-gray-300 rounded-lg text-[18px] font-medium text-gray-700 hover:bg-gray-50">
Cancel
</button>
<button onclick="publishContest()" class="gradient-btn text-white px-6 py-3 rounded-lg text-[18px] font-medium">
Yes, Publish
</button>
</div>
</div>
</div>
</div>
<script>
// Global variables
let currentPrizeId = null;
let prizes = {
1: { title: "First Prize", description: "", image: null },
2: { title: "Second Prize", description: "", image: null },
3: { title: "Third Prize", description: "", image: null }
};
let additionalPrizes = [];
// Modal functions
function openPrizeModal(prizeId) {
currentPrizeId = prizeId;
const modal = document.getElementById('prize-modal');
const modalTitle = document.getElementById('modal-title');
const prizeTitleInput = document.getElementById('prize-title');
const prizeDescInput = document.getElementById('prize-description');
const imagePreview = document.getElementById('image-preview');
const previewImage = document.getElementById('preview-image');
// Set modal title
modalTitle.textContent = prizeId <= 3 ? `Edit ${prizes[prizeId].title}` : "Add Prize Details";
// Set current values if they exist
const prize = prizeId <= 3 ? prizes[prizeId] : additionalPrizes.find(p => p.id === prizeId);
prizeTitleInput.value = prize ? prize.title : "";
prizeDescInput.value = prize ? prize.description : "";
// Handle image preview
if (prize && prize.image) {
previewImage.src = prize.image;
imagePreview.classList.remove('hidden');
} else {
imagePreview.classList.add('hidden');
}
// Show modal
modal.classList.remove('opacity-0', 'pointer-events-none');
setTimeout(() => {
document.querySelector('.modal-content').classList.remove('transform', 'translate-y-20');
}, 10);
}
function closePrizeModal() {
const modal = document.getElementById('prize-modal');
document.querySelector('.modal-content').classList.add('transform', 'translate-y-20');
modal.classList.add('opacity-0', 'pointer-events-none');
setTimeout(() => {
modal.classList.add('pointer-events-none');
}, 300);
// Reset file input
document.getElementById('prize-image-upload').value = '';
}
function previewImage(input) {
const file = input.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
const previewImage = document.getElementById('preview-image');
previewImage.src = e.target.result;
document.getElementById('image-preview').classList.remove('hidden');
}
reader.readAsDataURL(file);
}
}
function savePrizeDetails() {
const prizeTitle = document.getElementById('prize-title').value;
const prizeDesc = document.getElementById('prize-description').value;
const previewImage = document.getElementById('preview-image');
if (!prizeTitle) {
alert("Please enter a prize title");
return;
}
// Save prize details
if (currentPrizeId <= 3) {
prizes[currentPrizeId] = {
title: prizeTitle,
description: prizeDesc,
image: previewImage.src || null
};
} else {
// Handle additional prizes
const existingIndex = additionalPrizes.findIndex(p => p.id === currentPrizeId);
if (existingIndex >= 0) {
additionalPrizes[existingIndex] = {
id: currentPrizeId,
title: prizeTitle,
description: prizeDesc,
image: previewImage.src || null
};
} else {
additionalPrizes.push({
id: currentPrizeId,
title: prizeTitle,
description: prizeDesc,
image: previewImage.src || null
});
}
}
// Update prize card display
updatePrizeCard(currentPrizeId);
// Close modal
closePrizeModal();
}
function updatePrizeCard(prizeId) {
const prizeCard = document.getElementById(`prize-card-${prizeId}`);
const prize = prizeId <= 3 ? prizes[prizeId] : additionalPrizes.find(p => p.id === prizeId);
if (!prize) return;
prizeCard.innerHTML = `
<div class="h-40 bg-gray-100 flex items-center justify-center overflow-hidden">
${prize.image ?
`<img src="${prize.image}" alt="${prize.title}" class="w-full h-full object-cover">` :
`<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>`
}
</div>
<div class="p-4">
<h3 class="text-[20px] font-semibold mb-1">${prize.title}</h3>
<p class="text-[18px] text-gray-600 truncate">${prize.description || "No description provided"}</p>
<button class="mt-2 text-[#CABDFF] text-[16px] font-medium" onclick="event.stopPropagation(); openPrizeModal(${prizeId})">
Edit
</button>
</div>
`;
prizeCard.classList.remove('border-2', 'border-dashed', 'border-gray-300');
prizeCard.classList.add('border', 'border-transparent');
}
function addMorePrizes() {
const newPrizeId = additionalPrizes.length > 0 ?
Math.max(...additionalPrizes.map(p => p.id)) + 1 : 4;
const prizeContainer = document.querySelector('#prize-upload-section .grid');
const newPrizeCard = document.createElement('div');
newPrizeCard.id = `prize-card-${newPrizeId}`;
newPrizeCard.className = 'prize-card bg-white rounded-xl shadow-md overflow-hidden cursor-pointer border-2 border-dashed border-gray-300 hover:border-[#CABDFF] transition-all';
newPrizeCard.onclick = () => openPrizeModal(newPrizeId);
newPrizeCard.innerHTML = `
<div class="h-40 bg-gray-100 flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6v6m0 0v6m0-6h6m-6 0H6" />
</svg>
</div>
<div class="p-4">
<h3 class="text-[20px] font-semibold mb-1">Additional Prize</h3>
<p class="text-[18px] text-gray-600">Click to add prize details</p>
</div>
`;
prizeContainer.appendChild(newPrizeCard);
// Add to additional prizes array
additionalPrizes.push({
id: newPrizeId,
title: "",
description: "",
image: null
});
}
// Section navigation functions
function showPreviewSection() {
// Validate that at least one prize has details
const hasPrizeDetails = Object.values(prizes).some(p => p.title && p.title !== "First Prize" && p.title !== "Second Prize" && p.title !== "Third Prize") ||
additionalPrizes.some(p => p.title);
if (!hasPrizeDetails) {
alert("Please add details for at least one prize before proceeding");
return;
}
// Update progress bar
document.getElementById('progress-bar').style.width = '100%';
// Hide prize upload section
document.getElementById('prize-upload-section').classList.add('hidden');
// Show preview section
document.getElementById('preview-section').classList.remove('hidden');
document.getElementById('preview-section').classList.add('slide-up');
// Populate preview prizes
const previewContainer = document.getElementById('preview-prizes-container');
previewContainer.innerHTML = '';
// Add main prizes
for (const [id, prize] of Object.entries(prizes)) {
if (prize.title && prize.title !== "First Prize" && prize.title !== "Second Prize" && prize.title !== "Third Prize") {
previewContainer.innerHTML += `
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-start">
${prize.image ?
`<img src="${prize.image}" alt="${prize.title}" class="w-16 h-16 object-cover rounded-lg mr-4">` :
`<div class="w-16 h-16 bg-gray-200 rounded-lg mr-4 flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>
</div>`
}
<div>
<h4 class="text-[18px] font-medium">${prize.title}</h4>
<p class="text-[16px] text-gray-600">${prize.description || "No description provided"}</p>
</div>
</div>
</div>
`;
}
}
// Add additional prizes
additionalPrizes.forEach(prize => {
if (prize.title) {
previewContainer.innerHTML += `
<div class="bg-gray-50 p-4 rounded-lg">
<div class="flex items-start">
${prize.image ?
`<img src="${prize.image}" alt="${prize.title}" class="w-16 h-16 object-cover rounded-lg mr-4">` :
`<div class="w-16 h-16 bg-gray-200 rounded-lg mr-4 flex items-center justify-center">
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>
</div>`
}
<div>
<h4 class="text-[18px] font-medium">${prize.title}</h4>
<p class="text-[16px] text-gray-600">${prize.description || "No description provided"}</p>
</div>
</div>
</div>
`;
}
});
}
function backToPrizeUpload() {
// Update progress bar
document.getElementById('progress-bar').style.width = '50%';
// Hide preview section
document.getElementById('preview-section').classList.add('hidden');
document.getElementById('preview-section').classList.remove('slide-up');
// Show prize upload section
document.getElementById('prize-upload-section').classList.remove('hidden');
document.getElementById('prize-upload-section').classList.add('fade-in');
}
function saveAsDraft() {
// In a real app, this would save to a database
alert("Contest saved as draft successfully!");
}
function confirmPublish() {
const modal = document.getElementById('publish-modal');
modal.classList.remove('opacity-0', 'pointer-events-none');
setTimeout(() => {
document.querySelector('#publish-modal .modal-content').classList.remove('transform', 'translate-y-20');
}, 10);
}
function closePublishModal() {
const modal = document.getElementById('publish-modal');
document.querySelector('#publish-modal .modal-content').classList.add('transform', 'translate-y-20');
modal.classList.add('opacity-0', 'pointer-events-none');
setTimeout(() => {
modal.classList.add('pointer-events-none');
}, 300);
}
function publishContest() {
closePublishModal();
// In a real app, this would publish to a database
alert("Contest published successfully!");
// Reset form for demo purposes
setTimeout(() => {
window.location.reload();
}, 1500);
}
</script>
<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=Design-28/contest" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |