mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-02 02:47:52 +01:00
Remove popup animation
This commit is contained in:
parent
5a8973d12a
commit
da63c26258
@ -14,7 +14,7 @@ export function showLoader() {
|
|||||||
loaderPopup = new Popup(`
|
loaderPopup = new Popup(`
|
||||||
<div id="loader">
|
<div id="loader">
|
||||||
<div id="load-spinner" class="fa-solid fa-gear fa-spin fa-3x"></div>
|
<div id="load-spinner" class="fa-solid fa-gear fa-spin fa-3x"></div>
|
||||||
</div>`, POPUP_TYPE.DISPLAY, null, { transparent: true, animation: 'fast' });
|
</div>`, POPUP_TYPE.DISPLAY, null, { transparent: true, animation: 'none' });
|
||||||
|
|
||||||
// No close button, loaders are not closable
|
// No close button, loaders are not closable
|
||||||
loaderPopup.closeButton.style.display = 'none';
|
loaderPopup.closeButton.style.display = 'none';
|
||||||
@ -23,19 +23,19 @@ export function showLoader() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function hideLoader() {
|
export async function hideLoader() {
|
||||||
// Yoink preloader entirely; it only exists to cover up unstyled content while loading JS
|
|
||||||
// If it's present, we remove it once and then it's gone.
|
|
||||||
yoinkPreloader();
|
|
||||||
|
|
||||||
if (!loaderPopup) {
|
if (!loaderPopup) {
|
||||||
console.warn('There is no loader showing to hide');
|
console.warn('There is no loader showing to hide');
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
//Sets up a 2-step animation. Spinner blurs/fades out, and then the loader shadow does the same (by utilizing the popup closing transition)
|
// Spinner blurs/fades out
|
||||||
$('#load-spinner').on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () {
|
$('#load-spinner').on('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd', function () {
|
||||||
$(`#${ELEMENT_ID}`).remove();
|
$(`#${ELEMENT_ID}`).remove();
|
||||||
|
// Yoink preloader entirely; it only exists to cover up unstyled content while loading JS
|
||||||
|
// If it's present, we remove it once and then it's gone.
|
||||||
|
yoinkPreloader();
|
||||||
|
|
||||||
loaderPopup.complete(POPUP_RESULT.AFFIRMATIVE).then(() => {
|
loaderPopup.complete(POPUP_RESULT.AFFIRMATIVE).then(() => {
|
||||||
loaderPopup = null;
|
loaderPopup = null;
|
||||||
resolve();
|
resolve();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user