File size: 2,237 Bytes
f909699
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
class CustomPreloader extends HTMLElement {
  connectedCallback() {
    this.attachShadow({ mode: 'open' });
    this.shadowRoot.innerHTML = `
      <style>
        :host {
          position: fixed;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background: rgba(var(--color-dark), 1);
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;
          z-index: 9999;
          transition: opacity 0.8s cubic-bezier(0.77, 0, 0.175, 1);
        }
        .loader {
          width: 80px;
          height: 80px;
          position: relative;
        }
        .loader-circle {
          position: absolute;
          width: 100%;
          height: 100%;
          border: 3px solid transparent;
          border-top-color: rgba(var(--color-primary), 1);
          border-radius: 50%;
          animation: spin 1.5s cubic-bezier(0.65, 0.05, 0.36, 1) infinite;
        }
        .loader-circle:nth-child(2) {
          border-top-color: rgba(var(--color-secondary), 1);
          animation-delay: 0.3s;
          width: 70%;
          height: 70%;
          top: 15%;
          left: 15%;
        }
        .loader-circle:nth-child(3) {
          border-top-color: rgba(var(--color-accent), 1);
          animation-delay: 0.6s;
          width: 50%;
          height: 50%;
          top: 25%;
          left: 25%;
        }
        @keyframes spin {
          0% { transform: rotate(0deg); }
          100% { transform: rotate(360deg); }
        }
        .progress-text {
          margin-top: 2rem;
          font-family: var(--font-mono);
          font-size: 0.875rem;
          color: rgba(255,255,255,0.7);
          letter-spacing: 0.1em;
        }
      </style>
      <div class="loader">
        <div class="loader-circle"></div>
        <div class="loader-circle"></div>
        <div class="loader-circle"></div>
      </div>
      <div class="progress-text">LOADING PORTFOLIO</div>
    `;

    // Simulate loading
    setTimeout(() => {
      this.style.opacity = '0';
      setTimeout(() => {
        this.remove();
      }, 800);
    }, 2000);
  }
}

customElements.define('custom-preloader', CustomPreloader);