mirror of
https://github.com/wu736139669/vczero.github.io.git
synced 2026-08-05 06:23:38 +00:00
add upload
This commit is contained in:
+162
@@ -0,0 +1,162 @@
|
||||
<!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" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
<meta content="telephone=no" name="format-detection" />
|
||||
<title>HTML5图片上传预览</title>
|
||||
<style>
|
||||
html, body, div, span, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, address, big, cite, code, del, em, font, img, ins, small, strong, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body {
|
||||
margin: 0 auto;
|
||||
}
|
||||
body {
|
||||
font-family: Arial,"宋体",Lucida,Verdana,Helvetica,sans-serif;
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
line-height: 150%;
|
||||
}
|
||||
.w {
|
||||
width: 800px;
|
||||
padding: 0;
|
||||
margin: 0 auto;
|
||||
zoom: 1;
|
||||
margin: 10px;
|
||||
}
|
||||
.mc {
|
||||
padding: 30px 0 20px;
|
||||
|
||||
border-width: 0px 1px 1px;
|
||||
}
|
||||
.form {
|
||||
width: 750px;
|
||||
}
|
||||
.item {
|
||||
padding-top: 9px;
|
||||
z-index: 1;
|
||||
}
|
||||
.label{
|
||||
width: 190px;
|
||||
text-align: right;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.item-ifo{
|
||||
position: relative;
|
||||
width: 370px;
|
||||
}
|
||||
.text{
|
||||
width: 238px;
|
||||
height: 16px;
|
||||
padding: 10px 25px 10px 5px;
|
||||
border: 1px solid #cccccc;
|
||||
float: none;
|
||||
font-size: 14px;
|
||||
font-family: arial,"宋体";
|
||||
color: #999;
|
||||
overflow: hidden;
|
||||
}
|
||||
.btn{
|
||||
|
||||
border: 1px solid #dddddd;
|
||||
padding: 0;
|
||||
width: 77px;
|
||||
height: 28px;
|
||||
background: #f4f4f4;
|
||||
margin-top: 0;
|
||||
text-align: center;
|
||||
line-height: 28px;
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
}
|
||||
.btn span {
|
||||
color: #333;
|
||||
}
|
||||
a:link, a:visited {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
}
|
||||
a:link, a:visited {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="w">
|
||||
<div class="mc">
|
||||
<div class="form">
|
||||
<div class="item">
|
||||
<span class="label">最大宽度(px)</span>
|
||||
<div class="item-ifo">
|
||||
<input type="text" id="maxwidth" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label">最大高度(px)</span>
|
||||
<div class="item-ifo">
|
||||
<input type="text" id="maxheight" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label">压缩质量(%)</span>
|
||||
<div class="item-ifo">
|
||||
<input type="text" id="quality" value=100 />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label"></span>
|
||||
<div class="item-ifo">
|
||||
<a class="btn">
|
||||
<span id="drawImage">裁剪</span>
|
||||
</a>
|
||||
<a class="btn">
|
||||
<span id="uploadImageInfo">上传</span>
|
||||
</a>
|
||||
<a class="btn">
|
||||
<span id="saveImageInfo">下载</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label">日志</span>
|
||||
<div class="item-ifo">
|
||||
<textarea id="msg" rows="10" cols="50" style="font-size:14px;color:red;"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<span class="label">选择图片</span>
|
||||
<div class="item-ifo">
|
||||
<input id="upload" type="file" single accept="image/gif,image/png,image/jpeg"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="container" style="">
|
||||
<canvas id="myCanvas"></canvas>
|
||||
</div>
|
||||
<script src="http://cdn.staticfile.org/require-jquery/0.25.0/require-jquery.js"></script>
|
||||
<script src="3.js"></script>
|
||||
<script type="text/javascript">
|
||||
var u = new Upload('#upload', '#myCanvas');
|
||||
u.showImg();
|
||||
|
||||
$('#drawImage').on('click', function(){
|
||||
u.drawImage({
|
||||
width:300,
|
||||
height:300
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user