-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
164 lines (140 loc) · 4.63 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!doctype html>
<html>
<head>
<title>Simple Cropper</title>
<link href='http://fonts.googleapis.com/css?family=Pacifico&text=Simple%20Cropper' rel='stylesheet' type='text/css'>
<style>
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
height: 100%;
background: #d7381c;
font: 400 16px/1.5 Helvetica, Arial, sans-serif;
color: #fff;
}
html, button {
-webkit-font-smoothing: antialiased;
}
body {
min-height: 100%;
position: relative;
text-rendering: optimizeLegibility;
}
h1 {
font-family: Pacifico, cursive;
text-align: center;
margin-bottom: 80px;
}
.demo {
width: 100%;
max-width: 1100px;
position: absolute;
left: 50%;
top: 50%;
-webkit-transform: translate3d(-50%, -50%, 0);
-moz-transform: translate3d(-50%, -50%, 0);
transform: translate3d(-50%, -50%, 0);
background: url('loading.gif') no-repeat center center;
padding: 10px;
}
.demo__wrapper {
overflow: hidden;
}
.demo__split {
float: left;
width: 50%;
opacity: 0;
position: relative;
z-index: 2;
}
.demo__preview {
background: #eee;
z-index: 1;
}
.demo--ready .demo__split {
opacity: 1;
}
.demo__zoom {
text-align: center;
margin-top: 20px;
margin: 20px auto;
width: 50%;
background: #fff;
color: #333;
border-radius: 20px;
padding: 0 12px;
height: 26px;
}
.btn, .demo__zoom__current {
color: #333;
background: none;
padding: 0 12px;
height: 26px;
display: inline-block;
border: none;
border-left: 1px solid #ccc;
font-weight: bold;
outline: none;
cursor: pointer;
float: left;
width: 20%;
line-height: 26px;
font-size: 12px;
}
.btn:first-child {
border-left: none;
}
.demo__zoom__current {
cursor: default;
font-weight: normal;
}
img {
max-width: 100%;
height: auto;
display: block;
}
canvas {
display: block;
}
.simple-cropper__cropper {
box-shadow: 0 0 0 2px white;
}
@media (max-width: 600px) {
.demo {
position: static;
-webkit-transform: none;
-moz-transform: none;
transform: none;
}
.demo__split {
float: none;
width: 100%;
}
}
</style>
</head>
<body>
<div class="demo" id="cropper">
<h1>Simple cropper</h1>
<div class="demo__wrapper">
<div class="demo__cropper demo__split">
<img width="1400" height="933" src="https://images.unsplash.com/photo-1534531173927-aeb928d54385?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1400&q=80" alt="">
</div>
<div class="demo__preview demo__split"></div>
</div>
<div class="demo__zoom">
<button type="btn" class="btn" id="zoom0">Zoom max</button>
<button type="btn" class="btn" id="zoomOut">Zoom out</button>
<span class="demo__zoom__current" id="currentZoom">100%</span>
<button type="btn" class="btn" id="zoomIn">Zoom in</button>
<button type="btn" class="btn" id="zoom100">No Zoom</button>
</div>
</div>
<script type="module" src="./script.js"></script>
</body>
</html>