Ver Fonte

allow control over background color when using images (#453)

Hakim El Hattab há 13 anos atrás
pai
commit
544e090bd1
5 ficheiros alterados com 9 adições e 6 exclusões
  1. 2 2
      css/reveal.css
  2. 0 0
      css/reveal.min.css
  3. 5 2
      js/reveal.js
  4. 1 1
      js/reveal.min.js
  5. 1 1
      test/background.html

+ 2 - 2
css/reveal.css

@@ -1245,8 +1245,8 @@ body {
 	left: 0;
 }
 
-.no-transition,
-.no-transition * {
+.reveal .no-transition,
+.reveal .no-transition * {
 	-webkit-transition: none !important;
 	   -moz-transition: none !important;
 	    -ms-transition: none !important;

Diff do ficheiro suprimidas por serem muito extensas
+ 0 - 0
css/reveal.min.css


+ 5 - 2
js/reveal.js

@@ -249,7 +249,8 @@ var Reveal = (function(){
 
 	/**
 	 * Creates the slide background elements and appends them
-	 * to the background container.
+	 * to the background container. One element is created per
+	 * slide no matter if the given slide has visible background.
 	 */
 	function createBackgrounds() {
 
@@ -264,6 +265,7 @@ var Reveal = (function(){
 			var data = {
 				background: slide.getAttribute( 'data-background' ),
 				backgroundSize: slide.getAttribute( 'data-background-size' ),
+				backgroundColor: slide.getAttribute( 'data-background-color' ),
 				backgroundRepeat: slide.getAttribute( 'data-background-repeat' ),
 				backgroundPosition: slide.getAttribute( 'data-background-position' )
 			};
@@ -272,7 +274,7 @@ var Reveal = (function(){
 
 			if( data.background ) {
 				// Auto-wrap image urls in url(...)
-				if( /\.(png|jpg|jpeg|gif|bmp|)$/gi.test( data.background ) ) {
+				if( /\.(png|jpg|jpeg|gif|bmp)$/gi.test( data.background ) ) {
 					element.style.backgroundImage = 'url('+ data.background +')';
 				}
 				else {
@@ -282,6 +284,7 @@ var Reveal = (function(){
 
 			// Additional and optional background properties
 			if( data.backgroundSize ) element.style.backgroundSize = data.backgroundSize;
+			if( data.backgroundColor ) element.style.backgroundColor = data.backgroundColor;
 			if( data.backgroundRepeat ) element.style.backgroundRepeat = data.backgroundRepeat;
 			if( data.backgroundPosition ) element.style.backgroundPosition = data.backgroundPosition;
 

Diff do ficheiro suprimidas por serem muito extensas
+ 1 - 1
js/reveal.min.js


+ 1 - 1
test/background.html

@@ -54,7 +54,7 @@
 					<h2>Background image</h2>
 				</section>
 
-				<section data-background="assets/image2.png" data-background-size="100px" data-background-repeat="repeat">
+				<section data-background="assets/image2.png" data-background-size="100px" data-background-repeat="repeat" data-background-color="#111" style="background: rgba(255,255,255,0.9)">
 					<h2>Background image</h2>
 					<code>data-background-size="100px" data-background-repeat="repeat"</code>
 				</section>

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff

PANIC: session(release): write data/sessions/6/6/660bb976923b63d3: no space left on device

PANIC

session(release): write data/sessions/6/6/660bb976923b63d3: no space left on device
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/session@v1.0.3/session.go:204 (0xb13e07)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:80 (0x967b75)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:157 (0x9512ee)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:135 (0x951205)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:124 (0x967cc4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:114 (0x967bf6)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/recovery.go:161 (0x15baec4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/logger.go:40 (0x96b257)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:157 (0x9512ee)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:135 (0x951205)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:124 (0x967cc4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/router.go:187 (0x972959)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/router.go:304 (0x973a01)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/macaron.go:218 (0x96c572)
/my/cache/.heroku/go/go1.26.3/go/src/net/http/server.go:3311 (0x85a5cd)
/my/cache/.heroku/go/go1.26.3/go/src/net/http/server.go:2073 (0x837f6f)
/my/cache/.heroku/go/go1.26.3/go/src/runtime/asm_amd64.s:1771 (0x493380)