styles.css 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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. .center {
  99. text-align: center;
  100. margin-inline: auto;
  101. }
  102. .block-center {
  103. margin-block: auto;
  104. }
  105. .right {
  106. text-align: end;
  107. }
  108. .ellipsis {
  109. overflow: hidden;
  110. text-overflow: ellipsis;
  111. white-space: nowrap;
  112. }
  113. .margin-after {
  114. margin-block-end: 0.5rem;
  115. }
  116. .pill-shape {
  117. border-radius: 100vmax;
  118. }
  119. input.pill-shape {
  120. text-align: center;
  121. padding: 0.25rem 1ch;
  122. }
  123. .highlight-border {
  124. border: 1px solid var(--highlight);
  125. }
  126. @import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Math&display=swap");
  127. .math-font {
  128. font-family: "Noto Sans Math", sans-serif;
  129. }
  130. /* Block */
  131. body {
  132. color: var(--highlight);
  133. background-color: var(--background);
  134. accent-color: var(--highlight);
  135. transition: accent-color 250ms, color 250ms, background-color 250ms;
  136. display: grid;
  137. grid-template-columns: 14rem 1fr 7rem;
  138. }
  139. body > * + :not(:last-child) {
  140. border-inline-end: 1px solid var(--highlight);
  141. }
  142. hr {
  143. color: var(--highlight);
  144. }
  145. button,
  146. select,
  147. label,
  148. input[type="radio"],
  149. input[type="checkbox"] {
  150. cursor: pointer;
  151. }
  152. button {
  153. border-radius: 100vmax;
  154. padding-block: 0.25rem;
  155. border: 1px solid var(--highlight);
  156. transition: background-color 100ms;
  157. }
  158. button:hover {
  159. box-shadow: 0 0 4px 2px var(--shadow);
  160. }
  161. button.color-select {
  162. color: var(--highlight);
  163. background-color: var(--background);
  164. }
  165. button.color-select:hover {
  166. box-shadow: 0px 0px 4px 2px var(--shadow), inset 100vmax 100vmax rgb(255 255 255 / 0.2);
  167. }
  168. #prevColors button {
  169. width: 100%;
  170. margin-block-end: 0.5ch;
  171. }
  172. .color-inputs input[type="text"] {
  173. min-width: 0px;
  174. }
  175. .color-inputs input[type="color"] {
  176. flex: 0 0 2rem;
  177. }
  178. .color-inputs input[type="radio"] {
  179. display: none;
  180. }
  181. #cls-title,
  182. #cls-fn,
  183. #cls-metric-mount {
  184. transition: opacity 200ms;
  185. }
  186. [data-faded="true"] {
  187. opacity: 25%;
  188. }
  189. #color-results,
  190. #name-results {
  191. margin-inline-start: 1ch;
  192. }
  193. .toggle-label {
  194. padding: 0 0.625ch 0.125rem;
  195. opacity: 50%;
  196. transition: opacity 200ms, color 200ms, border-color 200ms, background-color 200ms;
  197. }
  198. :is(input[type="checkbox"], input[type="radio"]):checked + .toggle-label {
  199. opacity: 100%;
  200. background-color: var(--highlight);
  201. color: var(--background);
  202. border-color: var(--highlight);
  203. }
  204. /* Pokemon Tiles */
  205. .pkmn-tile {
  206. max-width: 24ch;
  207. padding-inline: 0.5ch;
  208. --tile-block-padding: 0.25rem;
  209. --tile-border-radius: 8px;
  210. transition: transform 250ms ease-out;
  211. }
  212. .pkmn-tile:hover .ellipsis {
  213. overflow: visible;
  214. width: fit-content;
  215. background-color: var(--background);
  216. box-shadow: 0px 0px 2px 4px var(--background);
  217. }
  218. .pkmn-tile .pkmn-info {
  219. /* no block-start padding here, this makes the
  220. images look like they go right up to the border */
  221. padding: 0 0.5ch var(--tile-block-padding);
  222. border-radius: var(--tile-border-radius);
  223. box-shadow: 4px 4px 2px var(--shadow);
  224. margin-block-start: 0.25rem;
  225. }
  226. .pkmn-tile .cluster-buttons {
  227. position: relative;
  228. --gap: 0.125rem;
  229. justify-content: center;
  230. /* but here we put the block-start padding back to
  231. fix the vertical centering of the cluster buttons */
  232. margin-block-start: var(--tile-block-padding);
  233. margin-inline-start: 0.5ch;
  234. padding-inline: 0.25ch;
  235. border-radius: var(--tile-border-radius);
  236. background-color: var(--shadow);
  237. box-shadow: 0px 0px 8px var(--shadow);
  238. }
  239. .pkmn-tile a {
  240. height: 64px;
  241. display: inline-flex;
  242. justify-content: center;
  243. align-items: center;
  244. }
  245. .pkmn-tile img {
  246. max-height: 100%;
  247. }
  248. .pkmn-tile button {
  249. font-size: 0.75rem;
  250. font-weight: 600;
  251. /* padding-block-start: 0.35rem; */
  252. padding-inline-start: 2ch;
  253. padding-inline-end: 1ch;
  254. }
  255. .pkmn-tile button[data-included="true"] {
  256. position: relative;
  257. }
  258. .pkmn-tile button[data-included="true"]::before {
  259. position: absolute;
  260. content: "·";
  261. inset: 50% auto auto 0.375ch;
  262. font-size: 1.5rem;
  263. /* slightly nicer than a normal vertical centering */
  264. transform: translateY(-48%);
  265. }
  266. .pkmn-tile :is(.cluster-info, .total-info) {
  267. visibility: hidden;
  268. position: absolute;
  269. opacity: 0%;
  270. inset: 100% auto auto 50%;
  271. transform: translateX(-50%);
  272. transition: visibility 200ms, opacity 200ms ease-out, transform 200ms ease-out;
  273. font-size: 0.75rem;
  274. grid-template-columns: repeat(3, 1fr);
  275. grid-auto-rows: min-content;
  276. column-gap: 0.5ch;
  277. row-gap: 0.125rem;
  278. padding: var(--tile-block-padding) 0.5ch;
  279. border-radius: var(--tile-border-radius);
  280. border: 1px solid var(--background);
  281. box-shadow: 2px 2px 2px var(--shadow);
  282. background-color: var(--highlight);
  283. color: var(--background);
  284. }
  285. .pkmn-tile .pkmn-data-separator {
  286. height: 1px;
  287. background-color: var(--background);
  288. }
  289. .pkmn-tile .pkmn-data-size {
  290. grid-column: 2 / -1;
  291. }
  292. .pkmn-tile:hover {
  293. z-index: 10;
  294. }
  295. .pkmn-tile button:hover + :is(.cluster-info, .total-info),
  296. :is(.cluster-info, .total-info):hover {
  297. visibility: visible;
  298. opacity: 100%;
  299. }
  300. @media (prefers-reduced-motion: no-preference) {
  301. .pkmn-tile:hover {
  302. /* TODO fix total */
  303. transform: scale(105%) translateX(-3%) translateY(-5%);
  304. }
  305. .pkmn-tile button:hover + :is(.cluster-info, .total-info) {
  306. transform: translateX(-50%) translateY(5%);
  307. }
  308. }
  309. /* Sort Function Controls */
  310. .fn-control .fn-minmax label span {
  311. padding: 0.125rem 0.75ch;
  312. }
  313. .fn-control .fn-body {
  314. --gap: 0.25ch;
  315. margin-block: 0.5rem;
  316. justify-content: center;
  317. align-items: center;
  318. }
  319. .fn-control :is(input[type="checkbox"], input[type="radio"]) {
  320. display: none;
  321. }
  322. .fn-control .toggle-label:first-child {
  323. /* only affects the fake label on the cluster function */
  324. opacity: inherit;
  325. color: inherit;
  326. background-color: inherit;
  327. border: none;
  328. padding: 0;
  329. }
  330. .fn-fraction > *:first-child {
  331. /* this feels a little fragile */
  332. padding-bottom: 6px;
  333. margin-bottom: 4px;
  334. border-block-end: 1px solid var(--highlight);
  335. }
  336. /* Metric Controls */
  337. .metric-fields {
  338. border: none;
  339. }
  340. .metric-fields :is(select:disabled, input[type="radio"]) {
  341. display: none;
  342. }
  343. .metric-fields select {
  344. width: 100%;
  345. padding: 0.25rem 1ch;
  346. }