From 8befc80d1917d8724501087bfea4f16f9d0f4fa9 Mon Sep 17 00:00:00 2001 From: Dmitry Baranovskiy Date: Wed, 16 Oct 2013 07:20:01 +1100 Subject: [PATCH 01/12] Updates to README and code sample for Snap.animate --- README.md | 7 ++++--- src/svg.js | 13 ++++++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b8138ea..9b51a9a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -Snap.svg +[Snap.svg](http://snapsvg.io) ====== -JavaScript library for SVG. +A JavaScript library for modern SVG graphics. API Reference is in `dist/reference.html` @@ -17,11 +17,12 @@ Snap.svg uses [Grunt](http://gruntjs.com/) to build npm install -g grunt-cli +_*You might need to use `sudo npm`, depending on your configuration._ + * Install dependencies with npm npm install - _*Snap.svg uses Grunt 0.4.0. You might want to [read](http://gruntjs.com/getting-started) more on their website if you haven’t upgraded since a lot has changed._ * Type `grunt` in the command line to build the files. diff --git a/src/svg.js b/src/svg.js index 746a249..7ce9cc5 100644 --- a/src/svg.js +++ b/src/svg.js @@ -2071,10 +2071,6 @@ function arrayFirstValue(arr) { } return res; }; - // SIERRA unfamiliar with the phrase _caring function,_ so the text for the _setter_ param isn't clear. - // SIERRA With the animation's start/end states defined, how is its _speed_ distinguished from its _duration_? - // SIERRA Text explaining the mina format should move to the section on the mina object interface. (Prior comment applies: object interfaces need to also be documented.) - // SIERRA unclear how to express a custom _easing_ (+) /*\ * Snap.animate [ method ] @@ -2096,6 +2092,14 @@ function arrayFirstValue(arr) { o status (function) gets or sets the status of the animation, o stop (function) stops the animation o } + | var rect = Snap().rect(0, 0, 10, 10); + | Snap.animate(0, 10, function (val) { + | rect.attr({ + | x: val + | }); + | }, 1000); + | // in given context is equivalent to + | rect.animate({x: 10}, 1000); \*/ Snap.animate = function (from, to, setter, ms, easing, callback) { if (typeof easing == "function" && !easing.length) { @@ -2107,7 +2111,6 @@ function arrayFirstValue(arr) { callback && eve.once("mina.finish." + anim.id, callback); return anim; }; - // SIERRA Element.stop(). Does it _stop_ or _pause_ the animations? If you run Element.animate() to restart the animation, does it commence from the beginning? /*\ * Element.stop [ method ] From 75dde3b1a001edb811e1d17aa8eddad6ab6e705b Mon Sep 17 00:00:00 2001 From: Dmitry Baranovskiy Date: Wed, 16 Oct 2013 07:23:04 +1100 Subject: [PATCH 02/12] Merge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dbc8a9..1f0c48f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ [Snap.svg](http://snapsvg.io) ====== -A JavaScript library for modern SVG graphics. +A JavaScript SVG library for the modern web API Reference is in `dist/reference.html` From fcc9322fbdec8bd43df6242c33078c6520d4d5e9 Mon Sep 17 00:00:00 2001 From: Dmitry Baranovskiy Date: Wed, 16 Oct 2013 07:25:23 +1100 Subject: [PATCH 03/12] Renamed demos files to index.html --- demos/animated-map/{demojs2.html => index.html} | 0 demos/illustrated-infographic-coffee/{demo.html => index.html} | 0 demos/pattern/{demojs.html => index.html} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename demos/animated-map/{demojs2.html => index.html} (100%) rename demos/illustrated-infographic-coffee/{demo.html => index.html} (100%) rename demos/pattern/{demojs.html => index.html} (100%) diff --git a/demos/animated-map/demojs2.html b/demos/animated-map/index.html similarity index 100% rename from demos/animated-map/demojs2.html rename to demos/animated-map/index.html diff --git a/demos/illustrated-infographic-coffee/demo.html b/demos/illustrated-infographic-coffee/index.html similarity index 100% rename from demos/illustrated-infographic-coffee/demo.html rename to demos/illustrated-infographic-coffee/index.html diff --git a/demos/pattern/demojs.html b/demos/pattern/index.html similarity index 100% rename from demos/pattern/demojs.html rename to demos/pattern/index.html From a803cb783efab8fffe26eff71e250b164f4e2999 Mon Sep 17 00:00:00 2001 From: Yohei Shimomae Date: Tue, 15 Oct 2013 14:53:00 -0700 Subject: [PATCH 04/12] added crocodile demo --- demos/animated-crocodile/crocodile.svg | 118 +++++++++++++++++++++++++ demos/animated-crocodile/index.html | 84 ++++++++++++++++++ 2 files changed, 202 insertions(+) create mode 100644 demos/animated-crocodile/crocodile.svg create mode 100644 demos/animated-crocodile/index.html diff --git a/demos/animated-crocodile/crocodile.svg b/demos/animated-crocodile/crocodile.svg new file mode 100644 index 0000000..99bff2c --- /dev/null +++ b/demos/animated-crocodile/crocodile.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demos/animated-crocodile/index.html b/demos/animated-crocodile/index.html new file mode 100644 index 0000000..1946537 --- /dev/null +++ b/demos/animated-crocodile/index.html @@ -0,0 +1,84 @@ + + + + + + Snap + + + + + + \ No newline at end of file From f8d7d64735bff7b557d275d3a61b8377c5fe3f75 Mon Sep 17 00:00:00 2001 From: Dmitry Baranovskiy Date: Wed, 16 Oct 2013 11:10:39 +1100 Subject: [PATCH 05/12] Small optimisations of crocodile demo --- demos/animated-crocodile/crocodile.svg | 135 +++++++++---------------- demos/animated-crocodile/index.html | 10 +- 2 files changed, 52 insertions(+), 93 deletions(-) diff --git a/demos/animated-crocodile/crocodile.svg b/demos/animated-crocodile/crocodile.svg index 99bff2c..96d6d80 100644 --- a/demos/animated-crocodile/crocodile.svg +++ b/demos/animated-crocodile/crocodile.svg @@ -2,117 +2,76 @@ + width="260px" height="250px" viewBox="0 0 260 250" enable-background="new 0 0 260 250" xml:space="preserve"> - - - - - + - - - + 119.387,206.523 119.387,167.64"/> + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - + + + + + - - - - + 107.897,156.377"/> + + + + - - + + - - + + - - + + - - + + - - + + - - - - - + -4,200.541 -4,206.523 79.747,206.523 156.522,206.523 187.432,198.55 235.288,189.577 244.252,179.604"/> + + + + + diff --git a/demos/animated-crocodile/index.html b/demos/animated-crocodile/index.html index 1946537..14f162d 100644 --- a/demos/animated-crocodile/index.html +++ b/demos/animated-crocodile/index.html @@ -20,8 +20,8 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 14db7036694508d31353ebcc5d914d083605ca3e Mon Sep 17 00:00:00 2001 From: Dmitry Baranovskiy Date: Wed, 16 Oct 2013 17:34:52 +1100 Subject: [PATCH 07/12] Found workaround for Safari and change location to San Francisco --- demos/animated-map/index.html | 19 +- demos/animated-map/map.svg | 948 +++++++++++++++++----------------- 2 files changed, 486 insertions(+), 481 deletions(-) diff --git a/demos/animated-map/index.html b/demos/animated-map/index.html index 102f806..d95f33e 100644 --- a/demos/animated-map/index.html +++ b/demos/animated-map/index.html @@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License."> - Snap + Long Flight