浏览代码

merge slide numbers, adjust code format

Hakim El Hattab 11 年之前
父节点
当前提交
bdb46060b3
共有 12 个文件被更改,包括 102 次插入2 次删除
  1. 16 0
      css/reveal.css
  2. 0 0
      css/reveal.min.css
  3. 7 0
      css/theme/beige.css
  4. 7 0
      css/theme/default.css
  5. 7 0
      css/theme/moon.css
  6. 7 0
      css/theme/night.css
  7. 7 0
      css/theme/serif.css
  8. 7 0
      css/theme/simple.css
  9. 7 0
      css/theme/sky.css
  10. 7 0
      css/theme/solarized.css
  11. 29 1
      js/reveal.js
  12. 1 1
      js/reveal.min.js

+ 16 - 0
css/reveal.css

@@ -476,6 +476,22 @@ body {
 		        transition: width 800ms cubic-bezier(0.260, 0.860, 0.440, 0.985);
 	}
 
+/*********************************************
+ * SLIDE NUMBER
+ *********************************************/
+
+.reveal .slide-number {
+	position: fixed;
+	display: block;
+	opacity: 0.5; 
+	z-index: 31;
+	width: 110px;
+	bottom: 30px;
+	left: 11px;
+	font-size: 12px;
+	text-align: center;
+	letter-spacing: 0px
+}
 
 /*********************************************
  * SLIDES

文件差异内容过多而无法显示
+ 0 - 0
css/reveal.min.css


+ 7 - 0
css/theme/beige.css

@@ -127,6 +127,13 @@ body {
 .reveal .controls div.navigate-down.enabled:hover {
   border-top-color: #c0a86e; }
 
+/*********************************************
+ * SLIDE NUMBER
+ *********************************************/
+.reveal .slide-number {
+  color: #8b743d;
+}
+
 /*********************************************
  * PROGRESS BAR
  *********************************************/

+ 7 - 0
css/theme/default.css

@@ -127,6 +127,13 @@ body {
 .reveal .controls div.navigate-down.enabled:hover {
   border-top-color: #71e9f4; }
 
+/*********************************************
+ * SLIDE NUMBER
+ *********************************************/
+.reveal .slide-number {
+  color: #13daec;
+}
+
 /*********************************************
  * PROGRESS BAR
  *********************************************/

+ 7 - 0
css/theme/moon.css

@@ -127,6 +127,13 @@ body {
 .reveal .controls div.navigate-down.enabled:hover {
   border-top-color: #78b9e6; }
 
+/*********************************************
+ * SLIDE NUMBER
+ *********************************************/
+.reveal .slide-number {
+  color: #268bd2;
+}
+
 /*********************************************
  * PROGRESS BAR
  *********************************************/

+ 7 - 0
css/theme/night.css

@@ -115,6 +115,13 @@ body {
 .reveal .controls div.navigate-down.enabled:hover {
   border-top-color: #f3d7ac; }
 
+/*********************************************
+ * SLIDE NUMBER
+ *********************************************/
+.reveal .slide-number {
+  color: #e7ad52;
+}
+
 /*********************************************
  * PROGRESS BAR
  *********************************************/

+ 7 - 0
css/theme/serif.css

@@ -117,6 +117,13 @@ body {
 .reveal .controls div.navigate-down.enabled:hover {
   border-top-color: #8b7c69; }
 
+/*********************************************
+ * SLIDE NUMBER
+ *********************************************/
+.reveal .slide-number {
+  color: #51483d;
+}
+
 /*********************************************
  * PROGRESS BAR
  *********************************************/

+ 7 - 0
css/theme/simple.css

@@ -117,6 +117,13 @@ body {
 .reveal .controls div.navigate-down.enabled:hover {
   border-top-color: #0000f1; }
 
+/*********************************************
+ * SLIDE NUMBER
+ *********************************************/
+.reveal .slide-number {
+  color: darkblue;
+}
+
 /*********************************************
  * PROGRESS BAR
  *********************************************/

+ 7 - 0
css/theme/sky.css

@@ -124,6 +124,13 @@ body {
 .reveal .controls div.navigate-down.enabled:hover {
   border-top-color: #74a7cb; }
 
+/*********************************************
+ * SLIDE NUMBER
+ *********************************************/
+.reveal .slide-number {
+  color: #3b759e;
+}
+
 /*********************************************
  * PROGRESS BAR
  *********************************************/

+ 7 - 0
css/theme/solarized.css

@@ -127,6 +127,13 @@ body {
 .reveal .controls div.navigate-down.enabled:hover {
   border-top-color: #78b9e6; }
 
+/*********************************************
+ * SLIDE NUMBER
+ *********************************************/
+.reveal .slide-number {
+  color: #268bd2;
+}
+
 /*********************************************
  * PROGRESS BAR
  *********************************************/

+ 29 - 1
js/reveal.js

@@ -108,7 +108,10 @@ var Reveal = (function(){
 			viewDistance: 3,
 
 			// Script dependencies to load
-			dependencies: []
+			dependencies: [],
+
+			// Indicates whether to show the slides number
+			showSlideNumber: false
 		},
 
 		// Flags if reveal.js is loaded (has dispatched the 'ready' event)
@@ -378,6 +381,9 @@ var Reveal = (function(){
 			'<div class="navigate-up"></div>' +
 			'<div class="navigate-down"></div>' );
 
+		// slide number
+		createSingletonNode( dom.wrapper, 'div', 'slide-number', '' );
+
 		// State background element [DEPRECATED]
 		createSingletonNode( dom.wrapper, 'div', 'state-background', null );
 
@@ -395,6 +401,7 @@ var Reveal = (function(){
 		dom.controlsPrev = toArray( document.querySelectorAll( '.navigate-prev' ) );
 		dom.controlsNext = toArray( document.querySelectorAll( '.navigate-next' ) );
 
+		dom.slideNumber = document.querySelector( '.slide-number' );
 	}
 
 	/**
@@ -1613,6 +1620,7 @@ var Reveal = (function(){
 		updateProgress();
 		updateBackground();
 		updateParallax();
+		updateSlideNumber();
 
 		// Update the URL hash
 		writeURL();
@@ -1647,6 +1655,7 @@ var Reveal = (function(){
 		updateControls();
 		updateProgress();
 		updateBackground( true );
+		updateSlideNumber();
 
 	}
 
@@ -1851,6 +1860,25 @@ var Reveal = (function(){
 
 	}
 
+	/**
+	 * Updates the slide number div to reflect the current slide.
+	 */
+	function updateSlideNumber() {
+
+		// Update slide number if enabled
+		if( config.showSlideNumber && dom.slideNumber) {
+
+			// Display the number of the page using 'indexh - indexv' format
+			var indexString = indexh;
+			if( indexv > 0 ) {
+				indexString += ' - ' + indexv;
+			}
+
+			dom.slideNumber.innerHTML = indexString;
+		}
+
+	}
+
 	/**
 	 * Updates the state of all control/navigation arrows.
 	 */

文件差异内容过多而无法显示
+ 1 - 1
js/reveal.min.js


部分文件因为文件数量过多而无法显示