-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathicon.html
51 lines (49 loc) · 1.24 KB
/
icon.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
<html>
<head>
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
</head>
<style>
body {
background-color: #eeeeee;
}
#box {
background-color: #00796b;
color: #ffffff;
width: 512px;
height: 512px;
font-family: BlinkMacSystemFont, -apple-system, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, Helvetica, Arial, sans-serif;
font-size: 120px;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
align-items: center;
border-radius: 10%;
}
div {
line-height: 1;
}
</style>
<script>
createImage = async () => {
const box = document.getElementById('box');
console.log(html2canvas);
const c = html2canvas(box, {
scale:1, backgroundColor: "rgba(0,0,0,0)"});
c.then(canvas => {
console.log(canvas);
const img = document.getElementById('captureImg');
img.src = canvas.toDataURL();
});
};
</script>
<body>
<div id="box">
<div>Unseeen</div>
</div>
<button onclick="createImage()">create</button>
<div>
<img id="captureImg" />
</div>
</body>
</html>