styles.css 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  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: 20ch 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: 16ch;
  189. }
  190. #cls-title,
  191. #cls-fn,
  192. #cls-metric-mount {
  193. transition: opacity 200ms;
  194. }
  195. [data-faded="true"] {
  196. opacity: 25%;
  197. }
  198. #color-results,
  199. #name-results {
  200. margin-inline-start: 1ch;
  201. }
  202. .toggle-label {
  203. padding: 0 0.625ch 0.125rem;
  204. opacity: 50%;
  205. transition: opacity 200ms, color 200ms, border-color 200ms, background-color 200ms;
  206. }
  207. :is(input[type="checkbox"], input[type="radio"]):checked + .toggle-label {
  208. opacity: 100%;
  209. background-color: var(--highlight);
  210. color: var(--background);
  211. border-color: var(--highlight);
  212. }
  213. /* Pokemon Tiles */
  214. .pkmn-tile {
  215. position: relative;
  216. width: 32ch;
  217. padding-inline: 0.5ch;
  218. --tile-block-padding: 0.25rem;
  219. --tile-border-radius: 8px;
  220. transition: transform 250ms ease-out;
  221. }
  222. .pkmn-tile .pkmn-title {
  223. justify-content: space-between;
  224. align-items: center;
  225. }
  226. .pkmn-tile .pkmn-info-icon {
  227. cursor: default;
  228. }
  229. .pkmn-tile:hover .ellipsis {
  230. overflow: visible;
  231. width: fit-content;
  232. background-color: var(--background);
  233. box-shadow: 0px 0px 2px 4px var(--background);
  234. }
  235. .pkmn-tile .pkmn-info {
  236. /* no block-start padding here, this makes the
  237. images look like they go right up to the border */
  238. padding: 0 0.5ch var(--tile-block-padding);
  239. border-radius: var(--tile-border-radius);
  240. box-shadow: 4px 4px 2px var(--shadow);
  241. margin-block-start: 0.25rem;
  242. }
  243. .pkmn-tile .pkmn-info-main {
  244. flex: 1;
  245. --gap: 0.125rem;
  246. }
  247. .pkmn-tile .cluster-buttons {
  248. --gap: 0.125rem;
  249. justify-content: center;
  250. /* but here we put the block-start padding back to
  251. fix the vertical centering of the cluster buttons */
  252. margin-block-start: var(--tile-block-padding);
  253. margin-inline-start: 0.5ch;
  254. padding-inline: 0.25ch;
  255. border-radius: var(--tile-border-radius);
  256. background-color: var(--shadow);
  257. box-shadow: 0px 0px 8px var(--shadow);
  258. }
  259. .pkmn-tile a {
  260. height: 64px;
  261. display: inline-flex;
  262. justify-content: center;
  263. align-items: center;
  264. }
  265. .pkmn-tile img {
  266. max-height: 100%;
  267. }
  268. .pkmn-tile .pkmn-score-row {
  269. flex-wrap: wrap;
  270. justify-content: space-around;
  271. align-items: center;
  272. }
  273. .pkmn-tile button {
  274. font-size: 0.75rem;
  275. font-weight: 600;
  276. padding: 0.125rem 1ch 0.125rem 2ch;
  277. white-space: nowrap;
  278. flex: 1;
  279. }
  280. .pkmn-tile button[data-included="true"] {
  281. position: relative;
  282. }
  283. .pkmn-tile button[data-included="true"]::before {
  284. position: absolute;
  285. content: "·";
  286. inset: 50% auto auto 0.375ch;
  287. font-size: 1.5rem;
  288. /* slightly nicer than a normal vertical centering */
  289. transform: translateY(-48%);
  290. }
  291. .pkmn-tile .color-select[hidden] + .pkmn-info-icon {
  292. display: none;
  293. }
  294. .pkmn-tile .pkmn-info-detail {
  295. position: absolute;
  296. inset: 100% 50% auto auto;
  297. visibility: hidden;
  298. opacity: 0%;
  299. transform: translateX(45%);
  300. transition: visibility 200ms, opacity 200ms ease-out, transform 200ms ease-out;
  301. font-size: 0.75rem;
  302. width: 32ch;
  303. grid-template-columns: repeat(3, 1fr);
  304. grid-auto-rows: min-content;
  305. column-gap: 0.5ch;
  306. row-gap: 0.125rem;
  307. padding: var(--tile-block-padding) 0.5ch;
  308. border-radius: var(--tile-border-radius);
  309. border: 1px solid var(--background);
  310. box-shadow: 2px 2px 2px var(--shadow);
  311. background-color: var(--highlight);
  312. color: var(--background);
  313. }
  314. .pkmn-info-detail:not(:empty):hover,
  315. .pkmn-tile[data-info="show-infoHover"] .pkmn-info-detail:not(:empty):nth-child(1),
  316. .pkmn-tile[data-info="show-infoHover1"] .pkmn-info-detail:not(:empty):nth-child(2),
  317. .pkmn-tile[data-info="show-infoHover2"] .pkmn-info-detail:not(:empty):nth-child(3),
  318. .pkmn-tile[data-info="show-infoHover3"] .pkmn-info-detail:not(:empty):nth-child(4),
  319. .pkmn-tile[data-info="show-infoHover4"] .pkmn-info-detail:not(:empty):nth-child(5) {
  320. visibility: visible;
  321. opacity: 100%;
  322. transform: translateX(50%) translateY(5%);
  323. }
  324. .pkmn-tile .pkmn-data-separator {
  325. height: 1px;
  326. background-color: var(--background);
  327. }
  328. .pkmn-tile .pkmn-data-wide {
  329. grid-column: 1 / 3;
  330. }
  331. .pkmn-tile:hover {
  332. z-index: 10;
  333. }
  334. @media (prefers-reduced-motion: no-preference) {
  335. .pkmn-tile:hover {
  336. transform: scale(105%) translateX(-3%) translateY(-5%);
  337. }
  338. }
  339. /* Sort Function Controls */
  340. .fn-control .fn-minmax label span {
  341. padding: 0.125rem 0.75ch;
  342. }
  343. .fn-control .fn-body {
  344. --gap: 0.25ch;
  345. margin-block: 0.5rem;
  346. justify-content: center;
  347. align-items: center;
  348. }
  349. .fn-control :is(input[type="checkbox"], input[type="radio"]) {
  350. display: none;
  351. }
  352. .fn-control .toggle-label:first-child {
  353. /* only affects the fake label on the cluster function */
  354. opacity: inherit;
  355. color: inherit;
  356. background-color: inherit;
  357. border: none;
  358. padding: 0;
  359. }
  360. .fn-fraction > *:first-child {
  361. /* this feels a little fragile */
  362. padding-bottom: 6px;
  363. margin-bottom: 4px;
  364. border-block-end: 1px solid var(--highlight);
  365. }
  366. /* Metric Controls */
  367. .metric-fields {
  368. border: none;
  369. }
  370. .metric-fields :is(select:disabled, input[type="radio"]) {
  371. display: none;
  372. }
  373. .metric-fields select {
  374. width: 100%;
  375. padding: 0.25rem 1ch;
  376. }