pokerogue/index.css

408 lines
8.9 KiB
CSS
Raw Normal View History

/* Global */
2023-12-25 20:03:50 +00:00
:root {
--color-base: hsl(0, 0%, 55%);
--color-light: hsl(0, 0%, 90%);
--color-dark: hsl(0, 0%, 10%);
}
html {
touch-action: none;
}
body {
margin: 0;
display:flex;
flex-direction: column;
align-items: center;
2023-12-25 20:03:50 +00:00
background: #484050;
}
@media (display-mode: fullscreen) {
body {
background: #000000;
}
}
2023-12-25 20:03:50 +00:00
#app {
display: flex;
justify-content: center;
2024-10-19 08:31:03 +01:00
align-items: center;
2023-12-25 20:03:50 +00:00
}
2023-12-30 23:41:25 +00:00
#app > div:first-child {
2024-10-19 08:31:03 +01:00
transform-origin: center !important;
}
/*
Supports automatic vertical centering as suggested in PR#1114, but only via CSS
Condition factorized to deduce CSS rules:
true if (isLandscape && !isMobile() && !hasTouchscreen() || (hasTouchscreen() && !isTouchControlsEnabled))
*/
/* isLandscape && !isMobile() && !hasTouchscreen() */
@media (orientation: landscape) and (pointer: fine) {
#app {
align-items: center;
}
}
@media (pointer: coarse) {
/* hasTouchscreen() && !isTouchControlsEnabled */
body:has(> #touchControls[class=visible]) #app {
align-items: start;
}
body:has(> #touchControls[class=visible]) #app > div:first-child {
transform-origin: top !important;
}
2023-12-30 23:41:25 +00:00
}
#layout:fullscreen #dpad, #layout:fullscreen {
bottom: 6rem;
}
input:-internal-autofill-selected {
-webkit-background-clip: text;
background-clip: text;
}
/* Need adjust input font-size */
input {
font-size: 3.2rem;
}
.hidden {
display: none !important;
2023-12-25 20:03:50 +00:00
}
input:-internal-autofill-selected {
-webkit-background-clip: text;
background-clip: text;
2023-12-25 20:03:50 +00:00
}
/* Touch Controls: */
#touchControls {
--text-shadow-size: 0.65vh;
--controls-size: 10vh;
--touch-control-opacity: 0.6;
--controls-padding: 1rem;
--controls-size-with-padding: calc(var(--controls-size) + var(--controls-padding));
--controls-size-with-wide-padding: calc(var(--controls-size) *1.2 + var(--controls-padding));
--control-group-extra-size: calc(var(--controls-size) * 0.8);
--control-group-extra-wide-size: calc(var(--controls-size) * 1.2);
--control-group-extra-2-offset: calc(var(--controls-size-with-padding) + (var(--controls-size) - var(--control-group-extra-size)) / 2);
--control-group-extra-1-offset: calc(var(--controls-padding) + (var(--controls-size) - var(--control-group-extra-size)) / 2);
--small-control-size: calc(var(--controls-size) / 3);
--rect-control-size: calc(var(--controls-size) * 0.74);
font-family: 'emerald';
font-size: var(--controls-size);
text-shadow: var(--color-dark) var(--text-shadow-size) var(--text-shadow-size);
color: var(--color-light);
}
@media (orientation: landscape) {
#touchControls {
--controls-size: 20vh;
--text-shadow-size: 1.3vh;
--small-button-offset: 4vh;
2024-04-09 04:22:15 +01:00
}
}
#touchControls:not(.visible) {
display: none;
2023-12-25 20:03:50 +00:00
}
#touchControls .active {
opacity: var(--touch-control-opacity);
2023-12-25 20:03:50 +00:00
}
.control-group {
position: fixed;
display: flex;
flex-wrap: wrap;
justify-content: space-around;
align-items: center;
width: var(--controls-size);
}
.control-group-dpad {
2023-12-25 20:03:50 +00:00
width: calc(2 * var(--controls-size));
height: calc(2 * var(--controls-size));
}
.control-group-extra {
width: var(--control-group-extra-size);
height: var(--control-group-extra-size);
2023-12-25 20:03:50 +00:00
}
/* Hide buttons on specific UIs */
2023-12-25 20:03:50 +00:00
/* Show #apadPreviousTab and #apadNextTab only in settings, except in touch configuration panel */
#touchControls:not([data-ui-mode^='SETTINGS']) #apadPreviousTab,
#touchControls:not([data-ui-mode^='SETTINGS']) #apadNextTab,
#touchControls:is(.config-mode) #apadPreviousTab,
#touchControls:is(.config-mode) #apadNextTab {
display: none;
2023-12-25 20:03:50 +00:00
}
/* Show #apadInfo only in battle */
#touchControls:not([data-ui-mode='COMMAND']):not([data-ui-mode='FIGHT']):not([data-ui-mode='BALL']):not([data-ui-mode='TARGET_SELECT']) #apadInfo {
display: none;
2023-12-25 20:03:50 +00:00
}
/* Show #apadStats only in battle and shop */
#touchControls:not([data-ui-mode='COMMAND']):not([data-ui-mode='FIGHT']):not([data-ui-mode='BALL']):not([data-ui-mode='TARGET_SELECT']):not([data-ui-mode='MODIFIER_SELECT']) #apadStats {
display: none;
}
/* Show cycle buttons only on STARTER_SELECT and on touch configuration panel */
#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT']) #apadOpenFilters,
#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT'], [data-ui-mode='RUN_INFO']) #apadCycleForm,
#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT'], [data-ui-mode='RUN_INFO']) #apadCycleShiny,
#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT']) #apadCycleNature,
#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT'], [data-ui-mode='RUN_INFO']) #apadCycleAbility,
#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT']) #apadCycleGender,
#touchControls:not(.config-mode):not([data-ui-mode='STARTER_SELECT']) #apadCycleVariant {
display: none;
}
/* Configuration toolbar */
#configToolbar {
width: 100%;
position: fixed;
top: 1rem;
left: 0;
z-index: 9;
2023-12-25 20:03:50 +00:00
user-select: none;
}
#configToolbar .column {
display: flex;
flex-direction: column;
align-items: center;
gap: 10%;
padding: 0 var(--controls-padding);
2023-12-25 20:03:50 +00:00
}
#configToolbar .button-row {
display: flex;
justify-content: space-evenly;
width: 100%;
2023-12-25 20:03:50 +00:00
}
#configToolbar .info-row {
display: flex;
justify-content: flex-start;
width: 100%;
2023-12-25 20:03:50 +00:00
}
#configToolbar .button {
z-index: 3;
background-color: var(--color-base);
display: flex;
justify-content: center;
align-items: center;
2024-01-06 03:24:05 +00:00
text-align: center;
2023-12-25 20:03:50 +00:00
border-radius: 10%;
height: var(--small-control-size);
font-size: var(--small-control-size);
border-radius: 8px;
padding: 2px 8px;
text-shadow: var(--color-dark) calc(var(--text-shadow-size) / 3) calc(var(--text-shadow-size) / 3);
2023-12-25 20:03:50 +00:00
}
#configToolbar .button:active {
opacity: var(--touch-control-opacity)
2023-12-25 20:03:50 +00:00
}
#configToolbar .orientation-label {
font-size: var(--small-control-size);
text-shadow: var(--color-dark) calc(var(--text-shadow-size) / 3) calc(var(--text-shadow-size) / 3);
2024-01-06 03:24:05 +00:00
}
/* dpad */
#dpad {
z-index: 3;
opacity: 0.8;
2024-01-06 03:24:05 +00:00
}
#dpad svg {
width: calc(2 * var(--controls-size));
height: calc(2 * var(--controls-size));
fill: var(--color-base);
}
/* apad buttons */
.apad-button {
background-color: var(--color-base);
border-radius: 50%;
display: flex;
justify-content: center;
2023-12-25 20:03:50 +00:00
align-items: center;
right: 0;
bottom: 0;
width: var(--controls-size);
height: var(--controls-size);
opacity: 0.8;
border-radius: 8px;
2023-12-25 20:03:50 +00:00
}
.apad-small {
width: var(--small-control-size);
height: var(--small-control-size);
2024-01-06 03:24:05 +00:00
}
.apad-label {
user-select: none;
height: 100%;
margin-right: -2px;
2024-04-19 03:52:26 +01:00
}
.apad-small > .apad-label {
font-size: var(--small-control-size);
text-shadow: var(--color-dark) calc(var(--text-shadow-size) / 3) calc(var(--text-shadow-size) / 3);
2023-12-25 20:03:50 +00:00
}
.apad-rectangle {
text-align: center;
width: var(--rect-control-size);
height: var(--small-control-size);
}
.apad-square {
width: var(--small-control-size);
height: var(--small-control-size);
2024-05-01 04:02:16 +01:00
}
.apad-circle {
width: var(--controls-size);
height: var(--controls-size);
border-radius: 50%;
2023-12-25 20:03:50 +00:00
}
/* Defaults:*/
#control-group-dpad {
left: var(--controls-padding);
bottom: var(--controls-padding);
2023-12-25 20:03:50 +00:00
}
#control-group-action {
right: var(--controls-padding);
bottom: var(--controls-size-with-padding);
2023-12-25 20:03:50 +00:00
}
#control-group-cancel {
right: var(--controls-size-with-wide-padding);
bottom: var(--controls-padding);
}
#control-group-extra-1 {
right: var(--control-group-extra-1-offset);
bottom: var(--control-group-extra-1-offset);
}
#control-group-extra-2 {
width: var(--control-group-extra-wide-size);
right: var(--control-group-extra-2-offset);
bottom: var(--control-group-extra-2-offset);
}
/* Layout */
2023-12-25 20:03:50 +00:00
#layout:fullscreen #dpad, #layout:fullscreen #apad {
bottom: 6rem;
}
input:-internal-autofill-selected {
-webkit-background-clip: text;
2024-02-20 05:02:44 +00:00
background-clip: text;
}
#banner {
display: none;
position: absolute;
top: 33.2%;
left: 0;
text-align: center;
z-index: 1000; /* Ensures the banner is on top of other elements */
& > img {
opacity: 50%;
}
}
#tnc-links {
font-size: xx-small;
position: relative;
}
a {
color: #328cea;
margin-right: 4px;
margin-left: 4px;
}
/* Firefox old*/
@-moz-keyframes blink {
0% {
opacity:1;
}
50% {
opacity:0;
}
100% {
opacity:1;
}
}
@-webkit-keyframes blink {
0% {
opacity:1;
}
50% {
opacity:0;
}
100% {
opacity:1;
}
}
/* IE */
@-ms-keyframes blink {
0% {
opacity:1;
}
50% {
opacity:0;
}
100% {
opacity:1;
}
}
/* Opera and prob css3 final iteration */
@keyframes blink {
0% {
opacity:1;
}
50% {
opacity:0;
}
100% {
opacity:1;
}
}
.blink-image {
-moz-animation: blink normal 4s infinite ease-in-out; /* Firefox */
-webkit-animation: blink normal 4s infinite ease-in-out; /* Webkit */
-ms-animation: blink normal 4s infinite ease-in-out; /* IE */
animation: blink normal 4s infinite ease-in-out; /* Opera and prob css3 final iteration */
}