cocoat commited on
Commit
dd48974
·
verified ·
1 Parent(s): 697b196

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -16
app.py CHANGED
@@ -465,18 +465,17 @@ progress::-moz-progress-bar {
465
  align-items: center;
466
  justify-content: center;
467
  font-weight: bold;
468
- position: fixed !important;
469
- top: 50% !important;
470
  left: 50% !important;
471
  transform: translate(-50%, -50%) !important;
472
  width: 100vw !important;
473
  height: 100vh !important;
474
- display: flex !important;
475
  z-index: 9999 !important;
476
- background-color: rgba(255, 250, 241, 0.9) !important;
 
477
  }
478
 
479
- body.gradio-running #custom-loader { display: flex; }
480
  #custom-loader, .loading-text {
481
  width: auto !important;
482
  height: auto !important;
@@ -485,11 +484,11 @@ height: auto !important;
485
  #custom-loader .loading-text span {
486
  display: inline-block;
487
  animation: fadeLetter 1.8s ease-in-out infinite;
488
- font-size:3em;
489
  }
490
  #custom-loader img {
491
- width: 64px;
492
- height: 64px;
493
  border-radius: 50%;
494
  margin-left: 8px;
495
  display: inline-block;
@@ -529,17 +528,17 @@ with gr.Blocks(css=css, theme=gr.themes.Default(font=[gr.themes.GoogleFont("Play
529
  """
530
  <script>
531
  window.addEventListener('load', () => {
532
- // const observer = new MutationObserver(() => {
533
- // const svg = document.querySelector('svg.svelte-zyxd38');
534
- // if (!svg) return;
535
  // 一度挿入したら再挿入しない
536
- // if (svg.querySelector('foreignObject#custom-loader-fo')) return;
537
 
538
- const component25 = document.querySelector('.image-container');
539
  if (component25) {
540
  // カスタムローダーのHTML
541
  const loaderHTML = `
542
- <div id="custom-loader" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
543
  <div class="loading-text">
544
  <span style="animation-delay:0s">i</span>
545
  <span style="animation-delay:0.1s">n</span>
@@ -559,8 +558,8 @@ window.addEventListener('load', () => {
559
  component25.insertAdjacentHTML('beforeend', loaderHTML);
560
  }
561
 
562
- // });
563
- // observer.observe(document.body, { childList: true, subtree: true });
564
  });
565
 
566
  </script>
 
465
  align-items: center;
466
  justify-content: center;
467
  font-weight: bold;
468
+ position: absolute !important;
469
+ bottom: 0 !important;
470
  left: 50% !important;
471
  transform: translate(-50%, -50%) !important;
472
  width: 100vw !important;
473
  height: 100vh !important;
 
474
  z-index: 9999 !important;
475
+ display: flex;
476
+ /* background-color: rgba(255, 250, 241, 0) !important;*/
477
  }
478
 
 
479
  #custom-loader, .loading-text {
480
  width: auto !important;
481
  height: auto !important;
 
484
  #custom-loader .loading-text span {
485
  display: inline-block;
486
  animation: fadeLetter 1.8s ease-in-out infinite;
487
+ font-size:1.5em;
488
  }
489
  #custom-loader img {
490
+ width: 32px;
491
+ height: 32px;
492
  border-radius: 50%;
493
  margin-left: 8px;
494
  display: inline-block;
 
528
  """
529
  <script>
530
  window.addEventListener('load', () => {
531
+ const observer = new MutationObserver(() => {
532
+ const svg = document.querySelector('svg.svelte-zyxd38');
533
+ if (!svg) return;
534
  // 一度挿入したら再挿入しない
535
+ if (svg.querySelector('foreignObject#custom-loader-fo')) return;
536
 
537
+ const component25 = document.querySelector('.svelte-ls20lj');
538
  if (component25) {
539
  // カスタムローダーのHTML
540
  const loaderHTML = `
541
+ <div id="custom-loader">
542
  <div class="loading-text">
543
  <span style="animation-delay:0s">i</span>
544
  <span style="animation-delay:0.1s">n</span>
 
558
  component25.insertAdjacentHTML('beforeend', loaderHTML);
559
  }
560
 
561
+ });
562
+ observer.observe(document.body, { childList: true, subtree: true });
563
  });
564
 
565
  </script>