ソースを参照

[add][refs #2] Some style

isundil 9 年 前
コミット
55451c9309
3 ファイル変更48 行追加6 行削除
  1. 1 1
      src/Flammenkuchen.php
  2. 32 5
      src/templates/bonjour.php
  3. 15 0
      www/css/style.css

+ 1 - 1
src/Flammenkuchen.php

@@ -1,6 +1,6 @@
 <?php
 
-define("MAXSIZE", 460);
+define("MAXSIZE", 920);
 
 class Flammenkuchen
 {

+ 32 - 5
src/templates/bonjour.php

@@ -1,6 +1,5 @@
 <?php include ("header.php"); ?>
 <title>Bonjour Flammenkuchen !</title></head><body>
-<?php var_dump($data); ?>
 <?php
 $yymmddays = CacheController::getCacheIndex()->getData();
 $currentYymmdd = $router->getRequestYymmdd();
@@ -9,9 +8,37 @@ $prevYymmdd = $currentYymmddIndex == 0 ? null : $yymmddays[$currentYymmddIndex -
 $nextYymmdd = $currentYymmddIndex == count($yymmddays) -1 ? null : $yymmddays[$currentYymmddIndex +1];
 if ($nextYymmdd > (int) ((new DateTime())->format("ymd")))
     $nextYymmdd = null;
-
-var_dump(array($prevYymmdd, $currentYymmdd, $nextYymmdd));
+$yymmddDT = DateTime::createFromFormat("ymd", $currentYymmdd);
+$months = array("janvier", "fevrier", "mars", "avril", "mai", "juin", "juillet", "aout", "septembre", "octobre", "novembre", "decembre");
+$yymmddStr = $yymmddDT->format("d ")
+    . $months[$yymmddDT->format('m') -1] .' '
+    . $yymmddDT->format('Y');
 ?>
-
-<img src="<?php echo $router->getImageForRequest(); ?>" alt="<?php echo $data->getTitle(); ?>" />
+<header>
+    <h1>Bonjour Flammenkuchen !</h1>
+    <p>Tous les jours, un peu plus de lardons !!</p>
+</header>
+<div class="section left"><div class="section-content">
+    <img src="<?php echo $router->getImageForRequest(); ?>" alt="<?php echo $data->getTitle(); ?>" class="img-content" />
+</div></div>
+<div class="section right"><div class="section-content">
+    <header>
+        <h2><?php echo $data->getTitle();?>
+        <h3>La flammenkuchen du <?php echo $yymmddStr; ?></h3>
+    </header>
+    <p><?php echo $data->getDescription(); ?></p>
+    <footer class="article-footer">
+        <div class="button-container">
+<?php if ($prevYymmdd === null) { ?>
+            <a class="dailyBt bt-prev disabled" href="#">Lardon pr&eacute;c&eacute;dent</a>
+<?php } else { ?>
+            <a class="dailyBt bt-prev" href="<?php echo $prevYymmdd; ?>">Lardon pr&eacute;c&eacute;dent</a>
+<?php } if ($nextYymmdd === null) { ?>
+            <a class="dailyBt bt-next disabled" href="#">Lardon suivant</a>
+<?php } else { ?>
+            <a class="dailyBt bt-next" href="<?php echo $nextYymmdd; ?>">Lardon suivant</a>
+<?php } ?>
+        </div>
+    </footer>
+</div></div>
 </body></html>

+ 15 - 0
www/css/style.css

@@ -0,0 +1,15 @@
+* { margin: 0; padding: 0; }
+body { margin: 50px 100px; }
+header { margin-bottom: 50px; }
+footer { margin-top: 50px; }
+h1 { display: inline-block; padding: 25px; margin: 10px 0; background-color: #D3B3A5; color: black; font-weight: bold; font-size: 3rem; }
+h2 { color: #D3B3A5; font-weight: bold; font-size: 2rem; }
+h3 { color: #EDD6CB; font-weight: bold; font-size: 1.5rem; }
+a { padding: 10px; background-color: #D3B3A5; text-decoration: none; color: white; }
+a.disabled { padding: 10px; visibility: hidden; }
+img { max-width: 100%; }
+
+.section { display: inline-block; width: 50%; float: left; }
+.section-content { margin: 0 20px 0 0; }
+.article-footer { text-align: center; }
+