-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
86 lines (78 loc) · 3.53 KB
/
demo.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
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telphone=no, email=no">
<meta name="renderer" content="webkit">
<meta name="HandheldFriendly" content="true">
<meta name="screen-orientation" content="portrait">
<meta name="x5-orientation" content="portrait">
<title></title>
<style media="screen">
* {
margin: 0;
padding: 0
}
img {
display: block;
}
</style>
</head>
<body>
<div class='upload'>
<input type="text" id='width' placeholder='width'>
<input type="text" id='height' placeholder='height'>
<input type="text" id='ratio' placeholder='ratio'>
<input type="text" id='max' placeholder='max'>
<select id="rotate">
<option value="">自讀取圖片</option>
<option value="1">0°</option>
<option value="6">90°</option>
<option value="3">180°</option>
<option value="8">270°</option>
</select>
<button type="button" id="btn">實例化插件</button>
<br>
<br>
<!-- <input type="file" id='file' capture="camera" accept="image/*"><label id="upload1"></label> -->
<input type="file" id='file'><label id="upload1"></label>
<br>
<br>
<p>原始圖片</p>
<img class="old" width="300">
<p>修改圖片</p>
<img class="new">
</div>
<script src="./js/exif.js"></script>
<script src="./js/picProcess.js" charset="utf-8"></script>
<script type="text/javascript">
window.onload = function() {
var dom = document.getElementById('file'),
btn = document.getElementById('btn'),
width = document.getElementById('width'),
height = document.getElementById('height'),
ratio = document.getElementById('ratio'),
max = document.getElementById('max'),
rotate = document.getElementById('rotate'),
upload;
btn.onclick = function() {
upload = new SelectFileImage({
nSelector: '.new',
oSselector: '.old',
width: width.value,
height: height.value,
ratio: ratio.value,
max: max.value,
orientation: rotate.value,
})
}
dom.addEventListener('change', function(e) {
upload.start(e);
});
}
</script>
</body>
</html>