* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(135deg, #2a0e1f 0%, #4a1942 50%, #6b2463 100%);
transition: background 0.8s ease;
}
body.blink {
background: linear-gradient(135deg, #ff6b9d 0%, #c44569 50%, #8b1a5e 100%);
}
.container {
text-align: center;
padding: 3rem;
background: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(10px);
border-radius: 20px;
border: 1px solid rgba(255, 255, 255, 0.1);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
h1 {
color: #fff;
font-size: 2.5rem;
margin-bottom: 1.5rem;
font-weight: 300;
letter-spacing: 2px;
}
.controls {
display: flex;
gap: 1rem;
justify-content: center;
flex-wrap: wrap;
}
button {
padding: 1rem 2rem;
font-size: 1rem;
border: none;
border-radius: 10px;
cursor: pointer;
background: linear-gradient(135deg, #ff6b9d, #c44569);
color: white;
font-weight: 500;
transition: transform 0.2s, box-shadow 0.2s;
box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}
button:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}
button:active {
transform: translateY(0);
}
button.stop {
background: linear-gradient(135deg, #666, #444);
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
button.stop:hover {
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}
.info {
margin-top: 2rem;
color: rgba(255, 255, 255, 0.7);
font-size: 0.9rem;
}
let blinkInterval = null;
const body = document.body;
const startBtn = document.getElementById('startBtn');
const stopBtn = document.getElementById('stopBtn');
startBtn.addEventListener('click', () => {
if (!blinkInterval) {
blinkInterval = setInterval(() => {
body.classList.toggle('blink');
}, 800);
}
});
stopBtn.addEventListener('click', () => {
if (blinkInterval) {
clearInterval(blinkInterval);
blinkInterval = null;
body.classList.remove('blink');
}
});
No comments yet. Be the first!