Created
April 29, 2014 17:12
-
-
Save reem/11406427 to your computer and use it in GitHub Desktop.
Famous Blurry Text in Scrollview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*globals define*/ | |
define(function(require, exports, module) { | |
'use strict'; | |
// import dependencies | |
var Engine = require('famous/core/Engine'); | |
var Surface = require('famous/core/Surface'); | |
var Scrollview = require('famous/views/Scrollview'); | |
var StateModifier = require('famous/modifiers/StateModifier'); | |
var ViewSequence = require('famous/core/ViewSequence'); | |
var pack = function (length, fill) { | |
var res = []; | |
for (var i = 0; i < length; i++) { | |
res.push(fill); | |
} | |
return res; | |
}; | |
var mainContext = Engine.createContext(); | |
var scrollView = new Scrollview(); | |
var packed = pack(100); | |
var surfaces = packed.map(function () { | |
var surface = new Surface({ | |
size: [300, 50], | |
content: "This is some sample text.", | |
properties: { | |
color: "black", | |
textAlign: "center", | |
backgroundColor: "#FFA" | |
} | |
}); | |
surface.pipe(scrollView); | |
return surface; | |
}); | |
scrollView.sequenceFrom(surfaces); | |
mainContext.add(scrollView); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment