Spaces:
Running
Running
Commit
·
faeee9d
1
Parent(s):
9c96839
Welcom and warning message added
Browse files- index.html +18 -4
- main.css +132 -9
- main.js +23 -0
index.html
CHANGED
@@ -21,6 +21,9 @@
|
|
21 |
<link rel="preload" as="image" href="./images/deck-06-back.png">
|
22 |
<link rel="preload" as="image" href="./images/deck-07.jpg">
|
23 |
<link rel="preload" as="image" href="./images/deck-07-back.png">
|
|
|
|
|
|
|
24 |
<link rel="stylesheet" href="main.css">
|
25 |
<script type="module" src="main.js"></script>
|
26 |
</head>
|
@@ -32,8 +35,12 @@
|
|
32 |
<dialog id="welcome">
|
33 |
<div>
|
34 |
<h1 style="text-align: center; font-size: 2em;">Tarot AI Experience</h1>
|
35 |
-
<
|
36 |
-
<
|
|
|
|
|
|
|
|
|
37 |
<button id="start" class="continue-button"></button>
|
38 |
</div>
|
39 |
</dialog>
|
@@ -69,7 +76,7 @@
|
|
69 |
<img src="./images/avatar-07.png" alt="Avatar" class="fortune-teller-avatar">
|
70 |
</div>
|
71 |
<div class="fortune-teller-buttons">
|
72 |
-
<button>+</button>
|
73 |
</div>
|
74 |
<div class="fortune-teller-buttons">
|
75 |
<button disabled id="fortune-teller-selected" class="continue-button"></button>
|
@@ -106,10 +113,17 @@
|
|
106 |
<div class="setting">
|
107 |
<label for="llm-server">Tarot LLM HuggingFace Space</label>
|
108 |
<input id="llm-server" type="text" spellcheck="false" autocomplete="false" value="hysts/zephyr-7b">
|
109 |
-
|
110 |
</div>
|
111 |
</div>
|
112 |
</dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
113 |
</body>
|
114 |
|
115 |
</html>
|
|
|
21 |
<link rel="preload" as="image" href="./images/deck-06-back.png">
|
22 |
<link rel="preload" as="image" href="./images/deck-07.jpg">
|
23 |
<link rel="preload" as="image" href="./images/deck-07-back.png">
|
24 |
+
<link rel="preload" as="image" href="./icons/hand-soft.png">
|
25 |
+
<link rel="preload" as="image" href="./icons/hand.png">
|
26 |
+
<link rel="preload" as="image" href="./icons/play.svg">
|
27 |
<link rel="stylesheet" href="main.css">
|
28 |
<script type="module" src="main.js"></script>
|
29 |
</head>
|
|
|
35 |
<dialog id="welcome">
|
36 |
<div>
|
37 |
<h1 style="text-align: center; font-size: 2em;">Tarot AI Experience</h1>
|
38 |
+
<h2>Your Personal Digital Oracle</h2>
|
39 |
+
<h3>Created by <a href="https://www.linkedin.com/in/massimo-avvisati-7220312/">Massimo Avvisati</a></h3>
|
40 |
+
<p class="mystic-warning">The cosmic energies channeled through AI guide these cards and craft these images.</p>
|
41 |
+
<p class="mystic-warning">Like a mirror reflecting the vast universe, they may show unexpected facets and occasional quirks.</p>
|
42 |
+
<p class="mystic-warning">Trust your intuition as you explore these digital divinations, and remember: true wisdom comes from
|
43 |
+
within.</p>
|
44 |
<button id="start" class="continue-button"></button>
|
45 |
</div>
|
46 |
</dialog>
|
|
|
76 |
<img src="./images/avatar-07.png" alt="Avatar" class="fortune-teller-avatar">
|
77 |
</div>
|
78 |
<div class="fortune-teller-buttons">
|
79 |
+
<button id="coming-soon">+</button>
|
80 |
</div>
|
81 |
<div class="fortune-teller-buttons">
|
82 |
<button disabled id="fortune-teller-selected" class="continue-button"></button>
|
|
|
113 |
<div class="setting">
|
114 |
<label for="llm-server">Tarot LLM HuggingFace Space</label>
|
115 |
<input id="llm-server" type="text" spellcheck="false" autocomplete="false" value="hysts/zephyr-7b">
|
|
|
116 |
</div>
|
117 |
</div>
|
118 |
</dialog>
|
119 |
+
<dialog id="coming-soon-dialog">
|
120 |
+
<div class="toolbar">
|
121 |
+
<button id="close-coming-soon-button">✖</button>
|
122 |
+
</div>
|
123 |
+
<div>
|
124 |
+
<h3>Coming soon</h3>
|
125 |
+
</div>
|
126 |
+
</dialog>
|
127 |
</body>
|
128 |
|
129 |
</html>
|
main.css
CHANGED
@@ -17,7 +17,17 @@ body {
|
|
17 |
background-repeat: no-repeat;
|
18 |
background-position: left bottom;
|
19 |
background-color: #111;
|
20 |
-
height:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
}
|
22 |
|
23 |
body.background-01 {
|
@@ -58,7 +68,7 @@ body.background-06 {
|
|
58 |
|
59 |
/*
|
60 |
.fortune-teller-profile {
|
61 |
-
grid-template-rows:
|
62 |
grid-template-columns: 1fr 1fr;
|
63 |
grid-template-areas:'picture deck'
|
64 |
'bio bio';
|
@@ -83,7 +93,7 @@ body.background-06 {
|
|
83 |
aspect-ratio: 1;
|
84 |
position: relative;
|
85 |
width: 100%;
|
86 |
-
max-height:
|
87 |
overflow: hidden;
|
88 |
cursor: url("./icons/hand.png") 19 4, default;
|
89 |
}
|
@@ -101,7 +111,7 @@ textarea {
|
|
101 |
font-size: 1rem;
|
102 |
min-width: 60lvw;
|
103 |
max-width: 80lvw;
|
104 |
-
font-size: clamp(1rem,
|
105 |
color: inherit;
|
106 |
}
|
107 |
|
@@ -161,7 +171,7 @@ textarea:focus-visible {
|
|
161 |
transform: translate(-50%, -50%) scale(var(--card-size)) rotateY(0deg);
|
162 |
border: 3px solid wheat;
|
163 |
box-shadow: 0 0 10px black;
|
164 |
-
top:
|
165 |
left: 50lvw;
|
166 |
}
|
167 |
|
@@ -393,12 +403,10 @@ div.setting input {
|
|
393 |
border: 0;
|
394 |
font-family: 'Courier New', Courier, monospace;
|
395 |
}
|
396 |
-
div.setting input::placeholder {
|
397 |
|
398 |
-
}
|
399 |
/* response dialog */
|
400 |
#response {
|
401 |
-
margin-bottom:
|
402 |
}
|
403 |
|
404 |
div.response-container {
|
@@ -441,7 +449,7 @@ div.response-container {
|
|
441 |
div.current-fortune-teller {
|
442 |
aspect-ratio: 1;
|
443 |
background-size: cover;
|
444 |
-
height:
|
445 |
display: flex;
|
446 |
margin: auto;
|
447 |
border-radius: 10%;
|
@@ -474,4 +482,119 @@ body.background-06 div.current-fortune-teller {
|
|
474 |
|
475 |
body.background-07 div.current-fortune-teller {
|
476 |
background-image: url(./images/avatar-07.png);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
477 |
}
|
|
|
17 |
background-repeat: no-repeat;
|
18 |
background-position: left bottom;
|
19 |
background-color: #111;
|
20 |
+
height: 100vh;
|
21 |
+
}
|
22 |
+
|
23 |
+
dialog a {
|
24 |
+
text-decoration: none;
|
25 |
+
font-weight: bold;
|
26 |
+
color: white;
|
27 |
+
}
|
28 |
+
|
29 |
+
dialog#welcome {
|
30 |
+
max-width: 50vw;
|
31 |
}
|
32 |
|
33 |
body.background-01 {
|
|
|
68 |
|
69 |
/*
|
70 |
.fortune-teller-profile {
|
71 |
+
grid-template-rows: 30vh;
|
72 |
grid-template-columns: 1fr 1fr;
|
73 |
grid-template-areas:'picture deck'
|
74 |
'bio bio';
|
|
|
93 |
aspect-ratio: 1;
|
94 |
position: relative;
|
95 |
width: 100%;
|
96 |
+
max-height: 20vh;
|
97 |
overflow: hidden;
|
98 |
cursor: url("./icons/hand.png") 19 4, default;
|
99 |
}
|
|
|
111 |
font-size: 1rem;
|
112 |
min-width: 60lvw;
|
113 |
max-width: 80lvw;
|
114 |
+
font-size: clamp(1rem, 5vh, 2rem);
|
115 |
color: inherit;
|
116 |
}
|
117 |
|
|
|
171 |
transform: translate(-50%, -50%) scale(var(--card-size)) rotateY(0deg);
|
172 |
border: 3px solid wheat;
|
173 |
box-shadow: 0 0 10px black;
|
174 |
+
top: 50vh;
|
175 |
left: 50lvw;
|
176 |
}
|
177 |
|
|
|
403 |
border: 0;
|
404 |
font-family: 'Courier New', Courier, monospace;
|
405 |
}
|
|
|
406 |
|
|
|
407 |
/* response dialog */
|
408 |
#response {
|
409 |
+
margin-bottom: 1vh;
|
410 |
}
|
411 |
|
412 |
div.response-container {
|
|
|
449 |
div.current-fortune-teller {
|
450 |
aspect-ratio: 1;
|
451 |
background-size: cover;
|
452 |
+
height: 30vh;
|
453 |
display: flex;
|
454 |
margin: auto;
|
455 |
border-radius: 10%;
|
|
|
482 |
|
483 |
body.background-07 div.current-fortune-teller {
|
484 |
background-image: url(./images/avatar-07.png);
|
485 |
+
}
|
486 |
+
|
487 |
+
.mystic-warning {
|
488 |
+
animation: fadeIn 0.5s ease-in-out;
|
489 |
+
}
|
490 |
+
|
491 |
+
h1::before {
|
492 |
+
content: '✨';
|
493 |
+
margin-right: 5px;
|
494 |
+
}
|
495 |
+
|
496 |
+
h1::after {
|
497 |
+
content: '✨';
|
498 |
+
margin-left: 5px;
|
499 |
+
}
|
500 |
+
|
501 |
+
@keyframes fadeIn {
|
502 |
+
from {
|
503 |
+
opacity: 0;
|
504 |
+
transform: translateY(20px);
|
505 |
+
}
|
506 |
+
|
507 |
+
to {
|
508 |
+
opacity: 1;
|
509 |
+
transform: translateY(0);
|
510 |
+
}
|
511 |
+
}
|
512 |
+
|
513 |
+
|
514 |
+
/* Media query per schermi fino a 768px di larghezza (tipicamente tablet e smartphone in modalità landscape) */
|
515 |
+
@media screen and (max-width: 768px) {
|
516 |
+
:root {
|
517 |
+
--card-size: 0.4;
|
518 |
+
/* Riduce la dimensione delle carte */
|
519 |
+
}
|
520 |
+
|
521 |
+
#fortune-tellers {
|
522 |
+
grid-template-columns: 1fr 1fr;
|
523 |
+
/* Cambia il layout a 2 colonne */
|
524 |
+
gap: 0.5rem;
|
525 |
+
}
|
526 |
+
|
527 |
+
.fortune-teller-profile {
|
528 |
+
max-height: 15vh;
|
529 |
+
}
|
530 |
+
|
531 |
+
dialog {
|
532 |
+
padding: 0.5rem 1rem 1rem 1rem;
|
533 |
+
font-size: 0.9rem;
|
534 |
+
}
|
535 |
+
|
536 |
+
textarea {
|
537 |
+
min-width: 80lvw;
|
538 |
+
font-size: clamp(0.9rem, 4vh, 1.5rem);
|
539 |
+
}
|
540 |
+
|
541 |
+
button {
|
542 |
+
width: 3rem;
|
543 |
+
height: 3rem;
|
544 |
+
font-size: 1.5rem;
|
545 |
+
}
|
546 |
+
}
|
547 |
+
|
548 |
+
/* Media query per schermi fino a 480px di larghezza (tipicamente smartphone in modalità portrait) */
|
549 |
+
@media screen and (max-width: 480px) {
|
550 |
+
:root {
|
551 |
+
--card-size: 0.3;
|
552 |
+
/* Riduce ulteriormente la dimensione delle carte */
|
553 |
+
}
|
554 |
+
|
555 |
+
#fortune-tellers {
|
556 |
+
grid-template-columns: 1fr;
|
557 |
+
/* Cambia il layout a 1 colonna */
|
558 |
+
}
|
559 |
+
|
560 |
+
.fortune-teller-profile {
|
561 |
+
max-height: 12vh;
|
562 |
+
}
|
563 |
+
|
564 |
+
dialog {
|
565 |
+
font-size: 0.8rem;
|
566 |
+
border-radius: 1rem;
|
567 |
+
}
|
568 |
+
|
569 |
+
div.response-container {
|
570 |
+
grid-template-columns: 1fr;
|
571 |
+
/* Cambia il layout a 1 colonna */
|
572 |
+
gap: 1rem;
|
573 |
+
}
|
574 |
+
|
575 |
+
div.current-fortune-teller {
|
576 |
+
height: 20vh;
|
577 |
+
}
|
578 |
+
|
579 |
+
#settings div {
|
580 |
+
font-size: 1rem;
|
581 |
+
}
|
582 |
+
|
583 |
+
div.setting input {
|
584 |
+
font-size: 1rem;
|
585 |
+
width: 100%;
|
586 |
+
box-sizing: border-box;
|
587 |
+
}
|
588 |
+
}
|
589 |
+
|
590 |
+
/* Media query per gestire l'altezza dello schermo su dispositivi molto piccoli */
|
591 |
+
@media screen and (max-height: 600px) {
|
592 |
+
.fortune-teller-profile {
|
593 |
+
max-height: 25vh;
|
594 |
+
}
|
595 |
+
|
596 |
+
dialog {
|
597 |
+
max-height: 80vh;
|
598 |
+
overflow-y: auto;
|
599 |
+
}
|
600 |
}
|
main.js
CHANGED
@@ -289,6 +289,29 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
289 |
openDeckSelectionDialog();
|
290 |
})
|
291 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
// Chiamata alla funzione per aprire il dialogo di benvenuto all'avvio dell'app
|
293 |
openDeckSelectionDialog();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
});
|
|
|
289 |
openDeckSelectionDialog();
|
290 |
})
|
291 |
|
292 |
+
const comingSoonButton = document.getElementById('coming-soon');
|
293 |
+
const comingSoonDialog = document.getElementById('coming-soon-dialog');
|
294 |
+
|
295 |
+
comingSoonButton.addEventListener('click', () => {
|
296 |
+
comingSoonDialog.showModal();
|
297 |
+
})
|
298 |
+
|
299 |
+
const comingSoonCloseButton = document.getElementById('close-coming-soon-button');
|
300 |
+
comingSoonCloseButton.addEventListener('click', () => {
|
301 |
+
comingSoonDialog.close();
|
302 |
+
})
|
303 |
+
|
304 |
// Chiamata alla funzione per aprire il dialogo di benvenuto all'avvio dell'app
|
305 |
openDeckSelectionDialog();
|
306 |
+
openWelcomeDialog();
|
307 |
+
|
308 |
+
const dialogs = document.querySelectorAll('dialog');
|
309 |
+
dialogs.forEach(dialog => {
|
310 |
+
dialog.addEventListener('keydown', (event) => {
|
311 |
+
if (event.key === 'Escape') {
|
312 |
+
event.preventDefault(); // Impedisce la chiusura
|
313 |
+
}
|
314 |
+
});
|
315 |
+
});
|
316 |
+
|
317 |
});
|