Skip to content

Instantly share code, notes, and snippets.

@woeldiche
Created June 3, 2015 11:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save woeldiche/f2b30b42aecb7f014d0a to your computer and use it in GitHub Desktop.
Save woeldiche/f2b30b42aecb7f014d0a to your computer and use it in GitHub Desktop.
Modular Framer project
# Import layers
Imports = Framer.Importer.load "imported/Nordea Markets Master"
# Import settings and model
config = require("nmSettings").config;
model = require("nmModel").model;
# Import page changing behavior
slideIn = require("nmSlidein");
# Import instances of pages
TradeInstance = require("nmTrade");
# ...
domReady = require("npm").domready;
# Import stages and imported pages
addStates = require("nmStates");
Layers = require("nmLayers");
# Load libraries
_ = require("npm").lodash;
utils = require("nmUtils");
observejs = require("npm").observejs;
domReady () ->
# Extend config with zoom levels
config.pixelRatio = Screen.width / 1024;
# Set Framer default
utils.setDefault(Framer);
# Create Layers ----------------------------------------
document = Layers.document(Imports, config);
BackgroundIcon = Layers.background(Imports, document, config);
MarketWatch = Layers.marketWatch(Imports, document, config)
TradeView = Layers.tradeView(Imports, document, config);
MenuView = Layers.menuView(Imports, document, config);
# Add States -------------------------------------------
TradeView = addStates(TradeView, config);
# Add slidein functionality --------------------------------
slideIn.addToggle(MenuView.TradeIconActive, TradeView.Window)
slideIn.addOpen(MarketWatch.TradeBtn, TradeView.Window, MenuView.TradeIconActive)
slideIn.addClose(TradeView.closeBtn, TradeView.Window, MenuView.TradeIconActive)
slideIn.addClose(Imports.Tradelog_btn, TradeView.Window, MenuView.TradeIconActive)
# Initiate trade instance ----------------------------------
Trade = new TradeInstance(TradeView)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment