-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
80 lines (76 loc) · 1.47 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
<style>
#container {
display: table;
text-align: center;
background-color: white;
width: 670px;
height: 670px;
position: relative;
}
#container-child {
display: table-cell;
vertical-align: middle;
text-align: center;
}
img {
max-height: 280px
}
#ng {
}
#hoa {
}
body {
font-family:'helvetica neue';
font-weight: 300;
padding: 100px;
background-color: #ddd;
}
#plus-container {
position: relative;
display: inline-block;
width: 100px;
height: 260px;
}
#plus {
position: absolute;
font-size: 140px;
font-weight: 100;
left: 0;
right: 0;
}
#handle {
font-size: 120px;
margin-top: 60px;
}
</style>
<div id="container">
<div id="container-child">
<img src="ng.png" id="ng">
<span id="plus-container">
<span id="plus">+</span>
</span>
<img src="hoa.png" id="hoa">
<div id="handle">
@AngularAir
</div>
</div>
</div>
<div>
<button onclick="downloadImage()">Download Image</button>
</div>
<div id="output"></div>
<script src="jquery-2.1.1.min.js"></script>
<script src="html2canvas.min.js"></script>
<script src="canvas2image.js"></script>
<script>
function downloadImage() {
html2canvas($("#container-child"), {
onrendered: function(canvas) {
theCanvas = canvas;
document.body.appendChild(canvas);
Canvas2Image.saveAsPNG(canvas);
$("#output").append(canvas);
}
});
}
</script>