Skip to content

Instantly share code, notes, and snippets.

@reem
Created April 29, 2014 17:12
Show Gist options
  • Save reem/11406427 to your computer and use it in GitHub Desktop.
Save reem/11406427 to your computer and use it in GitHub Desktop.
Famous Blurry Text in Scrollview
/*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