Code import
This commit is contained in:
62
index.html
Normal file
62
index.html
Normal file
@@ -0,0 +1,62 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html lang="nl">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>T.A.E.N.I.A.</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link rel="icon" href="favicon.png">
|
||||
<script>
|
||||
var submit = null;
|
||||
|
||||
function handleFormSubmit(event) {
|
||||
// Manually construct the submit event, because GET forms use incorrect URL encoding for mail clients.
|
||||
event.preventDefault();
|
||||
|
||||
const form = event.target;
|
||||
const bodyText = document.getElementById("body-text").value;
|
||||
|
||||
window.location = form.action + "?"
|
||||
+ "subject=" + encodeURI(form.dataset.chosen)
|
||||
+ "&body=" + encodeURI(bodyText);
|
||||
}
|
||||
|
||||
window.addEventListener("load", function () {
|
||||
const form = document.getElementsByTagName("form")[0];
|
||||
form.addEventListener("submit", handleFormSubmit);
|
||||
|
||||
const handleClick = function (event) {
|
||||
form.dataset.chosen = event.target.value;
|
||||
};
|
||||
|
||||
const buttons = form.querySelectorAll("input[type=submit]");
|
||||
for (let i = 0; i < buttons.length; ++i) {
|
||||
buttons[i].addEventListener("click", handleClick);
|
||||
}
|
||||
|
||||
form.dataset.chosen = buttons[0].value;
|
||||
})
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="viewport">
|
||||
<img id="logo" src="google-logo.svg" alt="Googl.I.A.">
|
||||
<form action="mailto:taeniabestuur@gmail.com">
|
||||
<input class="search" id="body-text" name="body" autofocus>
|
||||
<div class="buttons">
|
||||
<input type="submit" name="subject" value="T.A.E.N.I.A. zoeken">
|
||||
<input type="submit" name="subject" value="Moederdier red mij">
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<p>Volg de hele week <a href="https://dcw.ssr-leiden.nl/" target="_blank">de strijd tegen nepnieuws.</a></p>
|
||||
|
||||
<p>Google aangeboden in: <a href="http://www.dispuut-mocca.nl/" target="_blank">Overleden dispuut</a></p>
|
||||
</div>
|
||||
<div id="bottom-bar">
|
||||
<div>
|
||||
<a href="https://www.ssr-leiden.nl/">SSR Leiden</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user