#container { --base-color: white; --highlight-color: red; position: relative; color: var(--base-color); font-family: sans; } /* components {{{ */ /* background switcher {{{ */ #background { background-color: black; } #background div { position: absolute; height: 100%; width: 100%; opacity: 0; transition: opacity 0.5s linear; } #background div.show { opacity: 1; } /* }}} */ /* progress bar {{{ */ .progress-bar { position: relative; height: 5px; } .progress-bar .bg { position: absolute; width: 100%; height: 5px; background-color: var(--base-color); opacity: 0.5; } .progress-bar .shade { position: absolute; height: 5px; background-color: var(--base-color); animation-timing-function: linear; animation-play-state: paused; } @keyframes progress { from { width: 0%; } to { width: 100%; } } /* }}} */ /* }}} */ /* main layout {{{ */ /* base {{{ */ #container { display: grid; grid-template-columns: [start] auto [right] 300px [end]; grid-template-rows: [top] 50px [header] auto [game] 180px [bottom]; height: 450px; width: 800px; margin: 0 auto; overflow: hidden; } #container > div { overflow: hidden; position: relative; transition: top 0.5s, left 0.5s, opacity 0.5s; opacity: 0; } #container #background { opacity: 1; grid-column: start / end; grid-row: top / bottom; } #loading { grid-column: start / end; grid-row: top / bottom; align-self: center; justify-self: center; } #song-info { grid-column: start / right; grid-row: header / game; left: -500px; } #song-list { grid-column: right / end; grid-row: top / bottom; left: 300px; } #folder-info { grid-column: start / right; grid-row: top / header; left: -500px; } #game { top: 180px; grid-column: start / end; grid-row: game / bottom; } #score { grid-column: start / right; grid-row: header / bottom; left: -500px; } #loader { top: -50px; grid-column: right / end; grid-row: top / header; } #ready { grid-column: start / end; grid-row: top / bottom; align-self: center; justify-self: center; } /* }}} */ /* loading {{{ */ #container.loading #loading { opacity: 1; } #container.loading #loading.finished { opacity: 0; } #container.loading #song-info, #container.loading #folder-info { top: 50px; left: 0; } #container.loading #song-list { left: 50px; } /* }}} */ /* select {{{ */ #container.select #song-info, #container.select #folder-info { opacity: 1; top: 0; left: 0; } #container.select #song-list { opacity: 1; left: 0; } /* }}} */ /* game {{{ */ #container.game #folder-info { opacity: 1; top: 0; left: 0; } #container.game #song-info { opacity: 1; top: -150px; left: 0; } #container.game.game-loading #loader { opacity: 1; top: 0; } #container #ready { overflow: hidden; max-height: 0; transition: max-height 0s ease 0.5s, top 0.5s, left 0.5s, opacity 0.5s; } #container.game.game-loading #ready { opacity: 1; max-height: 100%; transition: max-height 0s, top 0.5s, left 0.5s, opacity 0.5s; } #container.game.game-playing #game { opacity: 1; top: 0; } #container.game.game-finished #score { opacity: 1; left: 0; } /* }}} */ /* }}} */ /* sub layouts {{{ */ /* select-screen {{{ */ /* folder-info {{{ */ #folder-info { display: flex; flex-direction: row; align-items: center; } #folder-info .left:hover, #folder-info .right:hover { text-shadow: 0px 0px 5px var(--base-color); } /* }}} */ /* song-info {{{ */ #song-info { display: grid; } .song-info { align-self: end; margin-left: 20px; text-shadow: 0px 0px 5px var(--base-color); } .song-info .genre { font-size: 12px; } .song-info .creator { font-size: 20px; line-height: 0.5; } .song-info .title { font-size: 30px; } /* }}} */ /* song-list {{{ */ .song-list { margin-left: 20px; transition: margin-top 0.2s; } .song-item { height: 40px; display: grid; grid-template-columns: 40px auto; grid-template-rows: 16px 24px; grid-template-areas: "diff creator" "diff title"; transition: margin-left 0.2s; } .song-item div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1; } .song-item .difficulty { grid-area: diff; align-self: end; justify-self: end; margin-bottom: 1px; margin-right: 5px; font-style: italic; font-weight: bold; } .song-item .difficulty-bg { grid-area: diff; align-self: center; justify-self: center; height: 30px; width: 30px; background: radial-gradient(circle at 10% 10%, rgba(0, 255, 255, 1), transparent); border-radius: 20%; opacity: 0; transition: opacity 0.2s ease-in-out; } .song-item .difficulty-bg.normal { background: radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.6), transparent); opacity: 1; } .song-item:hover { text-shadow: 0px 0px 5px var(--base-color); } .song-item.selected { margin-left: -10px; text-shadow: 0px 0px 5px var(--base-color); } .song-item.selected .difficulty-bg { opacity: 1; box-shadow: -1px -1px 10px -2px var(--base-color); } .song-item.selected .difficulty-bg.normal { opacity: 0; } .song-item .creator { grid-area: creator; font-size: 12px; } .song-item .title { grid-area: title; font-size: 20px; } /* }}} */ /* }}} */ /* game-screen {{{ */ /* loading-screen {{{ */ #loader { display: flex; flex-direction: column; justify-content: center; align-items: center; } #loader .progress-bar { width: 80%; } #loader .progress-bar .shade { transition: width 0.2s; } #ready { display: flex; flex-direction: column; align-items: center; } #ready .status { font-size: 30px; } #ready .message { font-size: 14px; } /* }}} */ /* track-progress {{{ */ .track-progress { display: grid; grid-template-columns: max-content auto; grid-template-rows: 50% 50%; grid-template-areas: "tl tb" "il ib"; grid-gap: 0px 10px; align-items: center; align-self: end; } .track-progress .total-label, .track-progress .interval-label { justify-self: right; font-variant-caps: small-caps; font-size: 12px; } .track-progress .total-label { grid-area: tl; } .track-progress .interval-label { grid-area: il; justify-self: right; } .track-progress .total { grid-area: tb; } .track-progress .interval { grid-area: ib; } /* }}} */ /* typing area {{{ */ #game { display: grid; grid-template-columns: 50px 50px auto; grid-template-rows: 40px 24px 12px 30px auto 22px; grid-template-areas: ". . track" "score score score" ". . kana" ". . kanji" "romaji-first romaji romaji" ". . stats"; grid-row-gap: 2px; padding: 2px 20px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.5)); } #game .track-progress { grid-area: track; } #game .score-line { grid-area: score; } #game .kana-line { grid-area: kana; font-size: 12px; margin-left: 15px; } #game .kanji-line { grid-area: kanji; padding-left: 5px; border-bottom: solid 2px rgba(255, 255, 255, 0.5); border-left: solid 10px rgba(255, 255, 255, 0.5); border-radius: 0px 0px 0px 10px; } #game .stats-line { grid-area: stats; } #game .romaji-first, #game .romaji-line { text-transform: uppercase; align-self: baseline; line-height: 1; } #game .romaji-first { grid-area: romaji-first; justify-self: right; font-size: 36px; padding: 0px 2px; } #game .romaji-line { grid-area: romaji; font-size: 20px; } #game .romaji-first.error { animation: pulse 0.2s; } /* }}} */ /* score area {{{ */ .score-line { display: flex; } .score-line .pair, .stats-line .pair { margin: 0px 4px; border-bottom: solid 2px rgba(255, 255, 255, 0.5); border-radius: 2px; } .score-line .pair span, .stats-line .pair span { text-align: right; padding: 0px 4px; } .score-line .combo { flex: none; width: 100px; text-align: left; } .score-line .pair { flex: 1; display: flex; } .stats-line { display: flex; justify-content: right; } .stats-line .pair span { font-size: 14px; } .stats-line .pair .value { display: inline-block; min-width: 50px; } /* }}} */ /* score screen {{{ */ #score { display: grid; grid-template-columns: max-content auto; align-items: baseline; align-content: end; grid-gap: 5px; padding: 20px; } #score .class, #score .score { text-shadow: 0px 0px 5px var(--highlight-color); } #score .class { font-size: 40px; } #score .score { font-size: 24px; } /* }}} */ .kana { display: inline-block; position: relative; white-space: pre; } .kana::after { display: inline-block; content: attr(data-text); position: absolute; left: 0; top: 0; color: var(--highlight-color); font-weight: bold; overflow: hidden; width: 0px; transition: width 0.1s; } .kana.half::after { width: 50%; } .kana.full::after { width: 100%; } @keyframes pulse { 0% { color: var(--base-color); } 50% { color: red; } 100% { color: var(--base-color); } } #game.waiting .kana-line, #game.waiting .kanji-line { opacity: 0.5; } #game.waiting .romaji-first, #game.waiting .romaji-line { color: transparent; } /* }}} */ /* }}} */