added loading placeholder when searching; added loading placeholder when changing tabs in search tab
This commit is contained in:
parent
e429b9e978
commit
04c127dd6c
@ -21,6 +21,7 @@ This is just the WebUI for deemix, it should be used with deemix-pyweb or someth
|
||||
- Context menu for pywebview (Context menu is blocked in pywebview)
|
||||
- Copy and paste functions
|
||||
- Block selection where it's not needed (keep only titles artists albums labels and useful data)
|
||||
- There's a SASS mixin for this. Need to use it in the proper classes
|
||||
- ?
|
||||
|
||||
# License
|
||||
|
File diff suppressed because one or more lines are too long
@ -20,8 +20,8 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="loading_overlay" class="active">
|
||||
<span id="loading_text">Connecting to the server...</span>
|
||||
<div id="start_app_placeholder" class="loading_placeholder">
|
||||
<span class="loading_placeholder__text">Connecting to the server...</span>
|
||||
<div class="lds-ring">
|
||||
<div></div>
|
||||
<div></div>
|
||||
@ -69,6 +69,7 @@
|
||||
</div>
|
||||
</span>
|
||||
</aside>
|
||||
|
||||
<main id="main_content">
|
||||
<div id="middle_section">
|
||||
<header id="search">
|
||||
@ -223,8 +224,14 @@ <h1>No results</h1>
|
||||
</div>
|
||||
<!-- ### Track Search Tab ### -->
|
||||
<div id="track_search" class="search_tabcontent">
|
||||
<div v-if="!results.trackTab.loaded">
|
||||
<h1>Loading</h1>
|
||||
<div v-if="!results.trackTab.loaded" class="loading_placeholder">
|
||||
<span class="loading_placeholder__text">Loading...</span>
|
||||
<div class="lds-ring">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="results.trackTab.data.length == 0">
|
||||
<h1>No Tracks found</h1>
|
||||
@ -287,8 +294,14 @@ <h1>No Tracks found</h1>
|
||||
</div>
|
||||
<!-- ### Album Search Tab ### -->
|
||||
<div id="album_search" class="search_tabcontent">
|
||||
<div v-if="!results.albumTab.loaded">
|
||||
<h1>Loading</h1>
|
||||
<div v-if="!results.albumTab.loaded" class="loading_placeholder">
|
||||
<span class="loading_placeholder__text">Loading...</span>
|
||||
<div class="lds-ring">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="results.albumTab.data.length == 0">
|
||||
<h1>No Albums found</h1>
|
||||
@ -312,8 +325,14 @@ <h1>No Albums found</h1>
|
||||
</div>
|
||||
<!-- ### Artist Search Tab ### -->
|
||||
<div id="artist_search" class="search_tabcontent">
|
||||
<div v-if="!results.artistTab.loaded">
|
||||
<h1>Loading</h1>
|
||||
<div v-if="!results.artistTab.loaded" class="loading_placeholder">
|
||||
<span class="loading_placeholder__text">Loading...</span>
|
||||
<div class="lds-ring">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="results.artistTab.data.length == 0">
|
||||
<h1>No Artists found</h1>
|
||||
@ -334,8 +353,14 @@ <h1>No Artists found</h1>
|
||||
</div>
|
||||
<!-- ### Playlist Search Tab ### -->
|
||||
<div id="playlist_search" class="search_tabcontent">
|
||||
<div v-if="!results.playlistTab.loaded">
|
||||
<h1>Loading</h1>
|
||||
<div v-if="!results.playlistTab.loaded" class="loading_placeholder">
|
||||
<span class="loading_placeholder__text">Loading...</span>
|
||||
<div class="lds-ring">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="results.playlistTab.data.length == 0">
|
||||
<h1>No Playlists found</h1>
|
||||
@ -1442,6 +1467,15 @@ <h1>Errors for {{ title }}</h1>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
<div id="search_placeholder" class="loading_placeholder loading_placeholder--hidden">
|
||||
<span class="loading_placeholder__text">Searching...</span>
|
||||
<div class="lds-ring">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="download_tab_container" class="tab_hidden">
|
||||
|
File diff suppressed because one or more lines are too long
@ -61,8 +61,6 @@ const FavoritesTab = new Vue({
|
||||
this.artists = artists
|
||||
this.playlists = playlists
|
||||
|
||||
console.log('update ok')
|
||||
|
||||
// Removing animation class only when the animation has completed an iteration
|
||||
// Prevents animation ugly stutter
|
||||
this.$refs.reloadButton.addEventListener(
|
||||
|
@ -131,6 +131,10 @@ const MainSearch = new Vue({
|
||||
}
|
||||
},
|
||||
handleMainSearch(result) {
|
||||
// Hiding loading placeholder
|
||||
document.getElementById('content').style.display = ''
|
||||
document.getElementById('search_placeholder').classList.toggle('loading_placeholder--hidden')
|
||||
|
||||
let resetObj = { data: [], next: 0, total: 0, loaded: false }
|
||||
|
||||
this.results.allTab = result
|
||||
|
@ -46,6 +46,10 @@ function handleSearchBarKeyup(e) {
|
||||
if (term !== MainSearch.results.query || main_selected == 'search_tab') {
|
||||
document.getElementById('search_tab_content').style.display = 'none'
|
||||
socket.emit('mainSearch', { term })
|
||||
|
||||
// Showing loading placeholder
|
||||
document.getElementById('content').style.display = 'none'
|
||||
document.getElementById('search_placeholder').classList.toggle('loading_placeholder--hidden')
|
||||
} else {
|
||||
document.getElementById('search_tab_content').style.display = 'block'
|
||||
document.getElementById('main_search_tablink').click()
|
||||
|
@ -1,5 +1,5 @@
|
||||
export const socket = io.connect(window.location.href)
|
||||
|
||||
socket.on('connect', () => {
|
||||
document.getElementById('loading_overlay').classList.remove('active')
|
||||
document.getElementById('start_app_placeholder').classList.add('loading_placeholder--hidden')
|
||||
})
|
||||
|
@ -1,41 +0,0 @@
|
||||
/* Source: https://loading.io/css/ */
|
||||
.lds-ring {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
|
||||
div {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
margin: 8px;
|
||||
border: 8px solid #fff;
|
||||
border-radius: 50%;
|
||||
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
||||
border-color: #fff transparent transparent transparent;
|
||||
|
||||
&:nth-child(1) {
|
||||
animation-delay: -0.45s;
|
||||
}
|
||||
|
||||
&:nth-child(2) {
|
||||
animation-delay: -0.3s;
|
||||
}
|
||||
|
||||
&:nth-child(3) {
|
||||
animation-delay: -0.15s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes lds-ring {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
@ -1,3 +1,45 @@
|
||||
/* Source: https://loading.io/css/ */
|
||||
.lds-ring {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
|
||||
div {
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
margin: 8px;
|
||||
border: 8px solid #fff;
|
||||
border-radius: 50%;
|
||||
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
||||
border-color: #fff transparent transparent transparent;
|
||||
|
||||
&:nth-child(1) {
|
||||
animation-delay: -0.45s;
|
||||
}
|
||||
|
||||
&:nth-child(2) {
|
||||
animation-delay: -0.3s;
|
||||
}
|
||||
|
||||
&:nth-child(3) {
|
||||
animation-delay: -0.15s;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes lds-ring {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
|
@ -12,7 +12,7 @@ input[type='search'] {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
input[type=search]::-webkit-search-cancel-button {
|
||||
input[type='search']::-webkit-search-cancel-button {
|
||||
-webkit-appearance: none;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
@ -96,28 +96,6 @@ button:hover {
|
||||
border: 1px solid var(--accent-color);
|
||||
}
|
||||
|
||||
#loading_overlay {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: absolute;
|
||||
flex-direction: column;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: none;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
#loading_overlay.active {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
#loading_text {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
#main_content {
|
||||
margin-left: 48px;
|
||||
width: calc(100% - 48px);
|
||||
@ -304,3 +282,34 @@ button.with_icon i {
|
||||
.hide {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.loading_placeholder {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
height: 100%;
|
||||
|
||||
&.loading_placeholder--hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&__text {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
&#search_placeholder {
|
||||
height: calc(100% - 93px);
|
||||
}
|
||||
|
||||
&#start_app_placeholder {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: hsla(0, 0, 0, 50%);
|
||||
z-index: 1000;
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
@import './tabs/settings-tab';
|
||||
@import './tabs/tabs';
|
||||
|
||||
@import './animations';
|
||||
@import './middle-section';
|
||||
@import './progressbar';
|
||||
@import './sidebar';
|
||||
|
Loading…
Reference in New Issue
Block a user