I'll create a modern, glassmorphic calendar with a space theme. Here's a cool calendar design with smooth animations and a unique visual style:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cosmic Calendar</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Orbitron', monospace;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: #0a0a0a;
overflow: hidden;
position: relative;
}
/* Animated background stars */
.stars {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
}
.star {
position: absolute;
width: 2px;
height: 2px;
background: white;
border-radius: 50%;
animation: twinkle 3s infinite;
}
@keyframes twinkle {
0%, 100% { opacity: 0; }
50% { opacity: 1; }
}
/* Nebula effect */
.nebula {
position: fixed;
width: 600px;
height: 600px;
background: radial-gradient(circle, rgba(138, 43, 226, 0.3) 0%, rgba(30, 144, 255, 0.2) 40%, transparent 70%);
filter: blur(60px);
animation: float 20s infinite ease-in-out;
pointer-events: none;
}
.nebula:nth-child(2) {
background: radial-gradient(circle, rgba(255, 20, 147, 0.3) 0%, rgba(255, 165, 0, 0.2) 40%, transparent 70%);
animation-delay: -10s;
animation-duration: 25s;
}
@keyframes float {
0%, 100% { transform: translate(-50%, -50%) scale(1); }
50% { transform: translate(-30%, -70%) scale(1.2); }
}
/* Calendar container */
.calendar-container {
background: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(20px);
border-radius: 30px;
padding: 40px;
box-shadow:
0 0 40px rgba(138, 43, 226, 0.3),
inset 0 0 20px rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.1);
position: relative;
z-index: 10;
animation: slideIn 1s ease-out;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(50px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Header */
.calendar-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
color: white;
}
.month-year {
font-size: 2.5em;
font-weight: 900;
text-transform: uppercase;
letter-spacing: 3px;
background: linear-gradient(45deg, #8a2be2, #1e90ff, #ff1493);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
animation: gradient 3s ease infinite;
background-size: 200% 200%;
}
@keyframes gradient {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.nav-button {
background: rgba(255, 255, 255, 0.1);
border: 1px solid rgba(255, 255, 255, 0.2);
color: white;
font-size: 1.5em;
width: 50px;
height: 50px;
border-radius: 50%;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
}
.nav-button:hover {
background: rgba(138, 43, 226, 0.3);
transform: scale(1.1);
box-shadow: 0 0 20px rgba(138, 43, 226, 0.5);
}
/* Calendar grid */
.calendar-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 15px;
}
.day-header {
text-align: center;
color: #8a2be2;
font-weight: 700;
font-size: 0.9em;
padding: 10px;
text-transform: uppercase;
letter-spacing: 2px;
}
.day {
aspect-ratio: 1;
display: flex;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 15px;
color: white;
font-weight: 400;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.day::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
background: radial-gradient(circle, rgba(138, 43, 226, 0.6) 0%, transparent 70%);
transition: all 0.5s ease;
transform: translate(-50%, -50%);
}
.day:hover::before {
width: 100%;
height: 100%;
}
.day:hover {
transform: translateY(-5px);
box-shadow: 0 10px 30px rgba(138, 43, 226, 0.4);
border-color: rgba(138, 43, 226, 0.5);
}
.day.other-month {
opacity: 0.3;
}
.day.today {
background: linear-gradient(135deg, rgba(138, 43, 226, 0.3), rgba(30, 144, 255, 0.3));
border: 2px solid rgba(138, 43, 226, 0.6);
font-weight: 700;
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% { box-shadow: 0 0 20px rgba(138, 43, 226, 0.5); }
50% { box-shadow: 0 0 40px rgba(138, 43, 226, 0.8); }
}
.day.selected {
background: rgba(255, 20, 147, 0.3);
border-color: rgba(255, 20, 147, 0.6);
}
/* Responsive */
@media (max-width: 600px) {
.calendar-container {
padding: 20px;
}
.month-year {
font-size: 1.8em;
}
.calendar-grid {
gap: 8px;
}
.day-header {
font-size: 0.7em;
letter-spacing: 1px;
}
}
</style>
</head>
<body>
<!-- Animated background elements -->
<div class="stars" id="stars"></div>
<div class="nebula" style="top: 20%; left: 10%;"></div>
<div class="nebula" style="bottom: 20%; right: 10%;"></div>
<!-- Calendar -->
<div class="calendar-container">
<div class="calendar-header">
<button class="nav-button" onclick="previousMonth()">‹</button>
<h1 class="month-year" id="monthYear"></h1>
<button class="nav-button" onclick="nextMonth()">›</button>
</div>
<div class="calendar-grid" id="calendar">
<!-- Calendar will be generated here -->
</div>
</div>
<script>
let currentDate = new Date();
let selectedDate = null;
// Create random stars
function createStars() {
const starsContainer = document.getElementById('stars');
const starCount = 150;
for (let i = 0; i < starCount; i++) {
const star = document.createElement('div');
star.className = 'star';
star.style.left = Math.random() * 100 + '%';
star.style.top = Math.random() * 100 + '%';
star.style.animationDelay = Math.random() * 3 + 's';
star.style.animationDuration = (Math.random() * 3 + 2) + 's';
// Vary star sizes
const size = Math.random() * 3;
star.style.width = size + 'px';
star.style.height = size + 'px';
starsContainer.appendChild(star);
}
}
function generateCalendar() {
const year = currentDate.getFullYear();
const month = currentDate.getMonth();
// Update header
const monthNames = ['January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'];
document.getElementById('monthYear').textContent = `${monthNames[month]} ${year}`;
// Clear calendar
const calendar = document.getElementById('calendar');
calendar.innerHTML = '';
// Add day headers
const dayHeaders = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
dayHeaders.forEach(day => {
const dayHeader = document.createElement('div');
dayHeader.className = 'day-header';
dayHeader.textContent = day;
calendar.appendChild(dayHeader);
});
// Get first day of month and number of days
const firstDay = new Date(year, month, 1).getDay();
const daysInMonth = new Date(year, month + 1, 0).getDate();
const daysInPrevMonth = new Date(year, month, 0).getDate();
// Add previous month's trailing days
for (let i = firstDay - 1; i >= 0; i--) {
const day = createDayElement(daysInPrevMonth - i, true);
calendar.appendChild(day);
}
// Add current month's days
const today = new Date();
for (let i = 1; i <= daysInMonth; i++) {
const day = createDayElement(i, false);
// Check if it's today
if (year === today.getFullYear() &&
month === today.getMonth() &&
i === today.getDate()) {
day.classList.add('today');
}
calendar.appendChild(day);
}
// Add next month's leading days
const remainingDays = 42 - (firstDay + daysInMonth);
for (let i = 1; i <= remainingDays; i++) {
const day = createDayElement(i, true);
calendar.appendChild(day);
}
}
function createDayElement(dayNumber, isOtherMonth) {
const day = document.createElement('div');
day.className = 'day';
if (isOtherMonth) day.classList.add('other-month');
day.textContent = dayNumber;
day.addEventListener('click', function() {
// Remove previous selection
document.querySelectorAll('.day.selected').forEach(d => {
d.classList.remove('selected');
});
// Add selection to clicked day
if (!this.classList.contains('other-month')) {
this.classList.add('selected');
}
});
return day;
}
function previousMonth() {
currentDate.setMonth(currentDate.getMonth() - 1);
generateCalendar();
}
function nextMonth() {
currentDate.setMonth(currentDate.getMonth() + 1);
generateCalendar();
}
// Initialize
createStars();
generateCalendar();
</script>
</body>
</html>
This calendar features:
- Space/Cosmic Theme - Dark background with animated stars and nebula effects
- Glassmorphism Design - Translucent panels with blur effects
- Orbitron Font - A futuristic, space-themed font from Google Fonts
- Interactive Elements:
- Hover effects on days with expanding glow
- Click to select dates
- Smooth navigation between months
- Today's date is highlighted with a pulsing effect
- Animations:
- Twinkling stars in the background
- Floating nebula clouds
- Gradient text animation on the month/year
- Slide-in animation on load
- Responsive Design - Adapts to smaller screens
The calendar has a modern, ethereal look with smooth transitions and a cohesive color scheme using purples, blues, and pinks to create a cosmic atmosphere.