All Projects → alandickinson → framer-view-stack

alandickinson / framer-view-stack

Licence: MIT license
A Framer module for creating views that stack on top of each other.

Programming Languages

coffeescript
4710 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to framer-view-stack

Framer-CollectionComponent
Framer Module
Stars: ✭ 22 (-8.33%)
Mutual labels:  framer, framerjs
framer-seed
Kickstart your Framer Library prototype development.
Stars: ✭ 31 (+29.17%)
Mutual labels:  framer, framerjs
Framer-Module-ShakeEvent
Shake event for your prototype.
Stars: ✭ 62 (+158.33%)
Mutual labels:  framer, framerjs
Framer-app-base
A Framer module to create the base of an app with a flow component and a tab bar menu
Stars: ✭ 13 (-45.83%)
Mutual labels:  framer, framerjs
Handout
Turn Python scripts into handouts with Markdown and figures
Stars: ✭ 1,973 (+8120.83%)
Mutual labels:  prototyping
Testdrive
Quickly try out any Swift pod or framework in a playground
Stars: ✭ 1,612 (+6616.67%)
Mutual labels:  prototyping
Guify
A simple GUI for inspecting and changing JavaScript variables
Stars: ✭ 111 (+362.5%)
Mutual labels:  prototyping
Reactype
🧪 Prototyping Tool for exporting React/Typescript Applications!
Stars: ✭ 1,203 (+4912.5%)
Mutual labels:  prototyping
Govuk Prototype Kit
Rapidly create HTML prototypes of GOV.UK services
Stars: ✭ 239 (+895.83%)
Mutual labels:  prototyping
Protovue
A prototyping component library
Stars: ✭ 195 (+712.5%)
Mutual labels:  prototyping
Sketchize
Sketchize is built for UI/UX Designers to help them design lovely apps for mobile, tablet, and desktop devices.
Stars: ✭ 162 (+575%)
Mutual labels:  prototyping
Puzzle Publisher
A Sketch plugin that exports Sketch artboards into clickable HTML file and publishes it on an external site.
Stars: ✭ 131 (+445.83%)
Mutual labels:  prototyping
Baumeister
👷 The aim of this project is to help you to build your things. From Bootstrap themes over static websites to single page applications.
Stars: ✭ 171 (+612.5%)
Mutual labels:  prototyping
Involt
Inject hardware interactions directly into HTML layout.
Stars: ✭ 128 (+433.33%)
Mutual labels:  prototyping
Odl
Operator Discretization Library https://odlgroup.github.io/odl/
Stars: ✭ 198 (+725%)
Mutual labels:  prototyping
Gotcha
Turn your Framer prototype into its own live developer spec.
Stars: ✭ 103 (+329.17%)
Mutual labels:  prototyping
Mag.js
MagJS - Modular Application Glue
Stars: ✭ 157 (+554.17%)
Mutual labels:  prototyping
Devtools Playground
Standalone Devtools for prototyping & debugging
Stars: ✭ 190 (+691.67%)
Mutual labels:  prototyping
Vuegg
🐣 vue GUI generator
Stars: ✭ 2,056 (+8466.67%)
Mutual labels:  prototyping
Rbbjson
Flexible JSON traversal for rapid prototyping.
Stars: ✭ 155 (+545.83%)
Mutual labels:  prototyping

Framer ViewStack Module

This is a module for the prototyping tool Framer. It helps you create and control views that stack on top of each other. You can swipe to dismiss them, or fan out the stack and select one to bring forward.

Swipe to dismiss Tap to fan out Scroll

Installation

  • Download the project from Github
  • Copy viewstack.coffee into the modules folder of your Framer project.
  • Import the module into your project by adding this line: ViewStack = require "viewstack"

Usage

Setup

Create the view stack, and then add a view to it using the addView method.

stack = new ViewStack.Manager

myview = stack.addView
  contents: myLayer

contents is required and can be a layer or an array of layers. These will get added to the view's ScrollView in the order they appear in the array, so list the elements from bottom to top. The ScrollView allows vertical scrolling, and its content layer is sized to fit the content you pass into it.

The view gets added but is kept off screen. To display it, use the presentView method.

All addView Options

myview = stack.addView
  contents: myLayer
  title: "My View"    # default: no title
  tintColor: "#fff"   # defualt: "#000"
  arrowColor: "#000"  # default: "rgba(0,0,0,0.4)"

Presenting Views

Use the presentView method to display a view on screen.

stack.presentView(myview)

When more than one view has been presented, they will stack.

Example

# create content layers
one = new Layer
  frame: Screen.frame
  backgroundColor: "rgba(0,128,255,1)"
two = new Layer
  frame: Screen.frame
  backgroundColor: "rgba(255,128,0,1)"

# create stack manager
ViewStack = require "viewstack"
stack = new ViewStack.Manager

# add views to the stack, passing in sketch layers with the contents parameter
view_one = stack.addView
	contents: one
	title: "One"
	tintColor: "#000"
view_two = stack.addView
	contents: two
	title: "Two"
	tintColor: "#000"

# add tap events to present views
one.on Events.Tap, ->
	stack.presentView(view_two)

# present first view
stack.presentView(view_one)

Fanning Out

When views are stacked onscreen tapping the top area will fan all of them out and let you select one. This is enabled by default, but you can turn it off by setting the fanOut parameter to false when you create the view stack.

stack = new ViewStack.Manager
  fanOut: false

You can also fan out the current stack of views programmatically with stack.fanOut() -- If there's more than one view on screen and the feature hasn't been disabled.

Managing Views

Changing Views

  • stack.dismissViews([views]) takes an array of views and will dismiss all of them.
  • stack.dismissCurrentView dismisses the view that's currently on top.
  • stack.switchToView(view) rearranges the stack to move a specific view to the front. This will dismiss any views that are above the view you pass in.

Helpers

Views have helper methods you can use to get access to specific layers.

  • myview.getScrollView() returns the ScrollComponent.
  • myview.getViewCover() returns the cover layer used to dim the view when its behind others.
  • myview.getHideBtn() returns the hide button.

To do

  • Fix a bug in the fanned out touch events
  • Add some error handling
  • Add more event hooks
  • Maybe just subclass Layer?
  • Make things more customizable -- animation curves, card styling, dismiss button, stack offset, etc.
  • Adjust the stacking offsets for different screen ratios (currently works best with iPhone 6 ratio)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].