cutscreen_preview.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <{include file="header.html"}>
  2. <link rel="stylesheet" type="text/css" href="<{$web_cfg.cdn}>/public/static/css/??swiper.min.css,swiper.animate.min.css" />
  3. <script src="<{$web_cfg.cdn}>/public/static/js/??swiper.jquery.min.js,swiper.animate.min.js"></script>
  4. <style>
  5. .swiper-container {width:100%; position:absolute;}
  6. .page-screen {
  7. background-attachment: scroll;
  8. background-position: top center;
  9. background-repeat: no-repeat;
  10. background-size: 320px auto;
  11. }
  12. .background_image {
  13. display: block;
  14. overflow: hidden;
  15. width: 100%;
  16. z-index: 0;
  17. position: absolute;
  18. }
  19. .upper_image {
  20. position: absolute;
  21. }
  22. .button_image {
  23. position: absolute;
  24. }
  25. @-webkit-keyframes right_start {
  26. 0%,30% {opacity: 0;-webkit-transform: translate(10px, 0) rotate(-90deg);}
  27. 60% {opacity: 1;-webkit-transform: translate(0,0) rotate(-90deg);}
  28. 100% {opacity: 0;-webkit-transform: translate(-8px, 0) rotate(-90deg);}
  29. }
  30. @-moz-keyframes right_start {
  31. 0%,30% {opacity: 0;-moz-transform: translate(10px,0) rotate(-90deg);}
  32. 60% {opacity: 1;-moz-transform: translate(0,0) rotate(-90deg);}
  33. 100% {opacity: 0;-moz-transform: translate(-8px,0) rotate(-90deg);}
  34. }
  35. @keyframes right_start {
  36. 0%,30% {opacity: 0;transform: translate(10px,0) rotate(-90deg);}
  37. 60% {opacity: 1;transform: translate(0,0) rotate(-90deg);}
  38. 100% {opacity: 0;transform: translate(-8px,0) rotate(-90deg);}
  39. }
  40. @-webkit-keyframes botton_start {
  41. 0%,30% {opacity: 0;-webkit-transform: translate(0,10px);}
  42. 60% {opacity: 1;-webkit-transform: translate(0,0);}
  43. 100% {opacity: 0;-webkit-transform: translate(0,-8px);}
  44. }
  45. @-moz-keyframes botton_start {
  46. 0%,30% {opacity: 0;-moz-transform: translate(0,10px);}
  47. 60% {opacity: 1;-moz-transform: translate(0,0);}
  48. 100% {opacity: 0;-moz-transform: translate(0,-8px);}
  49. }
  50. @keyframes botton_start {
  51. 0%,30% {opacity: 0;transform: translate(0,10px);}
  52. 60% {opacity: 1;transform: translate(0,0);}
  53. 100% {opacity: 0;transform: translate(0,-8px);}
  54. }
  55. .bottom_arrow {
  56. width: 20px;
  57. height: 15px;
  58. position: absolute;
  59. z-index: 999;
  60. bottom: 10px;
  61. left: 50%;
  62. animation: botton_start 1.5s infinite ease-in-out;
  63. -webkit-animation: botton_start 1.5s infinite ease-in-out;
  64. -moz-animation: botton_start 1.5s infinite ease-in-out;
  65. }
  66. .right_arrow {
  67. width: 20px;
  68. height: 15px;
  69. position: absolute;
  70. z-index: 999;
  71. right: 10px;
  72. top: 50%;
  73. animation: right_start 1.5s infinite ease-in-out;
  74. -webkit-animation: right_start 1.5s infinite ease-in-out;
  75. -moz-animation: right_start 1.5s infinite ease-in-out;
  76. }
  77. .music {
  78. width: 30px;
  79. height: 30px;
  80. overflow: hidden;
  81. position: fixed;
  82. z-index: 999;
  83. background: url("<{$web_cfg.cdn}>/public/static/img/music.png") no-repeat -30px 0px;
  84. background-size: 60px 30px;
  85. }
  86. .music.left {top:1%;left:2%;}
  87. .music.right {top:1%;right:2%;}
  88. .music.off {background-position: 0px 0px;}
  89. .mask {background-color:<{$cutScreenInfo.loading_bg_color}>;display: block;height: 100%;position: absolute;width: 100%;z-index: 200;}
  90. .loading{position:relative;text-align:center;top:40%; color:<{$cutScreenInfo.loading_text_color}>;}
  91. .loading i{font-size:30px;}
  92. .loading p{font-size: 12px;}
  93. </style>
  94. <div class="mask">
  95. <div class="loading">
  96. <i class="fa fa-spinner fa-pulse"></i>
  97. <p><span>0</span>%</p>
  98. </div>
  99. </div>
  100. <div class="wrapper jsc-sidebar-content jsc-sidebar-pulled">
  101. <{if $cutScreenInfo.music_url}>
  102. <div class="music <{if $cutScreenInfo.music_position == 1}>right<{/if}>"></div>
  103. <{/if}>
  104. <div class="swiper-container">
  105. <div class="swiper-wrapper">
  106. <{foreach from=$pageData item=item}>
  107. <div class="swiper-slide">
  108. <{if $item.background_image}><img class="background_image" style="" src="<{$item.background_image}>" ><{/if}>
  109. <img class="upper_image ani" style=
  110. "
  111. width:<{$item.upper_image.width}>px;
  112. height:<{$item.upper_image.height}>px;
  113. <{$item.upper_image.position_style}>
  114. "
  115. <{if $item.move}>
  116. swiper-animate-effect="<{if $item.move == 'up'}>fadeInUp<{else}>fadeInRight<{/if}>"
  117. swiper-animate-duration="0.3s"
  118. swiper-animate-delay="0.1s"
  119. <{/if}>
  120. src="<{$item.upper_image.url}>"
  121. >
  122. <{if $item.button_image.url}>
  123. <{if $item.button_link}>
  124. <a href="<{$item.button_link}>">
  125. <{/if}>
  126. <img class="button_image" style=
  127. "
  128. width: <{$item.button_image.width}>px;
  129. height: <{$item.button_image.height}>px;
  130. <{$item.button_image.position_style}>
  131. "
  132. src="<{$item.button_image.url}>"
  133. >
  134. <{if $item.button_link}>
  135. </a>
  136. <{/if}>
  137. <{/if}>
  138. </div>
  139. <{/foreach}>
  140. </div>
  141. </div>
  142. <{if $cutScreenInfo.cut_fx == 'fadeInUp'}>
  143. <img class="bottom_arrow" src="<{$web_cfg.cdn}>/public/static/img/arrow.png" >
  144. <{/if}>
  145. <{if $cutScreenInfo.cut_fx == 'fadeInRight'}>
  146. <img class="right_arrow" src="<{$web_cfg.cdn}>/public/static/img/arrow.png" >
  147. <{/if}>
  148. </div>
  149. <script>
  150. KISSY.use('node, dom, gallery/xplayer/2.1.0/index', function (S, Node, DOM, Xplayer) {
  151. S.log('image loading start');
  152. var $ = S.all;
  153. //loading
  154. var waitLoadingImgs = <{$waitLoadingImgs}>,
  155. hasLoadingTimes = 0, hasLoadingProgress = 0, loadNum = $(".mask p span");
  156. var runId, waitRunData = [];
  157. updateProgress(15, 100, 0);
  158. var avgTime = Math.round(70/waitLoadingImgs.length);
  159. for (var i = 0; i < waitLoadingImgs.length; i++) {
  160. var oi = new Image();
  161. oi.src = waitLoadingImgs[i];
  162. oi.onload = function () {
  163. ++hasLoadingTimes;
  164. S.log('image loading ok');
  165. updateProgress(avgTime, 100, 0);
  166. };
  167. }
  168. var ID = setInterval(function () {
  169. if (hasLoadingTimes == waitLoadingImgs.length) {
  170. clearInterval(ID);
  171. updateProgress(15, 1000, 1);
  172. S.log('image loading done');
  173. }
  174. }, 10);
  175. function updateProgress(num, time, isDone) {
  176. waitRunData.push(num+'-'+time+'-'+isDone);
  177. }
  178. runQueue();
  179. function runQueue() {
  180. if (runId > 0) clearInterval(runId);
  181. var time = 0, addnum = 0, tmpnum = 1;
  182. var rundata = waitRunData.shift();
  183. if (S.isUndefined(rundata)) {
  184. rundata = '';
  185. }
  186. rundata = rundata.split('-');
  187. addnum = rundata[0];
  188. time = rundata[1];
  189. isDone = rundata[2];
  190. var millisec = time/addnum;
  191. runId = setInterval(function () {
  192. if (tmpnum > addnum) {
  193. if (isDone == 1) {
  194. clearInterval(runId);
  195. loadNum.html(100);
  196. //
  197. jQuery(".mask").fadeOut();
  198. return false;
  199. }
  200. //S.log('runqueue');
  201. runQueue();
  202. return;
  203. }
  204. ++tmpnum;
  205. ++hasLoadingProgress;
  206. if (hasLoadingProgress > 100) hasLoadingProgress = 100;
  207. loadNum.html(hasLoadingProgress);
  208. }, millisec);
  209. }
  210. //20s
  211. setTimeout(function () {
  212. clearInterval(runId);
  213. loadNum.html(100);
  214. $(".mask").fadeOut();
  215. }, 15000);
  216. <{if $cutScreenInfo.music_url}>
  217. var XiamiPlay = new Xplayer({"autoplay": false});
  218. XiamiPlay.load({
  219. 'url' : '<{$cutScreenInfo.music_url}>',
  220. });
  221. XiamiPlay.play();
  222. $(".music").on('click', function () {
  223. if ($(this).hasClass('off')) {
  224. $(this).removeClass('off');
  225. XiamiPlay.play();
  226. } else {
  227. $(this).addClass('off');
  228. XiamiPlay.pause();
  229. }
  230. });
  231. <{/if}>
  232. var screenHeight = $(window).height();
  233. var headerHeight = $(".wrapper-header").height();
  234. $(".swiper-container").height(screenHeight - headerHeight);
  235. <{if $cutScreenInfo.cut_fx == 'fadeInRight'}>
  236. var direction = 'horizontal';
  237. <{else}>
  238. var direction = 'vertical';
  239. <{/if}>
  240. var swiper = new Swiper('.swiper-container', {
  241. direction : direction // vertical \ horizontal
  242. , speed: 300
  243. , onInit: function(swiper){
  244. swiperAnimateCache(swiper);
  245. swiperAnimate(swiper);
  246. }
  247. , onSlideChangeEnd: function(swiper){
  248. swiperAnimate(swiper);
  249. }
  250. });
  251. $(".bottom_arrow").width();
  252. });
  253. </script>
  254. </body>
  255. </html>