File size: 1,407 Bytes
0e76632
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!-- LoadingOverlay — Shows the hexagonal MAC loader centered with optional message -->
<script>
  import Loader from './Loader.svelte';
  import { globalLoading, loadingMessage } from '$lib/stores.js';

  export let show = false;
  export let message = '';
  export let size = 100;

  // Can be driven by props OR by global store
  $: visible = show || $globalLoading;
  $: displayMsg = message || $loadingMessage || '';
</script>

{#if visible}
  <div class="loading-overlay" aria-live="polite">
    <div class="loading-content">
      <Loader {size} color="var(--accent, #D97449)" />
      {#if displayMsg}
        <p class="loading-msg">{displayMsg}</p>
      {/if}
    </div>
  </div>
{/if}

<style>
  .loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.25s ease;
  }

  .loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .loading-msg {
    font-size: 14px;
    font-weight: 500;
    color: var(--text, #1A1A1A);
    letter-spacing: 0.03em;
    opacity: 0.85;
    margin: 0;
    text-align: center;
    max-width: 280px;
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
</style>