Being relatively new to famous and somewhat familiar with angular.
Question: Given that everything in famous is fixed positioning, how should I go about creating a scrollable section using famous angular?
HTML: This code snippet creates a grid of squares sourced from Famous/angular tutorial
<fa-app id="app">
<fa-grid-layout fa-options="myGridLayoutOptions">
<fa-modifier ng-repeat="item in list"
fa-size="[100, 100]"
fa-origin="[0.5, 0.5]"
fa-align="[0.5, 0.5]"
fa-rotate-z="item.rotate.get()">
<fa-surface fa-background-color="item.bgColor">
{{item.content}}
</fa-surface>
</fa-modifier>
</fa-grid-layout>
</fa-app>
CSS: Defines the position of the application window
#app {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
CTRL: Creates a 3x3 grid and iterates over the list items
var Engine = $famous[('famous/core/Engine')];
var Surface = $famous[('famous/core/Surface')];
var Transitionable = $famous['famous/transitions/Transitionable'];
var Easing = $famous['famous/transitions/Easing'];
$scope.myGridLayoutOptions = {
dimensions: [3, 3]
};
$scope.list = [
{content:"hello", bgColor: "#b58900", rotate: new Transitionable(0)},
{content:"world", bgColor: "#cb4b16", rotate: new Transitionable(0)},
{content: "famous", bgColor: "#dc322f", rotate: new Transitionable(0)},
{content: "angular", bgColor: "#d33682", rotate: new Transitionable(0)},
{content: "is", bgColor: "#6c71c4", rotate: new Transitionable(0)},
{content: "cool!", bgColor: "#268bd2", rotate: new Transitionable(0)},
{content: "asd", bgColor: "#d33682", rotate: new Transitionable(0)},
{content: "ass", bgColor: "#6c71c4", rotate: new Transitionable(0)},
{content: "fffs!", bgColor: "#268bd2", rotate: new Transitionable(0)},
{content:"hello", bgColor: "#b58900", rotate: new Transitionable(0)},
{content:"world", bgColor: "#cb4b16", rotate: new Transitionable(0)},
{content: "famous", bgColor: "#dc322f", rotate: new Transitionable(0)},
{content: "angular", bgColor: "#d33682", rotate: new Transitionable(0)},
{content: "is", bgColor: "#6c71c4", rotate: new Transitionable(0)},
{content: "cool!", bgColor: "#268bd2", rotate: new Transitionable(0)},
{content: "asd", bgColor: "#d33682", rotate: new Transitionable(0)},
{content: "ass", bgColor: "#6c71c4", rotate: new Transitionable(0)},
{content: "fffs!", bgColor: "#268bd2", rotate: new Transitionable(0)}
];
$scope.animate = function() {
for (var i = 0; i < $scope.list.length; i++) {
$scope.list[i].rotate.set(Math.PI * 4, {curve: Easing.inOutElastic, duration: 3000 * i})
};
};
$scope.animate();