Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.