Generate a beautiful calendar website.
- User
Generate a beautiful calendar website.
Assistant
I'll create a beautiful, interactive calendar website for you. 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: 'Segoe UI', Tahoma, Geneva, Verdana, 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 20px 40px rgba(0, 0, 0, 0.1); padding: 30px; max-width: 450px; width: 100%; transition: transform 0.3s ease; } .calendar-container:hover { transform: translateY(-5px); } .calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; } .nav-btn { background: linear-gradient(135deg, #667eea, #764ba2); border: none; color: white; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 18px; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); } .nav-btn:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); } .current-month { font-size: 24px; font-weight: 600; color: #333; text-align: center; min-width: 180px; } .weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 15px; } .weekday { text-align: center; font-weight: 600; color: #667eea; padding: 10px 5px; font-size: 14px; } .days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; } .day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 12px; cursor: pointer; font-weight: 500; transition: all 0.3s ease; position: relative; font-size: 16px; } .day:hover { background: rgba(102, 126, 234, 0.1); transform: scale(1.1); } .day.other-month { color: #ccc; } .day.today { background: linear-gradient(135deg, #667eea, #764ba2); color: white; font-weight: 700; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4); } .day.today:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5); } .day.selected { background: rgba(102, 126, 234, 0.2); color: #667eea; font-weight: 700; } .calendar-footer { margin-top: 25px; text-align: center; color: #666; font-size: 14px; } .today-info { background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1)); padding: 15px; border-radius: 12px; margin-top: 20px; text-align: center; } .today-date { font-size: 18px; font-weight: 600; color: #333; margin-bottom: 5px; } .today-day { font-size: 14px; color: #667eea; } @media (max-width: 480px) { .calendar-container { padding: 20px; margin: 10px; } .current-month { font-size: 20px; min-width: 150px; } .day { font-size: 14px; } } .fade-in { animation: fadeIn 0.5s ease-in; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } </style> </head> <body> <div class="calendar-container"> <div class="calendar-header"> <button class="nav-btn" id="prevBtn">‹</button> <div class="current-month" id="currentMonth"></div> <button class="nav-btn" id="nextBtn">›</button> </div> <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-grid" id="daysGrid"></div> <div class="today-info"> <div class="today-date" id="todayDate"></div> <div class="today-day" id="todayDay"></div> </div> </div> <script> class BeautifulCalendar { constructor() { this.currentDate = new Date(); this.today = new Date(); this.selectedDate = null; this.monthNames = [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ]; this.dayNames = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ]; this.init(); } init() { this.bindEvents(); this.render(); this.updateTodayInfo(); } bindEvents() { document.getElementById('prevBtn').addEventListener('click', () => { this.currentDate.setMonth(this.currentDate.getMonth() - 1); this.render(); }); document.getElementById('nextBtn').addEventListener('click', () => { this.currentDate.setMonth(this.currentDate.getMonth() + 1); this.render(); }); } render() { this.updateHeader(); this.updateDaysGrid(); // Add fade-in animation const container = document.querySelector('.calendar-container'); container.classList.remove('fade-in'); setTimeout(() => container.classList.add('fade-in'), 10); } updateHeader() { const monthElement = document.getElementById('currentMonth'); monthElement.textContent = `${this.monthNames[this.currentDate.getMonth()]} ${this.currentDate.getFullYear()}`; } updateDaysGrid() { const daysGrid = document.getElementById('daysGrid'); daysGrid.innerHTML = ''; const firstDay = new Date(this.currentDate.getFullYear(), this.currentDate.getMonth(), 1); const lastDay = new Date(this.currentDate.getFullYear(), this.currentDate.getMonth() + 1, 0); const startDate = new Date(firstDay); startDate.setDate(startDate.getDate() - firstDay.getDay()); for (let i = 0; i < 42; i++) { const date = new Date(startDate); date.setDate(startDate.getDate() + i); const dayElement = document.createElement('div'); dayElement.className = 'day'; dayElement.textContent = date.getDate(); if (date.getMonth() !== this.currentDate.getMonth()) { dayElement.classList.add('other-month'); } if (this.isSameDay(date, this.today)) { dayElement.classList.add('today'); } if (this.selectedDate && this.isSameDay(date, this.selectedDate)) { dayElement.classList.add('selected'); } dayElement.addEventListener('click', () => { document.querySelectorAll('.day.selected').forEach(el => { el.classList.remove('selected'); }); dayElement.classList.add('selected'); this.selectedDate = new Date(date); }); daysGrid.appendChild(dayElement); } } updateTodayInfo() { const todayDateElement = document.getElementById('todayDate'); const todayDayElement = document.getElementById('todayDay'); const options = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }; todayDateElement.textContent = this.today.toLocaleDateString('en-US', options); todayDayElement.textContent = `Today is ${this.dayNames[this.today.getDay()]}`; } isSameDay(date1, date2) { return date1.getDate() === date2.getDate() && date1.getMonth() === date2.getMonth() && date1.getFullYear() === date2.getFullYear(); } } // Initialize the calendar when the page loads document.addEventListener('DOMContentLoaded', () => { new BeautifulCalendar(); }); </script> </body> </html>This beautiful calendar website features:
Visual Design:
- Elegant gradient background with glass-morphism effect
- Smooth hover animations and transitions
- Modern, clean typography
- Responsive design for mobile devices
- Beautiful color scheme with purple/blue gradients
Functionality:
- Navigate between months using arrow buttons
- Current date highlighted with special styling
- Click on any date to select it
- Today's date and day information displayed at the bottom
- Smooth fade-in animations when switching months
Key Features:
- Fully responsive layout
- Interactive date selection
- Clean, intuitive navigation
- Professional styling with subtle shadows and effects
- Cross-browser compatible
To use this calendar, simply save the code as an HTML file and open it in your web browser. The calendar will automatically display the current month and highlight today's date. You can navigate through months and select specific dates by clicking on them.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.