Browse Source

显示启动页倒计时

luyanan 7 years ago
parent
commit
e426c1065d
1 changed files with 11 additions and 10 deletions
  1. 11 10
      app/html/guide.html

+ 11 - 10
app/html/guide.html

7
		<style>
7
		<style>
8
			.box {position: absolute;z-index: 2;top: 0;bottom: 0;left: 0;right:0;overflow: hidden;background: #ffffff;}			
8
			.box {position: absolute;z-index: 2;top: 0;bottom: 0;left: 0;right:0;overflow: hidden;background: #ffffff;}			
9
			.footer {width:100%;height:18%;background:#fff;display: flex;align-items: center;justify-content: center;position: fixed;bottom: 0;}
9
			.footer {width:100%;height:18%;background:#fff;display: flex;align-items: center;justify-content: center;position: fixed;bottom: 0;}
10
			.skip {position: fixed;top: 3%;right: 5%;background: rgba(0, 0, 0, 0.15);text-align: center;color: #fff;z-index:3;border-radius: 40px;}
10
			.skip {position: fixed;top: 3%;right: 5%;background: rgba(0, 0, 0, 0.15);text-align: center;color: #fff;z-index:3;border-radius: 60px;}
11
			.skip:before{content: "跳过广告";}
11
			.skip:before{content: "跳过广告";}
12
		</style>
12
		</style>
13
	</head>
13
	</head>
19
				<img class="logo" src="../images/logo.png" width="20%"/>
19
				<img class="logo" src="../images/logo.png" width="20%"/>
20
			</div>
20
			</div>
21
		</div>
21
		</div>
22
		<div class="skip" id="close"></div>
22
		<div class="skip" id="close"><span></span></div>
23
	</body>
23
	</body>
24
	<script src="../js/public/mui.min.js"></script>
24
	<script src="../js/public/mui.min.js"></script>
25
	<script src="../js/public/base.js"></script>
25
	<script src="../js/public/base.js"></script>
28
		var anos=ifiosAmdandroid();
28
		var anos=ifiosAmdandroid();
29
		var footer=document.getElementsByClassName("footer")[0]
29
		var footer=document.getElementsByClassName("footer")[0]
30
		var skip=document.getElementsByClassName("skip")[0]
30
		var skip=document.getElementsByClassName("skip")[0]
31
		var closet=document.getElementById("close")
31
		if(anos==0){//android
32
		if(anos==0){//android
32
			skip.style.fontSize="36px";
33
			skip.style.fontSize="36px";
33
			skip.style.padding="20px 36px";
34
			skip.style.padding="18px 36px";
34
		}else{
35
		}else{
35
//			footer.style.height="18%";
36
			skip.style.fontSize="16px";
36
			skip.style.fontSize="16px";
37
			skip.style.padding="10px 20px";
37
			skip.style.padding="10px 20px";
38
		}
38
		}
42
		mui.ready(function() {
42
		mui.ready(function() {
43
			var ua = navigator.userAgent.toLowerCase(); 
43
			var ua = navigator.userAgent.toLowerCase(); 
44
			if(/android|adr/gi.test(ua)){
44
			if(/android|adr/gi.test(ua)){
45
				document.getElementsByClassName("footer")[0].style.height=""
46
				document.getElementsByClassName("skip")[0].style.height=""
45
				footer.style.height=""
46
				skip.style.height=""
47
			}
47
			}
48
			mui.plusReady(function() {
48
			mui.plusReady(function() {
49
				plus.navigator.setFullscreen(true);
49
				plus.navigator.setFullscreen(true);
50
				plus.navigator.closeSplashscreen();
50
				plus.navigator.closeSplashscreen();
51
			});
51
			});
52
			document.getElementById("close").addEventListener('tap', function(event) {
52
			closet.addEventListener('tap', function(event) {
53
				plus.navigator.setFullscreen(false);
53
				plus.navigator.setFullscreen(false);
54
				plus.webview.currentWebview().close();
54
				plus.webview.currentWebview().close();
55
			}, false);
55
			}, false);
56
			setTimeMiu(5)
56
			setTimeMiu(5)
57

57

58
			function setTimeMiu(n) {
58
			function setTimeMiu(n) {
59
				var i = 0;
59
				var i = n;
60
				var Timer = setInterval(function() {
60
				var Timer = setInterval(function() {
61
					i++;
62
					if(i == n - 1) {
61
					closet.querySelector("span").innerHTML=i+"s"
62
					if(i == 0) {
63
						plus.navigator.setFullscreen(false);
63
						plus.navigator.setFullscreen(false);
64
						plus.webview.currentWebview().close();
64
						plus.webview.currentWebview().close();
65
						clearInterval(Timer);
65
						clearInterval(Timer);
66
					}
66
					}
67
					i--;
67
				}, 1000);
68
				}, 1000);
68
			}
69
			}
69
		})
70
		})