styles.css 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. /* Reset */
  2. *,
  3. *::before,
  4. *::after {
  5. box-sizing: border-box;
  6. }
  7. * {
  8. margin: 0;
  9. padding: 0;
  10. }
  11. html {
  12. color-scheme: dark light;
  13. }
  14. body {
  15. min-height: 100vh;
  16. }
  17. img,
  18. picture,
  19. video,
  20. canvas,
  21. svg {
  22. display: block;
  23. max-width: 100%;
  24. }
  25. input,
  26. button,
  27. textarea,
  28. select {
  29. font: inherit;
  30. }
  31. /* Colors */
  32. :root {
  33. --color-dark: #1f2123;
  34. --color-light: #e8e6e3;
  35. }
  36. :root {
  37. /* separated since these are used by the actual script */
  38. --highlight: var(--color-light);
  39. --background: var(--color-dark);
  40. --shadow-component: 255;
  41. --shadow: rgb(
  42. var(--shadow-component),
  43. var(--shadow-component),
  44. var(--shadow-component),
  45. 0.2
  46. );
  47. }
  48. /* Font */
  49. body {
  50. font-family: Arial, Helvetica, sans-serif;
  51. }
  52. /* Composition */
  53. .flex {
  54. display: flex;
  55. gap: var(--gap, 1rem);
  56. }
  57. .even {
  58. justify-content: space-between;
  59. align-items: stretch;
  60. }
  61. .wrap {
  62. flex-wrap: wrap;
  63. }
  64. .col {
  65. flex-direction: column;
  66. }
  67. .grid {
  68. display: grid;
  69. gap: var(--gap, 1rem);
  70. }
  71. .full-grid-row {
  72. grid-column: 1 / -1;
  73. }
  74. .flow > * + * {
  75. margin-block-start: var(--flow-space, 1rem);
  76. }
  77. .no-gap {
  78. --gap: 0px;
  79. }
  80. .small-gap {
  81. --gap: 0.5rem;
  82. }
  83. .big-gap {
  84. --gap: 1.5rem;
  85. }
  86. .small-flow-space {
  87. --flow-space: 0.5rem;
  88. }
  89. .section {
  90. padding-block-start: var(--flow-space, 1rem);
  91. padding-inline: var(--flow-space-inline, 1ch);
  92. }
  93. /* Utility */
  94. .emphasis {
  95. font-size: 1.125rem;
  96. font-weight: 600;
  97. }
  98. .smaller {
  99. font-size: 0.875rem;
  100. }
  101. .smallest {
  102. font-size: 0.75rem;
  103. }
  104. .center {
  105. text-align: center;
  106. margin-inline: auto;
  107. }
  108. .block-center {
  109. margin-block: auto;
  110. }
  111. .right {
  112. text-align: end;
  113. }
  114. .ellipsis {
  115. overflow: hidden;
  116. text-overflow: ellipsis;
  117. white-space: nowrap;
  118. }
  119. .margin-after {
  120. margin-block-end: 0.5rem;
  121. }
  122. .pill-shape {
  123. border-radius: 100vmax;
  124. }
  125. input.pill-shape {
  126. text-align: center;
  127. padding: 0.25rem 1ch;
  128. }
  129. .highlight-border {
  130. border: 1px solid var(--highlight);
  131. }
  132. @import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Math&display=swap");
  133. .math-font {
  134. font-family: "Noto Sans Math", sans-serif;
  135. }
  136. /* Block */
  137. body {
  138. color: var(--highlight);
  139. background-color: var(--background);
  140. accent-color: var(--highlight);
  141. transition: accent-color 250ms, color 250ms, background-color 250ms;
  142. display: grid;
  143. grid-template-columns: 24ch 1fr 12ch;
  144. }
  145. body > * + :not(:last-child) {
  146. border-inline-end: 1px solid var(--highlight);
  147. }
  148. hr {
  149. color: var(--highlight);
  150. }
  151. button,
  152. select,
  153. label,
  154. input[type="radio"],
  155. input[type="checkbox"] {
  156. cursor: pointer;
  157. }
  158. button {
  159. border-radius: 100vmax;
  160. padding-block: 0.25rem;
  161. border: 1px solid var(--highlight);
  162. transition: background-color 100ms;
  163. }
  164. button:hover {
  165. box-shadow: 0 0 4px 2px var(--shadow);
  166. }
  167. button.color-select {
  168. color: var(--highlight);
  169. background-color: var(--background);
  170. }
  171. button.color-select:hover {
  172. box-shadow: 0px 0px 4px 2px var(--shadow), inset 100vmax 100vmax rgb(255 255 255 / 0.2);
  173. }
  174. #prevColors button {
  175. width: 100%;
  176. margin-block-end: 0.5ch;
  177. }
  178. .color-inputs input[type="text"] {
  179. min-width: 0px;
  180. }
  181. .color-inputs input[type="color"] {
  182. flex: 0 0 2rem;
  183. }
  184. .color-inputs input[type="radio"] {
  185. display: none;
  186. }
  187. input[name="resultsToDisplay"] {
  188. width: 18ch;
  189. }
  190. #cls-title,
  191. #cls-fn,
  192. #cls-metric-mount {
  193. transition: opacity 200ms;
  194. }
  195. #cls-fn {
  196. justify-content: center;
  197. align-items: center;
  198. margin: 0;
  199. }
  200. #cls-fn .fn-minmax {
  201. align-items: center;
  202. }
  203. [data-faded="true"] {
  204. opacity: 25%;
  205. }
  206. #color-results,
  207. #name-results {
  208. margin-inline-start: 1ch;
  209. }
  210. .toggle-label {
  211. padding: 0 0.625ch 0.125rem;
  212. opacity: 50%;
  213. transition: opacity 200ms, color 200ms, border-color 200ms, background-color 200ms;
  214. }
  215. :is(input[type="checkbox"], input[type="radio"]):checked + .toggle-label {
  216. opacity: 100%;
  217. background-color: var(--highlight);
  218. color: var(--background);
  219. border-color: var(--highlight);
  220. }
  221. /* Pokemon Tiles */
  222. .pkmn-tile {
  223. position: relative;
  224. width: 32ch;
  225. padding-inline: 0.5ch;
  226. --tile-block-padding: 0.25rem;
  227. --tile-border-radius: 8px;
  228. transition: transform 250ms ease-out;
  229. }
  230. .pkmn-tile .pkmn-title {
  231. justify-content: space-between;
  232. align-items: center;
  233. }
  234. .pkmn-tile .pkmn-info-icon {
  235. cursor: default;
  236. }
  237. .pkmn-tile:hover .ellipsis {
  238. overflow: visible;
  239. width: fit-content;
  240. background-color: var(--background);
  241. box-shadow: 0px 0px 2px 4px var(--background);
  242. }
  243. .pkmn-tile .pkmn-info {
  244. /* no block-start padding here, this makes the
  245. images look like they go right up to the border */
  246. padding: 0 0.5ch var(--tile-block-padding);
  247. border-radius: var(--tile-border-radius);
  248. box-shadow: 4px 4px 2px var(--shadow);
  249. margin-block-start: 0.25rem;
  250. height: 100%;
  251. }
  252. .pkmn-tile .pkmn-info-main {
  253. flex: 1;
  254. --gap: 0.125rem;
  255. }
  256. .pkmn-tile .cluster-buttons {
  257. --gap: 0.125rem;
  258. justify-content: center;
  259. /* but here we put the block-start padding back to
  260. fix the vertical centering of the cluster buttons */
  261. margin-block-start: var(--tile-block-padding);
  262. margin-inline-start: 0.5ch;
  263. padding-inline: 0.25ch;
  264. border-radius: var(--tile-border-radius);
  265. background-color: var(--shadow);
  266. box-shadow: 0px 0px 8px var(--shadow);
  267. }
  268. .pkmn-tile a {
  269. height: 64px;
  270. display: inline-flex;
  271. justify-content: center;
  272. align-items: center;
  273. }
  274. .pkmn-tile img {
  275. max-height: 100%;
  276. }
  277. .pkmn-tile .pkmn-score-row {
  278. flex-wrap: wrap;
  279. justify-content: space-around;
  280. align-items: center;
  281. }
  282. .pkmn-tile button {
  283. font-size: 0.75rem;
  284. font-weight: 600;
  285. padding: 0.125rem 1ch 0.125rem 2ch;
  286. white-space: nowrap;
  287. flex: 1;
  288. }
  289. .pkmn-tile button[data-included="true"] {
  290. position: relative;
  291. }
  292. .pkmn-tile button[data-included="true"]::before {
  293. position: absolute;
  294. content: "·";
  295. inset: 50% auto auto 0.375ch;
  296. font-size: 1.5rem;
  297. /* slightly nicer than a normal vertical centering */
  298. transform: translateY(-48%);
  299. }
  300. .pkmn-tile .color-select[hidden] + .pkmn-info-icon {
  301. display: none;
  302. }
  303. .pkmn-tile .pkmn-info-detail {
  304. position: absolute;
  305. inset: 100% 50% auto auto;
  306. visibility: hidden;
  307. opacity: 0%;
  308. transform: translateX(45%);
  309. transition: visibility 200ms, opacity 200ms ease-out, transform 200ms ease-out;
  310. font-size: 0.75rem;
  311. width: 32ch;
  312. grid-template-columns: repeat(3, 1fr);
  313. grid-auto-rows: min-content;
  314. column-gap: 0.5ch;
  315. row-gap: 0.125rem;
  316. padding: var(--tile-block-padding) 0.5ch;
  317. border-radius: var(--tile-border-radius);
  318. border: 1px solid var(--background);
  319. box-shadow: 2px 2px 2px var(--shadow);
  320. background-color: var(--highlight);
  321. color: var(--background);
  322. }
  323. .pkmn-info-detail:not(:empty):hover,
  324. .pkmn-tile[data-info="show-infoHover"] .pkmn-info-detail:not(:empty):nth-child(1),
  325. .pkmn-tile[data-info="show-infoHover1"] .pkmn-info-detail:not(:empty):nth-child(2),
  326. .pkmn-tile[data-info="show-infoHover2"] .pkmn-info-detail:not(:empty):nth-child(3),
  327. .pkmn-tile[data-info="show-infoHover3"] .pkmn-info-detail:not(:empty):nth-child(4),
  328. .pkmn-tile[data-info="show-infoHover4"] .pkmn-info-detail:not(:empty):nth-child(5) {
  329. visibility: visible;
  330. opacity: 100%;
  331. transform: translateX(50%) translateY(5%);
  332. }
  333. .pkmn-tile .pkmn-data-separator {
  334. height: 1px;
  335. background-color: var(--background);
  336. }
  337. .pkmn-tile .pkmn-data-wide {
  338. grid-column: 1 / 3;
  339. }
  340. .pkmn-tile:hover {
  341. z-index: 10;
  342. }
  343. @media (prefers-reduced-motion: no-preference) {
  344. .pkmn-tile:hover {
  345. transform: scale(105%) translateX(-3%) translateY(-5%);
  346. }
  347. }
  348. /* Sort Function Controls */
  349. .fn-control .fn-minmax label span {
  350. padding: 0.125rem 0.75ch;
  351. }
  352. .fn-control .fn-body {
  353. --gap: 0.25ch;
  354. margin-block: 0.5rem;
  355. justify-content: center;
  356. align-items: center;
  357. }
  358. .fn-control :is(input[type="checkbox"], input[type="radio"]) {
  359. display: none;
  360. }
  361. .fn-control .toggle-label:first-child {
  362. /* only affects the fake label on the cluster function */
  363. opacity: inherit;
  364. color: inherit;
  365. background-color: inherit;
  366. border: none;
  367. padding: 0;
  368. }
  369. .fn-fraction > *:first-child {
  370. /* this feels a little fragile */
  371. padding-bottom: 6px;
  372. margin-bottom: 4px;
  373. border-block-end: 1px solid var(--highlight);
  374. }
  375. /* Metric Controls */
  376. .metric-fields {
  377. border: none;
  378. }
  379. .metric-fields :is(select:disabled, input[type="radio"]) {
  380. display: none;
  381. }
  382. .metric-fields select {
  383. width: 100%;
  384. padding: 0.25rem 1ch;
  385. }