Move istschonwiedervollmond.de source here.
This commit is contained in:
parent
c0317bcfd9
commit
e3d655793f
2
.dockerignore
Normal file
2
.dockerignore
Normal file
|
@ -0,0 +1,2 @@
|
|||
LICENSE
|
||||
README.md
|
2
Dockerfile
Normal file
2
Dockerfile
Normal file
|
@ -0,0 +1,2 @@
|
|||
FROM php:7-apache
|
||||
COPY wwwroot /var/www/html
|
BIN
wwwroot/favicon.ico
Normal file
BIN
wwwroot/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
120
wwwroot/index.php
Normal file
120
wwwroot/index.php
Normal file
|
@ -0,0 +1,120 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="de-DE">
|
||||
<head profile="http://gmpg.org/xfn/11">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<?php
|
||||
//aktuelles Datum in Jahre umrechnen
|
||||
$year = ((((((date("s") / 60)+ date("i")) / 60)+date("G")) / 24) + date("z") - 1) / (365 + (date("L"))) + date("Y");
|
||||
//
|
||||
$rads = 3.14159265359/180;
|
||||
$phase=0.5;
|
||||
|
||||
//Anzahl der Mondphasen seit 2000
|
||||
$k = floor(($year-2000)*12.36853087)+$phase;
|
||||
// Mittlerer JDE Wert des Ereignisses
|
||||
$JDE = 2451550.09766+29.530588861*$k;
|
||||
// Relevante Winkelwerte in [Radiant]
|
||||
$M = (2.5534+29.10535670*$k)*$rads;
|
||||
$Ms = (201.5643+385.81693528*$k)*$rads;
|
||||
$F = (160.7108+390.67050284*$k)*$rads;
|
||||
//
|
||||
// Korrekturterme JDE f<>r Vollmond
|
||||
$JDE += -0.40614*Sin($Ms);
|
||||
$JDE += 0.17302*Sin($M);
|
||||
$JDE += 0.01614*Sin(2*$Ms);
|
||||
$JDE += 0.01043*Sin(2*$F);
|
||||
$JDE += 0.00734*Sin($Ms-$M);
|
||||
$JDE += -0.00515*Sin($Ms+$M);
|
||||
$JDE += 0.00209*Sin(2*$M);
|
||||
$JDE += -0.00111*Sin($Ms-2*$F);
|
||||
//
|
||||
//Konvertierung von Julianischem Datum auf Gregorianisches Datum
|
||||
$z = floor($JDE + 0.5);
|
||||
$f = ($JDE + 0.5) - floor($JDE + 0.5);
|
||||
if ($z < 2299161) {
|
||||
$a = $z;
|
||||
}
|
||||
else {
|
||||
$g = floor(($z - 1867216.25) / 36524.25);
|
||||
$a = $z + 1 + $g - floor($g / 4);
|
||||
}
|
||||
$b = $a + 1524;
|
||||
$c = floor(($b - 122.1) / 365.25);
|
||||
$d = floor(365.25 * $c);
|
||||
$e = floor(($b - $d) / 30.6001);
|
||||
|
||||
$tag_temp = $b - $d - floor(30.6001 * $e) + $f; //Tag incl. Tagesbruchteilen
|
||||
$stunde_temp = ($tag_temp - floor($tag_temp)) * 24;
|
||||
$minute_temp = ($stunde_temp - floor($stunde_temp)) * 60;
|
||||
|
||||
$stunde = floor($stunde_temp);
|
||||
$minute = floor($minute_temp);
|
||||
$sekunde = round(($minute_temp - floor($minute_temp)) * 60);
|
||||
|
||||
$tag = floor($tag_temp);
|
||||
|
||||
if ($e < 14) {
|
||||
$monat = $e -1;
|
||||
}
|
||||
else {
|
||||
$monat = $e - 13;
|
||||
}
|
||||
if ($monat > 2) {
|
||||
$jahr = $c - 4716;
|
||||
}
|
||||
else {
|
||||
$jahr = $c - 4715;
|
||||
}
|
||||
|
||||
$datum = mktime($stunde,$minute,$sekunde,$monat,$tag,$jahr);
|
||||
|
||||
/*
|
||||
echo "Naechster Vollmond (".$phase.") ".$tag;
|
||||
echo "\n\n";
|
||||
echo $tag_temp." ".$datum." ".date('j.n.Y, H:i', $datum)." ".time();
|
||||
echo "\n\n";
|
||||
echo $stunde." ".$minute." ".$sekunde." ".$monat." ".$tag." ".$jahr;
|
||||
echo "\n\n";
|
||||
echo abs($datum-time());
|
||||
echo "\n\n";
|
||||
*/
|
||||
$vollmond=(abs($datum-time())<43200);
|
||||
?>
|
||||
<title>Ist schon wieder Vollmond? - <?php echo($vollmond?"Ja":"Nein"); ?></title>
|
||||
<!-- Piwik -->
|
||||
<script type="text/javascript">
|
||||
var _paq = _paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://matomo.wazong.de/";
|
||||
_paq.push(['setTrackerUrl', u+'piwik.php']);
|
||||
_paq.push(['setSiteId', 34]);
|
||||
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript';
|
||||
g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
|
||||
})();
|
||||
</script>
|
||||
<noscript><p><img src="https://matomo.wazong.de/piwik.php?idsite=34" style="border:0;" alt="" /></p></noscript>
|
||||
<!-- End Piwik Code -->
|
||||
<link rel="stylesheet" href="mond.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Ist schon wieder Vollmond?</h1>
|
||||
<hr/>
|
||||
<?php if($vollmond) { ?>
|
||||
<div class="main">
|
||||
<p class="answer yes">Ja!</p>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="main">
|
||||
<p class="answer no">Nein</p>
|
||||
<p class="subanswer">Einfach nur so #<a href="https://twitter.com/search?q=%23allebekloppt">allebekloppt</a>.</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="footer">
|
||||
<hr/>
|
||||
<p>Vollmond: <?php echo (date('j.n.Y, H:i', $datum));?> UTC</p>
|
||||
<p>Dieser Service wird präsentiert von <a href="https://dentaku.wazong.de/">Dentaku</a> (<a href="https://dentaku.wazong.de/impressum/">Impressum</a>).</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
55
wwwroot/mond.css
Normal file
55
wwwroot/mond.css
Normal file
|
@ -0,0 +1,55 @@
|
|||
|
||||
body, input, textarea, select, option {
|
||||
font-family: Futura, Futura-Medium, "Futura Medium", "Century Gothic", CenturyGothic, "Apple Gothic", AppleGothic, "URW Gothic L", "Avant Garde", sans-serif;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #eaeaec;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #c40000;
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:link:hover,
|
||||
a:visited:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a img{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.main {
|
||||
text-align: center;
|
||||
min-height: 350px;
|
||||
}
|
||||
|
||||
.answer {
|
||||
padding-top: 15%;
|
||||
font-size: 7em;
|
||||
}
|
||||
|
||||
.yes {
|
||||
color: #00cf00;
|
||||
}
|
||||
|
||||
.no {
|
||||
color: #ff0000;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
font-size: 0.7em;
|
||||
color: #c0c0c0;
|
||||
text-align: center;
|
||||
background: #eaeaec;
|
||||
}
|
Loading…
Reference in a new issue