:root { --card-h: 47; --card-s: 95%; --card-l: 58%; --card-color: hsl(var(--card-h) var(--card-s) var(--card-l)); --card-width: 25rem; --card-aspect: 63 / 88; --theme-primary: hsl(158 100% 33%); --theme-secondary: hsl(165 67% 48%); --theme-ternary: hsl(112 46% 75%); --theme-highlight: hsl(111 95% 92%); --theme-white: hsl(0 100% 100%); --theme-subtext: hsl(0 0% 30%); } html, body { overflow: scroll; } * { outline-style: none; outline-width: 0.15rem; outline-color: var(--theme-primary); transition: outline-offset 0.25s ease-out; } *:focus-visible:not(input) { outline-style: dashed; outline-offset: 0.25em; /* border-radius: 0.375em; */ } .info h1::selection { text-fill-color: white; -webkit-text-fill-color: white; -moz-text-fill-color: white; } *::selection { background-color: gold; } body { height: 100vh; font-family: 'Gill Sans', 'Gill Sans Mt', 'sans-serif'; background-color: whitesmoke; background-image: linear-gradient(300deg, var(--theme-highlight), var(--theme-white)); } main { display: grid; grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr)); place-items: center; gap: 1.5rem 0; margin: 0 auto; max-width: 80rem; padding: 3rem; } section { /* display: flex; flex-direction: column; */ display: grid; place-items: center; box-sizing: border-box; width: 100%; /* border: 2px dashed dodgerblue; */ } .info { max-width: 35rem; height: min-content; } .poke-trio { display: flex; flex-direction: row; justify-content: space-between; height: 5rem; position: relative; } .poke-trio > img { position: relative; user-select: none; } .poke-trio > img::after { content: ''; position: absolute; top: 0; /* bottom: 0; */ left: 0; /* left: 50%; */ /* width: 100%; */ /* height: 15%; */ width: 3rem; height: 3rem; /* background-color: hsl(0 0% 25% / 0.5); */ background-color: blue; /* border-radius: 50%; */ border: 2px solid red; } .info h1 { /* min-width: 25rem; */ /* background-size: 100%; */ background-image: linear-gradient(0deg, var(--theme-primary), var(--theme-secondary)); background-clip: text; text-fill-color: transparent; -webkit-background-clip: text; -moz-background-clip: text; -webkit-text-fill-color: transparent; -moz-text-fill-color: transparent; font-size: 4.5rem; font-weight: bold; text-align: center; margin: 0.5rem auto 3rem; /* text-align: left; */ /* margin: auto; */ /* padding-bottom: 1rem; */ transition: font-size 0.5s ease; } @media (max-width: 1280px) { .info h1 { font-size: 3rem; } } /* @media (min-width: 600px) and (max-width: 1280px) { */ @media (max-width: 1280px) { /* .scene[data-mode='card'] { --scale: 0.8; } */ .card-slot > .pokecard { --card-scale: 0.8; } } /* .info hr { width: 100%; border-width: 1px; margin: 1rem; } */ .info label { width: 100%; font-weight: 700; font-size: 1.25rem; text-align: center; } .info input { box-sizing: border-box; display: block; width: 80%; padding: 0.5rem 1rem; margin: 0.5rem auto; /* border-radius: 0.375rem; border: hsl(0 0% 70%); box-shadow: 0 0 0.1rem var(--theme-primary); */ border-radius: 1rem; border: 0.2rem solid hsl(0 0% 70%); /* box-shadow: 0 0 0.1rem var(--theme-primary); */ box-shadow: 0 0 0.25rem hsl(165.1 64.7% 48.8% / 60%); /* box-shadow: 0 0 0.25rem hsl(165.1 64.7% 48.8% / 60%); */ font-size: 1.25rem; text-align: center; outline-color: white; /* transition: outline-color 0.5s ease-in; */ transition: border-color 0.25s ease-in; /* outline: none; */ } input:focus { border-color: transparent; /* border-color: var(--theme-primary); */ outline-style: solid; outline-color: var(--theme-primary); } .info input::placeholder { text-align: center; } .info p { width: 80%; margin: 3rem auto 0; line-height: 1.5rem; text-align: justify; color: var(--theme-subtext); } .info a:is(:hover, :focus, :active, :visited) { color: inherit; } /* Output Section */ .output { display: flex; flex-direction: column; justify-content: space-around; height: max-content; perspective: 100rem; } .output .actions { display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 1rem; width: 100%; margin: 1rem auto 1.5rem; transform-style: preserve-3d; transform-origin: bottom; transform: translateY(-25%); transition: transform 0.5s, opacity 0.5s; visibility: hidden; opacity: 0; } [data-mode='card'][data-state='completed'] .actions { visibility: visible; transform: translateY(0); opacity: 1; /* pointer-events: none; */ } @media (max-width: 500px) { main { padding: 3rem 0; /* background-color: hotpink !important; */ } .output .actions { display: flex; flex-wrap: wrap; width: 90vw; } /* .output .actions > button { width: max-content; width: 40rem; whitespace: nowrap; } */ /* .info h1 { font-size: 3rem; } */ /* .scene { transform: scale(0.8); } */ } .duration { color: var(--theme-subtext); margin: 0 auto; text-align: right; width: max-content; background-color: var(--theme-highlight); padding: 0.5rem 1rem; border-radius: 1rem; visibility: hidden; opacity: 0; transition: opacity 0.2s ease-in; } .duration.displayed { visibility: visible; opacity: 1; } button { whitespace: nowrap; padding: 0.5rem 1rem; border: none; border-radius: 1rem; /* margin: 1rem; */ background-image: linear-gradient(-90deg, var(--theme-ternary), var(--theme-secondary)); /* color: var(--theme-white); */ color: white; font-weight: bold; box-shadow: 0 0.2rem 0.375rem hsl(158 100% 33% / 60%); transition: transform 0.1s ease-out, box-shadow 0.1s, outline-offset 0.25s ease-out; cursor: pointer; user-select: none; } button:active { transform: translateY(0.1rem); box-shadow: none; } /* button:focus-visible: { outline-offset: 1em !important; } */ .scene { --scale: 0.9; perspective: 100rem; /* margin: 0.5rem; */ margin: 2rem; height: 40rem; /* height: 100%; */ /* transform: scale(2); */ box-sizing: border-box; /* border: 2px dashed gold; */ transform-origin: top; transform: scale(var(--scale)); transition: transform 0.5s ease-out; } .grass { --h: 90; --s: 60%; --l: 40%; } .grass.energy { filter: contrast(0.75) grayscale(1) sepia(1) saturate(10) hue-rotate(55deg) drop-shadow(0 0 0.1rem green); } .fire { --h: 0; --s: 75%; --l: 45%; } .fire.energy { filter: contrast(0.75) grayscale(1) sepia(1) saturate(10) hue-rotate(335deg) drop-shadow(0 0 0.1rem red); } .water { --h: 210; --s: 100%; --l: 58%; } .water.energy { filter: contrast(0.75) grayscale(1) sepia(1) saturate(10) hue-rotate(180deg) drop-shadow(0 0 0.1rem cyan); } .lightning { --h: 50; --s: 100%; --l: 58%; } .lightning.energy { filter: contrast(0.75) grayscale(1) sepia(1) saturate(10) hue-rotate(5deg) drop-shadow(0 0 0.1rem gold); } .fighting { --h: 25; --s: 72%; --l: 36%; } .fighting.energy { filter: contrast(0.75) grayscale(1) sepia(1) saturate(10) hue-rotate(320deg) drop-shadow(0 0 0.1rem brown); } .psychic { --h: 299; --s: 43%; --l: 44%; } .psychic.energy { filter: grayscale(1) sepia(1) saturate(10) hue-rotate(240deg) drop-shadow(0 0 0.1rem purple); } .colorless { --h: 21; --s: 27%; --l: 85%; } .colorless.energy { font-size: 0.9em; border-radius: 50%; background-color: hsl(0 0% 100% / 15%); filter: contrast(100) grayscale(1) drop-shadow(0 0 0.1rem white); } .darkness { --h: 100; --s: 3%; --l: 17%; } .darkness.energy { filter: drop-shadow(0 0 0.1rem black); } .darkness :not(.species) { color: whitesmoke; } .metal { --h: 240; --s: 20%; --l: 77%; } .metal.energy { filter: drop-shadow(0 0 0.1rem silver); } .dragon { --h: 30; --s: 6%; --l: 44%; } .dragon.energy { filter: contrast(0.75) grayscale(1) sepia(1) saturate(10) hue-rotate(15deg) drop-shadow(0 0 0.1rem gold); } .fairy { --h: 334; --s: 74%; --l: 55%; } .fairy.energy { filter: contrast(0.75) grayscale(1) sepia(1) saturate(10) hue-rotate(300deg) drop-shadow(0 0 0.1rem pink); } .card-slot { perspective: 100rem; transition: transform 0.5s ease-out; } .pokecard, .pokecard * { box-sizing: border-box; } .pokecard { --color: hsl(var(--h) var(--s) var(--l)); --lighter: hsl(var(--h) var(--s) calc(var(--l) + 10%)); --lightest: hsl(var(--h) var(--s) calc(var(--l) + 30%)); --card-rx: 0deg; --card-ry: 0deg; --card-rz: 0deg; --card-scale: 1; display: flex; flex-direction: column; width: 25rem; aspect-ratio: 63 / 88; padding: 0.5rem 1rem; border: 1rem solid; border-radius: 0.75rem; border-color: var(--card-color); background-image: linear-gradient( 45deg, var(--lighter) 0%, var(--lightest) 15%, var(--lightest) 30%, var(--color) 50%, var(--lightest) 90%, var(--lighter) 100% ); transform-origin: center; transform-style: preserve-3d; transform: rotateX(var(--card-rx)) rotateY(var(--card-ry)) scale(var(--card-scale)); transition: transform 0.5s ease-out; } .pokecard[data-displayed='true'] { display: flex; } .pokecard[data-displayed='false'] { display: none; } .pokecard :where(header, p) { font-family: 'Gill Sans', 'Gill Sans Mt', 'sans-serif'; } .pokecard :is(.evolves) { font-family: 'Century Gothic', 'sans-serif'; } .pokecard :where(header, p) { font-family: 'Gill Sans', 'Gill Sans Mt'; } .evolves { margin: 0; font-weight: bold; font-size: 0.5rem; } header { display: flex; flex-direction: row; justify-content: space-between; } header > * { display: inline-block; } .name { justify-self: left; font-size: 1.25rem; margin: 0; } .hp { font-size: 1.25rem; color: hsl(0 100% 50%); } header .energy { display: inline-block; transform: translateY(-0.15rem); } .frame:is(.picture, .species, .description) { --lighter: hsl(var(--card-h) var(--card-s) calc(var(--card-l) + 15%)); --lightest: hsl(var(--card-h) var(--card-s) calc(var(--card-l) + 30%)); --darker: hsl(var(--card-h) var(--card-s) calc(var(--card-l) - 15%)); border-color: var(--darker) var(--card-color) var(--lighter); } .picture { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background-color: white; border: 0.375rem solid; box-shadow: 0.25rem 0.25rem 0.5rem black; user-select: none; } .species { width: 90%; padding: 0.1rem; margin: 0.25rem auto; text-align: center; font-size: 0.75rem; font-style: italic; font-weight: bold; background-image: linear-gradient(90deg, var(--card-color), var(--lightest) 45% 55%, var(--card-color)); border-width: 0 0.2rem; border-style: solid; border-image: linear-gradient(var(--lightest), var(--darker)) 1 100%; } .grid-three { display: grid; grid-template-columns: repeat(3, 1fr); } .grid-three > *:first-child { text-align: left; } .grid-three > span:last-child { text-align: right; } .attacks { list-style-type: none; padding: 0; margin: 0.1rem auto 0; } .attacks-row { max-height: 5rem; grid-template-columns: 3rem 10fr 1fr; align-items: center; gap: 1rem; font-size: 0.95em; } .attack-text > span:only-child { display: block; margin-left: -2rem; text-align: center; } .attack-cost { display: flex; justify-content: space-evenly; flex-flow: row wrap; text-align: justify; } .energy { width: fit-content; aspect-ratio: 1 / 1; cursor: default; user-select: none; } .energy:only-child { justify-self: flex-start; margin: auto; } .attack-name { font-weight: bold; } .attack-damage { min-width: 2.25rem; font-size: 1.375rem; text-align: center; } hr { background-color: black; border: 0.5px solid black; } .multipliers { display: flex; flex-direction: row; justify-content: space-between; height: 2rem; margin-top: -0.5rem; text-align: center; font-size: 0.75rem; font-weight: bold; } .multipliers > div { display: flex; flex-direction: column; align-items: center; margin: 0; } .resistance { position: relative; } .resistance-total { position: absolute; top: 1rem; left: 2.5rem; } .description { padding: 0.1rem 0.5rem; margin: 0.25rem 0 0.5rem; border: 0.15rem solid; font-size: 0.65rem; font-style: italic; font-weight: bold; } .footer { text-align: center; font-weight: bold; font-size: 0.6rem; margin: auto 0; } .pokecard a { text-decoration: none; color: inherit !important; } /* Booster Pack */ .booster { display: none; --booster-rx: 0deg; --booster-ry: 0deg; /* --booster-ry: 65deg; */ --booster-rz: -5deg; /* --booster-rz: 0deg; */ --booster-scale: 0.7; /* --width: 18.9rem; --height: 27.2rem; */ --width: var(--card-width); --height: calc(var(--card-width) / 66 * 88); --depth: 0.5rem; --bg: hsl(227, 54%, 21%); /* --foil: */ /* width: var(--width); height: var(--height); */ width: var(--width); height: var(--height); position: relative; transform-style: preserve-3d; transform: rotateX(var(--booster-rx)) rotateY(var(--booster-ry)) rotateZ(var(--booster-rz)) scale(var(--booster-scale)); transition: transform 0.5s ease-in-out; cursor: pointer; } .booster > div { position: absolute; display: grid; place-items: center; font-size: 5rem; transform-origin: center; user-select: none; } .face:is(.front, .back, .left, .right) { height: var(--height); background-color: var(--bg); } .face:is(.front, .back, .top, .bottom) { width: var(--width); } .left, .right { width: var(--depth); } .face:is(.top, .bottom) { height: var(--depth); } .foil { width: var(--width); background-image: linear-gradient( 90deg, hsl(0 0% 80%) 0%, hsl(0 0% 84%) 10%, hsl(0 0% 88%) 20%, hsl(0 0% 92%) 30%, hsl(0 0% 96%) 40%, hsl(0 0% 100%) 50%, hsl(0 0% 96%) 60%, hsl(0 0% 92%) 70%, hsl(0 0% 88%) 80%, hsl(0 0% 84%) 90%, hsl(0 0% 80%) 100% ); } .foil.top.flat { transform-origin: bottom; transform: translate3d(0, -30px, 0px) rotateX(0deg); height: 20px; } .foil.top.flat::after, .foil.bottom.flat::after { content: ''; position: absolute; width: var(--width); height: 20px; background: radial-gradient(#ffffff 0%, transparent 50%); background-size: 1% 100%; } .foil.top.front { transform-origin: bottom; transform: translate3d(0, -11.4px, 3.8px) rotateX(20.5deg); height: 11px; } .foil.top.back { transform-origin: bottom; transform: translate3d(0, -11.4px, -4px) rotateX(339deg); height: 11px; } .face.front { transform: rotateY(0deg) translate3d(0, 0, calc(var(--depth) / 2)); } .face.left { transform: rotateY(90deg) translate3d(0, 0, calc(var(--width) - calc(var(--depth) / 2))); } .face.back { transform: rotateY(180deg) translate3d(0, 0, calc(var(--depth) / 2)) rotateZ(180deg); } .face.right { transform: rotateY(-90deg) translate3d(0, 0, calc(var(--depth) / 2)); } .face.top { transform: rotateX(90deg) translate3d(0, 0, calc(var(--depth) / 2)); } .face.bottom { transform: rotateX(-90deg) translate3d(0, 0, calc(var(--height) - calc(var(--depth) / 2))); } .foil.bottom.flat { transform-origin: top; transform: translate3d(0, calc(var(--height) + 10px), 0px) rotateX(0deg); height: 20px; } .foil.bottom.front { transform-origin: top; transform: translate3d(0, var(--height), 3.8px) rotateX(-19.5deg); height: 11px; } .foil.bottom.back { transform-origin: top; transform: translate3d(0, var(--height), -3.8px) rotateX(19.5deg); height: 11px; } .foil.back.flat { transform-origin: bottom; transform: translate3d(calc(var(--width) / 2 - 25px), 0px, calc(var(--depth) * -0.50001)) rotateX(0deg); width: 30px; height: var(--height); transform-style: preserve-3d; background-image: linear-gradient( 90deg, hsl(0 0% 0%) 0%, hsl(0 0% 10%) 20%, hsl(0 0% 40%) 30%, hsl(0 0% 60%) 40%, hsl(0 0% 86%) 50%, hsl(0 0% 90%) 60%, hsl(0 0% 85%) 80%, hsl(0 0% 90%) 90%, hsl(0 0% 70%) 100% ); } .foil.back.flap { transform-origin: center; transform: translate3d(calc(var(--width) / 2 - 25.5px), 0, -8px) rotateY(15deg); width: 30px; height: var(--height); transform-style: preserve-3d; background-image: linear-gradient( 90deg, hsl(0 0% 70%) 0%, hsl(0 0% 74%) 10%, hsl(0 0% 78%) 20%, hsl(0 0% 82%) 30%, hsl(0 0% 86%) 40%, hsl(0 0% 90%) 50%, hsl(0 0% 86%) 60%, hsl(0 0% 82%) 70%, hsl(0 0% 78%) 80%, hsl(0 0% 74%) 90%, hsl(0 0% 70%) 100% ); } .foil.back.flap::after { content: ''; position: absolute; width: 30px; height: var(--height); background: radial-gradient(#ffffff 0%, transparent 50%); background-size: 100% 0.75%; } .gradient-bg { background-image: linear-gradient( 225deg, hsl(270deg 100% 7%) 0%, hsl(246deg 77% 15%) 14%, hsl(223deg 59% 24%) 29%, hsl(199deg 44% 35%) 43%, hsl(175deg 32% 48%) 57%, hsl(151deg 36% 62%) 71%, hsl(128deg 45% 78%) 86%, hsl(104deg 100% 95%) 100% ); } .face.front { display: flex; flex-direction: column; justify-content: space-evenly; gap: 0.5rem; box-sizing: border-box; padding: 1rem; } .face.front, .face.back { background-image: url("data:image/svg+xml;utf8,"); background-position: center; background-size: var(--width); } .face.right, .face.left { background-image: linear-gradient( 0deg, hsl(151deg 36% 62%) 0%, hsl(175deg 32% 48%) 14%, hsl(199deg 44% 35%) 29%, hsl(223deg 59% 24%) 57%, hsl(246deg 77% 15%) 86%, hsl(270deg 100% 7%) 100% ); } img.title { width: 100%; filter: drop-shadow(0 0.25rem 0.1rem hsl(220 100% 10% / 0.75)); } img.hf-logo { width: 90%; } .triangle.top.right { width: calc(var(--depth) * 10); aspect-ratio: 1 / 1.35; transform: rotateY(90deg) translate3d(0.1px, -59.1px, -39.5px) scale(0.1); clip-path: polygon(0% 100%, 50% 0%, 100% 100%); } .triangle.top.left { width: calc(var(--depth) * 10); aspect-ratio: 1 / 1.35; transform: rotateY(90deg) translate3d(0.1px, -59.1px, calc(var(--width) - 41.5px)) scale(0.1); clip-path: polygon(0% 100%, 50% 0%, 100% 100%); } .triangle.bottom.left { width: calc(var(--depth) * 10); aspect-ratio: 1 / 1.35; background-color: hotpink !important; transform: rotateY(90deg) translate3d(0.1px, calc(var(--height) - 49px), calc(var(--width) - 41.5px)) scale(0.1); clip-path: polygon(0% 0%, 50% 100%, 100% 0%); } .triangle.bottom.right { width: calc(var(--depth) * 10); aspect-ratio: 1 / 1.35; transform: rotateY(90deg) translate3d(0px, calc(var(--height) - 49px), -39.5px) scale(0.1); clip-path: polygon(0% 0%, 50% 100%, 100% 0%); } /* Animation */ /* transform: rotateX(var(--booster-rx)) rotateY(var(--booster-ry)) rotateZ(var(--booster-rz)) scale(var(--booster-scale)); */ @keyframes spin-x { from { /* transform: scale(0.9) rotate(0turn); */ transform: scale(var(--scale)) rotate(0turn); } to { /* transform: scale(0.9) rotate(1turn); */ transform: scale(var(--scale)) rotate(1turn); } } @keyframes spin-y { 0% { /* transform: rotateZ(0turn) rotateY(0turn); */ transform: rotateX(var(--booster-rx)) rotateY(0deg) rotateZ(0deg) scale(var(--booster-scale)); } /* 80% { transform: rotateX(var(--booster-rx)) rotateY(360deg) rotateZ(0deg) scale(var(--booster-scale)); } */ 100% { transform: rotateX(var(--booster-rx)) rotateY(360deg) rotateZ(0deg) scale(var(--booster-scale)); } } @keyframes bounce { 0% { transform: rotateX(var(--booster-rx)) rotateY(var(--booster-ry)) rotateZ(var(--booster-rz)) scale(var(--booster-scale)) translateY(0%); } 30% { transform: rotateX(var(--booster-rx)) rotateY(var(--booster-ry)) rotateZ(var(--booster-rz)) scale(var(--booster-scale)) translateY(-2%); } 50% { transform: rotateX(var(--booster-rx)) rotateY(var(--booster-ry)) rotateZ(var(--booster-rz)) scale(var(--booster-scale)) translateY(1%); } 70% { transform: rotateX(var(--booster-rx)) rotateY(var(--booster-ry)) rotateZ(var(--booster-rz)) scale(var(--booster-scale)) translateY(-1%); } 100% { transform: rotateX(var(--booster-rx)) rotateY(var(--booster-ry)) rotateZ(var(--booster-rz)) scale(var(--booster-scale)) translateY(0%); } } @keyframes shrink { from { transform: rotateZ(-45deg) scale(var(--booster-scale)); opacity: 1; } to { transform: rotateZ(-270deg) scale(0); opacity: 0; } } [data-mode='booster']:is([data-state='ready'], [data-state='generating'], [data-state='completed']) .booster { display: block; } [data-state='ready'] .booster { animation: 5s bounce infinite ease-out; } [data-state='generating'] .scene { animation: 15s spin-x infinite linear; /* height: auto; */ transform-origin: center; } [data-state='generating'] .booster { animation: 3s spin-y infinite linear; transform-origin: center; cursor: default; } [data-mode='booster'][data-state='completed'] .booster { animation: 0.5s shrink ease-out forwards; } [data-mode='booster'][data-state='completed'] .card-slot { transform: scale(0); } [data-mode='card'][data-state='completed'] .booster { --booster-scale: 0; } [data-mode='card'][data-state='completed'] .card-slot { transform: scale(1); }