Skip to content

Commit

Permalink
Create create.html
Browse files Browse the repository at this point in the history
  • Loading branch information
PythonScratcher authored Jun 30, 2024
1 parent e1b2c6e commit 2c0c45a
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions create.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>User Account Generator</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
max-width: 400px;
width: 100%;
text-align: center;
}
h1 {
color: #333;
}
button {
background-color: #4CAF50;
color: white;
border: none;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin-top: 20px;
cursor: pointer;
border-radius: 4px;
transition: background-color 0.3s;
}
button:hover {
background-color: #45a049;
}
.result {
margin-top: 20px;
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #f9f9f9;
display: none;
}
.result p {
margin: 5px 0;
}
</style>
</head>
<body>
<div class="container">
<h1>User Account Generator</h1>
<button id="generateBtn">Generate Account</button>
<div class="result" id="resultDiv">
<p id="username">Username: <span id="usernameValue"></span></p>
<p id="password">Password: <span id="passwordValue"></span></p>
</div>
</div>

<script>
document.getElementById('generateBtn').addEventListener('click', function() {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://liverpool.uk-fc.net/api.php', true);
xhr.onload = function() {
if (xhr.status === 200) {
var data = JSON.parse(xhr.responseText);
document.getElementById('usernameValue').textContent = data.username;
document.getElementById('passwordValue').textContent = data.password;
document.getElementById('resultDiv').style.display = 'block';
} else {
alert('Error fetching data from the server. Please try again later.');
}
};
xhr.onerror = function() {
alert('Request failed. Please check your internet connection and try again.');
};
xhr.send();
});
</script>
</body>
</html>

0 comments on commit 2c0c45a

Please sign in to comment.