html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Self Improvement</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Reset Your Life</h1>
<button id="resetButton">Reset</button>
<div id="quote" class="quote"></div>
<div id="task" class="task"></div>
</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
body {
font-family: Arial, sans-serif;
background-color: #e0f7fa;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
text-align: center;
padding: 20px;
}
h1 {
color: #00796b;
}
button {
padding: 15px 30px;
font-size: 18px;
background-color: #00796b;
color: white;
border: none;
border-radius: 25px;
cursor: pointer;
margin: 20px 0;
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
const quotes = [
"The best time to plant a tree was 20 years ago. The second best time is now.",
"You are never too old to set another goal or to dream a new dream.",
"Success is not the key to happiness. Happiness is the key to success.",
"Believe you can and you're halfway there.",
"Your limitation—it's only your imagination."
];
const tasks = [
"Write down three things you are grateful for today.",
"Spend 10 minutes meditating or practicing mindfulness.",
"Read a chapter of a book you've been meaning to start.",
"Take a 30-minute walk outside and enjoy nature.",
"Reach out to a friend or family member you haven't spoken to in a while."
];
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('resetButton').addEventListener('click', function() {
const randomQuote = quotes[Math.floor(Math.random() * quotes.length)];
const randomTask = tasks[Math.floor(Math.random() * tasks.length)];
document.getElementById('quote').innerText = randomQuote;
document.getElementById('task').innerText = randomTask;
});
});
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Exécuter