-
-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathindex.html
More file actions
125 lines (112 loc) · 4.28 KB
/
Copy pathindex.html
File metadata and controls
125 lines (112 loc) · 4.28 KB
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
<html>
<head>
<title>Painterro demo</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
html,body,#wrapper {
height:100%;
margin:0;
padding:0;
background-color: white;
}
#conatiner {
position: absolute;
top: 50px;
bottom: 50px;
left: 20px;
right: 20px;
}
#holder {
display: flex;
}
</style>
</head>
<body>
<div id="app">
</div>
<div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div>
<div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div><div>asf</div>
</div>
<!--<script src="https://github.com/ivictbor/painterro/releases/download/0.1.7/painterro-0.1.7.min.js"></script>-->
<script src="painterro.min.js"></script>
<script>
window.p = Painterro({
language: 'uk',
backgroundFillColorAlpha: 0,
hideByEsc: true,
colorScheme: {
main: '#8B817A',
control: '#1A1A1A',
controlContent: '#fff',
controlShadow: 'none',
activeControl: '#6F6762',
activeControlContent: '#fff',
hoverControl: '#6F6762',
hoverControlContent: '#fff',
},
//defaultTool : 'brush',
//how_to_paste_actions: ['extend_right'],
/*hiddenTools: [
'select',
'crop',
'pixelize',
'line',
'arrow',
'rect',
'ellipse',
// 'brush',
// 'eraser',
'text',
'rotate',
'resize',
// 'save',
'open',
// 'close',
// 'undo',
'redo',
// 'zoomin',
// 'zoomout',
'bucket',
'clear',
'settings',
],
*/
saveHandler: this._onPainterroSave,
});
window.p.show()
const ctx = window.p.ctx;
// ctx.beginPath();
// ctx.moveTo(0,0);
// ctx.lineTo(300,150);
// ctx.strokeStyle="#FF0000";
// ctx.stroke();
// document.onpaste = (event) => {
// const { items } = event.clipboardData || event.originalEvent.clipboardData;
// Array.from(items).forEach((item) => {
// if (item.kind === 'file') {
// if (!window.painterroOpenedInstance) {
// // if painterro already opened - it will handle onpaste
// const blob = item.getAsFile();
// const reader = new FileReader();
// reader.onload = (readerEvent) => {
// window.painterroOpenedInstance = Painterro({
// initText: 'Press <b>PrtScr</b>, <b>Ctrl+V</b> to paste screenshot.<br>Press <b>Ctrl+S</b> to save', // todo: different for os-es
// onHide: () => {
// window.painterroOpenedInstance = undefined;
// },
// saveHandler: (image, done) => {
// console.log('Save it here', image.asDataURL()); // you could provide your save handler
// done(true);
// },
// }).show(readerEvent.target.result, item.type);
// };
// reader.readAsDataURL(blob);
// }
// }
// });
// };
const el = document.getElementById('app')
el.addEventListener('changeActiveTool',(e)=>{console.log('activeToolHasBeenCHanged',e)})
</script>
</body>
</html>