Generate a beautiful calendar website.
- User
Generate a beautiful calendar website.
Assistant
I'll create a beautiful, modern calendar website for you with a clean design and smooth interactions. Here's a complete HTML file with embedded CSS and JavaScript:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Beautiful Calendar</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px; } .calendar-container { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(10px); border-radius: 20px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); overflow: hidden; max-width: 500px; width: 100%; animation: slideIn 0.5s ease-out; } @keyframes slideIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } } .calendar-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 30px; text-align: center; position: relative; } .month-year { font-size: 28px; font-weight: 600; margin-bottom: 10px; letter-spacing: 1px; } .current-date { font-size: 16px; opacity: 0.9; font-weight: 300; } .nav-buttons { position: absolute; top: 50%; transform: translateY(-50%); width: 100%; display: flex; justify-content: space-between; padding: 0 20px; } .nav-btn { background: rgba(255, 255, 255, 0.2); border: none; color: white; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; font-size: 18px; } .nav-btn:hover { background: rgba(255, 255, 255, 0.3); transform: scale(1.1); } .calendar-body { padding: 20px; } .weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 10px; } .weekday { text-align: center; font-weight: 600; color: #667eea; font-size: 14px; padding: 10px 0; } .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; } .day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; cursor: pointer; transition: all 0.3s ease; font-weight: 500; color: #333; position: relative; overflow: hidden; } .day:hover { background: #f3f4f6; transform: scale(1.05); } .day.other-month { color: #cbd5e1; } .day.today { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; font-weight: 600; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); } .day.selected { background: #e0e7ff; color: #667eea; font-weight: 600; } .day::before { content: ''; position: absolute; top: 50%; left: 50%; width: 0; height: 0; background: rgba(102, 126, 234, 0.2); border-radius: 50%; transform: translate(-50%, -50%); transition: width 0.3s ease, height 0.3s ease; } .day:active::before { width: 100%; height: 100%; } .today-button { margin: 20px auto 0; display: block; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border: none; padding: 12px 30px; border-radius: 25px; cursor: pointer; font-size: 16px; font-weight: 500; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); } .today-button:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); } @media (max-width: 480px) { .calendar-container { border-radius: 15px; } .month-year { font-size: 24px; } .day { font-size: 14px; } } </style> </head> <body> <div class="calendar-container"> <div class="calendar-header"> <h2 class="month-year" id="monthYear"></h2> <p class="current-date" id="currentDate"></p> <div class="nav-buttons"> <button class="nav-btn" id="prevBtn">‹</button> <button class="nav-btn" id="nextBtn">›</button> </div> </div> <div class="calendar-body"> <div class="weekdays"> <div class="weekday">Sun</div> <div class="weekday">Mon</div> <div class="weekday">Tue</div> <div class="weekday">Wed</div> <div class="weekday">Thu</div> <div class="weekday">Fri</div> <div class="weekday">Sat</div> </div> <div class="days" id="days"></div> <button class="today-button" id="todayBtn">Today</button> </div> </div> <script> const monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; let currentDate = new Date(); let currentMonth = currentDate.getMonth(); let currentYear = currentDate.getFullYear(); let selectedDate = null; const monthYear = document.getElementById('monthYear'); const currentDateElement = document.getElementById('currentDate'); const daysContainer = document.getElementById('days'); const prevBtn = document.getElementById('prevBtn'); const nextBtn = document.getElementById('nextBtn'); const todayBtn = document.getElementById('todayBtn'); function updateHeader() { monthYear.textContent = `${monthNames[currentMonth]} ${currentYear}`; const today = new Date(); currentDateElement.textContent = today.toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); } function getDaysInMonth(month, year) { return new Date(year, month + 1, 0).getDate(); } function getFirstDayOfMonth(month, year) { return new Date(year, month, 1).getDay(); } function generateCalendar() { daysContainer.innerHTML = ''; updateHeader(); const daysInMonth = getDaysInMonth(currentMonth, currentYear); const firstDay = getFirstDayOfMonth(currentMonth, currentYear); const daysInPrevMonth = getDaysInMonth(currentMonth - 1, currentYear); // Previous month days for (let i = firstDay - 1; i >= 0; i--) { const day = createDayElement(daysInPrevMonth - i, true, false); daysContainer.appendChild(day); } // Current month days const today = new Date(); for (let i = 1; i <= daysInMonth; i++) { const isToday = i === today.getDate() && currentMonth === today.getMonth() && currentYear === today.getFullYear(); const day = createDayElement(i, false, isToday); daysContainer.appendChild(day); } // Next month days const remainingDays = 42 - (firstDay + daysInMonth); for (let i = 1; i <= remainingDays; i++) { const day = createDayElement(i, true, false); daysContainer.appendChild(day); } } function createDayElement(dayNumber, isOtherMonth, isToday) { const day = document.createElement('div'); day.classList.add('day'); if (isOtherMonth) day.classList.add('other-month'); if (isToday) day.classList.add('today'); day.textContent = dayNumber; day.addEventListener('click', function() { if (!isOtherMonth) { document.querySelectorAll('.day.selected').forEach(d => d.classList.remove('selected')); if (!this.classList.contains('today')) { this.classList.add('selected'); } selectedDate = new Date(currentYear, currentMonth, dayNumber); } }); return day; } prevBtn.addEventListener('click', () => { currentMonth--; if (currentMonth < 0) { currentMonth = 11; currentYear--; } generateCalendar(); }); nextBtn.addEventListener('click', () => { currentMonth++; if (currentMonth > 11) { currentMonth = 0; currentYear++; } generateCalendar(); }); todayBtn.addEventListener('click', () => { currentDate = new Date(); currentMonth = currentDate.getMonth(); currentYear = currentDate.getFullYear(); generateCalendar(); }); // Initialize calendar generateCalendar(); </script> </body> </html>This calendar website features:
- Modern Design: A gradient background with a glassmorphism effect on the calendar container
- Smooth Animations: Fade-in animation on load and hover effects on interactive elements
- Navigation: Previous/next month buttons and a "Today" button to quickly return to the current date
- Visual Feedback: The current date is highlighted with a gradient background, and days have hover and click effects
- Responsive Layout: Adapts to different screen sizes with a mobile-friendly design
- Clean Typography: Uses system fonts for optimal readability across platforms
- Interactive Days: Click on any day to select it (excluding days from other months)
The calendar automatically displays the current month and highlights today's date. You can navigate between months using the arrow buttons or quickly return to today using the "Today" button at the bottom. The design uses a purple gradient theme that creates a modern, professional appearance.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.