Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
fdsggfd authored Dec 20, 2023
1 parent 46c1240 commit cba4313
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions templates/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand All @@ -9,18 +10,20 @@
body {
font-family: Arial, sans-serif;
margin: 20px;
color: white; /* Set text color to white */
color: white;
}

#output {
margin-top: 20px;
color: white; /* Set text color to white */
color: white;
}
/* Add this style for button text color */

button {
color: white;
}
</style>
</head>

<body>
<h1>Social Media Checker</h1>
<form id="checkerForm">
Expand All @@ -34,27 +37,32 @@ <h1>Social Media Checker</h1>
<script>
function checkSocialMedia() {
var email = document.getElementById('email').value;
var outputDiv = document.getElementById('output');

// Display loading message
outputDiv.innerHTML = "Loading... Please wait.";

var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
var result = JSON.parse(xhr.responseText);
document.getElementById('output').innerHTML = `
outputDiv.innerHTML = `
<p>Twitter: ${result.twitter}</p>
<p>Instagram: ${result.instagram}</p>
<p>Snapchat: ${result.snapchat}</p>
`;
} else {
document.getElementById('output').innerHTML = "Error: Unable to fetch results.";
outputDiv.innerHTML = "Error: Unable to fetch results.";
}
}
};

xhr.open('POST', '/check', true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.send(JSON.stringify({email: email}));
xhr.send(JSON.stringify({ email: email }));
}
</script>
</body>

</html>

0 comments on commit cba4313

Please sign in to comment.