diff --git a/src/KekRozsak/FrontBundle/Resources/public/css/statuslines.css b/src/KekRozsak/FrontBundle/Resources/public/css/statuslines.css index 3015f86..7343d19 100644 --- a/src/KekRozsak/FrontBundle/Resources/public/css/statuslines.css +++ b/src/KekRozsak/FrontBundle/Resources/public/css/statuslines.css @@ -58,3 +58,8 @@ background-color: transparent; color: #c4d3ff; } + +#moonphase { + float: right; + width: 30px; +} diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/0_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/0_large.png new file mode 100644 index 0000000..ca66056 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/0_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/0_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/0_small.png new file mode 100644 index 0000000..3dd09b0 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/0_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/10_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/10_large.png new file mode 100644 index 0000000..75af837 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/10_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/10_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/10_small.png new file mode 100644 index 0000000..7697411 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/10_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/11_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/11_large.png new file mode 100644 index 0000000..5d62cff Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/11_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/11_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/11_small.png new file mode 100644 index 0000000..690ffb6 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/11_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/12_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/12_large.png new file mode 100644 index 0000000..cb8bb51 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/12_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/12_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/12_small.png new file mode 100644 index 0000000..1eb21ce Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/12_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/13_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/13_large.png new file mode 100644 index 0000000..c75e877 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/13_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/13_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/13_small.png new file mode 100644 index 0000000..fe3bf1c Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/13_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/14_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/14_large.png new file mode 100644 index 0000000..c75e877 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/14_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/14_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/14_small.png new file mode 100644 index 0000000..fe3bf1c Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/14_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/15_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/15_large.png new file mode 100644 index 0000000..f8249d1 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/15_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/15_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/15_small.png new file mode 100644 index 0000000..e201901 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/15_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/16_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/16_large.png new file mode 100644 index 0000000..b73cfc1 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/16_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/16_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/16_small.png new file mode 100644 index 0000000..bc8ee09 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/16_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/17_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/17_large.png new file mode 100644 index 0000000..77e44ee Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/17_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/17_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/17_small.png new file mode 100644 index 0000000..5c3420e Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/17_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/18_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/18_large.png new file mode 100644 index 0000000..8e4f866 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/18_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/18_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/18_small.png new file mode 100644 index 0000000..92e974f Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/18_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/19_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/19_large.png new file mode 100644 index 0000000..92b24e9 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/19_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/19_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/19_small.png new file mode 100644 index 0000000..f6026e0 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/19_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/1_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/1_large.png new file mode 100644 index 0000000..b04b7d3 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/1_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/1_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/1_small.png new file mode 100644 index 0000000..1ebf546 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/1_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/20_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/20_large.png new file mode 100644 index 0000000..8f6d2f8 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/20_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/20_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/20_small.png new file mode 100644 index 0000000..2e45ff2 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/20_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/21_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/21_large.png new file mode 100644 index 0000000..d347f2c Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/21_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/21_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/21_small.png new file mode 100644 index 0000000..a8fe035 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/21_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/22_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/22_large.png new file mode 100644 index 0000000..41aae50 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/22_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/22_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/22_small.png new file mode 100644 index 0000000..e3d7362 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/22_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/23_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/23_large.png new file mode 100644 index 0000000..b8e02b4 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/23_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/23_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/23_small.png new file mode 100644 index 0000000..337ee5f Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/23_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/24_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/24_large.png new file mode 100644 index 0000000..58c190b Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/24_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/24_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/24_small.png new file mode 100644 index 0000000..e0d132f Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/24_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/25_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/25_large.png new file mode 100644 index 0000000..22a7506 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/25_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/25_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/25_small.png new file mode 100644 index 0000000..3ccbe46 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/25_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/26_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/26_large.png new file mode 100644 index 0000000..f4f2b83 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/26_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/26_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/26_small.png new file mode 100644 index 0000000..dc1cf25 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/26_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/27_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/27_large.png new file mode 100644 index 0000000..63c0cd5 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/27_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/27_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/27_small.png new file mode 100644 index 0000000..c73ea18 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/27_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/2_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/2_large.png new file mode 100644 index 0000000..bbf9ca4 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/2_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/2_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/2_small.png new file mode 100644 index 0000000..ee00a59 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/2_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/3_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/3_large.png new file mode 100644 index 0000000..a448bd8 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/3_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/3_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/3_small.png new file mode 100644 index 0000000..78793be Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/3_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/4_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/4_large.png new file mode 100644 index 0000000..df1c12e Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/4_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/4_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/4_small.png new file mode 100644 index 0000000..2654cf3 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/4_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/5_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/5_large.png new file mode 100644 index 0000000..61c555e Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/5_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/5_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/5_small.png new file mode 100644 index 0000000..07d4016 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/5_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/6_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/6_large.png new file mode 100644 index 0000000..a116559 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/6_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/6_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/6_small.png new file mode 100644 index 0000000..51b75bb Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/6_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/7_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/7_large.png new file mode 100644 index 0000000..caecd36 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/7_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/7_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/7_small.png new file mode 100644 index 0000000..32a7a45 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/7_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/8_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/8_large.png new file mode 100644 index 0000000..339a032 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/8_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/8_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/8_small.png new file mode 100644 index 0000000..639be9d Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/8_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/9_large.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/9_large.png new file mode 100644 index 0000000..57332cc Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/9_large.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/9_small.png b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/9_small.png new file mode 100644 index 0000000..16620a1 Binary files /dev/null and b/src/KekRozsak/FrontBundle/Resources/public/images/moonphase/9_small.png differ diff --git a/src/KekRozsak/FrontBundle/Resources/views/Default/main_template.html.twig b/src/KekRozsak/FrontBundle/Resources/views/Default/main_template.html.twig index 529b529..a7af022 100644 --- a/src/KekRozsak/FrontBundle/Resources/views/Default/main_template.html.twig +++ b/src/KekRozsak/FrontBundle/Resources/views/Default/main_template.html.twig @@ -52,6 +52,9 @@ #} +
+ {{ moonphase.percent }} +
diff --git a/src/KekRozsak/FrontBundle/Twig/TwigMoonphaseExtension.php b/src/KekRozsak/FrontBundle/Twig/TwigMoonphaseExtension.php new file mode 100644 index 0000000..018cb3a --- /dev/null +++ b/src/KekRozsak/FrontBundle/Twig/TwigMoonphaseExtension.php @@ -0,0 +1,62 @@ +container = $container; + } + + public function getGlobals() + { + $globals = parent::getGlobals(); + + $gds = new \DateTime('now'); + + $baseDate = new \DateTime(); + $baseDate->setTimezone(new \DateTimeZone('UTC')); + $baseDate->setDate(2005, 4, 8); + $baseDate->setTime(8, 48, 0); + + $diff = abs($gds->getTimestamp() - $baseDate->getTimestamp()); + $origPhasePercent = $diff / (self::SYNODIC * self::SECPERDAY); + $phasePercent = fmod(($origPhasePercent) * 100.0, 100.0); + if ($phasePercent < 0) { + $phasePercent += 100; + } + $phase = round($phasePercent * 0.279); + $realPercent = (50.0 - abs($phasePercent - 50.0)) * 2.0; + + $globals['moonphase'] = array( + 'phaseNum' => $phase, + 'percent' => $realPercent, + ); + + return $globals; + } + + public function getName() + { + return 'twig_moonphase'; + } +}