-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.html
76 lines (75 loc) · 2.27 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<script src="js/mui.min.js"></script>
<link href="css/mui.min.css" rel="stylesheet"/>
<script type="text/javascript" charset="utf-8">
mui.init();
mui.plusReady(function(){
var nickname = document.getElementById("nickname");
var roomid = document.getElementById("roomid");
var enter = document.getElementById("enter");
enter.addEventListener('tap',function(){
if(nickname.value.length == 0){
plus.nativeUI.toast("昵称不能为空");
return;
}
if(roomid.value.length == 0 || roomid.value.length < 3){
plus.nativeUI.toast("房间号为>3的纯数字");
return;
}
localStorage.nickname = nickname.value;
localStorage.roomid = roomid.value;
mui.openWindow({
url:"chat_top.html",
id:"chat_top"
})
})
})
</script>
<style type="text/css">
.mui-content{
margin: 45% 5% 40% 5%;
}
.mui-input-row label{
width: 25% !important;
}
.mui-input-row label~input,
.mui-input-row label~select,
.mui-input-row label~textarea{
width: 75% !important;
}
.mui-btn{
width: 100%;
letter-spacing: 5px;
font-size: 18px;
}
.mui-input-group{
border-radius: 4px;
}
</style>
</head>
<body>
<header class="mui-bar mui-bar-nav">
<h1 class="mui-title">秘密聊天室</h1>
</header>
<div class="mui-content">
<form class="mui-input-group">
<div class="mui-input-row">
<label>昵称:</label>
<input type="text" class="mui-input-clear" placeholder="请输入昵称" id="nickname">
</div>
<div class="mui-input-row">
<label>房间:</label>
<input type="number" class="mui-input-clear" placeholder="请输入房间号" id="roomid">
</div>
</form>
<div class="mui-content-padded" align="center">
<button type="button" class="mui-btn mui-btn-blue" id="enter">进入房间</button>
</div>
</div>
</body>
</html>