styles.css 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  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. .iflex {
  58. display: inline-flex;
  59. }
  60. .center-content {
  61. justify-content: center;
  62. }
  63. .center-items {
  64. align-items: center;
  65. }
  66. .even {
  67. justify-content: space-between;
  68. align-items: stretch;
  69. }
  70. .wrap {
  71. flex-wrap: wrap;
  72. }
  73. .col {
  74. flex-direction: column;
  75. }
  76. .grid {
  77. display: grid;
  78. gap: var(--gap, 1rem);
  79. }
  80. .full-grid-row {
  81. grid-column: 1 / -1;
  82. }
  83. .flow > * + * {
  84. margin-block-start: var(--flow-space, 1rem);
  85. }
  86. [data-flexGap="none"] {
  87. --gap: 0px;
  88. }
  89. [data-flexGap="normal"] {
  90. --gap: 1rem;
  91. }
  92. [data-flexGap="smaller"] {
  93. --gap: 0.125rem;
  94. }
  95. [data-flexGap="small"] {
  96. --gap: 0.5rem;
  97. }
  98. [data-flexGap="big"] {
  99. --gap: 1.5rem;
  100. }
  101. [data-flowSpace="small"] {
  102. --flow-space: 0.5rem;
  103. }
  104. .section {
  105. padding-block-start: 0.5rem;
  106. padding-inline: 1ch;
  107. }
  108. /* Utility */
  109. .emphasis {
  110. font-size: 1.125rem;
  111. font-weight: 600;
  112. }
  113. .smaller {
  114. font-size: 0.875rem;
  115. }
  116. .smallest {
  117. font-size: 0.75rem;
  118. }
  119. .center {
  120. text-align: center;
  121. margin-inline: auto;
  122. }
  123. .block-center {
  124. margin-block: auto;
  125. }
  126. .right {
  127. text-align: end;
  128. }
  129. .ellipsis {
  130. overflow: hidden;
  131. text-overflow: ellipsis;
  132. white-space: nowrap;
  133. }
  134. .margin-after {
  135. margin-block-end: 0.5rem;
  136. }
  137. .pill-shape {
  138. border-radius: 100vmax;
  139. }
  140. input.pill-shape {
  141. text-align: center;
  142. padding: 0.25rem 1ch;
  143. }
  144. .highlight-border {
  145. border: 1px solid var(--highlight);
  146. }
  147. .aspect-even {
  148. height: auto;
  149. width: auto;
  150. aspect-ratio: 1 / 1;
  151. }
  152. .aspect-tall {
  153. height: auto;
  154. width: auto;
  155. aspect-ratio: 1 / 3;
  156. }
  157. .aspect-wide {
  158. height: auto;
  159. width: auto;
  160. aspect-ratio: 3 / 1;
  161. }
  162. @import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Math&display=swap");
  163. .math-font {
  164. font-family: "Noto Sans Math", sans-serif;
  165. }
  166. /* Block */
  167. body {
  168. color: var(--highlight);
  169. background-color: var(--background);
  170. accent-color: var(--highlight);
  171. transition: accent-color 250ms, color 250ms, background-color 250ms;
  172. display: grid;
  173. grid-template-columns: 1fr 12ch;
  174. }
  175. body > * + :not(:last-child) {
  176. border-inline-end: 1px solid var(--highlight);
  177. }
  178. hr {
  179. color: var(--highlight);
  180. }
  181. button,
  182. select,
  183. label,
  184. input[type="radio"],
  185. input[type="checkbox"] {
  186. cursor: pointer;
  187. }
  188. button {
  189. border-radius: 100vmax;
  190. padding-block: 0.25rem;
  191. border: none;
  192. transition: background-color 100ms;
  193. }
  194. button:hover {
  195. box-shadow: 0 0 4px 2px var(--shadow);
  196. }
  197. button.color-select {
  198. color: var(--highlight);
  199. background-color: var(--background);
  200. }
  201. button.color-select:hover {
  202. box-shadow: 0px 0px 4px 2px var(--shadow), inset 100vmax 100vmax rgb(255 255 255 / 0.2);
  203. }
  204. #prevColors button {
  205. width: 100%;
  206. margin-block-end: 0.5ch;
  207. }
  208. #cls-fn {
  209. overflow: hidden;
  210. transition: max-width 400ms ease-in-out, opacity 500ms, visibility 500ms;
  211. }
  212. [data-faded="true"] {
  213. opacity: 0;
  214. max-width: 0;
  215. visibility: hidden;
  216. }
  217. [data-faded="false"] {
  218. opacity: 1;
  219. max-width: 50ch;
  220. visibility: visible;
  221. }
  222. .toggle-label {
  223. white-space: nowrap;
  224. padding: 0 0.625ch;
  225. opacity: 50%;
  226. transition: opacity 200ms, color 200ms, border-color 200ms, background-color 200ms;
  227. }
  228. :is(input[type="checkbox"], input[type="radio"]):checked + .toggle-label {
  229. opacity: 100%;
  230. background-color: var(--highlight);
  231. color: var(--background);
  232. border-color: var(--highlight);
  233. }
  234. /* Pokemon Tiles */
  235. .pkmn-tile {
  236. position: relative;
  237. width: 32ch;
  238. padding-inline: 0.5ch;
  239. --tile-block-padding: 0.25rem;
  240. --tile-border-radius: 8px;
  241. transition: transform 250ms ease-out;
  242. }
  243. .pkmn-tile .pkmn-title {
  244. justify-content: space-between;
  245. }
  246. .pkmn-tile .pkmn-info-icon {
  247. cursor: default;
  248. }
  249. .pkmn-tile:hover .ellipsis {
  250. overflow: visible;
  251. width: fit-content;
  252. background-color: transparent;
  253. }
  254. .pkmn-tile .pkmn-info {
  255. /* no block-start padding here, this makes the
  256. images look like they go right up to the border */
  257. padding: 0 0.5ch var(--tile-block-padding);
  258. border-radius: var(--tile-border-radius);
  259. box-shadow: 4px 4px 2px var(--shadow);
  260. margin-block-start: 0.25rem;
  261. height: 100%;
  262. }
  263. .pkmn-tile .pkmn-info-main {
  264. flex: 1;
  265. }
  266. .pkmn-tile .cluster-buttons {
  267. /* but here we put the block-start padding back to
  268. fix the vertical centering of the cluster buttons */
  269. margin-block-start: var(--tile-block-padding);
  270. margin-inline-start: 0.5ch;
  271. padding: var(--gap) 0.25ch;
  272. border-radius: var(--tile-border-radius);
  273. background-color: var(--shadow);
  274. box-shadow: 0px 0px 8px var(--shadow);
  275. }
  276. .pkmn-tile a {
  277. height: 64px;
  278. }
  279. .pkmn-tile img {
  280. max-height: 100%;
  281. }
  282. .pkmn-tile .pkmn-score-row {
  283. flex-wrap: wrap;
  284. justify-content: space-around;
  285. }
  286. .pkmn-tile button {
  287. font-size: 0.75rem;
  288. font-weight: 600;
  289. padding: 0.125rem 1ch 0.125rem 2ch;
  290. white-space: nowrap;
  291. flex: 1;
  292. }
  293. .pkmn-tile button[data-included="true"] {
  294. position: relative;
  295. }
  296. .pkmn-tile button[data-included="true"]::before {
  297. position: absolute;
  298. content: "·";
  299. inset: 50% auto auto 0.375ch;
  300. font-size: 1.5rem;
  301. /* slightly nicer than a normal vertical centering */
  302. transform: translateY(-48%);
  303. }
  304. .pkmn-tile .color-select[hidden] + .pkmn-info-icon {
  305. display: none;
  306. }
  307. .pkmn-tile .pkmn-info-detail {
  308. position: absolute;
  309. inset: 100% 50% auto auto;
  310. visibility: hidden;
  311. opacity: 0%;
  312. transform: translateX(45%);
  313. transition: visibility 200ms, opacity 200ms ease-out, transform 200ms ease-out;
  314. font-size: 0.75rem;
  315. width: 32ch;
  316. grid-template-columns: repeat(3, 1fr);
  317. grid-auto-rows: min-content;
  318. column-gap: 0.5ch;
  319. row-gap: 0.125rem;
  320. padding: var(--tile-block-padding) 0.5ch;
  321. border-radius: var(--tile-border-radius);
  322. box-shadow: 2px 2px 2px var(--shadow);
  323. background-color: var(--highlight);
  324. color: var(--background);
  325. }
  326. .pkmn-info-detail:not(:empty):hover,
  327. .pkmn-tile[data-info="show-infoHover"] .pkmn-info-detail:not(:empty):nth-child(1),
  328. .pkmn-tile[data-info="show-infoHover1"] .pkmn-info-detail:not(:empty):nth-child(2),
  329. .pkmn-tile[data-info="show-infoHover2"] .pkmn-info-detail:not(:empty):nth-child(3),
  330. .pkmn-tile[data-info="show-infoHover3"] .pkmn-info-detail:not(:empty):nth-child(4),
  331. .pkmn-tile[data-info="show-infoHover4"] .pkmn-info-detail:not(:empty):nth-child(5) {
  332. visibility: visible;
  333. opacity: 100%;
  334. transform: translateX(50%) translateY(5%);
  335. }
  336. .pkmn-tile .pkmn-data-separator {
  337. height: 1px;
  338. background-color: var(--background);
  339. }
  340. .pkmn-tile .pkmn-data-wide {
  341. grid-column: 1 / 3;
  342. }
  343. .pkmn-tile:hover {
  344. z-index: 10;
  345. }
  346. @media (prefers-reduced-motion: no-preference) {
  347. .pkmn-tile:hover {
  348. transform: scale(105%) translateX(3%) translateY(5%);
  349. }
  350. }
  351. /* Sort Controls */
  352. button[name="moreResults"],
  353. button[name="lessResults"],
  354. button[name="random"],
  355. button[name="clear"] {
  356. width: 2rem;
  357. }
  358. .control-group {
  359. padding: 0.25rem 1ch;
  360. background-color: var(--shadow);
  361. border-radius: 8px;
  362. }
  363. #color-inputs {
  364. /* fragile - would be nice to replace it at some point */
  365. border-radius: 36px 8px 8px 36px;
  366. padding-inline-start: 0.5ch;
  367. }
  368. #color-inputs > button + div > :first-child {
  369. justify-content: flex-end;
  370. }
  371. @keyframes spin {
  372. to {
  373. transform: rotate(360deg);
  374. }
  375. }
  376. #color-inputs button[name="randomColor"] {
  377. width: 4rem;
  378. font-size: 2.5rem;
  379. border: none;
  380. --rotate-time: 0.25s;
  381. animation: spin var(--rotate-time) infinite linear paused;
  382. transition: rotate calc(var(--rotate-time) * 3) ease-out;
  383. rotate: 360deg;
  384. }
  385. #color-inputs button[name="randomColor"]:hover {
  386. animation-play-state: running;
  387. rotate: 0deg;
  388. }
  389. #color-inputs input {
  390. height: 2rem;
  391. border: none;
  392. }
  393. #color-inputs output {
  394. text-align: right;
  395. }
  396. #name-search-controls {
  397. align-items: stretch;
  398. }
  399. #name-search-controls button[name="all"] {
  400. padding-inline: 1ch;
  401. }
  402. /* Sort Function Controls */
  403. .fn-control .fn-minmax label span {
  404. padding: 0.125rem 0.75ch;
  405. }
  406. .fn-control .fn-body {
  407. --gap: 0.25ch;
  408. }
  409. .fn-control :is(input[type="checkbox"], input[type="radio"]) {
  410. display: none;
  411. }
  412. .fn-control .toggle-label:first-child {
  413. /* only affects the fake label on the cluster function */
  414. opacity: inherit;
  415. color: inherit;
  416. background-color: inherit;
  417. border: none;
  418. padding: 0;
  419. }
  420. .fn-fraction > *:first-child {
  421. /* this feels a little fragile */
  422. padding-bottom: 6px;
  423. margin-bottom: 4px;
  424. border-block-end: 1px solid var(--highlight);
  425. }
  426. /* Metric Controls */
  427. .metric-fields {
  428. border: none;
  429. }
  430. .metric-fields :is(select:disabled, input[type="radio"]) {
  431. display: none;
  432. }
  433. .metric-fields select {
  434. width: 18ch;
  435. align-self: stretch;
  436. padding-inline: 1ch;
  437. }
  438. /* Other Controls */
  439. :is(input[name="allowRepeatDexNum"], input[name="hideNoStart"], input[name="allowNFE"])
  440. + span {
  441. padding: 0.125rem 1ch;
  442. }