-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmerged.txt
518 lines (447 loc) · 13.7 KB
/
merged.txt
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
<!--index.html-->
<!DOCTYPE html>
<html>
<head>
<title>Osho Zen Tarot</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="icon" href="assets/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="assets/favicon.ico" type="image/x-icon">
</head>
<body>
<div class="container">
<h1>Osho Zen Tarot</h1>
<div class="button-container">
<button id="drawButton" data-goatcounter-click="Draw Button">Draw</button>
<button id="headsOrTailsButton" data-goatcounter-click="Heads or Tails Button">Heads or Tails</button>
</div>
<div id="headsOrTailsContainer">
<button id="goBackButton">Go back</button>
</div>
<div id="cardContainer">
<img id="cardImage" src="" alt="Tarot Card">
<h2>Card Text</h2>
<div id="cardText"></div>
<h2>Card Commentary</h2>
<div id="cardCommentary"></div>
<div id="drawnCardsContainer">
<h2>Previously Drawn Cards</h2>
<ul id="drawnCardsList"></ul>
</div>
</div>
</div>
<footer>
<select id="cardSelect">
<option value="">Browse Cards</option>
</select>
<p></p>
<button class="small-button" onclick="window.location.href='layouts.html'">Card Layouts</button>
</footer>
<script src="js/cardData.js"></script>
<script src="script.js"></script>
<script data-goatcounter="https://osho-zen-tarot.goatcounter.com/count"
async src="//gc.zgo.at/count.js"></script>
</body>
</html>
/*styles.css*/
@font-face {
font-family: 'EBGaramond';
src: url('assets/EBGaramond.ttf') format('truetype');
}
body {
font-family: 'EBGaramond', serif;
text-align: center;
margin: 0;
padding: 20px;
background-color: #1A1A1A;
color: #DCDCDC;
}
.container {
max-width: 600px;
margin: 0 auto;
}
.button-container {
display: flex;
flex-direction: column;
align-items: center;
margin-bottom: 20px;
}
button {
padding: 24px 80px;
font-size: 32px;
margin-bottom: 10px;
background-color: #5A0000;
color: #DCDCDC;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
font-family: 'EBGaramond', serif;
font-weight: bold;
}
button:hover {
background-color: #901B1B;
}
select {
margin-bottom: 10px;
padding: 8px;
font-size: 14px;
border: 1px solid #5A0000;
border-radius: 4px;
background-color: #DCDCDC;
color: #333;
cursor: pointer;
font-family: 'EBGaramond', serif;
}
#cardContainer {
display: none;
}
#cardImage {
max-width: 100%;
height: auto;
margin-bottom: 20px;
}
#cardText, #cardCommentary {
white-space: pre-wrap;
text-align: left;
}
#drawnCardsContainer {
margin-top: 20px;
}
#drawnCardsList {
list-style-type: none;
padding: 0;
}
#drawnCardsList li {
cursor: pointer;
margin-bottom: 5px;
}
#drawnCardsList li.highlight {
font-weight: bold;
}
.layout {
margin-bottom: 20px;
}
.layout img {
max-width: 100%;
height: auto;
margin-bottom: 10px;
}
.layout p {
white-space: pre-wrap;
text-align: left;
}
.small-button {
padding: 8px 16px;
font-size: 14px;
background-color: #5A0000;
color: #DCDCDC;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
font-family: 'EBGaramond', serif;
font-weight: bold;
margin-left: 10px;
}
.small-button:hover {
background-color: #901B1B;
}
#headsOrTailsButton {
padding: 6px 60px;
font-size: 16px;
margin-bottom: 10px;
background-color: #5A0000;
color: #DCDCDC;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
font-family: 'EBGaramond', serif;
font-weight: bold;
}
#headsOrTailsButton:hover {
background-color: #901B1B;
}
#cardContainer.hidden,
footer.hidden {
display: none;
}
#headsOrTailsContainer {
display: none;
}
#goBackButton {
padding: 4px 20px;
font-size: 14px;
margin-top: 20px;
background-color: #5A0000;
color: #DCDCDC;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s ease;
font-family: 'EBGaramond', serif;
font-weight: bold;
}
#goBackButton:hover {
background-color: #901B1B;
}
.layout-dropdown {
margin-bottom: 1000px; /* Adjust the value as needed */
}
//Script.js
const drawButton = document.getElementById('drawButton');
const cardSelect = document.getElementById('cardSelect');
const cardContainer = document.getElementById('cardContainer');
const cardImage = document.getElementById('cardImage');
const cardText = document.getElementById('cardText');
const cardCommentary = document.getElementById('cardCommentary');
const totalCards = 79;
const drawnCards = [];
// Populate the dropdown menu with card names
function populateCardSelect() {
for (let i = 0; i < totalCards; i++) {
const option = document.createElement('option');
option.value = i + 1;
option.textContent = cardNames[i];
cardSelect.appendChild(option);
}
}
// Function to show Previously Drawn Cards title
function showDrawnCardsTitle() {
const drawnCardsTitle = document.querySelector('#drawnCardsContainer h2');
drawnCardsTitle.style.display = 'block';
}
// Function to draw a random card
function drawRandomCard() {
const randomCard = Math.floor(Math.random() * totalCards) + 1;
displayCard(randomCard);
addToDrawnCards(randomCard);
showDrawnCardsTitle();
headsOrTailsContainer.style.display = 'none';
cardContainer.style.display = 'block';
footer.classList.remove('hidden');
}
// Function to display a specific card
function displayCard(cardNumber) {
const imagePath = `assets/CardPictures/card_${cardNumber}.jpg`;
cardImage.src = imagePath;
cardText.textContent = cardData[cardNumber].text;
cardCommentary.textContent = cardData[cardNumber].commentary;
headsOrTailsContainer.style.display = 'none';
cardContainer.style.display = 'block';
footer.classList.remove('hidden');
highlightDrawnCard(cardNumber);
}
// Function to add the drawn card to the list
function addToDrawnCards(cardNumber) {
const drawnCardsList = document.getElementById('drawnCardsList');
const listItem = document.createElement('li');
const cardIndex = drawnCards.length + 1;
listItem.textContent = cardIndex + '- ' + cardNames[cardNumber - 1];
listItem.addEventListener('click', function() {
displayCard(cardNumber);
});
drawnCardsList.appendChild(listItem);
drawnCards.push(cardNumber);
}
// Function to highlight the clicked card in the list
function highlightDrawnCard(cardNumber) {
const drawnCardsList = document.getElementById('drawnCardsList');
const listItems = drawnCardsList.getElementsByTagName('li');
for (let i = 0; i < listItems.length; i++) {
if (drawnCards[i] === cardNumber) {
listItems[i].classList.add('highlight');
} else {
listItems[i].classList.remove('highlight');
}
}
}
// Function to track button clicks using GoatCounter
function trackButtonClick(buttonName) {
if (typeof goatcounter !== 'undefined' && goatcounter.count) {
goatcounter.count({
path: buttonName,
title: buttonName,
event: true,
});
}
}
// Draw a random card when the button is clicked
drawButton.addEventListener('click', function() {
drawRandomCard();
trackButtonClick('Draw Button');
});
// Display the selected card when the dropdown value changes
cardSelect.addEventListener('change', function() {
const selectedCard = parseInt(cardSelect.value);
if (selectedCard) {
displayCard(selectedCard);
} else {
cardContainer.style.display = 'none';
cardContainer.classList.add('hidden');
}
});
// Populate the dropdown menu and draw a random card when the page loads
window.addEventListener('load', function() {
populateCardSelect();
});
// Hide the "Previously Drawn Cards" title when the page loads
window.addEventListener('load', function() {
const drawnCardsTitle = document.querySelector('#drawnCardsContainer h2');
drawnCardsTitle.style.display = 'none';
populateCardSelect();
});
const headsOrTailsContainer = document.getElementById('headsOrTailsContainer');
const headsOrTailsButton = document.getElementById('headsOrTailsButton');
const footer = document.querySelector('footer');
// Function to handle the "Heads/Tails" button click event
function handleHeadsOrTailsClick() {
const result = Math.random() < 0.5 ? 'heads' : 'tails';
let resultElement = document.querySelector('#headsOrTailsContainer img');
if (!resultElement) {
resultElement = document.createElement('img');
resultElement.style.height = '200px';
resultElement.style.display = 'block';
resultElement.style.margin = '0 auto';
headsOrTailsContainer.insertBefore(resultElement, goBackButton);
}
if (headsOrTailsContainer.style.display === 'block') {
resultElement.src = 'assets/coinflip/pause.png';
setTimeout(() => {
resultElement.src = `assets/coinflip/${result}.png`;
}, 300);
} else {
resultElement.src = `assets/coinflip/${result}.png`;
headsOrTailsContainer.style.display = 'block';
cardContainer.style.display = 'none';
footer.classList.add('hidden');
}
}
// Add event listener to the "Heads/Tails" button
headsOrTailsButton.addEventListener('click', function() {
handleHeadsOrTailsClick();
trackButtonClick('Heads or Tails Button');
});
const goBackButton = document.getElementById('goBackButton');
// Function to handle the "Go back" button click event
function handleGoBackClick() {
if (drawnCards.length === 0) {
// If no card has been drawn, show the home screen
headsOrTailsContainer.style.display = 'none';
cardContainer.style.display = 'none';
drawButton.style.display = 'block';
headsOrTailsButton.style.display = 'block';
footer.classList.remove('hidden');
} else {
// If a card has been drawn, show the card container
headsOrTailsContainer.style.display = 'none';
cardContainer.style.display = 'block';
footer.classList.remove('hidden');
}
}
// Add event listener to the "Go back" button
goBackButton.addEventListener('click', handleGoBackClick);
// Pre-download the coin flip images
const coinImages = ['heads.png', 'tails.png', 'pause.png'];
const preloadedImages = [];
function preloadImages() {
coinImages.forEach(image => {
const img = new Image();
img.src = `assets/coinflip/${image}`;
preloadedImages.push(img);
});
}
// Call the preloadImages function when the page loads
window.addEventListener('load', preloadImages);
<!--layouts.html-->
<!DOCTYPE html>
<html>
<head>
<title>Card Spreads</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="container">
<h1>Card Spreads</h1>
<button id="randomButton">Random</button>
<p></p>
<select id="layoutDropdown"></select>
<p></p>
<div id="layoutContainer"></div>
</div>
<script src="layoutData.js"></script>
<script src="layoutScript.js"></script>
<button class="small-button" onclick="window.location.href='index.html'">Go back</button>
</body>
</html>//layoutscript.js
const layoutDropdown = document.getElementById('layoutDropdown');
const layoutContainer = document.getElementById('layoutContainer');
// Function to display layout details
function displayLayout(layoutNumber) {
layoutContainer.innerHTML = ''; // Clear previous layout
const layoutText = layoutData[layoutNumber];
const imagePath = `assets/ReadingLayouts/layout_${layoutNumber}.png`;
const layoutElement = document.createElement('div');
layoutElement.classList.add('layout');
const imageElement = document.createElement('img');
imageElement.src = imagePath;
imageElement.alt = `Layout ${layoutNumber}`;
layoutElement.appendChild(imageElement);
// Split the layout text by newline characters
const lines = layoutText.split('\n');
// Extract the first line as the title
const titleElement = document.createElement('h2');
titleElement.textContent = lines[0];
layoutElement.appendChild(titleElement);
// Join the remaining lines as the description
const descriptionElement = document.createElement('p');
descriptionElement.innerHTML = lines.slice(1).join('<br>');
layoutElement.appendChild(descriptionElement);
// Add two line breaks after the layout text
const lineBreaks = document.createElement('div');
lineBreaks.innerHTML = '<br><br>';
layoutElement.appendChild(lineBreaks);
layoutContainer.appendChild(layoutElement);
}
// Populate the dropdown menu with layout options
function populateDropdown() {
for (let i = 1; i <= Object.keys(layoutData).length; i++) {
const layoutText = layoutData[i.toString()];
const lines = layoutText.split('\n');
const layoutName = lines[0];
const option = document.createElement('option');
option.value = i.toString();
option.textContent = layoutName;
layoutDropdown.appendChild(option);
}
}
// Event listener for dropdown selection change
layoutDropdown.addEventListener('change', function() {
const selectedLayout = layoutDropdown.value;
displayLayout(selectedLayout);
});
// Populate the dropdown menu and display a random layout when the page loads
window.addEventListener('load', function() {
populateDropdown();
// const randomLayoutNumber = getRandomLayoutNumber();
// displayLayout(randomLayoutNumber);
// layoutDropdown.value = randomLayoutNumber;
});
// Function to select a random layout number
function getRandomLayoutNumber() {
const layoutCount = Object.keys(layoutData).length;
return Math.floor(Math.random() * layoutCount) + 1;
}
// Event listener for dropdown selection change
layoutDropdown.addEventListener('change', function() {
const selectedLayout = layoutDropdown.value;
displayLayout(selectedLayout);
});
const randomButton = document.getElementById('randomButton');
randomButton.addEventListener('click', function() {
const randomLayoutNumber = getRandomLayoutNumber();
displayLayout(randomLayoutNumber);
layoutDropdown.value = randomLayoutNumber;
});