implement song search

This commit is contained in:
Bui
2022-02-25 18:16:11 +00:00
parent 73a95abf62
commit 6c8b635c2a
9 changed files with 707 additions and 6 deletions

248
public/src/css/search.css Normal file
View File

@@ -0,0 +1,248 @@
#song-search-container {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5);
z-index: 2;
}
#song-search {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
display: flex;
flex-direction: column;
width: 60vmax;
height: 80vmin;
border-radius: 0.8vmax;
border: 0.35vmax solid #8C0C42;
color: #fff;
padding: 1vmax 1vmax 0 1vmax;
z-index: 1;
}
#song-search-input {
width: 100%;
font-size: 2vmax;
padding: 0.8vmax 1.2vmax;
border-radius: 0.3vmax;
border: 0.25vmax black solid;
font-family: TnT;
box-sizing: border-box;
-webkit-box-sizing:border-box;
-moz-box-sizing: border-box;
outline: none;
}
#song-search-input:focus {
border: 0.25vmax #fff923 solid;
}
#song-search-results {
margin-top: 0.5vmax;
overflow-y: scroll;
-ms-overflow-style: none;
scrollbar-width: none;
scroll-behavior: smooth;
}
#song-search-results::-webkit-scrollbar {
display: none;
}
.song-search-result {
display: flex;
height: 3.2vmax;
margin: 0.2vmax;
padding: 0.7vmax;
flex-direction: row;
text-align: center;
align-items: center;
justify-content: center;
border: 0.3vmax black solid;
position: relative;
}
.song-search-result::before {
display: block;
position: absolute;
content: '';
height: 100%;
width: 100%;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.song-search-result:last-of-type {
margin-bottom: 1vmax;
}
.song-search-result-info {
flex: 10;
font-size: 1.2vmax;
margin: 0.3vmax;
text-align: left;
z-index: 0;
position: relative;
white-space: nowrap;
padding-left: 0.2vmax;
overflow-x: clip;
}
.song-search-result-subtitle {
display: block;
font-size: 0.8vmax;
margin-top: 0.5vmax;
}
.song-search-result-title::before,
.song-search-result-subtitle::before {
content: attr(alt);
position: absolute;
z-index: -1;
}
.song-search-result-course {
flex: 1;
width: 100%;
height: 100%;
margin: 0.2vmax;
font-size: 1.2vmax;
border-radius: 0.3vmax;
position: relative;
z-index: 1;
}
.song-search-result-hidden {
visibility: hidden;
}
.song-search-result:hover {
border-color: #fff923;
cursor: pointer;
}
.song-search-result-active {
border-color: #fff923;
}
.song-search-result-course::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.5;
z-index: -1;
background-size: 6vmax;
border-radius: 0.3vmax;
}
.song-search-result-stars {
bottom: 0;
background: rgb(0 0 0 / 47%);
position: absolute;
width: 100%;
padding: 0.1vmax 0;
border-radius: 0 0 0.3vmax 0.3vmax;
}
.song-search-result-easy {
background-color: #D13215;
}
.song-search-result-easy::before {
background-position-x: -1.1vmax;
background-position-y: -0.7vmax;
}
.song-search-result-normal {
background-color: #799C22;
}
.song-search-result-normal::before {
background-position-x: -1.2vmax;
background-position-y: -6.4vmax;
}
.song-search-result-hard {
background-color: #31799B;
}
.song-search-result-hard::before {
background-position-x: -1.1vmax;
background-position-y: -11.4vmax;
}
.song-search-result-oni {
background-color: #AF2C7F;
}
.song-search-result-oni::before {
background-position-x: -1.2vmax;
background-position-y: -16.5vmax;
}
.song-search-result-ura {
background-color: #604AD5;
}
.song-search-result-ura::before {
background-position-x: -1.2vmax;
background-position-y: -21.6vmax;
}
.song-search-result-crown {
background-size: 1.9vmax;
background-position-x: 0.82vmax;
background-repeat: repeat-y;
width: 100%;
position: absolute;
height: 2vmax;
}
.song-search-result-gold {
background-position-y: 5.15vmax;
}
.song-search-result-silver {
background-position-y: 7.6vmax;
}
.song-search-result-noclear {
background-position-y: 0.15vmax;
}
#song-search-tip {
font-size: 1vmax;
margin-top: 1vmax;
text-align: center;
background-repeat: no-repeat;
background-position: top;
background-size: 10vmax;
background-color: #00000087;
border-radius: 0.5vmax;
padding: 1vmax;
}
#song-search-close {
position: absolute;
right: -0.77vmax;
top: -1.26vmax;
font-size: 2vmax;
font-family: TnT;
cursor: pointer;
}
.song-search-tip-error {
height: 8vmax;
}