generator-minxing
Version:
generator for creating minxing web app.
207 lines (197 loc) • 6.67 kB
HTML
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<title>MxUI</title>
<link rel="stylesheet" href="../../styles/mx.css"/>
<link rel="stylesheet" href="../../styles/example.css"/>
<style>
.page{
opacity: 1;
}
.page.home .font{
font-size: 27px;
}
.reset{
width: 100%;
text-align: left;
resize: none;
margin-top: 8px;
background: #fff;
outline: none;
font-size: 14px;
padding: 12px 0 0;
font-family: Monaco,Menlo,Consolas,"Courier New",FontAwesome,monospace;
}
pre{
padding: 10px 20px;
background: #fff;
border-radius: 4px;
border:1px solid #eee;
margin:10px 0;
font-family: Monaco,Menlo,Consolas,"Courier New",FontAwesome,monospace;
white-space: pre-wrap;
max-width: 100%;
word-wrap : break-word;
}
code{
font-family: Monaco,Menlo,Consolas,"Courier New",FontAwesome,monospace;
}
/* .pre{
overflow-y: scroll;
max-height: 10rem;
}*/
.mx-parent{
position: relative;
display: block;
}
.mx-copy{
position: absolute;
right: 0;
display: block;
font-size: 12px;
text-align: right;
padding: 5px 8px;
background-color: #fff;
color: #767676;
border-radius: 4px;
border: 1px solid #elele8;
top: 11px;
left: 0px;
}
.mx-copy-t{
top: 0;
}
.mx-copy-t6{
top: 6px;
}
.mx-copy:hover{
background-color: #563d7c;
}
</style>
</head>
<body>
<div class="page">
<div class="page__hd">
<h1 class="page__title">Toast</h1>
<p class="page__desc">弹出式提示</p>
</div>
<div class="page__bd page__bd_spacing">
<a href="javascript:;" class="mx-btn mx-btn_default" id="showToast">成功提示</a>
<div class="mx-parent">
<button class="mx-copy">copy</button>
</div>
<pre>
<a href="javascript:;" class="mx-btn mx-btn_default" id="showToast">成功提示</a>
<div id="toast" style="display: none;">
<div class="mx-mask_transparent"></div>
<div class="mx-toast">
<i class="mx-icon-success-no-circle mx-icon_toast"></i>
<p class="mx-toast__content">已完成</p>
</div>
</div>
<script>
// toast
$(function(){
var $toast = $('#toast');
$('#showToast').on('click', function(){
if ($toast.css('display') != 'none') return;
$toast.fadeIn(100);
setTimeout(function () {
$toast.fadeOut(100);
}, 2000);
});
});
</script>
</pre>
<a href="javascript:;" class="mx-btn mx-btn_default" id="showLoadingToast">加载中提示</a>
<div class="mx-parent">
<button class="mx-copy">copy</button>
</div>
<pre>
<a href="javascript:;" class="mx-btn mx-btn_default" id="showLoadingToast">加载中提示</a>
<div id="loadingToast" style="display:none;">
<div class="mx-mask_transparent"></div>
<div class="mx-toast">
<i class="mx-loading mx-icon_toast"></i>
<p class="mx-toast__content">数据加载中</p>
</div>
</div>
<script>
// loading
$(function(){
var $loadingToast = $('#loadingToast');
$('#showLoadingToast').on('click', function(){
if ($loadingToast.css('display') != 'none') return;
$loadingToast.fadeIn(100);
setTimeout(function () {
$loadingToast.fadeOut(100);
}, 2000);
});
});
</script>
</pre>
</div>
<div class="page__ft">
<a href="../../index.html"><img src="../../images/icon_footer_link.png" /></a>
</div>
<!--BEGIN toast-->
<div id="toast" style="display: none;">
<div class="mx-mask_transparent"></div>
<div class="mx-toast">
<i class="mx-icon-success-no-circle mx-icon_toast"></i>
<p class="mx-toast__content">已完成</p>
</div>
</div>
<!--end toast-->
<!-- loading toast -->
<div id="loadingToast" style="display:none;">
<div class="mx-mask_transparent"></div>
<div class="mx-toast">
<i class="mx-loading mx-icon_toast"></i>
<p class="mx-toast__content">数据加载中</p>
</div>
</div>
</div>
<script src="../../scripts/zepto.min.js"></script>
<script src="../../scripts/clipboard.min.js"></script>
<script>
var clipboard = new Clipboard('.mx-parent',{
target: function(trigger) {
return trigger.nextElementSibling;
}
});
clipboard.on('success', function(e) {
console.log(e);
});
clipboard.on('error', function(e) {
console.log(e);
});
</script>
<script type="text/javascript">
// toast
$(function(){
var $toast = $('#toast');
$('#showToast').on('click', function(){
if ($toast.css('display') != 'none') return;
$toast.fadeIn(100);
setTimeout(function () {
$toast.fadeOut(100);
}, 2000);
});
});
// loading
$(function(){
var $loadingToast = $('#loadingToast');
$('#showLoadingToast').on('click', function(){
if ($loadingToast.css('display') != 'none') return;
$loadingToast.fadeIn(100);
setTimeout(function () {
$loadingToast.fadeOut(100);
}, 2000);
});
});
</script>
</body>
</html>