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)
|
- Context menu for pywebview (Context menu is blocked in pywebview)
|
||||||
- Copy and paste functions
|
- Copy and paste functions
|
||||||
- Block selection where it's not needed (keep only titles artists albums labels and useful data)
|
- 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
|
# License
|
||||||
|
File diff suppressed because one or more lines are too long
@ -20,8 +20,8 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="loading_overlay" class="active">
|
<div id="start_app_placeholder" class="loading_placeholder">
|
||||||
<span id="loading_text">Connecting to the server...</span>
|
<span class="loading_placeholder__text">Connecting to the server...</span>
|
||||||
<div class="lds-ring">
|
<div class="lds-ring">
|
||||||
<div></div>
|
<div></div>
|
||||||
<div></div>
|
<div></div>
|
||||||
@ -69,6 +69,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<main id="main_content">
|
<main id="main_content">
|
||||||
<div id="middle_section">
|
<div id="middle_section">
|
||||||
<header id="search">
|
<header id="search">
|
||||||
@ -223,8 +224,14 @@ <h1>No results</h1>
|
|||||||
</div>
|
</div>
|
||||||
<!-- ### Track Search Tab ### -->
|
<!-- ### Track Search Tab ### -->
|
||||||
<div id="track_search" class="search_tabcontent">
|
<div id="track_search" class="search_tabcontent">
|
||||||
<div v-if="!results.trackTab.loaded">
|
<div v-if="!results.trackTab.loaded" class="loading_placeholder">
|
||||||
<h1>Loading</h1>
|
<span class="loading_placeholder__text">Loading...</span>
|
||||||
|
<div class="lds-ring">
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="results.trackTab.data.length == 0">
|
<div v-else-if="results.trackTab.data.length == 0">
|
||||||
<h1>No Tracks found</h1>
|
<h1>No Tracks found</h1>
|
||||||
@ -287,8 +294,14 @@ <h1>No Tracks found</h1>
|
|||||||
</div>
|
</div>
|
||||||
<!-- ### Album Search Tab ### -->
|
<!-- ### Album Search Tab ### -->
|
||||||
<div id="album_search" class="search_tabcontent">
|
<div id="album_search" class="search_tabcontent">
|
||||||
<div v-if="!results.albumTab.loaded">
|
<div v-if="!results.albumTab.loaded" class="loading_placeholder">
|
||||||
<h1>Loading</h1>
|
<span class="loading_placeholder__text">Loading...</span>
|
||||||
|
<div class="lds-ring">
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="results.albumTab.data.length == 0">
|
<div v-else-if="results.albumTab.data.length == 0">
|
||||||
<h1>No Albums found</h1>
|
<h1>No Albums found</h1>
|
||||||
@ -312,8 +325,14 @@ <h1>No Albums found</h1>
|
|||||||
</div>
|
</div>
|
||||||
<!-- ### Artist Search Tab ### -->
|
<!-- ### Artist Search Tab ### -->
|
||||||
<div id="artist_search" class="search_tabcontent">
|
<div id="artist_search" class="search_tabcontent">
|
||||||
<div v-if="!results.artistTab.loaded">
|
<div v-if="!results.artistTab.loaded" class="loading_placeholder">
|
||||||
<h1>Loading</h1>
|
<span class="loading_placeholder__text">Loading...</span>
|
||||||
|
<div class="lds-ring">
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="results.artistTab.data.length == 0">
|
<div v-else-if="results.artistTab.data.length == 0">
|
||||||
<h1>No Artists found</h1>
|
<h1>No Artists found</h1>
|
||||||
@ -334,8 +353,14 @@ <h1>No Artists found</h1>
|
|||||||
</div>
|
</div>
|
||||||
<!-- ### Playlist Search Tab ### -->
|
<!-- ### Playlist Search Tab ### -->
|
||||||
<div id="playlist_search" class="search_tabcontent">
|
<div id="playlist_search" class="search_tabcontent">
|
||||||
<div v-if="!results.playlistTab.loaded">
|
<div v-if="!results.playlistTab.loaded" class="loading_placeholder">
|
||||||
<h1>Loading</h1>
|
<span class="loading_placeholder__text">Loading...</span>
|
||||||
|
<div class="lds-ring">
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="results.playlistTab.data.length == 0">
|
<div v-else-if="results.playlistTab.data.length == 0">
|
||||||
<h1>No Playlists found</h1>
|
<h1>No Playlists found</h1>
|
||||||
@ -1442,6 +1467,15 @@ <h1>Errors for {{ title }}</h1>
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</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>
|
||||||
|
|
||||||
<div id="download_tab_container" class="tab_hidden">
|
<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.artists = artists
|
||||||
this.playlists = playlists
|
this.playlists = playlists
|
||||||
|
|
||||||
console.log('update ok')
|
|
||||||
|
|
||||||
// Removing animation class only when the animation has completed an iteration
|
// Removing animation class only when the animation has completed an iteration
|
||||||
// Prevents animation ugly stutter
|
// Prevents animation ugly stutter
|
||||||
this.$refs.reloadButton.addEventListener(
|
this.$refs.reloadButton.addEventListener(
|
||||||
|
@ -131,6 +131,10 @@ const MainSearch = new Vue({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleMainSearch(result) {
|
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 }
|
let resetObj = { data: [], next: 0, total: 0, loaded: false }
|
||||||
|
|
||||||
this.results.allTab = result
|
this.results.allTab = result
|
||||||
|
@ -46,6 +46,10 @@ function handleSearchBarKeyup(e) {
|
|||||||
if (term !== MainSearch.results.query || main_selected == 'search_tab') {
|
if (term !== MainSearch.results.query || main_selected == 'search_tab') {
|
||||||
document.getElementById('search_tab_content').style.display = 'none'
|
document.getElementById('search_tab_content').style.display = 'none'
|
||||||
socket.emit('mainSearch', { term })
|
socket.emit('mainSearch', { term })
|
||||||
|
|
||||||
|
// Showing loading placeholder
|
||||||
|
document.getElementById('content').style.display = 'none'
|
||||||
|
document.getElementById('search_placeholder').classList.toggle('loading_placeholder--hidden')
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('search_tab_content').style.display = 'block'
|
document.getElementById('search_tab_content').style.display = 'block'
|
||||||
document.getElementById('main_search_tablink').click()
|
document.getElementById('main_search_tablink').click()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
export const socket = io.connect(window.location.href)
|
export const socket = io.connect(window.location.href)
|
||||||
|
|
||||||
socket.on('connect', () => {
|
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 {
|
@keyframes spin {
|
||||||
from {
|
from {
|
||||||
transform: rotate(0deg);
|
transform: rotate(0deg);
|
||||||
|
@ -12,13 +12,13 @@ input[type='search'] {
|
|||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type=search]::-webkit-search-cancel-button {
|
input[type='search']::-webkit-search-cancel-button {
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
width: 28px;
|
width: 28px;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
background-color: var(--foreground);
|
background-color: var(--foreground);
|
||||||
-webkit-mask-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='28' viewBox='0 0 24 24' width='28'%3E%%3Cpath fill='%23ffffff' d='M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.9.89 1.59.89h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3 12.59L17.59 17 14 13.41 10.41 17 9 15.59 12.59 12 9 8.41 10.41 7 14 10.59 17.59 7 19 8.41 15.41 12 19 15.59z'/%3E3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
|
-webkit-mask-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='28' viewBox='0 0 24 24' width='28'%3E%%3Cpath fill='%23ffffff' d='M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.9.89 1.59.89h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3 12.59L17.59 17 14 13.41 10.41 17 9 15.59 12.59 12 9 8.41 10.41 7 14 10.59 17.59 7 19 8.41 15.41 12 19 15.59z'/%3E3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
|
||||||
mask-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='28' viewBox='0 0 24 24' width='28'%3E%%3Cpath fill='%23ffffff' d='M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.9.89 1.59.89h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3 12.59L17.59 17 14 13.41 10.41 17 9 15.59 12.59 12 9 8.41 10.41 7 14 10.59 17.59 7 19 8.41 15.41 12 19 15.59z'/%3E3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
|
mask-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' height='28' viewBox='0 0 24 24' width='28'%3E%%3Cpath fill='%23ffffff' d='M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.9.89 1.59.89h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-3 12.59L17.59 17 14 13.41 10.41 17 9 15.59 12.59 12 9 8.41 10.41 7 14 10.59 17.59 7 19 8.41 15.41 12 19 15.59z'/%3E3Cpath d='M0 0h24v24H0z' fill='none'/%3E%3C/svg%3E");
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type='checkbox'] {
|
input[type='checkbox'] {
|
||||||
@ -96,28 +96,6 @@ button:hover {
|
|||||||
border: 1px solid var(--accent-color);
|
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 {
|
#main_content {
|
||||||
margin-left: 48px;
|
margin-left: 48px;
|
||||||
width: calc(100% - 48px);
|
width: calc(100% - 48px);
|
||||||
@ -304,3 +282,34 @@ button.with_icon i {
|
|||||||
.hide {
|
.hide {
|
||||||
display: none !important;
|
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/settings-tab';
|
||||||
@import './tabs/tabs';
|
@import './tabs/tabs';
|
||||||
|
|
||||||
@import './animations';
|
|
||||||
@import './middle-section';
|
@import './middle-section';
|
||||||
@import './progressbar';
|
@import './progressbar';
|
||||||
@import './sidebar';
|
@import './sidebar';
|
||||||
|
Loading…
Reference in New Issue
Block a user