File size: 4,747 Bytes
cf991c1 | 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 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Create Countdown | Countdown Carnival</title>
<link rel="stylesheet" href="style.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
</head>
<body class="bg-gray-100 min-h-screen flex flex-col">
<custom-navbar></custom-navbar>
<main class="flex-grow container mx-auto px-4 py-12">
<div class="max-w-3xl mx-auto bg-white rounded-xl shadow-lg overflow-hidden">
<div class="bg-gradient-to-r from-purple-600 to-indigo-600 p-6">
<h1 class="text-3xl font-bold text-white">Create New Countdown</h1>
<p class="text-purple-200">Set up your exciting event countdown</p>
</div>
<div class="p-8">
<form id="createTimerForm" class="space-y-6">
<div>
<label for="newEventName" class="block text-lg font-medium text-gray-700 mb-2">Event Name</label>
<input type="text" id="newEventName" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500 transition duration-200" placeholder="What are you counting down to?">
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label for="newEventDate" class="block text-lg font-medium text-gray-700 mb-2">Event Date</label>
<input type="date" id="newEventDate" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500 transition duration-200">
</div>
<div>
<label for="newEventTime" class="block text-lg font-medium text-gray-700 mb-2">Event Time</label>
<input type="time" id="newEventTime" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500 transition duration-200">
</div>
</div>
<div>
<label for="eventColor" class="block text-lg font-medium text-gray-700 mb-2">Color Theme</label>
<select id="eventColor" class="w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500 transition duration-200">
<option value="purple-indigo">Purple to Indigo</option>
<option value="blue-teal">Blue to Teal</option>
<option value="pink-rose">Pink to Rose</option>
<option value="emerald-green">Emerald to Green</option>
<option value="orange-amber">Orange to Amber</option>
</select>
</div>
<div class="pt-4">
<button type="submit" class="w-full bg-purple-600 hover:bg-purple-700 text-white font-bold py-3 px-6 rounded-lg text-lg transition duration-200 flex items-center justify-center gap-2">
<i data-feather="plus"></i> Create Countdown
</button>
</div>
</form>
</div>
</div>
</main>
<custom-footer></custom-footer>
<script src="components/navbar.js"></script>
<script src="components/footer.js"></script>
<script src="script.js"></script>
<script>
feather.replace();
// Form handling for create page
document.getElementById('createTimerForm').addEventListener('submit', function(e) {
e.preventDefault();
const eventName = document.getElementById('newEventName').value;
const eventDate = document.getElementById('newEventDate').value;
const eventTime = document.getElementById('newEventTime').value;
if (eventName && eventDate && eventTime) {
const eventDateTime = new Date(`${eventDate}T${eventTime}`);
alert(`Countdown for "${eventName}" on ${eventDateTime.toLocaleString()} created successfully!`);
window.location.href = '/';
} else {
alert('Please fill in all fields!');
}
});
</script>
</body>
</html> |