From 1ab2e0a84830ebdb7bbc321ce06dd3dc22bc5613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Wed, 26 Oct 2016 18:01:41 +0800 Subject: [PATCH] Mobile should have fewer slides --- botanjs/src/Astro/Blog/Layout/MainFrame.js | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/botanjs/src/Astro/Blog/Layout/MainFrame.js b/botanjs/src/Astro/Blog/Layout/MainFrame.js index d2748d4..941be58 100644 --- a/botanjs/src/Astro/Blog/Layout/MainFrame.js +++ b/botanjs/src/Astro/Blog/Layout/MainFrame.js @@ -37,6 +37,7 @@ /** @function {System.Net.getData} */ var getData = __import( "System.Net.getData" ); + var mobile = __import( "System.Global.MOBILE" ); var header; @@ -346,13 +347,21 @@ , cCloud_2c = CharacterCloud.create( cCloudSymbol, null, 30, cloudRange_2c, 5 ) , cCloud_3 = CharacterCloud.create( cCloudSymbol2, "spin cw", 5, cloudRange_3 ) , cCloud_4 = CharacterCloud.create( cCloudSymbol, null, 5, cloudRange_4 ); - - bg.appendChild( Parallax.cssSlide( cCloud_1, 0, slide_1 ) ); - bg.appendChild( Parallax.cssSlide( cCloud_2a, 1, slide_2a ) ); - bg.appendChild( Parallax.cssSlide( cCloud_2b, 1, slide_2b ) ); - bg.appendChild( Parallax.cssSlide( cCloud_2c, 1, slide_2c ) ); - bg.appendChild( Parallax.cssSlide( cCloud_3, 2, slide_3 ) ); - bg.appendChild( Parallax.cssSlide( cCloud_4, 3, slide_4 ) ); + + if( mobile ) + { + bg.appendChild( Parallax.cssSlide( cCloud_2a, 0, slide_2a ) ); + bg.appendChild( Parallax.cssSlide( cCloud_2b, 1, slide_2b ) ); + } + else + { + bg.appendChild( Parallax.cssSlide( cCloud_1, 0, slide_1 ) ); + bg.appendChild( Parallax.cssSlide( cCloud_2a, 1, slide_2a ) ); + bg.appendChild( Parallax.cssSlide( cCloud_2b, 1, slide_2b ) ); + bg.appendChild( Parallax.cssSlide( cCloud_2c, 1, slide_2c ) ); + bg.appendChild( Parallax.cssSlide( cCloud_3, 2, slide_3 ) ); + bg.appendChild( Parallax.cssSlide( cCloud_4, 3, slide_4 ) ); + } IDOMElement( bg ).foreach( 1, function(e) {