Include the seasonator into the css for background.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 14 Aug 2014 13:16:39 +0000 (09:16 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 14 Aug 2014 13:16:39 +0000 (09:16 -0400)
Separate the background image from the main styles.css and setup
four css files, one for each season. These will setup the new background
images for each season.

Toolkit/Page.php
css/fall.css [new file with mode: 0644]
css/spring.css [new file with mode: 0644]
css/summer.css [new file with mode: 0644]
css/winter.css [new file with mode: 0644]
styles.css
templates/template.html

index bc0c368..d7127f6 100755 (executable)
@@ -56,6 +56,11 @@ define("PAGE_TITLE", SITENAME);
  */
 class Toolkit_Page
 {
+    /**
+     * Object containing data for the seansonator.
+     * @var type
+     */
+    public $seasonImages;
 
     /**
      * used on img src and style href tags
@@ -144,7 +149,13 @@ class Toolkit_Page
             : BASE_URL . 'index.php';
 
         // Resources needed for every page.
+        $this->seasonImages = $this->_getSeasonImages();
         $GLOBALS['styleSheets'] = array();
+        $this->seasonStyleSheet
+            = ($this->seasonImages->getSeason())
+            ? $this->seasonImages->getSeason()
+            : 'summer';
+
         // Resources needed for every page.
         $GLOBALS['topScripts'][] = JQUERY_CDN_JS;
         $GLOBALS['bottomScripts'][] = MEDIA_BASE_URL . 'js/foundation.min.js';
@@ -604,13 +615,10 @@ class Toolkit_Page
 
     private function _getMainNavigation()
     {
-        static $seasonImages;
+        $seasonImages = $this->seasonImages;
         if (defined('MAIN_LEVEL_NAV_ARRAY') && MAIN_LEVEL_NAV_ARRAY) {
             $mainNavArray = unserialize(MAIN_LEVEL_NAV_ARRAY);
         }
-        if (!$seasonImages) {
-            $seasonImages = $this->_getSeasonImages();
-        }
         $sideNav = new Toolkit_Template_Navigation_AllInOneSideNav(
             $this->_pageGateway
         );
diff --git a/css/fall.css b/css/fall.css
new file mode 100644 (file)
index 0000000..1920f25
--- /dev/null
@@ -0,0 +1,4 @@
+body {
+  background: url("../assets/background.jpg");
+  background-size: cover;
+}
\ No newline at end of file
diff --git a/css/spring.css b/css/spring.css
new file mode 100644 (file)
index 0000000..1920f25
--- /dev/null
@@ -0,0 +1,4 @@
+body {
+  background: url("../assets/background.jpg");
+  background-size: cover;
+}
\ No newline at end of file
diff --git a/css/summer.css b/css/summer.css
new file mode 100644 (file)
index 0000000..1920f25
--- /dev/null
@@ -0,0 +1,4 @@
+body {
+  background: url("../assets/background.jpg");
+  background-size: cover;
+}
\ No newline at end of file
diff --git a/css/winter.css b/css/winter.css
new file mode 100644 (file)
index 0000000..591b50b
--- /dev/null
@@ -0,0 +1,4 @@
+body {
+  background: url("../assets/background.jpg");
+  background-size: cover;
+}
index 8c09a9f..8d91f50 100644 (file)
@@ -75,8 +75,6 @@ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav,
 /* Dimensions */
 /* Site specific styles */
 body {
-  background: url("assets/background.jpg");
-  background-size: cover;
   font-family: "Arial";
   font-weight: 400;
   font-size: 12px;
index 2568416..765c7b0 100644 (file)
@@ -9,6 +9,7 @@
     <link rel="stylesheet" href="{mediaBaseURL:h}css/foundation.min.css">
     <link rel="stylesheet" href="{mediaBaseURL:h}css/normalize.css">
     <link rel="stylesheet" href="{mediaBaseURL:h}styles.css">
+    <link rel="stylesheet" href="{mediaBaseURL:h}css/{seasonStyleSheet}.css">
     <script src="{mediaBaseURL:h}js/vendor/modernizr.js"></script>
     {topScripts:h}
   </head>