style.css 9.9 KB

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