<div id="canvas"></div>
/* Fullscreen */
html, body {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background-color: #E6E6E6;
  font-family: sans-serif;
}

/* Centered canvas */
#canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translateX(-50%) translateY(-50%);
  -ms-transform: translateX(-50%) translateY(-50%);
  transform: translateX(-50%) translateY(-50%);
  overflow: hidden;
}
/*
  svgAnimation.js v1.0.0
  Licensed under the MIT license.
  https://www.opensource.org/licenses/mit-license.php

  Copyright 2016
  http://www.hellomichael.com/
*/

; (function(window) {
  'use strict';

  var svgAnimation = function () {
    var self = this;
    self.init();
  };

  svgAnimation.prototype = {
    constructor: svgAnimation,

    init: function() {
      var s = Snap("#canvas");
      Snap.load('https://raw.githubusercontent.com/hellomichael/svgAnimation/master/example/svg/backpack.svg', function (data) {
        s.append(data);
      });
    }
  };

  // Add to global namespace
  window.svgAnimation = svgAnimation;
})(window);

(function() {
  var backpack = new svgAnimation();
})();

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://rawgit.com/hellomichael/svgAnimation/master/example/js/libs/snap.svg.min.js
  2. https://rawgit.com/overjase/snap-easing/master/snap.svg.easing.js