File size: 1,464 Bytes
3002579
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
document.addEventListener('DOMContentLoaded', () => {
    // Initialize Vanta.js background
    VANTA.NET({
        el: "#vanta-background",
        mouseControls: true,
        touchControls: true,
        gyroControls: false,
        minHeight: 200.00,
        minWidth: 200.00,
        scale: 1.00,
        scaleMobile: 1.00,
        color: 0x7c3aed,
        backgroundColor: 0xf9fafb,
        points: 12.00,
        maxDistance: 22.00,
        spacing: 18.00
    });
    // Encoding/Decoding functions
    window.encodeMessage = function() {
      const input = document.getElementById('encode-input').value;
      const encoded = btoa(encodeURIComponent(input));
      document.getElementById('encode-output').textContent = encoded;
    };

    window.decodeMessage = function() {
      const input = document.getElementById('decode-input').value;
      try {
        const decoded = decodeURIComponent(atob(input));
        document.getElementById('decode-output').textContent = decoded;
      } catch (e) {
        document.getElementById('decode-output').textContent = "Invalid encoded message";
      }
    };

    // Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
        anchor.addEventListener('click', function (e) {
            e.preventDefault();
            document.querySelector(this.getAttribute('href')).scrollIntoView({
                behavior: 'smooth'
            });
        });
    });
});