With this build tool, you can develop Framer Generator exported prototypes with modular JavaScript, the latest ES6-Features like named imports/exports, npm packages and a development server with hot reloading capabilities.
- Clone this repo
$ git clone https://github.com/switchnollie/FramerBuildTool.git
- Run
$ npm install
inside the directory
- Develop your prototype in Sketch/ Figma/ Photoshop inside the
/framerPrototype
folder - Use Framer Generator to generate a
.framer
directory from your design. - start with
$ npm run start
The Framer
Object, and all of the API (the Animation
object, the Layer
object etc.) are expsed globally. Please refer to the Framer API Documentation. Your imported layers and groups are saved under the global myLayers
object variable.
- Choose your deviceType from here
- Copy it to
src/device.js
e.g.
device.deviceType = "apple-iphone-7-silver";
- Access your layers and groups as properties on the
myLayers
object variable and give them state, animations, touchHandlers etc.
Your project can be bundled with $ npm run build
. The static bundle can then be found under the dist
folder.
- e.g. Redux:
$ npm install -S redux
- in
src
e.g. in app.js:
import { createStore } from "redux";
- create a stylesheet in the
src
folder e.g.app.css
- import it in your JavaScript e.g. in app.js:
import "app.css";
- e.g. images: Save the file under
src
e.g.src/img/myPicture.png
import picture from "img/myPicture.png";
sketch.myLayer1.states = {
withPicture: {
image: picture
}