Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commitb6d0560e3fcb5f476a81c55c34bf09e9845fdd86 (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-01-17 17:15:40 +0200
Committer
 Syndamia <kamen@syndamia.com>
2023-01-17 17:15:40 +0200
Filesbe520fb34759260b965dc86e7f129dc2d5db49d7
web-buttons-b6d0560e3fcb5f476a81c55c34bf09e9845fdd86.tar
web-buttons-b6d0560e3fcb5f476a81c55c34bf09e9845fdd86.tar.gz
web-buttons-b6d0560e3fcb5f476a81c55c34bf09e9845fdd86.zip
Parent4e844712ab845dec0bdb7e6d806c47a4f522b40f (diff)
[mo] Added mozilla observatory
3 files changed, 63 insertions, 0 deletions
-rw-r--r--.gitmodules3
m---------public/dom-to-image0
-rw-r--r--public/mozilla-observatory.html60
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..74bedd0
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "public/dom-to-image"]
+ path = public/dom-to-image
+ url = https://github.com/tsayen/dom-to-image.git
diff --git a/public/dom-to-image b/public/dom-to-image
new file mode 160000
+Subproject fae625bce0970b3a039671ea7f338d05ecb3d0e
diff --git a/public/mozilla-observatory.html b/public/mozilla-observatory.html
new file mode 100644
index 0000000..026116c
--- /dev/null
+++ b/public/mozilla-observatory.html
@@ -0,0 +1,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>