styles.css 7.2 KB

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