styles.css 7.3 KB

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