style.css 10.0 KB

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