aboutsummaryrefslogtreecommitdiff
path: root/icon.html
diff options
context:
space:
mode:
Diffstat (limited to 'icon.html')
-rw-r--r--icon.html68
1 files changed, 68 insertions, 0 deletions
diff --git a/icon.html b/icon.html
new file mode 100644
index 0000000..579a6a9
--- /dev/null
+++ b/icon.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <style>
+ a {
+ display:block;
+ margin:10px auto;
+ padding:0px;
+ }
+
+ img {
+ margin:0;
+ padding:0;
+ border:solid 1px green;
+ }
+
+
+ </style>
+</head>
+<body>
+
+ <script>
+ var data = {
+ 16: [ 32, 0, 16],
+ 19: [ 35, 1, 18],
+ 32: [ 64, 1, 32],
+ 38: [ 75, 2, 38],
+ 48: [ 95, 1, 48],
+ 128: [260, 2, 131],
+ };
+
+
+ function createImageLink(size, logoFontSize, logoX, logoY) {
+ var colors = {'#333' : 'active', '#bbb' : 'disabled'};
+ for (var color in colors) {
+ var canvas = document.createElement('canvas');
+ canvas.width = canvas.height = size;
+ ctx = canvas.getContext('2d');
+ ctx.fillStyle = color;
+ ctx.font = 'Bold ' + logoFontSize + 'px Arial';
+ ctx.fillText('☈', logoX, logoY);
+
+
+ var a = document.createElement('a');
+ var img = document.createElement('img');
+ img.src = canvas.toDataURL();
+ a.href = canvas.toDataURL();
+ a.download = 'icon' + size + colors[color] + '.png';
+ a.appendChild(img);
+ a.style.width = size + 'px'
+ document.body.appendChild(a);
+ }
+ }
+
+ document.addEventListener('DOMContentLoaded', function() {
+ createImageLink(16, 32, 0, 16);
+ createImageLink(19, 35, 1, 18);
+ createImageLink(32, 64, 1, 32);
+ createImageLink(38, 75, 2, 38);
+ createImageLink(48, 95, 1, 48);
+ createImageLink(128, 260, 2, 131);
+
+ });
+
+ </script>
+</body>
+</html> \ No newline at end of file