famous-popup
Show popup notifications with famous
Getting started
Install using npm
npm install famous-popup
Or just copy popup.js
to your project.
Usage:
Creating a PopupController:
var PopupController = ; var popupCtrl = { ... } // RenderController inTransition { ... } // RenderController outTransition overlap: false // RenderController overlap global: false // Respond to Engine events; // Create a popup, which is just a RenderNodevar popup = content: "Hello World!";
Adding Popups:
// Add popup to the end of the queue (i.e. below all others)popupCtrl; // Add popup to the front of the queue (i.e. above all others)popupCtrl; // Replace current popup (or just show if there is no active popup)popupCtrl; // Whenever a popup is shown, popupCtrl emits an event:popupCtrl;
Hiding Popups:
// Hide current popuppopupCtrl; // Hide specific popuppopupCtrl; // Hide all popupspopupCtrlclear; // Popup can hide themselves by emitting a 'hide' eventpopup; // Whenever a popup is shown, popupCtrl emits an event:popupCtrl;
Adding a background
var background = properties: 'background-color':'rgba(0,0,0,0.8)' ; popupCtrl;
init
,show
and hide
are callbacks bound to the background node StateModifier.
For example, the default background callbacks are:
PopupControllerDEFAULT_BACKGROUND_OPTIONS = { this; this; } { this; this; } { this; };
Using events to trigger popups
// All methods exist as events:popupCtrl;popupCtrl;popupCtrl;popupCtrl;popupCtrl; // If you passed `engine: true` in options, // then you can use global events.Engine;Engine;Engine;Engine;Engine; // Note: they are prefixed with `popup-`!
Changelog
0.1.2 (20/1/2014)
- Fix famo.us dependency in package.json
0.1.1 (19/1/2014)
- Little bugfix
0.1.0 (19/1/2014)
- Initial release
Contribute
Feel free to contribute to this project in any way. The easiest way to support this project is by giving it a star.
Contact
- @markmarijnissen
- http://www.madebymark.nl
- info@madebymark.nl
© 2015 - Mark Marijnissen