<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>History Flooder</title>
    <link href="./prism.css" rel="stylesheet" />
    <style>

        input {
            margin: 10px;
            padding: 5px;
        }

        button {
            padding: 10px;
            background-color: #333333;
            color: white;
            border: none;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        button:hover {
            background-color: #424549;
        }

        * {
            background-color: black;
            color: rgb(196, 196, 196);
            font-family: monospace;
        }
        input,button {
				background-color: #131313;
				border:#0a0a0a ;
				border-width: 3px;
				border-radius: 3px;
				border-style:solid;
				margin: 1.4px;
				cursor: pointer;
			}  
            * {
            background-color: black;
            color: rgb(196, 196, 196);
            font-family: monospace;
        }
        input,button {
				background-color: #131313;
				border:#0a0a0a ;
				border-width: 3px;
				border-radius: 3px;
				border-style:solid;
				margin: 1.4px;
				cursor: pointer;
			}
  
	
    </style>
</head>
<body>
    <h1><u>PageFlood</u> <shiny>+</shiny></h1>
    <h2>Make sure to allow popups!</h2>
    <p>Step 1: Drag this tab into a new window.</p>
	<p>Step 2: Type in the URL you want to flood your history with.</p>
	<p>Step 3: Type how many times you want it to appear in your history. (preferably >100)</p>
	<p>Step 4: Press the "Flood" button and unleash the tsunami.</p>
	<p>Step 5: Close this window after all the pages load.</p>
	<p>Step 5: Congratulations! Your history is now flooded with the URL of choice.</p>
    <label for="num">How Many Times:</label>
    <input type="number" id="num" placeholder="Enter a number" min="1" required><br>

    <label for="url">Target URL:</label>
    <input type="url" id="url" placeholder="Enter the URL" required><br>

    <button onclick="performHistoryFlooding()">Flood History</button>

    <script>

function performHistoryFlooding() {
            var num = document.getElementById('num').value;
            var url = document.getElementById('url').value;

            for (var i = 1; i <= num; i++) {
                // Simulate clicking a link with the URL put in the box
                var link = document.createElement('a');
                link.href = url;
                link.target = '_blank'; // Open in a new tab/window
                document.body.appendChild(link);
                link.click();
                document.body.removeChild(link);
            }

            alert("History Flooding Successful!\n" + link + "\nNow Appears In Your History " + num + (num === 1 ? " time." : " Times."));
        }
    </script>
</body>
</html>