svg.escobar.life

A simple SVG markup editor for the web

Commit
fa588ec6a82213ca3bb79b1bb83390bd3684b5f1
Parent
75fdd3a24e67162eaf781a0308746ac0af823569
Author
Gark Garcia <37553739+GarkGarcia@users.noreply.github.com>
Date

Simplifyed the build pipeline and the icon scheme.

Diffstat

14 files changed, 40 insertions, 95 deletions

Status File Name N° Changes Insertions Deletions
Deleted assets/icons/browserconfig.xml 9 0 9
Deleted assets/icons/favicon-16x16.png 0 0 0
Deleted assets/icons/favicon-32x32.png 0 0 0
Deleted assets/icons/favicon.ico 0 0 0
Added assets/icons/favicon.svg 5 5 0
Deleted assets/icons/mstile-144x144.png 0 0 0
Deleted assets/icons/mstile-150x150.png 0 0 0
Deleted assets/icons/mstile-310x150.png 0 0 0
Deleted assets/icons/mstile-310x310.png 0 0 0
Deleted assets/icons/mstile-70x70.png 0 0 0
Modified build/build.py 31 11 20
Deleted build/config.json 7 0 7
Deleted build/template.html 34 0 34
Modified index.html 49 24 25
diff --git a/assets/icons/browserconfig.xml b/assets/icons/browserconfig.xml
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<browserconfig>
-    <msapplication>
-        <tile>
-            <square150x150logo src="assets/icons/mstile-150x150.png"/>
-            <TileColor>#9f00a7</TileColor>
-        </tile>
-    </msapplication>
-</browserconfig>
diff --git a/assets/icons/favicon-16x16.png b/assets/icons/favicon-16x16.png
Binary files differ.
diff --git a/assets/icons/favicon-32x32.png b/assets/icons/favicon-32x32.png
Binary files differ.
diff --git a/assets/icons/favicon.ico b/assets/icons/favicon.ico
Binary files differ.
diff --git a/assets/icons/favicon.svg b/assets/icons/favicon.svg
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" clip-rule="evenodd" viewBox="0 0 100 100">
+    <circle cx="50" cy="50" r="50" fill="#2d2b55"/>
+    <path fill="#fff" fill-rule="nonzero" d="M46.6365964 63.20753129h-4.4881496L39.4319352 76.57454H21.1545365L31.9910556 23.4254h24.3009679c7.1160793 0 12.6672117 1.54132506 16.6238699 4.59740061 3.9271309 3.05607555 5.90546 7.36115589 5.90546 12.86209188.45176769 8.83752089-5.45369231 16.99591388-14.6160135 20.1966732l8.8877173 15.25380318-18.8088901.23917113-7.677098-13.36700871h.0295273zm6.8798609-25.96335489h-6.1121511l-2.5688751 12.46347333h7.5294615c2.5098205 0 4.4881496-.63778968 5.8759327-1.8602199 1.3877831-1.24900479 2.066911-2.97635184 2.066911-5.20861572 0-3.58756695-2.2440748-5.39463771-6.791279-5.39463771z"/>
+</svg>
diff --git a/assets/icons/mstile-144x144.png b/assets/icons/mstile-144x144.png
Binary files differ.
diff --git a/assets/icons/mstile-150x150.png b/assets/icons/mstile-150x150.png
Binary files differ.
diff --git a/assets/icons/mstile-310x150.png b/assets/icons/mstile-310x150.png
Binary files differ.
diff --git a/assets/icons/mstile-310x310.png b/assets/icons/mstile-310x310.png
Binary files differ.
diff --git a/assets/icons/mstile-70x70.png b/assets/icons/mstile-70x70.png
Binary files differ.
diff --git a/build/build.py b/build/build.py
@@ -1,24 +1,16 @@
-import json, os
+import os
 
-BUILD_CMD = 'elm make {} --optimize --output=build/output/script.js'
-COMPRESS_CMD = 'echo /* {} */ > build/output/script.min.js && minify build/output/script.js --mangle >> build/output/script.min.js'
+BUILD_CMD = "elm make \"src/Main.elm\" --optimize --output=build/output/script.js"
+COMPRESS_CMD = "minify build/output/script.js --mangle -o script.min.js"
+COPYRIGHT = "// Thiago Brevidelli ⓒ 2019. ALL RIGHTS RESERVED"
 
-print("Loading build configs...")
+print("Compiling source files...")
+os.system(BUILD_CMD)
 
-with open("build/config.json", "r", encoding="utf8") as c_file:
-    config = json.loads(c_file.read())
+print("Compressing compiled ouput...")
+os.system(COMPRESS_CMD)
 
-    print("Compiling source files...")
-    srcs = ['"' + s + '"' for s in config["srcs"]]
-    os.system(BUILD_CMD.format(" ".join(srcs)))
+with open("script.min.js", "rw", encoding="utf8") as c_file:
+    c_file.write(COPYRIGHT + c_file.read())
 
-    print("Compressing compiled ouput...")
-    os.system(COMPRESS_CMD.format(config["copyright"]))
-
-    with open(config["template"], "r", encoding="utf8") as t_file, open("build/output/index.html", "w", encoding="utf8") as output:
-        template = t_file.read()
-
-        print("Compiling index.html...")
-        output.write(template.format(**config))
-
-print("\nAll done!")-
\ No newline at end of file
+print("\nAll done!")
diff --git a/build/config.json b/build/config.json
@@ -1,6 +0,0 @@
-{
-    "srcs": ["src/Main.elm"],
-    "template": "build/template.html",
-    "stylesheet": "styles.css",
-    "copyright": "Thiago Brevidelli ⓒ 2019. ALL RIGHTS RESERVED"
-}-
\ No newline at end of file
diff --git a/build/template.html b/build/template.html
@@ -1,33 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-	<!-- {copyright} -->
-	<head>
-	    <meta charset="UTF-8">
-	    <meta name="viewport" content="width=device-width, initial-scale=1">
-	    <link rel="stylesheet" href="{stylesheet}">
-
-        <link rel="apple-touch-icon" sizes="180x180" href="assets/icons/apple-touch-icon.png">
-        <link rel="icon" type="image/png" sizes="32x32" href="assets/icons/favicon-32x32.png">
-        <link rel="icon" type="image/png" sizes="16x16" href="assets/icons/favicon-16x16.png">
-        <link rel="manifest" href="manifest.json">
-        <link rel="mask-icon" href="assets/icons/safari-pinned-tab.svg" color="#b362ff">
-        <link rel="shortcut icon" href="assets/icons/favicon.ico">
-        <meta name="msapplication-TileColor" content="#9f00a7">
-        <meta name="msapplication-config" content="assets/icons/browserconfig.xml">
-
-        <script src="script.min.js"></script>
-	</head>
-
-	<body>
-		<script>Elm.Main.init()</script>
-        <script>
-            const load = () => navigator.serviceWorker
-                .register('/RawSvg/service-worker.js')
-                .then(console.log)
-                .catch(console.error);
-
-            if ('serviceWorker' in navigator)
-                window.addEventListener('load', load);
-        </script>
-	</body>
-</html>-
\ No newline at end of file
diff --git a/index.html b/index.html
@@ -1,33 +1,32 @@
 <!DOCTYPE HTML>
 <html>
-	<!-- Thiago Brevidelli ⓒ 2019. ALL RIGHTS RESERVED -->
-	<head>
-	    <meta charset="UTF-8">
-	    <meta name="viewport" content="width=device-width, initial-scale=1">
-	    <link rel="stylesheet" href="styles.css">
+<!-- Thiago Brevidelli ⓒ 2019. ALL RIGHTS RESERVED -->
+<head>
+    <meta charset="UTF-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <link rel="stylesheet" href="styles.css">
 
-        <link rel="apple-touch-icon" sizes="180x180" href="assets/icons/apple-touch-icon.png">
-        <link rel="icon" type="image/png" sizes="32x32" href="assets/icons/favicon-32x32.png">
-        <link rel="icon" type="image/png" sizes="16x16" href="assets/icons/favicon-16x16.png">
-        <link rel="manifest" href="manifest.json">
-        <link rel="mask-icon" href="assets/icons/safari-pinned-tab.svg" color="#b362ff">
-        <link rel="shortcut icon" href="assets/icons/favicon.ico">
-        <meta name="msapplication-TileColor" content="#9f00a7">
-        <meta name="msapplication-config" content="assets/icons/browserconfig.xml">
+    <link rel="apple-touch-icon" sizes="180x180" href="assets/icons/apple-touch-icon.png">
+    <link rel="mask-icon" href="assets/icons/safari-pinned-tab.svg" color="#b362ff">
+    <link rel="icon" type="image/svg+xml" sizes="16x16 32x32 48x48" href="assets/icons/favicon.svg">
 
-        <script src="script.min.js"></script>
-	</head>
+    <link rel="manifest" href="manifest.json">
+    <meta name="description" content="A simple SVG markup editor for the web.">
+    <script src="script.min.js"></script>
+</head>
 
-	<body>
-		<script>Elm.Main.init()</script>
-        <script>
-            const load = () => navigator.serviceWorker
-                .register('/RawSvg/service-worker.js')
+<body>
+    <script>Elm.Main.init()</script>
+    <script>
+        function load() {
+            navigator.serviceWorker
+                .register("/RawSvg/service-worker.js")
                 .then(console.log)
-                .catch(console.error);
+                .catch(() => console.error("Failed to register service worker."));
+        }
 
-            if ('serviceWorker' in navigator)
-                window.addEventListener('load', load);
-        </script>
-	</body>
+        if ("serviceWorker" in navigator)
+            window.addEventListener("load", load);
+    </script>
+</body>
 </html> 
\ No newline at end of file