ritterkraft commited on
Commit
f21a0d4
·
verified ·
1 Parent(s): a6aaa57

Add footer connect prompt and audio

Browse files
Files changed (3) hide show
  1. app.js +35 -0
  2. index.html +15 -2
  3. styles.css +51 -0
app.js CHANGED
@@ -145,6 +145,41 @@ document.getElementById("copy-command").addEventListener("click", async () => {
145
  window.toastTimer = setTimeout(() => toast.classList.remove("show"), 1500);
146
  });
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  window.addEventListener("resize", resize);
149
  resize();
150
  draw();
 
145
  window.toastTimer = setTimeout(() => toast.classList.remove("show"), 1500);
146
  });
147
 
148
+ const connectPrompt = document.getElementById("connect-prompt");
149
+ const connectAudio = document.getElementById("connect-audio");
150
+ const connectContinue = document.getElementById("connect-continue");
151
+ const connectClose = document.getElementById("connect-close");
152
+ const connectStay = document.getElementById("connect-stay");
153
+
154
+ document.querySelectorAll(".connect-link").forEach((link) => {
155
+ link.addEventListener("click", async (event) => {
156
+ event.preventDefault();
157
+ connectContinue.href = link.href;
158
+ connectPrompt.hidden = false;
159
+ connectAudio.currentTime = 0;
160
+ try {
161
+ await connectAudio.play();
162
+ } catch {
163
+ toast.textContent = "Tap Open link when ready";
164
+ toast.classList.add("show");
165
+ clearTimeout(window.toastTimer);
166
+ window.toastTimer = setTimeout(() => toast.classList.remove("show"), 1500);
167
+ }
168
+ });
169
+ });
170
+
171
+ function closeConnectPrompt() {
172
+ connectPrompt.hidden = true;
173
+ connectAudio.pause();
174
+ connectAudio.currentTime = 0;
175
+ }
176
+
177
+ connectClose.addEventListener("click", closeConnectPrompt);
178
+ connectStay.addEventListener("click", closeConnectPrompt);
179
+ connectPrompt.addEventListener("click", (event) => {
180
+ if (event.target === connectPrompt) closeConnectPrompt();
181
+ });
182
+
183
  window.addEventListener("resize", resize);
184
  resize();
185
  draw();
index.html CHANGED
@@ -112,12 +112,25 @@
112
  <footer class="site-footer" aria-label="Project links">
113
  <p>Advanced Data Intelligence is built in theLAB orbit.</p>
114
  <nav>
115
- <a href="https://thelabsource.com" target="_blank" rel="noreferrer">thelabsource.com</a>
116
- <a href="https://advanced-data-inteliigence.com" target="_blank" rel="noreferrer">advanced-data-inteliigence.com</a>
117
  </nav>
118
  </footer>
119
  </main>
120
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  <div class="toast" id="toast" role="status" aria-live="polite">Copied</div>
122
  <script src="./app.js"></script>
123
  </body>
 
112
  <footer class="site-footer" aria-label="Project links">
113
  <p>Advanced Data Intelligence is built in theLAB orbit.</p>
114
  <nav>
115
+ <a class="connect-link" href="https://thelabsource.com" target="_blank" rel="noreferrer">thelabsource.com</a>
116
+ <a class="connect-link" href="https://advanced-data-inteliigence.com" target="_blank" rel="noreferrer">advanced-data-inteliigence.com</a>
117
  </nav>
118
  </footer>
119
  </main>
120
 
121
+ <div class="connect-prompt" id="connect-prompt" hidden>
122
+ <div class="connect-card" role="dialog" aria-modal="true" aria-labelledby="connect-title">
123
+ <button class="connect-close" id="connect-close" type="button" aria-label="Close">×</button>
124
+ <p class="kicker"><span></span> Connection</p>
125
+ <h2 id="connect-title">Hi! I'm glad you are interested in connecting. Let's connect!</h2>
126
+ <div class="connect-actions">
127
+ <a class="button primary" id="connect-continue" href="https://thelabsource.com" target="_blank" rel="noreferrer">Open link</a>
128
+ <button class="button" id="connect-stay" type="button">Stay here</button>
129
+ </div>
130
+ </div>
131
+ </div>
132
+
133
+ <audio id="connect-audio" preload="auto" src="https://serve.thelabsource.com/u/Qk8XQz.mp3"></audio>
134
  <div class="toast" id="toast" role="status" aria-live="polite">Copied</div>
135
  <script src="./app.js"></script>
136
  </body>
styles.css CHANGED
@@ -508,6 +508,57 @@ code {
508
  font-weight: 700;
509
  }
510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
511
  .toast {
512
  position: fixed;
513
  z-index: 10;
 
508
  font-weight: 700;
509
  }
510
 
511
+ .connect-prompt {
512
+ position: fixed;
513
+ inset: 0;
514
+ z-index: 20;
515
+ display: grid;
516
+ place-items: center;
517
+ padding: 22px;
518
+ background: rgba(0, 0, 0, 0.62);
519
+ backdrop-filter: blur(18px);
520
+ }
521
+
522
+ .connect-prompt[hidden] {
523
+ display: none;
524
+ }
525
+
526
+ .connect-card {
527
+ position: relative;
528
+ width: min(720px, 100%);
529
+ padding: clamp(24px, 5vw, 46px);
530
+ border: 1px solid var(--line);
531
+ border-radius: 24px;
532
+ background:
533
+ linear-gradient(135deg, rgba(37,247,196,0.12), transparent 34%),
534
+ linear-gradient(315deg, rgba(245,182,74,0.12), transparent 34%),
535
+ rgba(8, 15, 22, 0.94);
536
+ box-shadow: 0 34px 140px rgba(0,0,0,0.6);
537
+ }
538
+
539
+ .connect-card h2 {
540
+ margin-bottom: 22px;
541
+ font-size: clamp(34px, 5vw, 64px);
542
+ }
543
+
544
+ .connect-close {
545
+ position: absolute;
546
+ top: 14px;
547
+ right: 14px;
548
+ width: 42px;
549
+ height: 42px;
550
+ border: 1px solid var(--line);
551
+ border-radius: 999px;
552
+ background: rgba(255,255,255,0.04);
553
+ cursor: pointer;
554
+ }
555
+
556
+ .connect-actions {
557
+ display: flex;
558
+ flex-wrap: wrap;
559
+ gap: 12px;
560
+ }
561
+
562
  .toast {
563
  position: fixed;
564
  z-index: 10;