TarotAI / main.css
massimoavvisati's picture
Welcom and warning message added
faeee9d
raw
history blame
12.5 kB
:root {
--default-font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
--rose: #ff0069ff;
--violet-jtc: #542344ff;
--steel-blue: #2d82b7ff;
--magnolia: #fcf7ffff;
--pearl: #e6e1c5ff;
--card-size: 0.6;
--card-effect: linear-gradient(45deg, #0006, #fff3 70%);
font-family: var(--default-font-family);
}
body {
margin: 0;
background-size: 50%;
background-repeat: no-repeat;
background-position: left bottom;
background-color: #111;
height: 100vh;
}
dialog a {
text-decoration: none;
font-weight: bold;
color: white;
}
dialog#welcome {
max-width: 50vw;
}
body.background-01 {
/* background-image: url("./images/background-02.png"), linear-gradient(270deg, #111 0%, #3c5462 90%); */
background-image: linear-gradient(270deg, #111 0%, #607d8b 90%);
}
body.background-02 {
/* background-image: url("./images/background-02.png"), linear-gradient(270deg, #111 0%, #3c5462 90%); */
background-image: linear-gradient(270deg, #111 0%, #3c5462 90%);
}
body.background-03 {
/* background-image: url("./images/background-02.png"), linear-gradient(270deg, #111 0%, #3c5462 90%); */
background-image: linear-gradient(270deg, #111 0%, #3c5462 90%);
}
body.background-04 {
background-image: linear-gradient(270deg, #111 0%, #009688 90%);
}
body.background-05 {
background-image: linear-gradient(270deg, #111 0%, #ac1444 90%);
}
body.background-06 {
background-image: linear-gradient(270deg, #111 0%, #795548 90%);
}
#fortune-tellers {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
gap: 1rem;
}
/*
.fortune-teller-profile {
grid-template-rows: 30vh;
grid-template-columns: 1fr 1fr;
grid-template-areas:'picture deck'
'bio bio';
max-width: min-content;
margin-block: 1rem;
display: grid;
overflow: auto;
align-self: center;
justify-items: center;
} */
.fortune-teller-profile {
display: flex;
justify-content: center;
align-items: center;
opacity: 0.3;
filter: grayscale();
border-radius: 50%;
border: 3px solid #fff3;
box-shadow: 0 0 20px #fff0;
transition: opacity 0.5s allow-discrete, box-shadow 1s;
aspect-ratio: 1;
position: relative;
width: 100%;
max-height: 20vh;
overflow: hidden;
cursor: url("./icons/hand.png") 19 4, default;
}
.fortune-teller-profile.selected {
opacity: 1;
filter: grayscale(0);
box-shadow: 0 0 20px #ffff;
}
textarea {
background-color: transparent;
border: 0;
border-right: 1px solid #fff6;
font-size: 1rem;
min-width: 60lvw;
max-width: 80lvw;
font-size: clamp(1rem, 5vh, 2rem);
color: inherit;
}
textarea:focus-visible {
outline: 0;
border-right: 1px solid #fff9;
}
.fortune-teller-profile p {
grid-area: bio;
}
.fortune-teller-profile .fortune-teller-avatar {
display: block;
aspect-ratio: 1;
height: 100%;
border-radius: 50%;
}
.fortune-teller-profile .fortune-teller-deck-back {
display: none;
grid-area: deck;
border-radius: 10%;
}
/*
.fortune-teller-profile img {
display: block;
height: 100%;
width: auto;
} */
.fortune-teller-buttons {
display: flex;
justify-content: center;
align-items: center;
}
#cards-container {
position: absolute;
inset: 0;
overflow: hidden;
}
.card {
display: flex;
justify-content: flex-start;
align-items: center;
flex-direction: column-reverse;
transition: top 0.7s, left 0.7s, rotate 0.5s;
transition-timing-function: cubic-bezier(0, -0.28, 0.75, -0.21);
width: 512px;
height: 768px;
background-image: linear-gradient(0deg, #000, #fff);
border-radius: 6%;
position: absolute;
transform: translate(-50%, -50%) scale(var(--card-size)) rotateY(0deg);
border: 3px solid wheat;
box-shadow: 0 0 10px black;
top: 50vh;
left: 50lvw;
}
.card.rotated {
transform: translate(-50%, -50%) scale(var(--card-size)) rotateY(90deg);
}
.card.flipped h2 {
display: none;
}
button {
cursor: url("./icons/hand.png") 19 4, default;
width: 4rem;
height: 4rem;
background-color: #3336;
border-radius: 50%;
border: 0;
backdrop-filter: blur(10px);
background-image: none;
font-size: 2rem;
color: white;
background-size: 3rem;
background-position: center;
}
button.continue-button {
background-image: url(./icons/play.svg);
}
div.toolbar {
display: flex;
align-items: center;
justify-content: flex-end;
padding: 1rem 0;
}
#settings-button {
letter-spacing: 3px;
font-size: 1rem;
}
#close-settings-button {
font-size: 1.5rem;
color: #fff9;
}
div.horizontal-buttons {
display: flex;
justify-content: space-between;
}
.card h2 {
text-align: center;
background-image: linear-gradient(0deg, #fff 0%, #fff3 140%);
border-radius: 15%;
padding: 4px 5px;
text-shadow: 0 0 3px #333;
color: #111;
border: 1px solid #fff6;
}
body.background-01 .card {
background-image: var(--card-effect), url(./images/deck-01.jpg)
}
body.background-01 .card.flipped {
background-image: linear-gradient(45deg, #0006, #fff3 70%), url(./images/deck-01-back.png);
}
body.background-02 .card {
background-image: linear-gradient(45deg, #0006, #fff3 70%), url(./images/deck-02.jpg)
}
body.background-02 .card.flipped {
background-image: linear-gradient(45deg, #0006, #fff3 70%), url('./images/deck-02-back.png');
}
body.background-03 .card {
background-image: linear-gradient(45deg, #0006, #fff3 70%), url(./images/deck-03.jpg)
}
body.background-03 .card.flipped {
background-image: linear-gradient(45deg, #0006, #fff3 70%), url('./images/deck-03-back.png');
}
body.background-05 .card {
background-image: linear-gradient(45deg, #0006, #fff3 70%), url(./images/deck-05.jpg)
}
body.background-05 .card.flipped {
background-image: linear-gradient(45deg, #0006, #fff3 70%), url('./images/deck-05-back.png');
}
body.background-04 .card {
background-image: url(./images/deck-04.jpg)
}
body.background-04 .card.flipped {
background-image: url('./images/deck-04-back.png');
}
body.background-06 .card {
background-image: url(./images/deck-06.jpg)
}
body.background-06 .card.flipped {
background-image: url('./images/deck-06-back.png');
}
body.background-07 .card {
background-image: url(./images/deck-07.jpg)
}
body.background-07 .card.flipped {
background-image: url('./images/deck-07-back.png');
}
dialog {
cursor: url("./icons/hand-soft.png") 19 4, default;
font-size: 1rem;
backdrop-filter: blur(10px);
background-image: linear-gradient(0deg, #fff3, transparent);
border-radius: 2rem;
border: #fff1 solid 2px;
background-color: transparent;
padding: 1rem 2rem 2rem 2rem;
text-align: center;
color: white;
text-shadow: 0 0 5px #fffc;
}
div.tag {
position: absolute;
bottom: 10px;
font-size: 1rem;
background-image: linear-gradient(45deg, #CDDC39, #8BC34A);
padding: 0.2rem 1rem;
border-radius: 1rem;
font-family: monospace;
color: #333;
text-shadow: 0 0 1px #444;
}
div.tag.human {
background-image: linear-gradient(45deg, #FFEB3B, #ff9800);
}
div.tag.cpu {
background-image: linear-gradient(45deg, #2196F3, #00BCD4);
}
/* DIALOGS */
/* Open state of the dialog */
dialog[open] {
opacity: 1;
}
/* Closed state of the dialog */
dialog {
opacity: 0;
transition: all 0.7s allow-discrete;
}
/* Before-open state */
/* Needs to be after the previous dialog[open] rule to take effect,
as the specificity is the same */
@starting-style {
dialog[open] {
opacity: 0;
}
}
/* Transition the :backdrop when the dialog modal is promoted to the top layer */
dialog::backdrop {
background-color: rgba(0, 0, 0, 0);
transition: all 0.7s allow-discrete;
}
dialog[open]::backdrop {
background-color: rgb(0 0 0 / 25%);
}
/* This starting-style rule cannot be nested inside the above selector
because the nesting selector cannot represent pseudo-elements. */
@starting-style {
dialog[open]::backdrop {
background-color: rgb(0 0 0 / 0%);
}
}
dialog div {
text-align: center;
color: white;
}
#settings div {
text-align: left;
font-size: 1.3rem;
}
#settings h2 {
font-weight: 400;
font-size: 1.2rem;
}
div.setting {
margin: 2rem 0;
}
div.setting label {
display: block;
}
div.setting input {
display: block;
font-size: 1.3rem;
width: 42ch;
background: #fff1;
color: #cddc39;
padding: 0.5rem 1rem;
border: 0;
font-family: 'Courier New', Courier, monospace;
}
/* response dialog */
#response {
margin-bottom: 1vh;
}
div.response-container {
grid-template-columns: 2fr 3fr 1fr;
align-items: center;
max-width: 80lvw;
display: grid;
}
#response-output span {
display: inline-block;
}
@keyframes bounce {
0% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
100% {
transform: translateY(0);
}
}
#response-output span:nth-child(1) {
animation: bounce 3s infinite 0.5s;
}
#response-output span:nth-child(2) {
animation: bounce 3s infinite 1.0s;
}
#response-output span:nth-child(3) {
animation: bounce 3s infinite 1.5s;
}
div.current-fortune-teller {
aspect-ratio: 1;
background-size: cover;
height: 30vh;
display: flex;
margin: auto;
border-radius: 10%;
}
body.background-01 div.current-fortune-teller {
background-image: url(./images/avatar-01.png);
}
body.background-02 div.current-fortune-teller {
background-image: url(./images/avatar-02.png);
}
body.background-03 div.current-fortune-teller {
background-image: url(./images/avatar-03.png);
}
body.background-04 div.current-fortune-teller {
background-image: url(./images/avatar-04.png);
}
body.background-05 div.current-fortune-teller {
background-image: url(./images/avatar-05.png);
}
body.background-06 div.current-fortune-teller {
background-image: url(./images/avatar-06.png);
}
body.background-07 div.current-fortune-teller {
background-image: url(./images/avatar-07.png);
}
.mystic-warning {
animation: fadeIn 0.5s ease-in-out;
}
h1::before {
content: '✨';
margin-right: 5px;
}
h1::after {
content: '✨';
margin-left: 5px;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* Media query per schermi fino a 768px di larghezza (tipicamente tablet e smartphone in modalità landscape) */
@media screen and (max-width: 768px) {
:root {
--card-size: 0.4;
/* Riduce la dimensione delle carte */
}
#fortune-tellers {
grid-template-columns: 1fr 1fr;
/* Cambia il layout a 2 colonne */
gap: 0.5rem;
}
.fortune-teller-profile {
max-height: 15vh;
}
dialog {
padding: 0.5rem 1rem 1rem 1rem;
font-size: 0.9rem;
}
textarea {
min-width: 80lvw;
font-size: clamp(0.9rem, 4vh, 1.5rem);
}
button {
width: 3rem;
height: 3rem;
font-size: 1.5rem;
}
}
/* Media query per schermi fino a 480px di larghezza (tipicamente smartphone in modalità portrait) */
@media screen and (max-width: 480px) {
:root {
--card-size: 0.3;
/* Riduce ulteriormente la dimensione delle carte */
}
#fortune-tellers {
grid-template-columns: 1fr;
/* Cambia il layout a 1 colonna */
}
.fortune-teller-profile {
max-height: 12vh;
}
dialog {
font-size: 0.8rem;
border-radius: 1rem;
}
div.response-container {
grid-template-columns: 1fr;
/* Cambia il layout a 1 colonna */
gap: 1rem;
}
div.current-fortune-teller {
height: 20vh;
}
#settings div {
font-size: 1rem;
}
div.setting input {
font-size: 1rem;
width: 100%;
box-sizing: border-box;
}
}
/* Media query per gestire l'altezza dello schermo su dispositivi molto piccoli */
@media screen and (max-height: 600px) {
.fortune-teller-profile {
max-height: 25vh;
}
dialog {
max-height: 80vh;
overflow-y: auto;
}
}