Browse Source

working navbar.

Frederic G. MARAND 8 years ago
parent
commit
6c5086c9f1
7 changed files with 49 additions and 11 deletions
  1. 2 1
      assignment.js
  2. 7 0
      assignment.scss
  3. 9 0
      templates/about.hbs
  4. 1 0
      templates/class.hbs
  5. 1 0
      templates/home.hbs
  6. 27 9
      templates/nav.hbs
  7. 2 1
      templates/species.hbs

+ 2 - 1
assignment.js

@@ -3,7 +3,8 @@ const EVENT_TEMPLATES_LOADED = "templates:loaded";
 const templateNames = [
   "class",
   "home",
-  "species"
+  "species",
+  "about"
 ];
 
 const partialNames = [

+ 7 - 0
assignment.scss

@@ -0,0 +1,7 @@
+//$bsInfoBg: #5bc0de;
+//$bsInfoBo: #46B8DA;
+//
+//.navbar .active {
+//  background-color: $bsInfoBg;
+//  border-color: $bsInfoBo;
+//}

+ 9 - 0
templates/about.hbs

@@ -0,0 +1,9 @@
+<div class="about">
+  {{> nav activeAbout="active" }}
+
+    <div class="container">
+      <ul>
+        <li><a href="https://www.youtube.com/watch?v=HDH6dcbRtuU&amp;feature=youtu.be&amp;t=37s" title="Animals: Dogs">More "Animals"</a></li>
+      </ul>
+    </div>
+</div>

+ 1 - 0
templates/class.hbs

@@ -1,3 +1,4 @@
 <div class="class">
+  {{> nav activeGallery="active" }}
   CLASS {{ greeting }} {{ moreText }}
 </div>

+ 1 - 0
templates/home.hbs

@@ -1,3 +1,4 @@
 <div class="home">
+  {{> nav activeGallery="active" }}
   HOME
 </div>

+ 27 - 9
templates/nav.hbs

@@ -1,9 +1,27 @@
-<div class="nav">
-  <nav role="navigation">
-    <div class="nav navbar-default">
-      <div class="navbar-brand">
-        <a href="https://www.youtube.com/watch?v=HDH6dcbRtuU&amp;feature=youtu.be&amp;t=37s" title="Animals: Dogs">Animals</a>
-      </div>
-    </div>
-  </nav>
-</div>
+<nav role="navigation" class="navbar navbar-default">
+  <div class="container-fluid">
+    <div class="navbar-header">
+      <button type="button" aria-expanded="false" class="navbar-toggle collapsed"
+        data-toggle="collapse"
+        data-target="#animals-navbar-collapse">
+        <span class="sr-only">Toggle navigation</span>
+        <span class="icon-bar"></span>
+        <span class="icon-bar"></span>
+        <span class="icon-bar"></span>
+      </button>
+      <a class="navbar-brand" href="#">Animals</a>
+    </div><!-- .navbar-header -->
+
+    <div class="hidden-xs">
+      <ul class="nav navbar-nav navbar-left">
+        <li class="{{activeGallery}}"><a href="#">Gallery</a></li>
+      </ul>
+    </div><!-- #animals-navbar-collapse -->
+
+    <div class="collapse navbar-collapse" id="animals-navbar-collapse">
+      <ul class="nav navbar-nav navbar-right">
+        <li class="{{activeAbout}}"><a href="#about">About</a></li>
+      </ul>
+    </div><!-- #animals-navbar-collapse -->
+  </div><!-- .container-fluid -->
+</nav>

+ 2 - 1
templates/species.hbs

@@ -1,3 +1,4 @@
 <div class="species">
-  SPECIES
+  {{> nav activeGallery="active" }}
+SPECIES
 </div>