loading.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>ELAB</title>
  5. <link rel="stylesheet" type="text/css" href="progress/src/normalize.css">
  6. <link rel="stylesheet" type="text/css" href="progress/style.css?v-1.043543">
  7. <link rel="stylesheet" type="text/css" href="progress/number-pb.css">
  8. <link rel="stylesheet" href="css/animate.css" />
  9. <!--<link href='http://fonts.googleapis.com/css?family=Quicksand' rel='stylesheet' type='text/css'>-->
  10. <meta name="viewport" content="width=device-width, initial-scale=1">
  11. <style type="text/css">
  12. html,body{
  13. width: 100%;
  14. height: 100%;
  15. }
  16. .container{
  17. width: 100%;
  18. height: 100%;
  19. align-items:center;
  20. }
  21. .samp-cell{
  22. width: 100%;
  23. text-align: center;
  24. vertical-align: middle;
  25. }
  26. .logo{
  27. margin-top: -10%;
  28. margin-bottom: 0;
  29. }
  30. .progress-num{
  31. margin: 0 auto;
  32. line-height: 100%;
  33. }
  34. .sample-pb{
  35. margin: 0 auto;
  36. }
  37. .number-pb{
  38. margin: 0 auto;
  39. }
  40. </style>
  41. </head>
  42. <body>
  43. <div class="container" id="sample-pb">
  44. <div class="samp-cell">
  45. <p class="progress-num" id="progress-num">0</p>
  46. <img class="logo" src="progress/img/LOGO.png" />
  47. <section class="sample-pb">
  48. <div class="number-pb">
  49. <div class="number-pb-shown"></div>
  50. <div class="number-pb-num">0%</div>
  51. </div>
  52. </section>
  53. </div>
  54. <div id="hidden" class="hidden">
  55. <img src="http://yun-image.elab-plus.com/images/index/1_objects@2x.png" class="hidden_img"></img>
  56. <img src="http://yun-image.elab-plus.com/images/index/1_objects_6.png" class="hidden_img"></img>
  57. <img src="http://yun-image.elab-plus.com/images/index/1_objects_7.png" class="hidden_img"></img>
  58. <img src="http://yun-image.elab-plus.com/images/index/1_objects.png" class="hidden_img"></img>
  59. <img src="http://yun-image.elab-plus.com/images/index/1_objects@2x_1.png" class="hidden_img"></img>
  60. <img src="http://yun-image.elab-plus.com/images/index/1_objects@2x_2.png" class="hidden_img"></img>
  61. <img src="http://yun-image.elab-plus.com/images/index/1_objects@2x_3.png" class="hidden_img"></img>
  62. <img src="http://yun-image.elab-plus.com/images/index/1_objects@2x_4.png" class="hidden_img"></img>
  63. <img src="http://yun-image.elab-plus.com/images/index/1_objects@2x_5.png" class="hidden_img"></img>
  64. <!--<img src="http://yun-image.elab-plus.com/water/img/dmaps/2048x2048/clouds.jpg" class="hidden_img"></img>-->
  65. <img src="http://yun-image.elab-plus.com/images/1.png" class="hidden_img"></img>
  66. <img src="http://yun-image.elab-plus.com/images/BG@2x.jpg" class="hidden_img"></img>
  67. <img src="http://yun-image.elab-plus.com/images/bg01.png" class="hidden_img"></img>
  68. <img src="http://yun-image.elab-plus.com/images/bg02.png" class="hidden_img"></img>
  69. <img src="http://yun-image.elab-plus.com/images/bg03.png" class="hidden_img"></img>
  70. <img src="http://yun-image.elab-plus.com/images/Bitmap@2x.png" class="hidden_img"></img>
  71. <img src="http://yun-image.elab-plus.com/images/Bitmap@2x9.png" class="hidden_img"></img>
  72. <img src="http://yun-image.elab-plus.com/images/Group 2@2x01.png" class="hidden_img"></img>
  73. <img src="http://yun-image.elab-plus.com/images/Group 2@2x02.png" class="hidden_img"></img>
  74. <img src="http://yun-image.elab-plus.com/images/Group 2@2x03.png" class="hidden_img"></img>
  75. <img src="http://yun-image.elab-plus.com/images/Group 4@2x.png" class="hidden_img"></img>
  76. <img src="http://yun-image.elab-plus.com/images/Group 7@2x.png" class="hidden_img"></img>
  77. <img src="http://yun-image.elab-plus.com/images/Group@2x.png" class="hidden_img"></img>
  78. <img src="http://yun-image.elab-plus.com/images/Group@2x01.png" class="hidden_img"></img>
  79. <img src="http://yun-image.elab-plus.com/images/Group@2x02.png" class="hidden_img"></img>
  80. <img src="http://yun-image.elab-plus.com/images/Group@2x03.png" class="hidden_img"></img>
  81. <img src="http://yun-image.elab-plus.com/images/ic_clear@2x.png" class="hidden_img"></img>
  82. <img src="http://yun-image.elab-plus.com/images/Line.png" class="hidden_img"></img>
  83. <img src="http://yun-image.elab-plus.com/images/Line0.png" class="hidden_img"></img>
  84. <!--<img src="http://yun-image.elab-plus.com/images/LOGO.png" class="hidden_img"></img>-->
  85. <img src="http://yun-image.elab-plus.com/images/Main@2x.png" class="hidden_img"></img>
  86. <img src="http://yun-image.elab-plus.com/images/Main@2x01.png" class="hidden_img"></img>
  87. <img src="http://yun-image.elab-plus.com/images/Menu-icon.png" class="hidden_img"></img>
  88. <img src="http://yun-image.elab-plus.com/images/Menu-icon@2x.png" class="hidden_img"></img>
  89. <img src="http://yun-image.elab-plus.com/images/Works-icon@2x.png" class="hidden_img"></img>
  90. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_1.png" class="hidden_img"></img>
  91. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_2.png" class="hidden_img"></img>
  92. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_3.png" class="hidden_img"></img>
  93. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_4.png" class="hidden_img"></img>
  94. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_5.png" class="hidden_img"></img>
  95. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x_6.png" class="hidden_img"></img>
  96. <img src="http://yun-image.elab-plus.com/images/contact/1_objects@2x.png" class="hidden_img"></img>
  97. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_1.png" class="hidden_img"></img>
  98. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_2.png" class="hidden_img"></img>
  99. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_3.png" class="hidden_img"></img>
  100. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_4.png" class="hidden_img"></img>
  101. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_5.png" class="hidden_img"></img>
  102. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_6.png" class="hidden_img"></img>
  103. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x_7.png" class="hidden_img"></img>
  104. <img src="http://yun-image.elab-plus.com/images/join/1_objects@2x.png" class="hidden_img"></img>
  105. <img src="http://yun-image.elab-plus.com/images/join/2_objects@2x_1.png" class="hidden_img"></img>
  106. <img src="http://yun-image.elab-plus.com/images/join/2_objects@2x.png" class="hidden_img"></img>
  107. <img src="http://yun-image.elab-plus.com/images/join/3_objects@2x_1.png" class="hidden_img"></img>
  108. <img src="http://yun-image.elab-plus.com/images/join/3_objects@2x.png" class="hidden_img"></img>
  109. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_1.png" class="hidden_img"></img>
  110. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_2.png" class="hidden_img"></img>
  111. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_3.png" class="hidden_img"></img>
  112. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_4.png" class="hidden_img"></img>
  113. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_5.png" class="hidden_img"></img>
  114. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_6.png" class="hidden_img"></img>
  115. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_7.png" class="hidden_img"></img>
  116. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_8.png" class="hidden_img"></img>
  117. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_9.png" class="hidden_img"></img>
  118. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_10.png" class="hidden_img"></img>
  119. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_11.png" class="hidden_img"></img>
  120. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_12.png" class="hidden_img"></img>
  121. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_13.png" class="hidden_img"></img>
  122. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_14.png" class="hidden_img"></img>
  123. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x_15.png" class="hidden_img"></img>
  124. <img src="http://yun-image.elab-plus.com/images/do/1_objects@2x.png" class="hidden_img"></img>
  125. <img src="http://yun-image.elab-plus.com/images/do/2_objects@2x_1.png" class="hidden_img"></img>
  126. <img src="http://yun-image.elab-plus.com/images/do/2_objects@2x_2.png" class="hidden_img"></img>
  127. <img src="http://yun-image.elab-plus.com/images/do/2_objects@2x.png" class="hidden_img"></img>
  128. <img src="http://yun-image.elab-plus.com/images/do/3_objects@2x.png" class="hidden_img"></img>
  129. <img src="http://yun-image.elab-plus.com/images/do/4_objects@2x.png" class="hidden_img"></img>
  130. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_1.jpg" class="hidden_img"></img>
  131. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_2.jpg" class="hidden_img"></img>
  132. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_3.png" class="hidden_img"></img>
  133. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_4.png" class="hidden_img"></img>
  134. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x.jpg" class="hidden_img"></img>
  135. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_6.jpg" class="hidden_img"></img>
  136. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_7.jpg" class="hidden_img"></img>
  137. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_8.jpg" class="hidden_img"></img>
  138. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_9.png" class="hidden_img"></img>
  139. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_10.jpg" class="hidden_img"></img>
  140. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_11.jpg" class="hidden_img"></img>
  141. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_12.png" class="hidden_img"></img>
  142. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_13.png" class="hidden_img"></img>
  143. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_14.jpg" class="hidden_img"></img>
  144. <img src="http://yun-image.elab-plus.com/images/projects/1_objects@2x_15.jpg" class="hidden_img"></img>
  145. <img src="http://yun-image.elab-plus.com/images/projects/2_objects@2x.png" class="hidden_img"></img>
  146. </div>
  147. </div>
  148. <script src="progress/src/jquery.min.js"></script>
  149. <!--<script src="http://yun-image.elab-plus.com/progress/src/jquery.velocity.min.js"></script>
  150. <script src="http://yun-image.elab-plus.com/progress/number-pb.js"></script>
  151. <script src= "https://npmcdn.com/imagesloaded@4.1/imagesloaded.pkgd.js"></script>-->
  152. <script>
  153. var $_h = $(window).height();
  154. //console.log($_h);
  155. $(".container").height($_h+'px');
  156. var percent;
  157. var Count = $(".hidden_img").length; //图片数量
  158. var Imgs = new Array(Count);
  159. var ImgLoaded = 0;
  160. var Urls = new Array(Count);
  161. for(var i = 0; i < Count; i++) {
  162. var $tmp = $(".hidden_img").eq(i).attr("src");
  163. Urls[i] = $tmp;
  164. }
  165. //mock
  166. var time0 = new Date().getTime();
  167. mockloaded = function () {
  168. var cur = new Date();
  169. var t = (cur.getTime() - time0) / 1000;
  170. var s = t | 0;
  171. var res = 98;
  172. if (s >= 0 && s < 3) {
  173. res = 8 * t;
  174. }
  175. if (s >= 3 && s < 16) {
  176. res = 24 + 2 * (t - 3);
  177. }
  178. if (s >= 16 && s < 96) {
  179. res = 50 + 0.5 * (t - 16);
  180. }
  181. if (s >= 96 && s < 176) {
  182. res = 90 + 0.1 * (t - 96);
  183. }
  184. return res | 0;
  185. }
  186. function sleep(ms) {
  187. return new Promise(resolve => setTimeout(resolve, ms));
  188. }
  189. var mock = setInterval(function () {
  190. var mock = mockloaded();
  191. $("#progress-num").text(mock);
  192. $(".number-pb-shown").css("width", "" + mock + "%");
  193. },100);
  194. //预加载图片
  195. function preLoadImgs() {
  196. for(var i = 0; i < Imgs.length; i++) {
  197. Imgs[i] = new Image();
  198. downloadImage(i);
  199. }
  200. }
  201. //加载单个图片
  202. function downloadImage(i) {
  203. Imgs[i].src = Urls[i];
  204. Imgs[i].onLoad = validateImages(i);
  205. }
  206. function validateImages(i) {
  207. if(!Imgs[i].complete) {
  208. window.setTimeout('downloadImage(' + i + ')', 200);
  209. } else if(typeof Imgs[i].naturalWidth != "undefined" && Imgs[i].naturalWidth == 0) {
  210. window.setTimeout('downloadImage(' + i + ')', 200);
  211. } else {
  212. ImgLoaded++;
  213. percent = parseInt(ImgLoaded / Count * 100);
  214. if(percent == 100) {
  215. $("#progress-num").text(percent);
  216. $(".number-pb-shown").css("width", "" + percent + "%");
  217. // controlBar.reach(100);
  218. //加载完毕,关闭loading
  219. clearInterval(mock);
  220. parent.hideLoading();
  221. }
  222. }
  223. }
  224. preLoadImgs();
  225. </script>
  226. </div>
  227. </body>
  228. </html>