forked from daattali/beautiful-jekyll
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtipme.html
More file actions
283 lines (261 loc) · 14.2 KB
/
Copy pathtipme.html
File metadata and controls
283 lines (261 loc) · 14.2 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
---
layout: page
title: Thank you! 🙏
# subtitle: Tip me a cup of tea 🫖🧘
permalink: /tipme/
share-title: Tip Me a Cup of Tea | Florian Geigl
share-description: If you’d like to support my work (including Meditation & Breathwork), you can tip me here. Thank you!
---
<div id="meditate">
</div>
<div id="paypal" class="main-explain-area jumbotron centered" style="text-align: center">
<h3>Paypal</h3>
<form action="https://www.paypal.com/donate" method="post" target="_top">
<input type="hidden" name="business" value="NKYCZ67AW43YJ" />
<input type="hidden" name="no_recurring" value="0" />
<input type="hidden" name="item_name" value="Thank you :)" />
<input type="hidden" name="currency_code" value="EUR" />
<input type="image" src="https://www.paypalobjects.com/en_US/AT/i/btn/btn_donateCC_LG.gif" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
<img alt="" border="0" src="https://www.paypal.com/en_AT/i/scr/pixel.gif" width="1" height="1" />
</form>
</div>
<div class="main-explain-area jumbotron centered" style="text-align: center">
<h3>Buymeacoffe.com</h3>
<a href="https://www.buymeacoffee.com/floriangeix" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
<br />
<br />
<img style="width: 25%" src="{{ 'bmc_qr.png' | relative_url }}" alt="Not found" />
</div>
<style>
/* Match the navbar avatar sizing (50px default, 100px on large screens) */
.tipme-dynamic-logo {
width: 3.125rem;
height: 3.125rem;
margin: 10px auto 6px;
display: block;
border-radius: 50%;
object-fit: cover;
}
@media (min-width: 1200px) {
.tipme-dynamic-logo {
width: 6.25rem;
height: 6.25rem;
}
}
</style>
<script>
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const meditate_minutes = urlParams.get('meditate-minutes');
if (meditate_minutes != null) {
const headerEl = document.querySelector('header.header-section');
if (headerEl) {
headerEl.style.display = 'none';
}
const navEl = document.querySelector('.navbar');
const mainEl = document.querySelector('main');
if (navEl && mainEl) {
const navHeight = Math.ceil(navEl.getBoundingClientRect().height);
mainEl.style.marginTop = `${navHeight}px`;
}
const minutes = Number(meditate_minutes);
const monthNames = [
'January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December'
];
function getPreviousMonthContext(now = new Date()) {
const prev = new Date(now.getFullYear(), now.getMonth() - 1, 1);
return {
monthIndex: prev.getMonth(),
monthName: monthNames[prev.getMonth()],
year: prev.getFullYear(),
};
}
function formatDurationFromMinutes(mins) {
if (!Number.isFinite(mins) || mins < 0) return null;
const totalMinutes = Math.floor(mins);
const hours = Math.floor(totalMinutes / 60);
const minutesLeft = totalMinutes % 60;
if (hours <= 0) return `${minutesLeft} minute${minutesLeft === 1 ? '' : 's'}`;
if (minutesLeft === 0) return `${hours} hour${hours === 1 ? '' : 's'}`;
return `${hours} hour${hours === 1 ? '' : 's'} ${minutesLeft} minute${minutesLeft === 1 ? '' : 's'}`;
}
function minutesCompliment(mins) {
if (!Number.isFinite(mins) || mins <= 0) return "I’m really glad you’re here. You don’t have to earn rest.";
if (mins < 10) return "Even a few breaths matter. I’m proud of you for showing up gently.";
if (mins < 30) return "A little time for you is still real care - you deserve that.";
if (mins < 120) return "That’s a tender amount of time you gave yourself. Thank you for being kind to you.";
if (mins < 300) return "That’s a lot of calm you offered your mind and body. I hope you felt held by it.";
return "That’s a beautiful month of returning to yourself. Truly: well done, softly.";
}
// Lunar New Year varies each year; keep a small lookup table.
// Dates are in local time; we only use the month/day.
const lunarNewYearDates = {
2024: new Date(2024, 1, 10),
2025: new Date(2025, 0, 29),
2026: new Date(2026, 1, 17),
2027: new Date(2027, 1, 6),
2028: new Date(2028, 0, 26),
2029: new Date(2029, 1, 13),
2030: new Date(2030, 1, 3),
};
function isLunarNewYearInMonth(year, monthIndex) {
const d = lunarNewYearDates[year];
return d && d.getFullYear() === year && d.getMonth() === monthIndex;
}
function getMonthlyTheme(prevMonthIndex, prevYear) {
const baseThemes = {
0: {
vibe: "A gentle reset",
hook: "New year or not - you don’t have to fix yourself to deserve care.",
ask: "If those January breaths helped you feel a little more held, and you’d like to send some love back, you can.",
quoteText: "May all beings be safe, well, and at ease.",
quoteSource: "Buddhist loving-kindness (mettā) blessing",
},
1: {
vibe: "Warmth in the quiet season",
hook: "Even a small pause can feel like a little hug from the inside.",
ask: "If your February pauses helped you feel a bit steadier, and you’d like to send some love back, you can.",
quoteText: "Hatred doesn’t end hatred; only love ends it.",
quoteSource: "Dhammapada (paraphrase)",
},
2: {
vibe: "A soft shift of seasons",
hook: "When everything starts changing, your breath can be something steady.",
ask: "If March felt like a transition and this practice helped you stay grounded, and you’d like to send some love back, you can.",
quoteText: "You don’t have to chase peace - you can return to it, right where you are.",
quoteSource: "Buddhist practice (inspired)",
},
3: {
vibe: "More light, more ease",
hook: "There’s nothing to prove here - just a moment to breathe and be.",
ask: "If your April breaths brought a little ease, and you’d like to send some love back, you can.",
quoteText: "Peace comes from within; don’t look for it outside.",
quoteSource: "Buddhist saying (traditional)",
},
4: {
vibe: "Room to breathe",
hook: "You’re allowed to rest, even when life is blooming all around you.",
ask: "If May got lively and this practice helped you stay soft in the middle of it, and you’d like to send some love back, you can.",
quoteText: "Just as a mother protects her only child, let your heart be boundless toward all.",
quoteSource: "Karaṇīya Mettā Sutta (paraphrase)",
},
5: {
vibe: "A lighter rhythm",
hook: "Sun’s up, shoulders down - you can let yourself exhale.",
ask: "If June was busy and these pauses helped you come back to yourself, and you’d like to send some love back, you can.",
quoteText: "Breathing in, I calm my body. Breathing out, I smile.",
quoteSource: "Thich Nhat Hanh (often taught as a gāthā)",
},
6: {
vibe: "Cooling down inside",
hook: "Heat outside, soft inside - one calm breath at a time.",
ask: "If July was a whirlwind and this practice helped you find a cool, calm corner inside, and you’d like to send some love back, you can.",
quoteText: "You, too, are worthy of your own kindness.",
quoteSource: "Buddhist practice (self-compassion inspired)",
},
7: {
vibe: "A gentle mid-year pause",
hook: "A calm minute between adventures is still a real kind of care.",
ask: "If August gave you a moment to reset and this practice helped, and you’d like to send some love back, you can.",
quoteText: "Drop by drop, the water jar is filled.",
quoteSource: "Dhammapada (paraphrase)",
},
8: {
vibe: "Finding your footing",
hook: "You can meet the day without abandoning yourself.",
ask: "If September got structured and this practice helped you stay gentle with yourself, and you’d like to send some love back, you can.",
quoteText: "In this moment, you can begin again.",
quoteSource: "Buddhist practice (inspired)",
},
9: {
vibe: "Cozy presence",
hook: "When days get shorter, your breath can feel like a warm light.",
ask: "If October felt intense and these pauses helped you feel more grounded, and you’d like to send some love back, you can.",
quoteText: "With a gentle heart, even a difficult day can soften.",
quoteSource: "Buddhist practice (inspired)",
},
10: {
vibe: "Soft gratitude",
hook: "Thank you for taking care of yourself - you deserve your own kindness.",
ask: "If these November moments helped you feel supported, and you’d like to send some love back, you can.",
quoteText: "Let go, and be free.",
quoteSource: "Buddhist teaching (inspired)",
},
11: {
vibe: "A year-end exhale",
hook: "One calm minute in the holiday whirlwind can be a real act of love.",
ask: "If December felt intense and this practice helped you find a softer place inside, and you’d like to send some love back, you can.",
quoteText: "Radiate kindness in all directions, without limit.",
quoteSource: "Buddhist loving-kindness (mettā) teaching (paraphrase)",
},
};
const theme = baseThemes[prevMonthIndex] || baseThemes[0];
let vibe = theme.vibe;
let hook = theme.hook;
let ask = theme.ask;
let quoteText = theme.quoteText;
let quoteSource = theme.quoteSource;
// If Lunar New Year happened in the previous month, adjust the single hook/ask/quote.
if (isLunarNewYearInMonth(prevYear, prevMonthIndex)) {
vibe = "A gentle turning of the page";
hook = "Lunar New Year can be a fresh start - and you can take it slowly.";
ask = "If Lunar New Year brought a lot of feelings (or a lot of people), and these pauses helped, and you’d like to send some love back, you can.";
quoteText = "Sabbe sattā bhavantu sukhitattā. (May all beings be well and happy.)";
quoteSource = "Traditional mettā phrase";
}
return { ...theme, vibe, hook, ask, quoteText, quoteSource };
}
const prev = getPreviousMonthContext();
const theme = getMonthlyTheme(prev.monthIndex, prev.year);
const compliment = minutesCompliment(minutes);
const durationText = formatDurationFromMinutes(minutes);
const displayedDuration = durationText || `${meditate_minutes} minutes`;
const meditate_block = `
<div class="main-explain-area jumbotron centered" style="text-align: center">
<p>
<em>“${theme.quoteText}”</em><br />
<small>- ${theme.quoteSource}</small>
</p>
<p>
<b>Thanks for using the <a href="https://apps.garmin.com/apps/e6f3f3d2-3ea6-4ec1-81a5-977c708eb75b" target="_blank" rel="noopener">Garmin Meditation & Breathwork</a> app</b>
</p>
<p>
<b>You gave yourself ${displayedDuration} of calm in ${prev.monthName} ${prev.year} 🧘♂️</b><br />
${compliment}
</p>
<p>
<b>${theme.vibe}</b><br />
${theme.hook}
</p>
<p>
${theme.ask}
</p>
<p>
<img src="{{ '/assets/img/website-logo.png' | relative_url }}" alt="Website logo" class="tipme-dynamic-logo" />
<a href="#paypal" style="text-decoration: none;">
<b>Buy the developer a cup of tea. 🍵</b>
</a>
<br />
<small>
(I promise to sip it mindfully)
</small>
</p>
<p>
Sending you a virtual hug - and a big thank you. <br />
<small>
PS: ♥️ can also look like
writing a <a href="https://apps.garmin.com/apps/e6f3f3d2-3ea6-4ec1-81a5-977c708eb75b?tid=2">positive review for the app</a> or
sending a brief "Thank you" to my <a href="mailto:florian.geigl+thankyou@gmail.com?subject=Thank you">mailbox</a>.
<br />
PPS: Need help with the app? Read the <a href="{{ '/meditate_app_user_guide/' | relative_url }}">user guide</a>.
</small>
</p>
</div>
`;
const meditateEl = document.getElementById("meditate");
if (meditateEl) {
meditateEl.outerHTML = meditate_block;
}
}
</script>