styles.css 9.7 KB

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