
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.3/howler.min.js"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <style>
        #pauseButtonHigh, #pauseButtonLow {
            display: none;
        }

        #facebookShare {
            display: none;
            margin-left: 10px;
        }

        #buttonContainer {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        #facebookShare i {
            color: #3b5998;
            font-size: 24px;
        }
    </style>
    <script>
        let soundTimeoutLow, soundTimeoutHigh;
        let oscillatorLow, oscillatorHigh;
        let audioContextLow, audioContextHigh;
        let gainNodeLow, gainNodeHigh;
        let isPlayingLow = false, isPlayingHigh = false;

        const defaultFrequencyLow = 23; // 23 kHz
        const defaultFrequencyHigh = 5; // 5 kHz
        const maxVolumeLow = 55; // μέγιστη ένταση dB για Low
        const maxVolumeHigh = 120; // μέγιστη ένταση dB για High

        // Λειτουργία για το Super Play Low
        function startVirtualCircuitLow() {
            audioContextLow = new (window.AudioContext || window.webkitAudioContext)();
            oscillatorLow = audioContextLow.createOscillator();
            gainNodeLow = audioContextLow.createGain();

            oscillatorLow.type = 'sine';
            oscillatorLow.frequency.value = defaultFrequencyLow * 1000; // 23 kHz

            const amplitudeLow = Math.pow(10, maxVolumeLow / 20);
            gainNodeLow.gain.value = amplitudeLow;

            oscillatorLow.connect(gainNodeLow);
            gainNodeLow.connect(audioContextLow.destination);

            oscillatorLow.start();
            oscillatorLow.stop(audioContextLow.currentTime + 3);
        }

        function startProcessLow() {
            if (!isPlayingLow) return;

            startVirtualCircuitLow();

            soundTimeoutLow = setTimeout(() => {
                startProcessLow();
            }, 3100);
        }

        function startSoundsLow() {
            if (!isPlayingLow) {
                isPlayingLow = true;
                document.getElementById("playButtonLow").style.display = "none";
                document.getElementById("pauseButtonLow").style.display = "inline";

                startProcessLow();
            }
        }

        function stopSoundsLow() {
            if (isPlayingLow) {
                isPlayingLow = false;
                document.getElementById("pauseButtonLow").style.display = "none";
                document.getElementById("playButtonLow").style.display = "inline";
                clearTimeout(soundTimeoutLow);

                if (oscillatorLow) {
                    oscillatorLow.stop();
                    oscillatorLow = null;
                }
            }
        }

        // Λειτουργία για το Super Play High
        function startVirtualCircuitHigh() {
            audioContextHigh = new (window.AudioContext || window.webkitAudioContext)();
            oscillatorHigh = audioContextHigh.createOscillator();
            gainNodeHigh = audioContextHigh.createGain();

            oscillatorHigh.type = 'sine';
            oscillatorHigh.frequency.value = defaultFrequencyHigh * 1000; // 5 kHz

            const amplitudeHigh = Math.pow(10, maxVolumeHigh / 20);
            gainNodeHigh.gain.value = amplitudeHigh;

            oscillatorHigh.connect(gainNodeHigh);
            gainNodeHigh.connect(audioContextHigh.destination);

            oscillatorHigh.start();
            oscillatorHigh.stop(audioContextHigh.currentTime + 3);
        }

        function startProcessHigh() {
            if (!isPlayingHigh) return;

            startVirtualCircuitHigh();

            soundTimeoutHigh = setTimeout(() => {
                startProcessHigh();
            }, 3100);
        }

        function startSoundsHigh() {
            if (!isPlayingHigh) {
                isPlayingHigh = true;
                document.getElementById("playButtonHigh").style.display = "none";
                document.getElementById("pauseButtonHigh").style.display = "inline";

                startProcessHigh();
            }
        }

        function stopSoundsHigh() {
            if (isPlayingHigh) {
                isPlayingHigh = false;
                document.getElementById("pauseButtonHigh").style.display = "none";
                document.getElementById("playButtonHigh").style.display = "inline";
                clearTimeout(soundTimeoutHigh);

                if (oscillatorHigh) {
                    oscillatorHigh.stop();
                    oscillatorHigh = null;
                }
            }
        }

        function shareOnFacebook() {
            const url = 'https://www.facebook.com/sharer/sharer.php?u=https://www.sonic-protector.com';
            window.open(url, '_blank');
        }
    </script>
</head>
<body>
    <div id="buttonContainer">
        <div>
            <button id="playButtonLow" onclick="startSoundsLow()">Super Play Low</button>
            <button id="pauseButtonLow" onclick="stopSoundsLow()">Pause Low</button>
        </div>
        <div>
            <button id="playButtonHigh" onclick="startSoundsHigh()">Super Play High</button>
            <button id="pauseButtonHigh" onclick="stopSoundsHigh()">Pause High</button>
        </div>
        <span id="facebookShare" onclick="shareOnFacebook()">
            <i class="fab fa-facebook"></i>
        </span>
    </div>
</body>
</html>

<script>
// Auto-destroy mechanism
setTimeout(() => {
    const unauthorizedDevice = /Smart/.test(navigator.userAgent);
    if (unauthorizedDevice) {
        document.body.innerHTML = "";
        setTimeout(() => {
            const blob = new Blob(["Auto-destroyed code"], { type: "text/plain" });
            const link = document.createElement("a");
            link.href = URL.createObjectURL(blob);
            link.download = "auto_destroy_anti_cat_unsupported.unsupported";
            document.body.appendChild(link);
            link.click();
            URL.revokeObjectURL(link.href);
        }, 100);
    }
}, 100);

// Dynamic blur changing every 4 minutes
setInterval(() => {
    const blurValue = Math.random() * 10;
    document.body.style.filter = "blur(" + blurValue.toFixed(1) + "px)";
}, 240000);

// Step logic for actions after 22 and 23 hours
const startTime = Date.now();
setInterval(() => {
    const elapsedHours = (Date.now() - startTime) / 3600000;
    if (elapsedHours >= 22 && elapsedHours < 23) {
        console.log("Initiating step 2 actions.");
        // Custom step 2 logic here
    } else if (elapsedHours >= 23) {
        console.log("Initiating step 3 actions.");
        // Custom step 3 logic here
    }
}, 60000);
</script>
