Search code examples
famo.us

Famo.us and landscape orientation


Is famo.us currently suitable for landscape oriented development ? I'm especially concerned in making it to work on iPhone. As I saw unfortunately the iOS < 7.1 safari takes a quarter of the height just for the navigation bar. Hiding it completely involves adding the app (webpage) to the main screen.


Solution

  • Famo.us is most certainly suitable for landscape oriented Design. The sizing feature of 'undefined' for Famo.us surfaces and the origin constraints on modifiers allow for designs to fit any number of device sizes and orientations.

    Detecting an orientation change using only Famo.us can be done using something similar to the following..

    Engine.on('resize',function(){
        size = context.getSize();
        if (size[0] > size[1]) {
            // landscape
        } else {
            // portrait
        } 
    
    });