Fake Name Generator
body {
font-family: Arial, sans-serif;
background-color: #f0f8ff;
color: #333;
margin: 0;
padding: 0;
}
.container {
max-width: 600px;
margin: auto;
padding: 20px;
text-align: center;
background: linear-gradient(135deg, #ffafbd, #ffc3a0);
border-radius: 10px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
h1 {
font-size: 2.5em;
margin-bottom: 20px;
}
.generator {
margin-top: 20px;
}
button {
padding: 10px 20px;
font-size: 1.2em;
background-color: #ff6b6b;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #ff4d4d;
}
.output {
margin-top: 20px;
padding: 20px;
background-color: white;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
h2 {
margin: 10px 0;
font-size: 1.8em;
color: #333;
}
p {
margin: 5px 0;
font-size: 1.2em;
}
document.getElementById('generate').addEventListener('click', generateFakeName);
function generateFakeName() {
const names = ["John Doe", "Jane Smith", "Emily Johnson", "Michael Brown", "Jessica Williams"];
const streets = ["123 Elm St", "456 Maple Ave", "789 Oak Dr", "101 Pine Ct", "202 Birch Blvd"];
const cities = ["Springfield", "Greenville", "Fairview", "Midtown", "Riverside"];
const states = ["NY", "CA", "TX", "FL", "IL"];
const zipCodes = ["12345", "67890", "10112", "13141", "51516"];
const randomName = names[Math.floor(Math.random() * names.length)];
const randomAddress = `${streets[Math.floor(Math.random() * streets.length)]}, ${cities[Math.floor(Math.random() * cities.length)]}, ${states[Math.floor(Math.random() * states.length)]} ${zipCodes[Math.floor(Math.random() * zipCodes.length)]}`;
const randomEmail = randomName.split(" ").join("").toLowerCase() + "@example.com";
const randomPhone = `(${Math.floor(Math.random() * 900 + 100)}) ${Math.floor(Math.random() * 900 + 100)}-${Math.floor(Math.random() * 9000 + 1000)}`;
document.getElementById('name').innerText = randomName;
document.getElementById('address').innerText = randomAddress;
document.getElementById('email').innerText = randomEmail;
document.getElementById('phone').innerText = randomPhone;
}
No comments:
Post a Comment