-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
1,825 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
.mui-numbox { | ||
border: solid 1px #bbb; | ||
overflow: hidden !important; | ||
display: inline-block; | ||
height: 35px; | ||
border-radius: 3px; | ||
background-color: #efeff4 !important; | ||
vertical-align: top; | ||
box-sizing: border-box; | ||
position: relative; | ||
padding: 0px 40px 0px 40px; | ||
width: 120px; | ||
vertical-align: middle; | ||
} | ||
.mui-numbox [class*=mui-numbox-btn] { | ||
width: 40px; | ||
height: 100%; | ||
margin: 0px; | ||
position: absolute; | ||
top: 0px; | ||
border: none; | ||
border-radius: 0px !important; | ||
font-size: 18px; | ||
color: #555; | ||
line-height: 100%; | ||
font-weight: normal; | ||
overflow: hidden; | ||
padding: 0px; | ||
background-color: #f9f9f9; | ||
} | ||
.mui-numbox [class*=mui-numbox-btn]:active { | ||
background-color: #ccc; | ||
} | ||
.mui-numbox [class*=mui-numbox-btn][disabled] { | ||
color: #c0c0c0; | ||
} | ||
.mui-numbox .mui-numbox-btn-plus { | ||
right: 0px; | ||
} | ||
.mui-numbox .mui-numbox-btn-minus { | ||
left: 0px; | ||
} | ||
.mui-numbox .mui-numbox-input { | ||
width: 100% !important; | ||
height: 100% !important; | ||
text-align: center; | ||
border: none; | ||
border-left: solid 1px #ccc !important; | ||
border-right: solid 1px #ccc !important; | ||
appearance: none; | ||
margin: 0px; | ||
padding: 0px 3px !important; | ||
display: inline-block; | ||
border-radius: 0px !important; | ||
} | ||
.mui-input-row .mui-numbox { | ||
margin: 2px 8px; | ||
float: right; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>手势锁屏示例</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||
<link rel="stylesheet" href="../css/mui.min.css" /> | ||
<style> | ||
* { | ||
box-sizing: border-box; | ||
} | ||
html, | ||
body { | ||
width: 100%; | ||
height: 100%; | ||
margin: 0px; | ||
padding: 0px; | ||
overflow: hidden; | ||
background-color: #efeff4; | ||
} | ||
#holder { | ||
width: 300px; | ||
height: 300px; | ||
border: solid 1px #bbb; | ||
border-radius: 5px; | ||
margin: 50px auto; | ||
background-color: #fff; | ||
} | ||
#alert { | ||
width: 300px; | ||
height: 45px; | ||
line-height: 45px; | ||
text-align: center; | ||
color: red; | ||
margin: auto auto; | ||
border: dashed 1px #bbb; | ||
border-radius: 5px; | ||
background-color: #fff; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div id='holder' class="mui-locker" data-locker-options='{"ringColor":"rgba(221,221,221,1)","fillColor":"#ffffff","pointColor":"rgba(0,136,204,1)","lineColor":"rgba(0,136,204,1)"}'></div> | ||
<div id='alert'></div> | ||
<script src="../js/mui.min.js"></script> | ||
<script src="../js/mui.locker.js"></script> | ||
<script> | ||
(function($,doc){ | ||
$.init(); | ||
|
||
var holder = doc.querySelector('#holder'), | ||
alert = doc.querySelector('#alert'), | ||
record = []; | ||
//处理事件 | ||
holder.addEventListener('done', function(event) { | ||
var rs = event.detail; | ||
if (rs.points.length < 4) { | ||
alert.innerText = '设定的手势太简单了'; | ||
record = []; | ||
rs.sender.clear(); | ||
return; | ||
} | ||
record.push(rs.points.join('')); | ||
if (record.length >= 2) { | ||
if (record[0] == record[1]) { | ||
alert.innerText = '手势设定完成'; | ||
} else { | ||
alert.innerText = '两次手势设定不一致'; | ||
} | ||
rs.sender.clear(); | ||
record = []; | ||
} else { | ||
alert.innerText = '请确认手势设定'; | ||
rs.sender.clear(); | ||
} | ||
}); | ||
}(mui,document)); | ||
|
||
</script> | ||
</body> | ||
|
||
</html> |
Oops, something went wrong.