2
0

style.css 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  1. #container {
  2. --base-color: white;
  3. --highlight-color: red;
  4. position: relative;
  5. color: var(--base-color);
  6. font-family: sans;
  7. }
  8. /* components {{{ */
  9. /* background switcher {{{ */
  10. #background {
  11. background-color: black;
  12. }
  13. #background div {
  14. position: absolute;
  15. height: 100%;
  16. width: 100%;
  17. opacity: 0;
  18. transition: opacity 0.5s linear;
  19. }
  20. #background div.show {
  21. opacity: 1;
  22. }
  23. /* }}} */
  24. /* progress bar {{{ */
  25. .progress-bar {
  26. position: relative;
  27. height: 5px;
  28. }
  29. .progress-bar .bg {
  30. position: absolute;
  31. width: 100%;
  32. height: 5px;
  33. background-color: var(--base-color);
  34. opacity: 0.5;
  35. }
  36. .progress-bar .shade {
  37. position: absolute;
  38. height: 5px;
  39. background-color: var(--base-color);
  40. animation-timing-function: linear;
  41. animation-play-state: paused;
  42. }
  43. @keyframes progress {
  44. from {
  45. width: 0%;
  46. }
  47. to {
  48. width: 100%;
  49. }
  50. }
  51. /* }}} */
  52. /* }}} */
  53. /* main layout {{{ */
  54. /* base {{{ */
  55. #container {
  56. display: grid;
  57. grid-template-columns: [start] auto [right] 300px [end];
  58. grid-template-rows: [top] 50px [header] auto [game] 180px [bottom];
  59. height: 450px;
  60. width: 800px;
  61. margin: 0 auto;
  62. overflow: hidden;
  63. }
  64. #container > div {
  65. overflow: hidden;
  66. position: relative;
  67. transition: top 0.5s, left 0.5s, opacity 0.5s;
  68. opacity: 0;
  69. }
  70. #container #background {
  71. opacity: 1;
  72. grid-column: start / end;
  73. grid-row: top / bottom;
  74. }
  75. #loading {
  76. grid-column: start / end;
  77. grid-row: top / bottom;
  78. align-self: center;
  79. justify-self: center;
  80. }
  81. #song-info {
  82. grid-column: start / right;
  83. grid-row: header / game;
  84. left: -500px;
  85. }
  86. #song-list {
  87. grid-column: right / end;
  88. grid-row: top / bottom;
  89. left: 300px;
  90. }
  91. #folder-info {
  92. grid-column: start / right;
  93. grid-row: top / header;
  94. left: -500px;
  95. }
  96. #game {
  97. top: 180px;
  98. grid-column: start / end;
  99. grid-row: game / bottom;
  100. }
  101. #score {
  102. grid-column: start / right;
  103. grid-row: header / bottom;
  104. left: -500px;
  105. }
  106. #loader {
  107. top: -50px;
  108. grid-column: right / end;
  109. grid-row: top / header;
  110. }
  111. #ready {
  112. grid-column: start / end;
  113. grid-row: top / bottom;
  114. align-self: center;
  115. justify-self: center;
  116. }
  117. /* }}} */
  118. /* loading {{{ */
  119. #container.loading #loading {
  120. opacity: 1;
  121. }
  122. #container.loading #loading.finished {
  123. opacity: 0;
  124. }
  125. #container.loading #song-info,
  126. #container.loading #folder-info {
  127. top: 50px;
  128. left: 0;
  129. }
  130. #container.loading #song-list {
  131. left: 50px;
  132. }
  133. /* }}} */
  134. /* select {{{ */
  135. #container.select #song-info,
  136. #container.select #folder-info {
  137. opacity: 1;
  138. top: 0;
  139. left: 0;
  140. }
  141. #container.select #song-list {
  142. opacity: 1;
  143. left: 0;
  144. }
  145. /* }}} */
  146. /* game {{{ */
  147. #container.game #folder-info {
  148. opacity: 1;
  149. top: 0;
  150. left: 0;
  151. }
  152. #container.game #song-info {
  153. opacity: 1;
  154. top: -150px;
  155. left: 0;
  156. }
  157. #container.game.game-loading #loader {
  158. opacity: 1;
  159. top: 0;
  160. }
  161. #container #ready {
  162. overflow: hidden;
  163. max-height: 0;
  164. transition: max-height 0s ease 0.5s, top 0.5s, left 0.5s, opacity 0.5s;
  165. }
  166. #container.game.game-loading #ready {
  167. opacity: 1;
  168. max-height: 100%;
  169. transition: max-height 0s, top 0.5s, left 0.5s, opacity 0.5s;
  170. }
  171. #container.game.game-playing #game {
  172. opacity: 1;
  173. top: 0;
  174. }
  175. #container.game.game-finished #score {
  176. opacity: 1;
  177. left: 0;
  178. }
  179. /* }}} */
  180. /* }}} */
  181. /* sub layouts {{{ */
  182. /* select-screen {{{ */
  183. /* folder-info {{{ */
  184. #folder-info {
  185. display: flex;
  186. flex-direction: row;
  187. align-items: center;
  188. }
  189. #folder-info .left:hover,
  190. #folder-info .right:hover {
  191. text-shadow: 0px 0px 5px var(--base-color);
  192. }
  193. /* }}} */
  194. /* song-info {{{ */
  195. #song-info {
  196. display: grid;
  197. }
  198. .song-info {
  199. align-self: end;
  200. margin-left: 20px;
  201. text-shadow: 0px 0px 5px var(--base-color);
  202. }
  203. .song-info .genre {
  204. font-size: 12px;
  205. }
  206. .song-info .creator {
  207. font-size: 20px;
  208. line-height: 0.5;
  209. }
  210. .song-info .title {
  211. font-size: 30px;
  212. }
  213. /* }}} */
  214. /* song-list {{{ */
  215. .song-list {
  216. margin-left: 20px;
  217. transition: margin-top 0.2s;
  218. }
  219. .song-item {
  220. height: 40px;
  221. display: grid;
  222. grid-template-columns: 40px auto;
  223. grid-template-rows: 16px 24px;
  224. grid-template-areas:
  225. "diff creator"
  226. "diff title";
  227. transition: margin-left 0.2s;
  228. }
  229. .song-item div {
  230. white-space: nowrap;
  231. overflow: hidden;
  232. text-overflow: ellipsis;
  233. line-height: 1;
  234. }
  235. .song-item .difficulty {
  236. grid-area: diff;
  237. align-self: end;
  238. justify-self: end;
  239. margin-bottom: 1px;
  240. margin-right: 5px;
  241. font-style: italic;
  242. font-weight: bold;
  243. }
  244. .song-item .difficulty-bg {
  245. grid-area: diff;
  246. align-self: center;
  247. justify-self: center;
  248. height: 30px;
  249. width: 30px;
  250. background: radial-gradient(circle at 10% 10%, rgba(0, 255, 255, 1), transparent);
  251. border-radius: 20%;
  252. opacity: 0;
  253. transition: opacity 0.2s ease-in-out;
  254. }
  255. .song-item .difficulty-bg.normal {
  256. background: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.6), transparent);
  257. opacity: 1;
  258. }
  259. .song-item:hover {
  260. text-shadow: 0px 0px 5px var(--base-color);
  261. }
  262. .song-item.selected {
  263. margin-left: -10px;
  264. text-shadow: 0px 0px 5px var(--base-color);
  265. }
  266. .song-item.selected .difficulty-bg {
  267. opacity: 1;
  268. box-shadow: -1px -1px 10px -2px var(--base-color);
  269. }
  270. .song-item.selected .difficulty-bg.normal {
  271. opacity: 0;
  272. }
  273. .song-item .creator {
  274. grid-area: creator;
  275. font-size: 12px;
  276. }
  277. .song-item .title {
  278. grid-area: title;
  279. font-size: 20px;
  280. }
  281. /* }}} */
  282. /* }}} */
  283. /* game-screen {{{ */
  284. /* loading-screen {{{ */
  285. #loader {
  286. display: flex;
  287. flex-direction: column;
  288. justify-content: center;
  289. align-items: center;
  290. }
  291. #loader .progress-bar {
  292. width: 80%;
  293. }
  294. #loader .progress-bar .shade {
  295. transition: width 0.2s;
  296. }
  297. #ready {
  298. display: flex;
  299. flex-direction: column;
  300. align-items: center;
  301. }
  302. #ready .status {
  303. font-size: 30px;
  304. }
  305. #ready .message {
  306. font-size: 14px;
  307. }
  308. /* }}} */
  309. /* track-progress {{{ */
  310. .track-progress {
  311. display: grid;
  312. grid-template-columns: max-content auto;
  313. grid-template-rows: 50% 50%;
  314. grid-template-areas:
  315. "tl tb"
  316. "il ib";
  317. grid-gap: 0px 10px;
  318. align-items: center;
  319. align-self: end;
  320. }
  321. .track-progress .total-label,
  322. .track-progress .interval-label {
  323. justify-self: right;
  324. font-variant-caps: small-caps;
  325. font-size: 12px;
  326. }
  327. .track-progress .total-label {
  328. grid-area: tl;
  329. }
  330. .track-progress .interval-label {
  331. grid-area: il;
  332. justify-self: right;
  333. }
  334. .track-progress .total {
  335. grid-area: tb;
  336. }
  337. .track-progress .interval {
  338. grid-area: ib;
  339. }
  340. /* }}} */
  341. /* typing area {{{ */
  342. #game {
  343. display: grid;
  344. grid-template-columns: 50px 50px auto;
  345. grid-template-rows: 40px 24px 12px 30px auto 22px;
  346. grid-template-areas:
  347. ". . track"
  348. "score score score"
  349. ". . kana"
  350. ". . kanji"
  351. "romaji-first romaji romaji"
  352. ". . stats";
  353. grid-row-gap: 2px;
  354. padding: 2px 20px;
  355. background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
  356. }
  357. #game .track-progress {
  358. grid-area: track;
  359. }
  360. #game .score-line {
  361. grid-area: score;
  362. }
  363. #game .kana-line {
  364. grid-area: kana;
  365. font-size: 12px;
  366. margin-left: 15px;
  367. }
  368. #game .kanji-line {
  369. grid-area: kanji;
  370. padding-left: 5px;
  371. border-bottom: solid 2px rgba(255, 255, 255, 0.5);
  372. border-left: solid 10px rgba(255, 255, 255, 0.5);
  373. border-radius: 0px 0px 0px 10px;
  374. }
  375. #game .stats-line {
  376. grid-area: stats;
  377. }
  378. #game .romaji-first,
  379. #game .romaji-line {
  380. text-transform: uppercase;
  381. align-self: baseline;
  382. line-height: 1;
  383. }
  384. #game .romaji-first {
  385. grid-area: romaji-first;
  386. justify-self: right;
  387. font-size: 36px;
  388. padding: 0px 2px;
  389. }
  390. #game .romaji-line {
  391. grid-area: romaji;
  392. font-size: 20px;
  393. }
  394. #game .romaji-first.error {
  395. animation: pulse 0.2s;
  396. }
  397. /* }}} */
  398. /* score area {{{ */
  399. .score-line {
  400. display: flex;
  401. }
  402. .score-line .pair,
  403. .stats-line .pair {
  404. margin: 0px 4px;
  405. border-bottom: solid 2px rgba(255, 255, 255, 0.5);
  406. border-radius: 2px;
  407. }
  408. .score-line .pair span,
  409. .stats-line .pair span {
  410. text-align: right;
  411. padding: 0px 4px;
  412. }
  413. .score-line .combo {
  414. flex: none;
  415. width: 100px;
  416. text-align: left;
  417. }
  418. .score-line .pair {
  419. flex: 1;
  420. display: flex;
  421. }
  422. .stats-line {
  423. display: flex;
  424. justify-content: right;
  425. }
  426. .stats-line .pair span {
  427. font-size: 14px;
  428. }
  429. .stats-line .pair .value {
  430. display: inline-block;
  431. min-width: 50px;
  432. }
  433. /* }}} */
  434. /* score screen {{{ */
  435. #score {
  436. display: grid;
  437. grid-template-columns: max-content auto;
  438. align-items: baseline;
  439. align-content: end;
  440. grid-gap: 5px;
  441. padding: 20px;
  442. }
  443. #score .class,
  444. #score .score {
  445. text-shadow: 0px 0px 5px var(--highlight-color);
  446. }
  447. #score .class {
  448. font-size: 40px;
  449. }
  450. #score .score {
  451. font-size: 24px;
  452. }
  453. /* }}} */
  454. .kana {
  455. display: inline-block;
  456. position: relative;
  457. white-space: pre;
  458. }
  459. .kana::after {
  460. display: inline-block;
  461. content: attr(data-text);
  462. position: absolute;
  463. left: 0;
  464. top: 0;
  465. color: var(--highlight-color);
  466. font-weight: bold;
  467. overflow: hidden;
  468. width: 0px;
  469. transition: width 0.1s;
  470. }
  471. .kana.half::after {
  472. width: 50%;
  473. }
  474. .kana.full::after {
  475. width: 100%;
  476. }
  477. @keyframes pulse {
  478. 0% {
  479. color: var(--base-color);
  480. }
  481. 50% {
  482. color: red;
  483. }
  484. 100% {
  485. color: var(--base-color);
  486. }
  487. }
  488. #game.waiting .kana-line,
  489. #game.waiting .kanji-line {
  490. opacity: 0.5;
  491. }
  492. #game.waiting .romaji-first,
  493. #game.waiting .romaji-line {
  494. color: transparent;
  495. }
  496. /* }}} */
  497. /* }}} */