styles.css 7.2 KB

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