-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
37 lines (37 loc) · 846 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Image Preview</title>
<style>
html{
height:100%;
width:100%;
-webkit-app-region: drag
}
body{
background-size:contain;
background-repeat: no-repeat;
width:100%;
height:100%;
margin:0;
position: absolute;
top:0;
}
</style>
</head>
<body>
<div id="imgArea">
</div>
<script>
var imgEle="";
require('electron').ipcRenderer.on('imageChange', function(event, url) {
//console.log(url);
var imgArea = document.querySelector('body');
imgArea.style.backgroundImage = 'url('+url+')';
imgEle="<img src='"+url+"' />";
require('electron').clipboard.writeText(imgEle);
});
</script>
</body>
</html>