-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
295 lines (256 loc) · 9.36 KB
/
index.html
File metadata and controls
295 lines (256 loc) · 9.36 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Doubt Dumpster ™ - Dump Your Doubts</title>
<style>
:root {
--color-primary: #4A7C59;
--color-primary-dark: #396947;
--color-secondary: #8C6E53;
--color-secondary-dark: #74563D;
--color-background: #E5F4E3;
--color-surface: #FAF3E0;
--color-text: #4A4A4A;
--color-text-light: #6B4F4F;
--font-main: 'Arial', sans-serif;
}
body {
font-family: var(--font-main);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
background-color: var(--color-background);
color: var(--color-text);
line-height: 1.6;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
background: var(--color-surface);
padding: 2rem;
border-radius: 8px;
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
border: 2px solid var(--color-secondary);
max-width: 600px;
width: 90%;
margin: 2rem;
}
h1 {
font-size: 2.5em;
color: var(--color-primary);
}
h2 {
font-size: 1.8em;
color: var(--color-primary);
}
.collapsible-container {
width: 100%;
border: 2px solid var(--color-secondary);
border-radius: 8px;
margin-bottom: 1rem;
overflow: hidden;
}
.collapsible {
background-color: var(--color-primary);
color: white;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
}
.active, .collapsible:hover {
background-color: var(--color-primary-dark);
}
.collapsible:after {
content: '\002B';
color: white;
font-weight: bold;
float: right;
margin-left: 5px;
}
.active:after {
content: "\2212";
}
.about {
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
font-size: 1.1em;
color: var(--color-text-light);
text-align: justify;
padding: 0 18px;
background-color: ivory;
}
.no-radius {
border-radius: 0px;
}
label {
font-size: 1.5em;
color: var(--color-primary);
margin-bottom: 0.5rem;
margin-top: 1rem;
display: block;
transition: all 0.3s ease;
}
label.message {
font-size: 1.8em;
color: var(--color-secondary);
background-color: rgba(74, 124, 89, 0.1);
padding: 1rem;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
margin-bottom: 1rem;
}
textarea {
font-size: 1.2em;
padding: 1rem;
max-width: 600px;
width: 95%;
height: 120px;
margin-bottom: 1rem;
resize: vertical;
border: 2px solid var(--color-secondary);
border-radius: 8px;
background-color: #FDFCF6;
color: var(--color-text);
}
textarea:focus {
border-color: var(--color-primary);
outline: none;
box-shadow: 0 0 0 2px rgba(74, 124, 89, 0.2);
}
button {
font-size: 1.2em;
padding: 0.8rem 1.5rem;
background-color: var(--color-primary);
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
}
button:hover, button:focus {
background-color: var(--color-primary-dark);
}
button:active {
}
#resetButton {
display: none;
background-color: var(--color-secondary);
}
#resetButton:hover, #resetButton:focus {
background-color: var(--color-secondary-dark);
}
@media (max-width: 600px) {
.container {
padding: 1.5rem;
}
h1 {
font-size: 2em;
}
.about, textarea {
font-size: 1em;
}
button {
font-size: 1.1em;
padding: 0.7rem 1.2rem;
}
}
</style>
</head>
<body>
<div class="container">
<h1 style="margin-bottom: 0px; margin-top: 0px;">The Doubt Dumpster ™</h1>
<h2 style="margin-top: 0px; font-style: italic; font-weight: normal;">When in doubt...dump it out!</h2>
<div class="collapsible-container">
<button class="collapsible no-radius">What's this all about?</button>
<div class="about">
<p>The Doubt Dumpster is here for you to get those doubts, those 'what ifs', out of your head so you can get back to trusting your beautiful self more fully.</p>
<p>And the best part about it is that there is no data landfill here. This means that the moment you press 'dump it out!,' no record exists! Doubts incinerated, data destroyed, all gone for good.</p>
<p>So you can feel totally free to ditch your doubts, knowing that no one will ever see what you have dumped out.</p>
<p>The moment you have it, dump it and be done with it. Throw your doubt…out!</p>
</div>
</div>
<label id="mainLabel" for="whatIf">What if...</label>
<textarea id="whatIf" placeholder="Enter your doubt..." aria-label="Enter your doubt" autofocus></textarea>
<button id="dumpIt">Dump it out!</button>
<button id="resetButton">Dump another doubt!</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/canvas-confetti@1.5.1/dist/confetti.browser.min.js"></script>
<script>
const label = document.getElementById('mainLabel');
const textarea = document.getElementById('whatIf');
const dumpButton = document.getElementById('dumpIt');
const resetButton = document.getElementById('resetButton');
const coll = document.getElementsByClassName("collapsible")[0];
const content = coll.nextElementSibling;
let isFirstDump = true;
const responses = [
"Awesome! You've just lightened your load. Remember to trust yourself with all of your heart. You're doing great.",
"That's it! No more stinky overthinky, just dump it out!",
"Well done. You're giving yourself the present of presence.",
"Great job and remember, don't stew over what you already knew.",
"Forget 'what IF,' let's enjoy 'what IS.'",
"Trust that quiet whisper of your Self that knows the truth.",
"Your intuition means something. Honor it.",
"Always doubt the doubt.",
"It's time to travel out of your head and into your heart.",
"Keep going! Chuck the muck to get unstuck!"
];
const defaultResponse = "Awesome! You've just lightened your load. Remember to trust yourself with all of your heart. You're doing great.";
coll.addEventListener("click", function() {
this.classList.toggle("active");
if (content.style.maxHeight){
content.style.maxHeight = null;
} else {
content.style.maxHeight = content.scrollHeight + "px";
}
});
// Trigger the click event to open it by default
coll.click();
dumpButton.addEventListener('click', function () {
const thought = textarea.value.trim();
if (!thought) {
alert("Please enter a thought before dumping it!");
return;
}
const randomResponse = responses.length > 0
? responses[Math.floor(Math.random() * responses.length)]
: defaultResponse;
label.textContent = randomResponse;
label.classList.add('message');
textarea.style.display = 'none';
dumpButton.style.display = 'none';
resetButton.style.display = 'inline-block';
confetti({
particleCount: 100,
spread: 70,
origin: { y: 0.6 }
});
if (isFirstDump) {
if (coll.classList.contains("active")) {
coll.click(); // Close the collapsible section
}
isFirstDump = false;
}
});
resetButton.addEventListener('click', function () {
label.textContent = "What if...";
label.classList.remove('message');
textarea.style.display = 'block';
textarea.value = '';
dumpButton.style.display = 'inline-block';
resetButton.style.display = 'none';
textarea.focus();
});
</script>
</body>
</html>