blob: 026116cb35afbde6c8f7d8bea23303711f3ad805 (
plain) (
blame)
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
|
<!DOCTYPE html>
<html>
<head>
<title>Mozilla Observatory button</title>
<link rel="stylesheet" href="https://syndamia.gitlab.io/web-buttons/common-styles.css" crossorigin="anonymous">
<style>
* {
font-smooth: never;
}
#button {
border: 2px outset #4582ec;
width: 115px;
background: white;
}
#button > * {
height: 35px;
}
#mozilla-logo {
padding: 5px;
float: left;
font: 11px Arial;
font-weight: bold;
}
#score {
color: white;
background-color: #2d882d;
float: right;
font: 18px Arial;
width: 35px;
text-align: center;
margin-bottom: 10px;
border-radius: 7px;
border: 3px solid #106610;
}
</style>
</head>
<body>
<div id="button" class="button-x39">
<div id="mozilla-logo">
Mozilla<br>Observatory
</div>
<div id="score">
A<sup>+</sup>
</div>
</div>
<script src="./dom-to-image/src/dom-to-image.js"></script>
<script>
var node = document.getElementById('button');
domtoimage.toPng(node)
.then (function (dataUrl) {
var img = new Image();
img.src = dataUrl;
document.body.appendChild(img);
})
.catch(function (error) {
console.error('oops, something went wrong!', error);
});
</script>
</body>
</html>
|