<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Email Extractor Tool</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>Email Extractor</h1>
<label for="textInput">Enter or Paste Text:</label>
<textarea id="textInput" placeholder="Paste your text here..."></textarea>
<button onclick="extractEmails()">Extract Emails</button>
<h2>Extracted Emails:</h2>
<textarea id="emailOutput" readonly></textarea>
<button onclick="copyEmails()">Copy Emails</button>
</div>
<script src="script.js"></script>
</body>
</html>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: Arial, sans-serif;
}
body {
background: linear-gradient(to right, #ff512f, #dd2476);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
text-align: center;
padding: 10px;
}
.container {
background: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
max-width: 400px;
width: 100%;
}
h1, h2 {
color: #333;
}
label {
font-weight: bold;
display: block;
margin-top: 10px;
text-align: left;
}
textarea {
width: 100%;
padding: 10px;
border: 2px solid #ff512f;
border-radius: 5px;
margin-top: 5px;
height: 80px;
resize: none;
}
button {
background: #ff512f;
color: #fff;
border: none;
padding: 10px;
border-radius: 5px;
cursor: pointer;
margin-top: 10px;
width: 100%;
transition: 0.3s;
}
button:hover {
background: #e0462b;
}
function extractEmails() {
let text = document.getElementById("textInput").value;
let emailRegex = /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g;
let emails = text.match(emailRegex) || [];
let uniqueEmails = [...new Set(emails)];
document.getElementById("emailOutput").value = uniqueEmails.join("\n");
}
function copyEmails() {
let emailOutput = document.getElementById("emailOutput");
emailOutput.select();
document.execCommand("copy");
alert("Emails copied to clipboard!");
}
