-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
672 lines (597 loc) · 25.2 KB
/
Copy pathindex.html
File metadata and controls
672 lines (597 loc) · 25.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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Hermetic Journal</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;1,400;1,500&family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500&display=swap" rel="stylesheet">
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #faf9f6;
--surface: #ffffff;
--border: #e8e4dc;
--text: #1c1a18;
--text-secondary: #6b6560;
--accent: #2d6a5e;
--accent-light: #eaf2f0;
--gold: #9e7b3c;
--gold-light: #f7f0e3;
--gold-border: #e3d0af;
--serif: 'Cormorant Garamond', Georgia, serif;
--sans: 'DM Sans', system-ui, sans-serif;
--radius: 6px;
}
body {
font-family: var(--sans);
background: var(--bg);
color: var(--text);
min-height: 100vh;
line-height: 1.6;
}
header {
text-align: center;
padding: 3.5rem 1.5rem 2.5rem;
border-bottom: 1px solid var(--border);
}
.site-glyph {
font-family: var(--serif);
font-size: 1.6rem;
color: var(--gold);
display: block;
margin-bottom: 0.6rem;
letter-spacing: 0.4em;
}
.site-title {
font-family: var(--serif);
font-size: clamp(1.9rem, 4vw, 2.9rem);
font-weight: 400;
letter-spacing: 0.02em;
color: var(--text);
}
.site-sub {
font-size: 0.72rem;
color: var(--text-secondary);
letter-spacing: 0.14em;
text-transform: uppercase;
margin-top: 0.5rem;
}
nav {
display: flex;
justify-content: center;
border-bottom: 1px solid var(--border);
background: var(--surface);
position: sticky;
top: 0;
z-index: 10;
}
.tab-btn {
background: none;
border: none;
border-bottom: 2px solid transparent;
padding: 1rem 2.2rem;
font-family: var(--sans);
font-size: 0.78rem;
font-weight: 400;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--text-secondary);
cursor: pointer;
transition: color 0.2s, border-color 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
color: var(--accent);
border-bottom-color: var(--accent);
font-weight: 500;
}
.section { display: none; max-width: 700px; margin: 0 auto; padding: 3rem 1.5rem 5rem; }
.section.active { display: block; }
/* ── Oracle ── */
.principle-badge {
display: inline-block;
font-size: 0.68rem;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--accent);
background: var(--accent-light);
padding: 0.28rem 0.8rem;
border-radius: 2rem;
margin-bottom: 1.4rem;
}
.principle-name {
font-family: var(--serif);
font-size: clamp(2.4rem, 6vw, 4rem);
font-weight: 400;
line-height: 1.05;
margin-bottom: 1.2rem;
}
.principle-axiom {
font-family: var(--serif);
font-style: italic;
font-size: 1.1rem;
color: var(--gold);
margin-bottom: 2rem;
padding-left: 1.2rem;
border-left: 2px solid var(--gold-border);
line-height: 1.55;
}
.principle-body {
font-size: 1rem;
line-height: 1.85;
color: var(--text-secondary);
margin-bottom: 2.5rem;
}
.reflection-card {
background: var(--gold-light);
border: 1px solid var(--gold-border);
border-radius: var(--radius);
padding: 1.5rem 1.6rem;
margin-bottom: 1.5rem;
}
.reflection-label {
font-size: 0.68rem;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--gold);
margin-bottom: 0.7rem;
font-weight: 500;
}
.reflection-prompt {
font-family: var(--serif);
font-size: 1.15rem;
line-height: 1.6;
color: var(--text);
}
.day-marker {
font-size: 0.74rem;
color: var(--text-secondary);
letter-spacing: 0.06em;
margin-top: 1rem;
text-align: center;
}
/* ── Meditations ── */
.quote-block {
position: relative;
padding: 1.5rem 1.5rem 1.5rem 3rem;
margin-bottom: 1.8rem;
}
.quote-block::before {
content: '\201C';
font-family: var(--serif);
font-size: 7rem;
color: var(--accent-light);
position: absolute;
top: -1.5rem;
left: -0.4rem;
line-height: 1;
}
.quote-text {
font-family: var(--serif);
font-size: clamp(1.25rem, 3vw, 1.7rem);
font-weight: 400;
line-height: 1.6;
color: var(--text);
}
.quote-source {
font-size: 0.78rem;
letter-spacing: 0.08em;
color: var(--text-secondary);
margin-top: 1rem;
text-transform: uppercase;
}
.ghost-btn {
background: none;
border: 1px solid var(--border);
padding: 0.6rem 1.2rem;
font-family: var(--sans);
font-size: 0.78rem;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--text-secondary);
cursor: pointer;
border-radius: var(--radius);
transition: border-color 0.2s, color 0.2s;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); }
/* ── Journal shared ── */
.field-label {
font-size: 0.7rem;
letter-spacing: 0.12em;
text-transform: uppercase;
color: var(--text-secondary);
margin-bottom: 0.6rem;
}
.journal-prompt {
font-family: var(--serif);
font-style: italic;
font-size: 1.3rem;
line-height: 1.5;
color: var(--text);
margin-bottom: 1.5rem;
}
textarea {
width: 100%;
min-height: 220px;
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1.1rem 1.2rem;
font-family: var(--sans);
font-size: 0.97rem;
line-height: 1.75;
color: var(--text);
background: var(--surface);
resize: vertical;
outline: none;
transition: border-color 0.2s;
}
textarea:focus { border-color: var(--accent); }
textarea::placeholder { color: var(--text-secondary); opacity: 0.45; }
.row {
display: flex;
align-items: center;
gap: 0.8rem;
margin-top: 0.9rem;
flex-wrap: wrap;
}
.solid-btn {
background: var(--accent);
color: #fff;
border: none;
padding: 0.65rem 1.6rem;
font-family: var(--sans);
font-size: 0.85rem;
font-weight: 500;
border-radius: var(--radius);
cursor: pointer;
transition: opacity 0.18s;
}
.solid-btn:hover { opacity: 0.85; }
.save-status {
font-size: 0.78rem;
color: var(--accent);
opacity: 0;
transition: opacity 0.35s;
}
.save-status.visible { opacity: 1; }
/* ── Past entries ── */
.entries-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 3rem;
padding-top: 2rem;
border-top: 1px solid var(--border);
margin-bottom: 1.2rem;
}
.entries-title {
font-size: 0.72rem;
letter-spacing: 0.1em;
text-transform: uppercase;
color: var(--text-secondary);
}
.entry-card {
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1.1rem 1.3rem;
margin-bottom: 0.7rem;
background: var(--surface);
}
.entry-date {
font-size: 0.72rem;
color: var(--text-secondary);
letter-spacing: 0.06em;
margin-bottom: 0.35rem;
}
.entry-prompt-mini {
font-family: var(--serif);
font-style: italic;
font-size: 0.9rem;
color: var(--text-secondary);
margin-bottom: 0.55rem;
}
.entry-text {
font-size: 0.9rem;
line-height: 1.65;
color: var(--text);
max-height: 72px;
overflow: hidden;
}
.entry-text.expanded { max-height: none; }
.expand-btn {
background: none;
border: none;
font-size: 0.74rem;
color: var(--accent);
cursor: pointer;
padding: 0.25rem 0;
margin-top: 0.25rem;
display: block;
}
.no-entries {
font-size: 0.9rem;
color: var(--text-secondary);
font-style: italic;
text-align: center;
padding: 2.5rem 0;
}
.med-section-gap { margin-top: 2.5rem; }
@media (max-width: 560px) {
.tab-btn { padding: 0.85rem 1.1rem; font-size: 0.72rem; }
}
</style>
</head>
<body>
<header>
<span class="site-glyph">☿ ☽ ☉</span>
<h1 class="site-title">The Hermetic Journal</h1>
<p class="site-sub">As above, so below · As within, so without</p>
</header>
<nav>
<button class="tab-btn active" data-tab="oracle">Oracle</button>
<button class="tab-btn" data-tab="meditations">Meditations</button>
<button class="tab-btn" data-tab="journal">Journal</button>
</nav>
<main>
<!-- ── ORACLE ── -->
<section id="oracle" class="section active">
<span class="principle-badge" id="principle-number"></span>
<h2 class="principle-name" id="principle-name"></h2>
<p class="principle-axiom" id="principle-axiom"></p>
<p class="principle-body" id="principle-body"></p>
<div class="reflection-card">
<p class="reflection-label">Today's reflection</p>
<p class="reflection-prompt" id="reflection-prompt"></p>
</div>
<p class="day-marker" id="day-marker"></p>
</section>
<!-- ── MEDITATIONS ── -->
<section id="meditations" class="section">
<div class="quote-block">
<p class="quote-text" id="quote-text"></p>
<p class="quote-source" id="quote-source"></p>
</div>
<button class="ghost-btn" id="refresh-quote">New passage →</button>
<div class="med-section-gap">
<div class="reflection-card">
<p class="reflection-label">Sit with this</p>
<p class="reflection-prompt" id="stoic-prompt"></p>
</div>
</div>
<div class="med-section-gap">
<p class="field-label">Your response</p>
<textarea id="meditations-textarea" placeholder="Write your thoughts on this passage..."></textarea>
<div class="row">
<button class="solid-btn" id="save-meditation">Save reflection</button>
<span class="save-status" id="med-save-status">Saved ✓</span>
</div>
</div>
</section>
<!-- ── JOURNAL ── -->
<section id="journal" class="section">
<p class="field-label">Today's prompt</p>
<p class="journal-prompt" id="journal-prompt"></p>
<textarea id="journal-textarea" placeholder="Begin writing..."></textarea>
<div class="row">
<button class="solid-btn" id="save-journal">Save entry</button>
<button class="ghost-btn" id="new-prompt">New prompt</button>
<span class="save-status" id="journal-save-status">Saved ✓</span>
</div>
<div class="entries-header">
<span class="entries-title">Past entries</span>
<button class="ghost-btn" id="clear-entries" style="font-size:0.7rem; padding:0.4rem 0.8rem;">Clear all</button>
</div>
<div id="entries-list"></div>
</section>
</main>
<script>
const principles = [
{
number: "The First Principle",
name: "Mentalism",
axiom: "The All is Mind; the Universe is Mental.",
body: "All that we perceive as reality is, at its most fundamental, a mental creation. Consciousness is not produced by the universe — the universe is produced by consciousness. The material world is a manifestation of thought at a cosmic scale. What you hold in mind, you tend to find in the world.",
prompt: "What mental pattern are you currently living out as if it were fixed reality? What might change if you recognized it as thought rather than fact?"
},
{
number: "The Second Principle",
name: "Correspondence",
axiom: "As above, so below; as below, so above.",
body: "The patterns and laws that govern the great are the same that govern the small. The movement of stars mirrors the movement of atoms. The dynamic within a single relationship mirrors the dynamic of nations. Nothing is truly isolated — every level of reality reflects and informs the others.",
prompt: "What is happening in your inner world right now? Where do you see that same pattern mirrored in your outer circumstances?"
},
{
number: "The Third Principle",
name: "Vibration",
axiom: "Nothing rests; everything moves; everything vibrates.",
body: "From the subtlest thought to the densest matter, everything is in constant motion. What we perceive as solid or fixed is merely vibrating at a rate slow enough for our senses to interpret as stillness. Change, therefore, is not the exception — it is the nature of existence itself.",
prompt: "Where in your life are you clinging to something you perceive as fixed or permanent? How might accepting its inherent movement change your relationship with it?"
},
{
number: "The Fourth Principle",
name: "Polarity",
axiom: "Everything is dual; everything has poles; everything has its pair of opposites.",
body: "Hot and cold are not opposites — they are degrees of the same thing. Love and hate, light and dark, courage and fear: each is a pole of a single spectrum. Knowing this, we may transmute one into the other not by conflict, but by moving along the scale — by raising or lowering the vibration of a given quality.",
prompt: "Name a quality in yourself or others that you find difficult. Can you locate its opposite within yourself? What would it mean to see them as one continuous spectrum?"
},
{
number: "The Fifth Principle",
name: "Rhythm",
axiom: "Everything flows, out and in; everything has its tides; all things rise and fall.",
body: "The pendulum swing manifests in all things. Every advance is followed by a retreat; every high tide recedes. Mastery does not mean stopping the swing — it means learning to compensate, to flow with the rhythm, and not to be entirely swept by the tide in either direction.",
prompt: "Where in your life do you currently feel the swing pulling you backward? Can you trust the rhythm rather than resist it?"
},
{
number: "The Sixth Principle",
name: "Cause & Effect",
axiom: "Every cause has its effect; every effect has its cause; nothing happens by chance.",
body: "Chance is a name for a law not yet recognized. Everything that occurs is the result of prior causes, and everything you do becomes a cause for future effects. The student of Hermeticism learns to rise above the level of mere effect — to become a conscious causer, rather than one who is perpetually acted upon.",
prompt: "What effect in your life are you treating as something that simply happened to you? What causes, including your own choices, led to it? What new cause can you set in motion today?"
},
{
number: "The Seventh Principle",
name: "Gender",
axiom: "Gender is in everything; everything has its masculine and feminine principles.",
body: "Gender here is not limited to biological sex. It is the principle of generation — the receptive and the projective, the void and the spark, the form and the force. Both principles exist in every mind, every creative act, every natural phenomenon. Wholeness requires their integration.",
prompt: "In your current creative or personal work, which principle feels dominant — receptive (gathering, listening, holding space) or projective (acting, expressing, initiating)? What would a better balance look like?"
}
];
const quotes = [
{ text: "You have power over your mind, not outside events. Realize this, and you will find strength.", source: "Book IV" },
{ text: "The impediment to action advances action. What stands in the way becomes the way.", source: "Book V" },
{ text: "Waste no more time arguing what a good man should be. Be one.", source: "Book X" },
{ text: "Very little is needed to make a happy life; it is all within yourself, in your way of thinking.", source: "Book VII" },
{ text: "Never let the future disturb you. You will meet it, if you have to, with the same weapons of reason which today arm you against the present.", source: "Book VII" },
{ text: "Accept the things to which fate binds you, and love the people with whom fate brings you together, and do so with all your heart.", source: "Book VI" },
{ text: "Confine yourself to the present.", source: "Book VIII" },
{ text: "Be tolerant with others and strict with yourself.", source: "Book V" },
{ text: "The first rule is to keep an untroubled spirit. The second is to look things in the face and know them for what they are.", source: "Book VIII" },
{ text: "Loss is nothing else but change, and change is nature's delight.", source: "Book IX" },
{ text: "The soul becomes dyed with the color of its thoughts.", source: "Book V" },
{ text: "If someone is able to show me that what I think or do is not right, I will happily change, for I seek the truth, by which no one was ever truly harmed.", source: "Book VI" },
{ text: "Receive without pride, relinquish without struggle.", source: "Book VIII" },
{ text: "Look back over the past, with its changing empires that rose and fell, and you can foresee the future too.", source: "Book VII" },
{ text: "Here is a rule to remember in future, when anything tempts you to feel bitter: not 'This is misfortune,' but 'To bear this worthily is good fortune.'", source: "Book IV" },
{ text: "In your actions, don't procrastinate. In your conversations, don't confuse. In your thoughts, don't wander. In your soul, don't be passive or aggressive.", source: "Book VIII" },
{ text: "Do not indulge in dreams of what you have not, but count up the chief of the blessings you do possess.", source: "Book VII" },
{ text: "How much more grievous are the consequences of anger than the causes of it.", source: "Book XI" },
{ text: "Begin at once to live, and count each separate day as a separate life.", source: "Book VII" },
{ text: "It never helps to know the opinions of men who have not examined themselves.", source: "Book IV" }
];
const stoicPrompts = [
"Which word in this passage cuts deepest? What does it illuminate about where you are right now?",
"How would you live differently today if you truly believed this?",
"Where in your life are you failing to apply this teaching? What would it look like to apply it?",
"What comfort or challenge does this passage offer you specifically?",
"If you could only carry one sentence from this passage into the next week, which would it be and why?",
"What habit of mind is this passage asking you to let go of?",
"Write a response to Marcus as if writing a letter to him about your life right now."
];
const journalPrompts = [
"What do I know to be true above that I have not yet honored below, in my daily life?",
"In what area of my life is the macrocosm most clearly reflected in the microcosm right now?",
"What is seeking to be transmuted within me? What is the higher expression of something I've been resisting?",
"If the universe is mental, what thought am I most unconsciously broadcasting? What thought do I wish to broadcast instead?",
"What in my outer world is a reflection of something I have not yet faced within?",
"Where have I been treating an effect as though it were a cause? What is the true origin?",
"What rhythm is moving through my life right now — ascent, descent, or the stillness before the turn?",
"What is my soul trying to integrate today between two apparent opposites?",
"As within, so without: describe your inner weather today, then describe its outer echo.",
"What would I be doing differently if I fully accepted that nothing is permanent, including my current difficulty?",
"What principle or law of nature is most alive in my experience today? What is it teaching me?",
"What would it mean to be a cause rather than an effect in one area of my life this week?",
"Where is the balance between receptive and projective out of alignment within me right now?",
"What correspondence do you notice between something small in your daily life and something large in the world?",
"What are you holding as a fixed belief that may, in truth, be one pole of a spectrum?"
];
const today = new Date();
const todayKey = today.toISOString().split('T')[0];
const dayOfYear = Math.floor((today - new Date(today.getFullYear(), 0, 0)) / 86400000);
let quoteIdx = dayOfYear % quotes.length;
let stoicPromptIdx = dayOfYear % stoicPrompts.length;
let journalPromptIdx = dayOfYear % journalPrompts.length;
function renderOracle() {
const p = principles[dayOfYear % 7];
document.getElementById('principle-number').textContent = p.number;
document.getElementById('principle-name').textContent = p.name;
document.getElementById('principle-axiom').textContent = p.axiom;
document.getElementById('principle-body').textContent = p.body;
document.getElementById('reflection-prompt').textContent = p.prompt;
document.getElementById('day-marker').textContent = today.toLocaleDateString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' });
}
function renderQuote() {
const q = quotes[quoteIdx];
document.getElementById('quote-text').textContent = q.text;
document.getElementById('quote-source').textContent = '— Marcus Aurelius, Meditations, ' + q.source;
document.getElementById('stoic-prompt').textContent = stoicPrompts[stoicPromptIdx];
}
function renderJournalPrompt() {
document.getElementById('journal-prompt').textContent = journalPrompts[journalPromptIdx];
}
function loadTodayJournalEntry() {
const key = 'hermetic_journal_' + todayKey + '_' + journalPromptIdx;
const saved = localStorage.getItem(key);
document.getElementById('journal-textarea').value = saved ? JSON.parse(saved).text : '';
}
function renderEntries() {
const list = document.getElementById('entries-list');
const keys = Object.keys(localStorage).filter(k => k.startsWith('hermetic_journal_')).sort().reverse();
if (!keys.length) {
list.innerHTML = '<p class="no-entries">No entries yet. Begin writing above.</p>';
return;
}
list.innerHTML = keys.map(k => {
const e = JSON.parse(localStorage.getItem(k));
const d = new Date(e.date + 'T12:00:00').toLocaleDateString('en-US', { weekday: 'long', month: 'long', day: 'numeric', year: 'numeric' });
const safeText = e.text.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/\n/g,'<br>');
const safePrompt = e.prompt.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');
return `<div class="entry-card">
<p class="entry-date">${d}</p>
<p class="entry-prompt-mini">${safePrompt}</p>
<div class="entry-text" id="et_${k}">${safeText}</div>
<button class="expand-btn" onclick="toggleExpand('et_${k}',this)">Read more</button>
</div>`;
}).join('');
keys.forEach(k => {
const el = document.getElementById('et_' + k);
if (el && el.scrollHeight <= 80) el.nextElementSibling.style.display = 'none';
});
}
function toggleExpand(id, btn) {
const el = document.getElementById(id);
el.classList.toggle('expanded');
btn.textContent = el.classList.contains('expanded') ? 'Show less' : 'Read more';
}
function flashSaved(id) {
const el = document.getElementById(id);
el.classList.add('visible');
setTimeout(() => el.classList.remove('visible'), 2200);
}
document.getElementById('refresh-quote').addEventListener('click', () => {
quoteIdx = (quoteIdx + 1) % quotes.length;
stoicPromptIdx = (stoicPromptIdx + 1) % stoicPrompts.length;
renderQuote();
document.getElementById('meditations-textarea').value = '';
});
document.getElementById('save-meditation').addEventListener('click', () => {
const text = document.getElementById('meditations-textarea').value.trim();
if (!text) return;
const key = 'hermetic_med_' + todayKey + '_' + quoteIdx;
localStorage.setItem(key, JSON.stringify({ date: todayKey, quote: quotes[quoteIdx].text, text }));
flashSaved('med-save-status');
});
document.getElementById('new-prompt').addEventListener('click', () => {
journalPromptIdx = (journalPromptIdx + 1) % journalPrompts.length;
renderJournalPrompt();
loadTodayJournalEntry();
});
document.getElementById('save-journal').addEventListener('click', () => {
const text = document.getElementById('journal-textarea').value.trim();
if (!text) return;
const key = 'hermetic_journal_' + todayKey + '_' + journalPromptIdx;
localStorage.setItem(key, JSON.stringify({ date: todayKey, prompt: journalPrompts[journalPromptIdx], text }));
flashSaved('journal-save-status');
renderEntries();
});
document.getElementById('clear-entries').addEventListener('click', () => {
if (!confirm('Clear all journal entries? This cannot be undone.')) return;
Object.keys(localStorage).filter(k => k.startsWith('hermetic_')).forEach(k => localStorage.removeItem(k));
renderEntries();
});
document.querySelectorAll('.tab-btn').forEach(btn => {
btn.addEventListener('click', () => {
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
document.querySelectorAll('.section').forEach(s => s.classList.remove('active'));
btn.classList.add('active');
document.getElementById(btn.dataset.tab).classList.add('active');
if (btn.dataset.tab === 'journal') renderEntries();
});
});
renderOracle();
renderQuote();
renderJournalPrompt();
loadTodayJournalEntry();
</script>
</body>
</html>