Gonzalo Ruiz de Villa
@gruizdevilla
http://slides.com/gruizdevilla/angular-famo-us
about me
@gruizdevilla
@adesis
Lo cual puede estar muy bien para cosas sencillas.
.reveal-animation.ng-enter {
-webkit-animation: enter_sequence 1s linear; /* Safari/Chrome */
animation: enter_sequence 1s linear; /* IE10+ and Future Browsers */
}
@-webkit-keyframes enter_sequence {
from { opacity:0; }
to { opacity:1; }
}
@keyframes enter_sequence {
from { opacity:0; }
to { opacity:1; }
}
.element-animation{
animation: animationFrames linear 4s;
animation-iteration-count: 1;
transform-origin: ;
-webkit-animation: animationFrames linear 4s;
-webkit-animation-iteration-count: 1;
-webkit-transform-origin: ;
-moz-animation: animationFrames linear 4s;
-moz-animation-iteration-count: 1;
-moz-transform-origin: ;
-o-animation: animationFrames linear 4s;
-o-animation-iteration-count: 1;
-o-transform-origin: ;
-ms-animation: animationFrames linear 4s;
-ms-animation-iteration-count: 1;
-ms-transform-origin: ;
}
@keyframes animationFrames{
0% {
left:-299px;
top:-196px;
opacity:1;
transform: rotate(-1deg) scaleX(1) scaleY(1) ;
}
50% {
left:-137px;
top:25px;
transform: rotate(976deg) scaleX(0.77) scaleY(3.179999999999998) ;
}
100% {
left:200px;
top:0px;
opacity:1;
transform: rotate(24deg) scaleX(3.52) scaleY(3.179999999999998) ;
}
}
@-moz-keyframes animationFrames{
0% {
left:-299px;
top:-196px;
opacity:1;
-moz-transform: rotate(-1deg) scaleX(1) scaleY(1) ;
}
50% {
left:-137px;
top:25px;
-moz-transform: rotate(976deg) scaleX(0.77) scaleY(3.179999999999998) ;
}
100% {
left:200px;
top:0px;
opacity:1;
-moz-transform: rotate(24deg) scaleX(3.52) scaleY(3.179999999999998) ;
}
}
@-webkit-keyframes animationFrames {
0% {
left:-299px;
top:-196px;
opacity:1;
-webkit-transform: rotate(-1deg) scaleX(1) scaleY(1) ;
}
50% {
left:-137px;
top:25px;
-webkit-transform: rotate(976deg) scaleX(0.77) scaleY(3.179999999999998) ;
}
100% {
left:200px;
top:0px;
opacity:1;
-webkit-transform: rotate(24deg) scaleX(3.52) scaleY(3.179999999999998) ;
}
}
@-o-keyframes animationFrames {
0% {
left:-299px;
top:-196px;
opacity:1;
-o-transform: rotate(-1deg) scaleX(1) scaleY(1) ;
}
50% {
left:-137px;
top:25px;
-o-transform: rotate(976deg) scaleX(0.77) scaleY(3.179999999999998) ;
}
100% {
left:200px;
top:0px;
opacity:1;
-o-transform: rotate(24deg) scaleX(3.52) scaleY(3.179999999999998) ;
}
}
@-ms-keyframes animationFrames {
0% {
left:-299px;
top:-196px;
opacity:1;
-ms-transform: rotate(-1deg) scaleX(1) scaleY(1) ;
}
50% {
left:-137px;
top:25px;
-ms-transform: rotate(976deg) scaleX(0.77) scaleY(3.179999999999998) ;
}
100% {
left:200px;
top:0px;
opacity:1;
-ms-transform: rotate(24deg) scaleX(3.52) scaleY(3.179999999999998) ;
}
}
var sync = new GenericSync({
"mouse" : {},
"touch" : {},
"scroll" : {scale : .5}
});
sync.on('update', function(data){
var currentPosition = position.get();
position.set([
currentPosition[0] + data.delta[0],
currentPosition[1] + data.delta[1]
]);
});
context var context = Engine.createContext();
│
surface context.add(surface);'
context var context = Engine.createContext();
│
modifier var chain = context.add(modifier);
│
surface chain.add(surface);
context
│
modifier
│
scrollview
┌───┬───┼───────┐
S1 S2 S3 ⋯ S10
┌─────┴─────┐
modifier1 modifier2
│ │
surface1 surface2
div.app
│
┌───┬───┼───────┐
div div div ⋯ div
Aunque tengamos un árbol complicado, en el DOM se ve una estructura plana donde se modifica la propiedad style con transformaciones CSS3 de cada capa
Ignorando los problemas anteriores...
Usando las convenciones de cada librería cuando sea posible.
Pues dad al César lo que es del César, y a Dios lo que es de Dios
var myView = new View();
var mySurface = new Surface();
mySurface.setContent("<div>I'm a surface</div>");
myView.add(mySurface);
<fa-view>
<fa-surface>
<div>I'm {{data.bound}}</div>
</fa-surface>
</fa-view>