FamousArchives / generator-famous

for those who hate doing things once
123 stars 26 forks source link

better main.js #16

Closed dmvaldman closed 10 years ago

dmvaldman commented 10 years ago

For your review. Used an imageSurface and got rid of the unnecessary CSS properties. It would be nice if we renamed famous_symbol_transparent.png to something simpler, like famous_logo.png

/*globals define*/
define(function(require, exports, module) {
    'use strict';
    // import dependencies
    var Engine = require('famous/core/Engine');
    var ImageSurface = require('famous/surfaces/ImageSurface');
    var StateModifier = require('famous/modifiers/StateModifier');

    // create the main context
    var mainContext = Engine.createContext();

    // your app here
    var logo = new ImageSurface({
        size: [200, 200],
        content: 'content/images/famous_symbol_transparent.png'
    });

    var logoModifier = new StateModifier({
        origin: [0.5, 0.5]
    });

    mainContext.add(logoModifier).add(logo);
});
MylesBorins commented 10 years ago

updated in 0.1.8