1
0
Fork 0
mirror of https://github.com/Findus23/nonsense.git synced 2024-09-20 17:13:50 +02:00
nonsense/public/index.html

75 lines
2.6 KiB
HTML
Raw Normal View History

2017-12-11 14:55:40 +01:00
<!DOCTYPE html>
2017-12-11 18:24:25 +01:00
<html lang="de">
2017-12-11 14:55:40 +01:00
<head>
<meta charset="UTF-8">
2017-12-11 18:47:15 +01:00
<title>nonsense</title>
2017-12-11 18:53:15 +01:00
<meta name="viewport" content="width=device-width, initial-scale=1">
2017-12-11 19:09:54 +01:00
<meta name="theme-color" content="#003399">
2017-12-11 14:55:40 +01:00
<link rel="stylesheet" href="style.css">
2017-12-11 21:53:30 +01:00
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function () {
var u = "https://piwik.ferienhaus-schiltern.at/";
_paq.push(['setTrackerUrl', u + 'piwik.php']);
_paq.push(['setSiteId', '13']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.type = 'text/javascript';
g.async = true;
g.defer = true;
g.src = u + 'piwik.js';
s.parentNode.insertBefore(g, s);
})();
</script>
<!-- End Piwik Code -->
2017-12-11 14:55:40 +01:00
</head>
<body>
<div id="contentbox">
<a href="#" id="buttonwrapper">
<svg viewBox="0 0 205.2 205.2" height="775.7" width="775.7" id="icon">
<g transform="translate(-3.2 -43.2)">
<circle r="88.7" cy="145.8" cx="105.8" fill="#fff"></circle>
<path d="M121.4 198.8c-.2-.2-5.1-.4-10.9-.5-5.7-.1-10.4-.4-10.4-.7 0-.3 9-10 20-21.8l20.1-21.4-50.8-.2-50.9-.2V134.3l51-.2 51.1-.2-16.7-17.6-20.4-21.6-3.8-3.9H124.4l24.6 26.3a687.5 687.5 0 0 1 24.6 27.1c0 .7-41.6 45-48.7 52-1.7 1.6-3.3 2.8-3.5 2.6z"></path>
</g>
</svg>
<span id="button">Neu Generieren</span>
</a>
<div id="box">
<div id="name">
</div>
<div id="description">
</div>
</div>
</div>
<script>
function fetchDescription() {
var descriptionDiv = document.getElementById("description");
var nameDiv = document.getElementById("name");
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
var data = JSON.parse(xhr.responseText)[0];
descriptionDiv.innerText = data.description;
nameDiv.innerText = data.name;
}
}
};
2017-12-11 18:24:25 +01:00
xhr.open('GET', '/api/description/1/', true);
2017-12-11 14:55:40 +01:00
xhr.send(null);
}
2017-12-11 21:53:30 +01:00
2017-12-11 14:55:40 +01:00
fetchDescription();
2017-12-11 21:53:30 +01:00
document.getElementById("buttonwrapper").addEventListener("click", function () {
_paq.push(['trackEvent', 'nonsense', 'reload']);
fetchDescription();
});
2017-12-11 14:55:40 +01:00
</script>
</body>
2017-12-11 18:24:25 +01:00
</html>