html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sad Emotional Theme</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div id="rain"></div>
<div class="container">
<h1>Lost in Thoughts</h1>
<p>Sometimes, the weight of the world feels too heavy to bear.</p>
<button id="revealQuoteBtn">Reveal a Quote</button>
<p id="quote" class="hidden"></p>
</div>
<script src="script.js"></script>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
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
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: 'Arial', sans-serif;
color: #ecf0f1;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
position: relative;
overflow: hidden;
background-color: #2c3e50; /* Dark background for the sad theme */
}
#rain {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none; /* Allow clicks to pass through */
}
.drop {
position: absolute;
Enter to Rename, Shift+Enter to Preview
js
js
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
document.addEventListener('DOMContentLoaded', function() {
// Rain effect
const rainContainer = document.getElementById('rain');
const dropCount = 100; // Number of raindrops
function createDrop() {
const drop = document.createElement('div');
drop.className = 'drop';
// Randomize the position and animation duration
const xPosition = Math.random() * window.innerWidth; // Random horizontal position
const duration = Math.random() * 1 + 0.5; // Random duration between 0.5s and 1.5s
drop.style.left = `${xPosition}px`;
drop.style.animationDuration = `${duration}s`;
rainContainer.appendChild(drop);
// Remove the drop after the animation ends to prevent memory leaks
drop.addEventListener('animationend', () => {
drop.remove();
});
}
// Create multiple drops at intervals
setInterval(createDrop, 200); // Create a new drop every 200 milliseconds
// Reveal quote functionality
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Запуск