From 05425aaf02aa3f43007953d2a784542ac5125499 Mon Sep 17 00:00:00 2001 From: "Mountain/\\Ash" Date: Sun, 15 Aug 2021 20:13:08 +0000 Subject: [PATCH 1/3] Just so small mods to get the sample working again --- README.md | 19 ++++++++-------- test.html => index.html | 49 ++++++++++++++++++++++++++++++++--------- scripts/interface.js | 12 +++++----- test.css | 24 -------------------- 4 files changed, 54 insertions(+), 50 deletions(-) rename test.html => index.html (56%) delete mode 100644 test.css diff --git a/README.md b/README.md index 84e6498..64d5177 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,28 @@ -SVG-optimiser.js -================ +# `SVG-optimiser.js` +> An online SVG optimiser using JavaScript and jQuery -An online SVG optimiser using Javascript and jQuery +## Using `optimise-functions.js` and `SVG-elements.js` -##Using optimise-functions.js and SVG-elements.js - -###Create an SVG_Root object +### Create an `SVG_Root` object The `SVG_Root` object is what parses the SVG and allows you to access the optimisation functions. You can pass it either a complete SVG or an SVG element (which can have child elements). You can pass it a string with: `var SVGObject = SVG_Root('');` -Or a JQuery object with: +Or a jQuery object with: `var SVGObject = SVG_Root($('#my-svg'));` -###Optimise the SVG +### Optimise the SVG Optimisation is done with: `svg.optimise();` There are many options which I will have to write about at some point. -###Write the SVG +### Write the SVG You can get the SVG as a string with: `SVGObject.write();` Or as a DOM element with: `SVGObject.createSVGObject();` + +## Licence +- [MIT](./LICENSE) \ No newline at end of file diff --git a/test.html b/index.html similarity index 56% rename from test.html rename to index.html index 8b236a9..048c4a4 100644 --- a/test.html +++ b/index.html @@ -1,16 +1,43 @@ - - SVG optimisation - - - - - - - + SVG Optimisation + + + + + + +

SVG optimiser

@@ -18,11 +45,13 @@

SVG optimiser

Upload

+
@@ -53,7 +82,7 @@

Options

Output

-
+
\ No newline at end of file diff --git a/scripts/interface.js b/scripts/interface.js index 625d1d2..1b7f07c 100644 --- a/scripts/interface.js +++ b/scripts/interface.js @@ -126,17 +126,15 @@ function loadSVG(id) { optimiseSVG(svgObj); // Update interface - $('#upload-container').hide("fast"); + $('#upload-section').hide('fast'); addOptions(svgObj); - $('#output-section').show(); - $('#optimise-section').show(); + $('#output-section,#optimise-section').show(); } -$(document).ready(function() { +$(function() { $('#upload-section > h2').click(function() { $('#upload-container').toggle('fast'); }); - $('#output-section').hide(); - $('#optimise-section').hide(); -}); \ No newline at end of file + $('#output-section,#optimise-section').hide(); +}); diff --git a/test.css b/test.css deleted file mode 100644 index 49f7037..0000000 --- a/test.css +++ /dev/null @@ -1,24 +0,0 @@ -#optimise-container > div { - display: inline-block; - background: #e8e8e8; - margin: 5px; - padding: 5px; -} - -#input-svg { - width:800px; - height:200px; - border: 1px solid #888; -} - -#options-container { - -webkit-columns: 300px 3; - -moz-columns: 300px 3; - columns: 300px 3; -} - -#output-container { - white-space: pre-wrap; - font-family: Fixed, 'Courier New', monospace; - font-size: 12px; -} \ No newline at end of file From c475f19d7937dadd44e11a99afb3686005d8b849 Mon Sep 17 00:00:00 2001 From: "Mountain/\\Ash" Date: Sun, 15 Aug 2021 22:26:53 +0200 Subject: [PATCH 2/3] GHPages is looking for this file... not the index.html??? --- index.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 index.md diff --git a/index.md b/index.md new file mode 100644 index 0000000..9da3e5e --- /dev/null +++ b/index.md @@ -0,0 +1,2 @@ +# [index.html](./index.html) +- [Go here](./index.html) From fd780312cc9915a74c8dbad655ca2c6c514eab27 Mon Sep 17 00:00:00 2001 From: "Mountain/\\Ash" Date: Sun, 15 Aug 2021 22:28:14 +0200 Subject: [PATCH 3/3] Adding link to GutHub Pages --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 64d5177..45acc2b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # `SVG-optimiser.js` > An online SVG optimiser using JavaScript and jQuery +Use it now: https://mountainash.github.io/SVG-optimiser.js/ + ## Using `optimise-functions.js` and `SVG-elements.js` ### Create an `SVG_Root` object @@ -25,4 +27,4 @@ Or as a DOM element with: `SVGObject.createSVGObject();` ## Licence -- [MIT](./LICENSE) \ No newline at end of file +- [MIT](./LICENSE)