瀏覽代碼

Final course version for gallery.

Frederic G. MARAND 8 年之前
父節點
當前提交
5f79a05f02
共有 1 個文件被更改,包括 138 次插入133 次删除
  1. 138 133
      index.html

+ 138 - 133
index.html

@@ -13,14 +13,14 @@
     <script src="js/jquery-2.2.2.js"></script>
     <script src="js/bootstrap.min.js"></script>
     <script src="js/handlebars-v3.0.3.js"></script>
-    
+
     <!-- 
       These are our javascript files.
       Albums.js contains the data
       gallery.js is the code
     -->
-    <script src="js/Albums.js"> </script>
-    <script src="js/gallery.js"> </script>
+    <script src="js/Albums.js"></script>
+    <script src="js/gallery.js"></script>
 
     <link href="css/bootstrap.css" rel="stylesheet">
     <link href="css/gallery.css" rel="stylesheet">
@@ -28,11 +28,12 @@
     <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
     <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
     <!--[if lt IE 9]>
-      <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
-      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
+    <script
+      src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
+    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
     <![endif]-->
-
   </head>
+
   <body>
 
     <div class="container">
@@ -40,152 +41,156 @@
       <!-- page tile -->
       <div class="page-header">
         <h1>My photo albums </h1>
-      </div>    
+      </div>
 
       <!-- A navigation menu that selects different views -->
       <ul class="nav nav-tabs">
-            <li role="" class="active"><a href="#" id="albums-tab" >Albums</a></li>
-            <li role=""><a href="#" id="photos-tab" >Photos</a></li>
-            <li role=""><a href="#" id="slideshow-tab" >Slideshow</a></li>
-          </ul>
-      <br/><br/>
+        <li role="" class="active"><a href="#" id="albums-tab">Albums</a></li>
+        <li role=""><a href="#" id="photos-tab">Photos</a></li>
+        <li role=""><a href="#" id="slideshow-tab">Slideshow</a></li>
+      </ul>
+      <br /><br />
 
 
       <!-- the content section is empty as we will fill it 
             via javascript and templates -->
-      <div id="content"  class="container-fluid"  role="main">
+      <div id="content" class="container-fluid" role="main">
       </div>
-  </div> <!-- / container -->
-
-<!-- Here are our Templates -->
-
-
-<!-- this is the template for the albums view -->
-<!-- 
-    it displays the albums in a bootstrap grid format
-    with one item for each album (using the {{#each}} template expression. 
-    Each album is displayed with a thumbnail image, a name and 
-    the number of photos (using the {{photos.length}} template expression, see my lecture for more details)
--->
-<script id="albums-template" type="text/x-handlebars-template">
-  <div class="row">
-
-    {{#each albums}}
-    <div class="col-xs-12 col-md-3"> 
-        <div class="album-thumbnail"  data-id="{{@index}}">
-          <img class="crop-img" src="{{thumbnail}}" alt=""/> 
-            
-          <div class="caption">
+    </div> <!-- / container -->
+
+    <!-- Here are our Templates -->
+
+
+    <!-- this is the template for the albums view -->
+    <!--
+        it displays the albums in a bootstrap grid format
+        with one item for each album (using the {{#each}} template expression.
+        Each album is displayed with a thumbnail image, a name and
+        the number of photos (using the {{photos.length}} template expression, see my lecture for more details)
+    -->
+    <script id="albums-template" type="text/x-handlebars-template">
+      <div class="row">
+
+        {{#each albums}}
+        <div class="col-xs-12 col-md-3">
+          <div class="album-thumbnail" data-id="{{@index}}">
+            <img class="crop-img" src="{{thumbnail}}" alt="" />
+
+            <div class="caption">
               <h4> {{name}} </h4>
               <p>{{photos.length}} photos</p>
+            </div>
           </div>
-         </div>
-    </div> <!-- / col -->
-
-    {{/each}}
-
-  </div> <!-- / row -->
-</script>
-
-<!-- this is the template for the photos view of a single album -->
-<!-- 
-    like albums view it uses a bootstrap grid format to display the photos in an album
-    
-    Each photos is displayed with anumbnail image, a name and 
-    a description
--->
-<script id="photos-template" type="text/x-handlebars-template">
-  <div class="row">
-    <!-- xs-12 : small display shows a single column (taking up 12 grid columns)-->
-    <!-- md-3 : medium and up displays use 3 grid columns per column -->
-
-    {{#each photos}}
-    <div class="col-xs-12 col-md-3"> 
-     <div class="photo-thumbnail"  data-id="{{@index}}">
-        <img class="crop-img" src="{{src}}" alt=""/> 
-          
-         <div class="caption">
-            <h3>{{title}}</h3>
-            <p>{{description}}</p>
-         </div>
-      </div>
-       
-    </div> <!-- / col -->
-    {{/each}}
-
-  </div> <!-- / row -->
-</script>
-
-<!-- this is the template for the view a single photo -->
-<!-- 
-    It is displayed as a large image with title and description
--->
-<script id="photo-template" type="text/x-handlebars-template">
-  <div class="row">
-    <div class="col-xs-12 col-md-12"> 
-        <img class="large-img" src="{{src}}" alt=""/> 
-          
-        <div class="caption">
-            <h3>{{title}}</h3>
-            <p>{{description}}</p>
-        </div>
-      </div> <!-- / col -->
+        </div> <!-- / col -->
+
+        {{/each}}
 
-  </div> <!-- / row -->
-</script>
-
-<!-- this is the template for the slideshow view of a single album -->
-<!-- 
-    It uses the carousel view, which is quite complex, see my lecture for details
--->
-<script id="slideshow-template" type="text/x-handlebars-template">
-  <div class="row">
-    <div class="col-md-6">
-
-      <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
-
-        <ol class="carousel-indicators">
-          <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
-          <li data-target="#carousel-example-generic" data-slide-to="1"></li>
-          <li data-target="#carousel-example-generic" data-slide-to="2"></li>
-        </ol>
-
-  
-       <!-- Wrapper for slides -->
-        <div class="carousel-inner" role="listbox">
-
-          {{#each photos}}
-            <div class="item {{#if @first}}active{{/if}}">
-             <img class="carousel-img" src="{{src}}" alt=""/> 
-            <div class="carousel-caption">
-              Image caption
+      </div> <!-- / row -->
+    </script>
+
+    <!-- this is the template for the photos view of a single album -->
+    <!--
+        like albums view it uses a bootstrap grid format to display the photos in an album
+
+        Each photos is displayed with anumbnail image, a name and
+        a description
+    -->
+    <script id="photos-template" type="text/x-handlebars-template">
+      <div class="row">
+        <!-- xs-12 : small display shows a single column (taking up 12 grid columns)-->
+        <!-- md-3 : medium and up displays use 3 grid columns per column -->
+
+        {{#each photos}}
+        <div class="col-xs-12 col-md-3">
+          <div class="photo-thumbnail" data-id="{{@index}}">
+            <img class="crop-img" src="{{src}}" alt="" />
+
+            <div class="caption">
+              <h3>{{title}}</h3>
+              <p>{{description}}</p>
             </div>
-          </div> <!-- / carousel item -->
-          {{/each}}
-
-        </div>
-
-        <!-- Controls -->
-        <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
-          <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
-          <span class="sr-only">Previous</span>
-        </a>
-        <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
-          <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
-          <span class="sr-only">Next</span>
-        </a>
-      </div>
+          </div>
+
+        </div> <!-- / col -->
+        {{/each}}
+
+      </div> <!-- / row -->
+    </script>
+
+    <!-- this is the template for the view a single photo -->
+    <!--
+        It is displayed as a large image with title and description
+    -->
+    <script id="photo-template" type="text/x-handlebars-template">
+      <div class="row">
+        <div class="col-xs-12 col-md-12">
+          <img class="large-img" src="{{src}}" alt="" />
 
-    </div> <!-- / carousel --> 
-  </div> <!-- / col -->
-</div> <!-- / row -->
-</script>
+          <div class="caption">
+            <h3>{{title}}</h3>
+            <p>{{description}}</p>
+          </div>
+        </div> <!-- / col -->
 
+      </div> <!-- / row -->
+    </script>
 
+    <!-- this is the template for the slideshow view of a single album -->
+    <!--
+        It uses the carousel view, which is quite complex, see my lecture for details
+    -->
+    <script id="slideshow-template" type="text/x-handlebars-template">
+      <div class="row">
+        <div class="col-md-6">
+
+          <div id="carousel-example-generic" class="carousel slide"
+            data-ride="carousel">
+
+            <ol class="carousel-indicators">
+              <li data-target="#carousel-example-generic" data-slide-to="0"
+                class="active"></li>
+              <li data-target="#carousel-example-generic"
+                data-slide-to="1"></li>
+              <li data-target="#carousel-example-generic"
+                data-slide-to="2"></li>
+            </ol>
+
+
+            <!-- Wrapper for slides -->
+            <div class="carousel-inner" role="listbox">
+
+              {{#each photos}}
+              <div class="item {{#if @first}}active{{/if}}">
+                <img class="carousel-img" src="{{src}}" alt="" />
+                <div class="carousel-caption">
+                  Image caption
+                </div>
+              </div> <!-- / carousel item -->
+              {{/each}}
 
+            </div>
 
+            <!-- Controls -->
+            <a class="left carousel-control" href="#carousel-example-generic"
+              role="button" data-slide="prev">
+              <span class="glyphicon glyphicon-chevron-left"
+                aria-hidden="true"></span>
+              <span class="sr-only">Previous</span>
+            </a>
+            <a class="right carousel-control" href="#carousel-example-generic"
+              role="button" data-slide="next">
+              <span class="glyphicon glyphicon-chevron-right"
+                aria-hidden="true"></span>
+              <span class="sr-only">Next</span>
+            </a>
+          </div>
 
+        </div> <!-- / carousel -->
+      </div> <!-- / col -->
+      </div> <!-- / row -->
+    </script>
 
 
   </body>
-</html>
+</html>
+