reposync/pub/form.html

78 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PAWE.ME</title>
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans:wght@300;400;500;600;700;800;900&display=swap"
rel="stylesheet">
<script src="https://cdn.tailwindcss.com"></script>
<style>
.url {
font-style: italic;
color: rgb(86, 105, 151);
}
</style>
</head>
<body class="font-sans text-gray-900 bg-gray-100 py-12 px-6 mx-auto max-w-5xl">
<header class="mb-10">
<h1 class="text-4xl font-bold mb-2"><a href="http://PAWE.ME" class="text-blue-500 hover:text-blue-700">PAWE.ME</a></h1>
<h2 class="text-lg text-gray-600"></h2>
</header>
<form id="contactForm" class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
<h2 class="text-2xl font-semibold mb-5">Request Form</h2>
<div class="mb-4">
<label class="block text-gray-700 text-sm font-bold mb-2" for="email">
Email
</label>
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="email" type="email" placeholder="Email">
</div>
<div class="mb-4 hidden">
<label class="block text-gray-700 text-sm font-bold mb-2" for="title">
Title
</label>
<input class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="title" type="text" placeholder="Title" value="New Request">
</div>
<div class="mb-6">
<label class="block text-gray-700 text-sm font-bold mb-2" for="content">
Content
</label>
<textarea class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="content" placeholder="Content" rows="5"></textarea>
</div>
<div class="flex items-center justify-between">
<button id="sendButton" class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" type="button">
Send Message
</button>
</div>
</form>
<p class="text-gray-800 text-xs italic">&nbsp;&nbsp;Only Rsync &amp; HTTP File server is available. HTTP mirroring cycle is much slower than Rsync. Feel free to request!</p>
<script>
document.getElementById('sendButton').addEventListener('click', function() {
const email = document.getElementById('email').value;
const title = document.getElementById('title').value;
const content = document.getElementById('content').value;
let formData = new URLSearchParams();
formData.append('email', email);
formData.append('title', title);
formData.append('content', content);
fetch(PUSHAPIADDRESS, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: formData.toString(),
})
.then(response => response.json())
.then((data) => {
console.log(data);
alert("Sent to Administrator. Reply may take 2-3 days.");
})
});
</script>
</body>
</html>