forked from jamesssooi/Croppr.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
38 lines (34 loc) · 848 Bytes
/
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
<!doctype html>
<html>
<head>
<script src="dist/croppr.js"></script>
<link rel="stylesheet" href="dist/croppr.css">
</head>
<style>
.modal {
padding: 18px;
position: absolute;
border: 1px solid lightgrey;
left: 50%;
transform: translateX(-50%);
width: 300px;
}
.modal img {
max-width: 100%;
}
</style>
<body>
<h1>Croppr.js</h1>
<div class="modal">
<img src="https://unsplash.it/500/500/?random" alt="" id="cropper">
</div>
<script>
var croppr = new Croppr('#cropper', {
onInitialize: (instance) => { console.log(instance); },
onCropStart: (data) => { console.log('start', data); },
onCropEnd: (data) => { console.log('end', data); },
onCropMove: (data) => { console.log('move', data); }
});
</script>
</body>
</html>