Easily create mockups in Inkscape, without jumping through hoops!
This is currently a work-in-progress, but it's starting to work! (:
To use MagicMockup, simply include the following JavaScript in
your SVG file (directly between the <svg>
and <def>
tags):
<script xlink:href="https://github.com/garrett/magicmockup/blob/master/magicmockup.js" type="text/ecmascript"/>
If you're using Inkscape 0.48, you can add MagicMockup right in Inkscape:
Inkscape plays nicely with the script tags, so you only have to add it once per file, and you can save as much as you want.
To make regions of the document clickable, have each frame as a layer and give the layer an id. For the clickable shape, add some directives in the object properties dialog inside of the "Description" entry.
You invoke a directive as directive=layerName
, e.g. next=Layer2
.
You can add multiple directives by putting each directive on a new line.
We currently support the following directives:
linear
by default). Easing functions supported are swing
, and linear
.Now, you can make interactive mockups! Also, clickable areas (buttons, etc.) are indicated by a mouse pointer.
More directives are planned. Stay tuned! We're planning on adding inter-document linking as well.
For your convenience, we've added InteractiveMockup.svg to use as an Inkscape template file. It has the magicmockup.js script tag already included.
To use it, copy the file to the templates folder in your Inkscape user directory.
Then, when you open Inkscape, go to File > New, and choose InteractiveMockup from the list of presets.
MagicMarkup is written in CoffeeScript and uses jQuery. You'll need CoffeeScript installed to develop.
You may install CoffeeScript either via:
gem install coffee-script
...or...
npm install coffee-script
...Depending on if you are using Ruby & Gem or Node.js & NPM.
As CoffeeScript is JavaScript, we suggest installing Node.js
and using npm
for installation.
Build magicmockup.js using cake build
- this will compile magicmockup.coffee and concatenate it with the dependencies in the deps/ directory.
There is a really simple script included for helping you to remember the commands to start a test webserver (based on Python — although any web server would work).