Fake address gernater tool
<!DOCTYPE html>
<html> <head> (…) (…) <title>Fake Address Generator</title> <style> body { font-family: Arial, sans-serif; } .container { max-width: 400px; margin: 0 auto; padding: 20px; } h1 { text-align: center; } button { display: block; margin: 20px auto; padding: 10px 20px; background-color: #4CAF50; color: #fff; border: none; border-radius: 4px; cursor: pointer; } .result-container { margin-top: 20px; padding: 10px; border: 1px solid #ccc; background-color: #f7f7f7; box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2); } .address { margin-bottom: 10px; } .copy-button { display: inline-block; margin-left: 10px; padding: 5px 10px; background-color: #4CAF50; color: #fff; border: none; border-radius: 4px; cursor: pointer; } </style> </head> <body> <div class="container"> <h1>Fake Address Generator</h1> <button onclick="generateAddress()">Generate Address</button> <div id="resultContainer" class="result-container"></div> </div> <script> const resultContainer = document.getElementById('resultContainer'); function generateAddress() { const streetNames = [ 'Main Street', 'First Avenue', 'Park Road', 'Elm Street', 'Cedar Lane', 'Maple Avenue', 'Pine Street', 'Oak Drive', 'Walnut Avenue', 'Spruce Court' ]; const cities = [ 'New York', 'Los Angeles', 'Chicago', 'Houston', 'Phoenix', 'Philadelphia', 'San Antonio', 'San Diego', 'Dallas', 'San Jose' ]; const randomStreet = streetNames[Math.floor(Math.random() * streetNames.length)]; const randomCity = cities[Math.floor(Math.random() * cities.length)]; const randomZip = generateRandomNumber(10000, 99999); const address = `${randomStreet}, ${randomCity}, ${randomZip}`; displayAddress(address); } function generateRandomNumber(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; } function displayAddress(address) { resultContainer.innerHTML = ''; const addressElement = document.createElement('div'); addressElement.classList.add('address'); addressElement.textContent = address; const copyButton = document.createElement('button'); copyButton.classList.add('copy-button'); copyButton.textContent = 'Copy'; copyButton.addEventListener('click', function () { copyToClipboard(address); }); addressElement.appendChild(copyButton); resultContainer.appendChild(addressElement); } function copyToClipboard(text) { const textarea = document.createElement('textarea'); textarea.value = text; document.body.appendChild(textarea); textarea.select(); document.execCommand('copy'); document.body.removeChild(textarea); alert('Copied to clipboard: ' + text); } </script> </body> </html>
Comments
Post a Comment
sunil191280@gmail.com