SlideShare a Scribd company logo
3D & animation effects
implementing animation & 3D using CSS3 & jQuery
presented by Vu Tran Lam
Saturday, March 9, 13
the web is less than
9000 days old
http://wwwflickr.com/photos/psd/3149878971
Saturday, March 9, 13
1/3
2012 estimates put the population at about 7 billion inhabitants...
Internet
of
people
on
planet
using
Saturday, March 9, 13
1/3 people has
a smartphone
of
Saturday, March 9, 13
the smartphone era
begins...
Saturday, March 9, 13
brings touch, gestures
iPhone 3G
web
touch
and the real web...
iPhone
2007 2008
Saturday, March 9, 13
20082007 2009
3GiPhone
iPhone 3GS
native apps and
android
apps
the rise of Android...
Saturday, March 9, 13
2008 2009
3G
2010
3GS
2011
4
blackberry
kindle
nook
devices go mainstream
iPhone 5...
with great expectations...
samsung
motorola
htc
LG
Saturday, March 9, 13
web evaluation...
Saturday, March 9, 13
Saturday, March 9, 13
Saturday, March 9, 13
Saturday, March 9, 13
yesterday
“go to the computer”
to use the web/Internet
Saturday, March 9, 13
yesterday
“go to the computer”
to use the web/Internet
today
“use the mobile”
to use the web/Internet
Saturday, March 9, 13
14
small + medium + large
Saturday, March 9, 13
15
one standard for every devices
Saturday, March 9, 13
Saturday, March 9, 13
http://www.flickr.com/photos/aubergene/970367879
...view flash &
video on iDevice?
Saturday, March 9, 13
http://www.flickr.com/photos/aubergene/970367879
no flash or video
but need to find a key...
Saturday, March 9, 13
...in the old days
Saturday, March 9, 13
function	
  MM_timelinePlay(tmLnName,	
  myID)	
  {	
  //v1.2
	
  	
  //Copyright	
  1998,	
  1999,	
  2000,	
  2001,	
  2002,	
  2003,	
  2004	
  Macromedia,	
  Inc.	
  All	
  rights	
  reserved.
	
  	
  var	
  i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
	
  	
  if	
  (document.MM_Time	
  ==	
  null)	
  MM_initTimelines();	
  //if	
  *very*	
  1st	
  time
	
  	
  tmLn	
  =	
  document.MM_Time[tmLnName];
	
  	
  if	
  (myID	
  ==	
  null)	
  {	
  myID	
  =	
  ++tmLn.ID;	
  firstTime=true;}//if	
  new	
  call,	
  incr	
  ID
	
  	
  if	
  (myID	
  ==	
  tmLn.ID)	
  {	
  //if	
  Im	
  newest
	
  	
  	
  	
  setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
	
  	
  	
  	
  fNew	
  =	
  ++tmLn.curFrame;
	
  	
  	
  	
  for	
  (i=0;	
  i<tmLn.length;	
  i++)	
  {
	
  	
  	
  	
  	
  	
  sprite	
  =	
  tmLn[i];
	
  	
  	
  	
  	
  	
  if	
  (sprite.charAt(0)	
  ==	
  's')	
  {
	
  	
  	
  	
  	
  	
  	
  	
  if	
  (sprite.obj)	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  numKeyFr	
  =	
  sprite.keyFrames.length;	
  firstKeyFr	
  =	
  sprite.keyFrames[0];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (fNew	
  >=	
  firstKeyFr	
  &&	
  fNew	
  <=	
  sprite.keyFrames[numKeyFr-­‐1])	
  {//in	
  range
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  keyFrm=1;
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  for	
  (j=0;	
  j<sprite.values.length;	
  j++)	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  props	
  =	
  sprite.values[j];	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (numKeyFr	
  !=	
  props.length)	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (props.prop2	
  ==	
  null)	
  sprite.obj[props.prop]	
  =	
  props[fNew-­‐firstKeyFr];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  else	
  	
  	
  	
  	
  	
  	
  	
  sprite.obj[props.prop2][props.prop]	
  =	
  props[fNew-­‐firstKeyFr];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  else	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  while	
  (keyFrm<numKeyFr	
  &&	
  fNew>=sprite.keyFrames[keyFrm])	
  keyFrm++;
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (firstTime	
  ||	
  fNew==sprite.keyFrames[keyFrm-­‐1])	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (props.prop2	
  ==	
  null)	
  sprite.obj[props.prop]	
  =	
  props[keyFrm-­‐1];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  else	
  	
  	
  	
  	
  	
  	
  	
  sprite.obj[props.prop2][props.prop]	
  =	
  props[keyFrm-­‐1];
	
  	
  	
  	
  	
  	
  	
  	
  }	
  }	
  }	
  }	
  }
	
  	
  	
  	
  	
  	
  }	
  else	
  if	
  (sprite.charAt(0)=='b'	
  &&	
  fNew	
  ==	
  sprite.frame)	
  eval(sprite.value);
	
  	
  	
  	
  	
  	
  if	
  (fNew	
  >	
  tmLn.lastFrame)	
  tmLn.ID	
  =	
  0;
	
  	
  }	
  }
}
...in the old days
Saturday, March 9, 13
function	
  MM_timelinePlay(tmLnName,	
  myID)	
  {	
  //v1.2
	
  	
  //Copyright	
  1998,	
  1999,	
  2000,	
  2001,	
  2002,	
  2003,	
  2004	
  Macromedia,	
  Inc.	
  All	
  rights	
  reserved.
	
  	
  var	
  i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
	
  	
  if	
  (document.MM_Time	
  ==	
  null)	
  MM_initTimelines();	
  //if	
  *very*	
  1st	
  time
	
  	
  tmLn	
  =	
  document.MM_Time[tmLnName];
	
  	
  if	
  (myID	
  ==	
  null)	
  {	
  myID	
  =	
  ++tmLn.ID;	
  firstTime=true;}//if	
  new	
  call,	
  incr	
  ID
	
  	
  if	
  (myID	
  ==	
  tmLn.ID)	
  {	
  //if	
  Im	
  newest
	
  	
  	
  	
  setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
	
  	
  	
  	
  fNew	
  =	
  ++tmLn.curFrame;
	
  	
  	
  	
  for	
  (i=0;	
  i<tmLn.length;	
  i++)	
  {
	
  	
  	
  	
  	
  	
  sprite	
  =	
  tmLn[i];
	
  	
  	
  	
  	
  	
  if	
  (sprite.charAt(0)	
  ==	
  's')	
  {
	
  	
  	
  	
  	
  	
  	
  	
  if	
  (sprite.obj)	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  numKeyFr	
  =	
  sprite.keyFrames.length;	
  firstKeyFr	
  =	
  sprite.keyFrames[0];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (fNew	
  >=	
  firstKeyFr	
  &&	
  fNew	
  <=	
  sprite.keyFrames[numKeyFr-­‐1])	
  {//in	
  range
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  keyFrm=1;
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  for	
  (j=0;	
  j<sprite.values.length;	
  j++)	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  props	
  =	
  sprite.values[j];	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (numKeyFr	
  !=	
  props.length)	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (props.prop2	
  ==	
  null)	
  sprite.obj[props.prop]	
  =	
  props[fNew-­‐firstKeyFr];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  else	
  	
  	
  	
  	
  	
  	
  	
  sprite.obj[props.prop2][props.prop]	
  =	
  props[fNew-­‐firstKeyFr];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  else	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  while	
  (keyFrm<numKeyFr	
  &&	
  fNew>=sprite.keyFrames[keyFrm])	
  keyFrm++;
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (firstTime	
  ||	
  fNew==sprite.keyFrames[keyFrm-­‐1])	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (props.prop2	
  ==	
  null)	
  sprite.obj[props.prop]	
  =	
  props[keyFrm-­‐1];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  else	
  	
  	
  	
  	
  	
  	
  	
  sprite.obj[props.prop2][props.prop]	
  =	
  props[keyFrm-­‐1];
	
  	
  	
  	
  	
  	
  	
  	
  }	
  }	
  }	
  }	
  }
	
  	
  	
  	
  	
  	
  }	
  else	
  if	
  (sprite.charAt(0)=='b'	
  &&	
  fNew	
  ==	
  sprite.frame)	
  eval(sprite.value);
	
  	
  	
  	
  	
  	
  if	
  (fNew	
  >	
  tmLn.lastFrame)	
  tmLn.ID	
  =	
  0;
	
  	
  }	
  }
}
...in the old days
Saturday, March 9, 13
function	
  MM_timelinePlay(tmLnName,	
  myID)	
  {	
  //v1.2
	
  	
  //Copyright	
  1998,	
  1999,	
  2000,	
  2001,	
  2002,	
  2003,	
  2004	
  Macromedia,	
  Inc.	
  All	
  rights	
  reserved.
	
  	
  var	
  i,j,tmLn,props,keyFrm,sprite,numKeyFr,firstKeyFr,propNum,theObj,firstTime=false;
	
  	
  if	
  (document.MM_Time	
  ==	
  null)	
  MM_initTimelines();	
  //if	
  *very*	
  1st	
  time
	
  	
  tmLn	
  =	
  document.MM_Time[tmLnName];
	
  	
  if	
  (myID	
  ==	
  null)	
  {	
  myID	
  =	
  ++tmLn.ID;	
  firstTime=true;}//if	
  new	
  call,	
  incr	
  ID
	
  	
  if	
  (myID	
  ==	
  tmLn.ID)	
  {	
  //if	
  Im	
  newest
	
  	
  	
  	
  setTimeout('MM_timelinePlay("'+tmLnName+'",'+myID+')',tmLn.delay);
	
  	
  	
  	
  fNew	
  =	
  ++tmLn.curFrame;
	
  	
  	
  	
  for	
  (i=0;	
  i<tmLn.length;	
  i++)	
  {
	
  	
  	
  	
  	
  	
  sprite	
  =	
  tmLn[i];
	
  	
  	
  	
  	
  	
  if	
  (sprite.charAt(0)	
  ==	
  's')	
  {
	
  	
  	
  	
  	
  	
  	
  	
  if	
  (sprite.obj)	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  numKeyFr	
  =	
  sprite.keyFrames.length;	
  firstKeyFr	
  =	
  sprite.keyFrames[0];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (fNew	
  >=	
  firstKeyFr	
  &&	
  fNew	
  <=	
  sprite.keyFrames[numKeyFr-­‐1])	
  {//in	
  range
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  keyFrm=1;
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  for	
  (j=0;	
  j<sprite.values.length;	
  j++)	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  props	
  =	
  sprite.values[j];	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (numKeyFr	
  !=	
  props.length)	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (props.prop2	
  ==	
  null)	
  sprite.obj[props.prop]	
  =	
  props[fNew-­‐firstKeyFr];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  else	
  	
  	
  	
  	
  	
  	
  	
  sprite.obj[props.prop2][props.prop]	
  =	
  props[fNew-­‐firstKeyFr];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  }	
  else	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  while	
  (keyFrm<numKeyFr	
  &&	
  fNew>=sprite.keyFrames[keyFrm])	
  keyFrm++;
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (firstTime	
  ||	
  fNew==sprite.keyFrames[keyFrm-­‐1])	
  {
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  if	
  (props.prop2	
  ==	
  null)	
  sprite.obj[props.prop]	
  =	
  props[keyFrm-­‐1];
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  else	
  	
  	
  	
  	
  	
  	
  	
  sprite.obj[props.prop2][props.prop]	
  =	
  props[keyFrm-­‐1];
	
  	
  	
  	
  	
  	
  	
  	
  }	
  }	
  }	
  }	
  }
	
  	
  	
  	
  	
  	
  }	
  else	
  if	
  (sprite.charAt(0)=='b'	
  &&	
  fNew	
  ==	
  sprite.frame)	
  eval(sprite.value);
	
  	
  	
  	
  	
  	
  if	
  (fNew	
  >	
  tmLn.lastFrame)	
  tmLn.ID	
  =	
  0;
	
  	
  }	
  }
}
Ugh, terrible code
...in the old days
Saturday, March 9, 13
you could not design graphic
http://www.flickr.com/photos/handwrite/3460075040
IMPOSSIBLE
& animation on website...
Saturday, March 9, 13
http://www.flickr.com/photos/vauvau/3466024918
animation & 3D effects
really bloody difficult...
this technique is
Saturday, March 9, 13
http://www.flickr.com/photos/clairity/1449248189
...we can not find a
suitable tree in the forest
Saturday, March 9, 13
http://www.flickr.com/photos/seatbelt67/502255276
hmm...
Saturday, March 9, 13
25
ways...?
Saturday, March 9, 13
26
...need a team
Saturday, March 9, 13
http://www.flickr.com/photos/farleyj/2768941171
Eureka!
HMTL5 & CSS3
Saturday, March 9, 13
welcome to w3c...
Saturday, March 9, 13
29
the next Web Standards
Saturday, March 9, 13
Saturday, March 9, 13
semantic layout
Web forms 2.0
audio & video
2D & 3D drawing
Saturday, March 9, 13
rounded corners
gradient fill
transition & animation
depth content
Saturday, March 9, 13
q
http://www.flickr.com/photos/sporst/3999795549
...let's first deal with
HTML5 Canvas & Video
graphic
Saturday, March 9, 13
...too many HTTP requests
provide alternates?
unsupported...that's a lot of
JavaScript!
requests...
...is Flash even supported?
does every device support Flash?
...ah, that is Flash!
the right version of
media formats...
Saturday, March 9, 13
HTML5 video suitable for
each browser
...screen size?
...available bandwidth?
for each browser...
media format
a couple
c.2000...
fsdfffSaturday, March 9, 13
Saturday, March 9, 13
Saturday, March 9, 13
Saturday, March 9, 13
HTML5 Canvas
Saturday, March 9, 13
using Canvas
<html>
<head>...</head>
<body>
<h1>Page	
  Heading</h1>
<p>Lorem	
  ipsum...</p>
<canvas	
  id="picture1"
width="400"
height="300"/>
<p>Lorem	
  ipsum...</p>
	
   </body>
</html>
Page Heading
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. orem
ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
eiusmod tempor incididunt ut labore et dolore magna aliqua. orem
ipsum dolor sit amet, consectetur adipisicing elit, sed do
Saturday, March 9, 13
What is the difference between 2 logos?
Canvas logo PNG logo
Saturday, March 9, 13
...and demo
Saturday, March 9, 13
q
http://www.flickr.com/photos/sporst/3999795549
...let's continue with
3D effect using CSS3
Saturday, March 9, 13
conveying depth with CSS3
Saturday, March 9, 13
transforms
-­‐webkit-­‐transform:translateY(200px);
Saturday, March 9, 13
transforms
-­‐webkit-­‐transform:translateY(200px)	
  rotate(45deg);
Saturday, March 9, 13
building a Box
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<div	
  class=“package”>
Saturday, March 9, 13
x5
building a Box
Saturday, March 9, 13
building a Box with 3DTransforms
z
x
y
Saturday, March 9, 13
z
x
y
.package	
  >	
  div:nth-­‐child(1)	
  {
-­‐webkit-­‐transform:translateZ(200px);
}
building a Box with 3DTransforms
Saturday, March 9, 13
building a Box with 3DTransforms
	
   	
   	
  
	
   	
   x
z
	
   y
	
   	
   	
  
.package	
  >	
  div:nth-­‐child(1)	
  {
-­‐webkit-­‐transform:translateZ(200px);
}
Saturday, March 9, 13
  	
   	
  
	
   	
   	
  
	
   	
   x
z
y
.package	
  >	
  div:nth-­‐child(2)	
  {
-­‐webkit-­‐transform:rotateY(90deg);
}
building a Box with 3DTransforms
Saturday, March 9, 13
x
	
   	
  
	
   z
y
-­‐webkit-­‐transform:
rotateY(90deg)	
  translateZ(200px);
.package	
  >	
  div:nth-­‐child(2)	
  {
}
building a Box with 3DTransforms
Saturday, March 9, 13
x
	
   	
  
	
   z
y
-­‐webkit-­‐transform:
rotateY(90deg)	
  translateZ(200px);
.package	
  >	
  div:nth-­‐child(2)	
  {
}
building a Box with 3DTransforms
Saturday, March 9, 13
52
building a Box with 3DTransforms
Saturday, March 9, 13
a 3D Box?
Saturday, March 9, 13
perspective
Saturday, March 9, 13
-webkit-perspective:400px;
Saturday, March 9, 13
-webkit-perspective:800px;
Saturday, March 9, 13
-webkit-perspective:8000px;
Saturday, March 9, 13
adding perspective
-­‐webkit-­‐perspective:800px;
.package	
  {
}
Saturday, March 9, 13
3D Box with perspective
Saturday, March 9, 13
...and demo
Saturday, March 9, 13
q
http://www.flickr.com/photos/sporst/3999795549
...let's continue with
transition effect using CSS3
Saturday, March 9, 13
rotating a Box
<div	
  class=“package”>
	
  <div></div>
	
  <div></div>
	
  <div></div>
	
  <div></div>
	
  <div></div>
</div>
Saturday, March 9, 13
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
	
  </div>
</div>
<div	
  class=“package_container”>
	
  <div	
  class=“package”>
rotating a Box
Saturday, March 9, 13
.package	
  {
-­‐webkit-­‐perspective:800px;
}
rotating a Box
Saturday, March 9, 13
.package	
  {
}
.package_container	
  {
-­‐webkit-­‐perspective:800px;
}
rotating a Box
Saturday, March 9, 13
.package	
  {
-­‐webkit-­‐transform-­‐style:preserve-­‐3d;
}
.package_container	
  {
-­‐webkit-­‐perspective:800px;
}
rotating a Box
Saturday, March 9, 13
.package	
  {
}
rotating a Box
Saturday, March 9, 13
.package	
  {
}
.package.right_side	
  {
-­‐webkit-­‐transform:rotateY(-­‐90deg);
}
class=“package	
  right_side”
rotating a Box
Saturday, March 9, 13
rotating a Box
.package	
  {
	
  	
  	
  -­‐webkit-­‐transition:-­‐webkit-­‐transform	
  1s;
}
.package.right_side	
  {
-­‐webkit-­‐transform:rotateY(-­‐90deg);
}
class=“package	
  right_side”
Saturday, March 9, 13
rotating a Box
.package	
  {
	
  	
  	
  -­‐webkit-­‐transition:-­‐webkit-­‐transform	
  1s;
}
.package.right_side	
  {
-­‐webkit-­‐transform:rotateX(-­‐90deg);
}
class=“package”
Saturday, March 9, 13
rotating a Box
.package	
  {
	
  	
  	
  -­‐webkit-­‐transition:-­‐webkit-­‐transform	
  1s;
}
.package.inside	
  {
-­‐webkit-­‐transform:rotateX(-­‐90deg);
}
class=“package	
  inside”
Saturday, March 9, 13
applying a Transition without javascript
Saturday, March 9, 13
.sticker	
  {
background-­‐position:-­‐30px;
border-­‐radius:5px;
}
.sticker:hover	
  {
background-­‐position:0;
border-­‐bottom-­‐left-­‐radius:50%	
  20px;
box-­‐shadow:-­‐5px	
  10px	
  15px	
  rgba(0,0,0,0.25);
}
applying a Transition without javascript
Saturday, March 9, 13
transition on hover
background-­‐position,
border-­‐bottom-­‐left-­‐radius,
box-­‐shadow;
-­‐webkit-­‐transition-­‐duration:1s;
}
.sticker:hover	
  {
background-­‐position:0;
border-­‐bottom-­‐left-­‐radius:50%	
  20px;
}
.sticker	
  {
background-­‐position:-­‐30px;
border-­‐radius:5px;
-­‐webkit-­‐transition-­‐property:
Saturday, March 9, 13
stamp keyframe animation
0%
middle
flat
small
100%
top right
rotated
small
25%
flipped
50%
flipped
big
Saturday, March 9, 13
@-­‐webkit-­‐keyframes
stamp keyframe animation
Saturday, March 9, 13
@-­‐webkit-­‐keyframes	
  stamp-­‐it	
  {
}
Animation	
  name
stamp keyframe animation
Saturday, March 9, 13
25%	
  {
}
50%	
  {
}
100%	
  {
}
}
@-­‐webkit-­‐keyframes	
  stamp-­‐it	
  {
stamp keyframe animation
Saturday, March 9, 13
25%	
  {
}
50%	
  {
}
100%	
  {
top:30px;
right:30px;
}
}
	
  
@-­‐webkit-­‐keyframes	
  stamp-­‐it	
  {
stamp keyframe animation
Saturday, March 9, 13
25%	
  {
-­‐webkit-­‐transform:translateZ(200px)	
  rotateY(-­‐45deg)	
  rotateX(-­‐30deg);
}
50%	
  {
-­‐webkit-­‐transform:translateZ(300px)	
  rotateY(-­‐45deg)	
  rotateX(-­‐30deg);
}
100%	
  {
top:30px;
right:30px;
-­‐webkit-­‐transform:rotate(-­‐5deg);
@-­‐webkit-­‐keyframes	
  stamp-­‐it	
  {
stamp keyframe animation
}
Saturday, March 9, 13
25%	
  {
-­‐webkit-­‐transform:translateZ(200px)	
  rotateY(-­‐45deg)	
  rotateX(-­‐30deg);
}
50%	
  {
-­‐webkit-­‐transform:translateZ(300px)	
  rotateY(-­‐45deg)	
  rotateX(-­‐30deg)
scale(2);
}
100%	
  {
top:30px;
right:30px;
-­‐webkit-­‐transform:rotate(-­‐5deg);
@-­‐webkit-­‐keyframes	
  stamp-­‐it	
  {
stamp keyframe animation
}
Saturday, March 9, 13
@-­‐webkit-­‐keyframes	
  stamp-­‐it	
  {...}
</style>
<style>
stamp keyframe animation
Saturday, March 9, 13
@-­‐webkit-­‐keyframes	
  stamp-­‐it	
  {...}
</style>
<style>
stamp keyframe animation
<script>
function	
  onClickHandler(event)	
  {
var	
  stampElement	
  =	
  /*	
  get	
  the	
  element	
  */;
var	
  stampElement.style.webkitAnimation	
  =	
  “stamp-­‐it	
  0.5s”;
}
</script>
Saturday, March 9, 13
animation fill mode
0%	
  {	
  background-­‐color:	
  orange;	
  }
50%	
  {	
  background-­‐color:	
  white;	
  }
100%	
  {	
  background-­‐color:	
  orange;	
  }
}
div.square	
  {
width:100px;
height:100px;
-­‐webkit-­‐animation:pulse	
  2s;
-­‐webkit-­‐animation-­‐delay:1s;
}
@-­‐webkit-­‐keyframes	
  pulse	
  {
Saturday, March 9, 13
2 second pulse
1 second delay
animation fill mode
0%	
  {	
  background-­‐color:	
  orange;	
  }
50%	
  {	
  background-­‐color:	
  white;	
  }
100%	
  {	
  background-­‐color:	
  orange;	
  }
}
div.square	
  {
width:100px;
height:100px;
-­‐webkit-­‐animation:pulse	
  2s;
-­‐webkit-­‐animation-­‐delay:1s;
}
@-­‐webkit-­‐keyframes	
  pulse	
  {
Saturday, March 9, 13
2 second pulse
1 second delay
animation fill mode
0%	
  {	
  background-­‐color:	
  orange;	
  }
50%	
  {	
  background-­‐color:	
  white;	
  }
100%	
  {	
  background-­‐color:	
  orange;	
  }
}
div.square	
  {
width:100px;
height:100px;
-­‐webkit-­‐animation:pulse	
  2s;
-­‐webkit-­‐animation-­‐delay:1s;
-­‐webkit-­‐animation-­‐fill-­‐mode:backwards;
}
@-­‐webkit-­‐keyframes	
  pulse	
  {
Saturday, March 9, 13
@-­‐webkit-­‐keyframes	
  stamp-­‐it	
  {...}
<script>
function	
  	
  	
  onClickHandler(event)	
  	
  	
  {
var	
  stampElement	
  =	
  /*	
  code	
  to	
  get	
  the	
  element	
  */;
var	
  stampElement.style.webkitAnimation	
  =	
  “stamp-­‐it	
  0.5s	
  forwards”;
}
</script
<style>
animation fill mode
</style>
Saturday, March 9, 13
progress indicator
0%	
  {
-­‐webkit-­‐transform:rotate(0);
100%	
  {
-­‐webkit-­‐transform:rotate(360deg);
}
@-­‐webkit-­‐keyframes	
  outer	
  {
Saturday, March 9, 13
progress indicator
0%	
  {
-­‐webkit-­‐transform:rotate(5);
100%	
  {
-­‐webkit-­‐transform:rotate(365deg);
}
@-­‐webkit-­‐keyframes	
  inner	
  {
Saturday, March 9, 13
.outer_paw
{
-­‐webkit-­‐animation:outer	
  5s	
  infinite;
}
.inner_paw
{
-­‐webkit-­‐animation:inner	
  5s	
  0.4s	
  infinite;
}
progress indicator
Saturday, March 9, 13
.outer_paw
{
-­‐webkit-­‐animation:outer	
  5s	
  infinite;
-­‐webkit-­‐animation-­‐timing-­‐function:steps(10);
}
.inner_paw
{
-­‐webkit-­‐animation:inner	
  5s	
  0.4s	
  infinite;
-­‐webkit-­‐animation-­‐timing-­‐function:steps(10);
}
SteppedTiming function
Saturday, March 9, 13
applying a transition
.box
{
background-­‐color:white;
-­‐webkit-­‐transition:opacity	
  1s;
}
.box:hover
{
background-­‐color:orange;
}
Saturday, March 9, 13
.box
{
background-­‐color:white;
-­‐webkit-­‐animation:fade	
  1s;
}
@-­‐webkit-­‐keyframes	
  fade
{
from	
  {	
  background-­‐color:white;	
  }
from	
  {	
  background-­‐color:orange;	
  }
}
applying a keyframe animation
Saturday, March 9, 13
keyframe animation with multiple keyframes
.box
{
background-­‐color:white;
-­‐webkit-­‐animation:fade	
  1s;
}
@-­‐webkit-­‐keyframes	
  fade
{
from	
  {	
  background-­‐color:white;	
  }
50%	
  {	
  background-­‐color:	
  cyan	
  }
to	
  {	
  background-­‐color:orange;	
  }
}
Saturday, March 9, 13
repeating keyframe animation
.box
{
background-­‐color:white;
-­‐webkit-­‐animation:fade	
  1s;
-­‐webkit-­‐animation-­‐iteration-­‐count:infinite;
}
@-­‐webkit-­‐keyframes	
  fade
{
from	
  {	
  background-­‐color:white;	
  }
50%	
  {	
  background-­‐color:	
  cyan	
  }
to	
  {	
  background-­‐color:orange;	
  }
}
Saturday, March 9, 13
...and demo
Saturday, March 9, 13
http://www.flickr.com/photos/aturkus/4040454167
Saturday, March 9, 13
... and in the real life
Saturday, March 9, 13
web showcases
Saturday, March 9, 13
...and demo
Saturday, March 9, 13
Saturday, March 9, 13
responsive websites
suitable for any device
Saturday, March 9, 13
...and demo
Saturday, March 9, 13
jQuery frameworks
Saturday, March 9, 13
jQueryUI frameworks
Saturday, March 9, 13
Saturday, March 9, 13
Jaws HTML5 Javascript Game Lib
web game frameworks
Saturday, March 9, 13
Saturday, March 9, 13
...and demo
Saturday, March 9, 13
go to the heaven...
Saturday, March 9, 13
mobile development
Saturday, March 9, 13
references
Apple Safari Developer
https://developer.apple.com/devcenter/
safari/index.action
Smashing Magazine
Graphic, CSS and Web design
http://www.smashingmagazine.com
Ben Frain
Everything needed to code websites
in HTML5 and CSS3 that are
responsive to every device
Tuts+
Great web design tutorials and articles
http://webdesign.tutsplus.com
Saturday, March 9, 13
many thanks
to
thank you
lamvt@fpt.com.vn
please
say
tutsplus
https://developer.apple.com
developer
https://tutsplus.com
xin
chào
http://www.smashingmagazine.com
smashingmagazine
Saturday, March 9, 13

More Related Content

PDF
Manual specialization
PPTX
Lecture1 classes3
PDF
Empathic Programming - How to write comprehensible code
PDF
Dive Into PyTorch
PDF
Oxygine 2 d objects,events,debug and resources
KEY
Ruby Supercomputing - Using The GPU For Massive Performance Speedup v1.1
PPTX
30 分鐘學會實作 Python Feature Selection
PPTX
TensorFlow
Manual specialization
Lecture1 classes3
Empathic Programming - How to write comprehensible code
Dive Into PyTorch
Oxygine 2 d objects,events,debug and resources
Ruby Supercomputing - Using The GPU For Massive Performance Speedup v1.1
30 分鐘學會實作 Python Feature Selection
TensorFlow

Viewers also liked (20)

PDF
Crafting animation on the web
PDF
Mastering CSS Animations
PDF
Workshop Advance CSS3 animation
PDF
Responsive Web Design
PDF
Introduction to iPhone Programming
PDF
Building a Completed iPhone App
PDF
HTML5 Web Standards
PDF
Succeed in Mobile career
PDF
Session 16 - Designing universal interface which used for iPad and iPhone
PDF
Session 15 - Working with Image, Scroll, Collection, Picker, and Web View
PDF
Session 4 - Object oriented programming with Objective-C (part 2)
PDF
Introduction to MVC in iPhone Development
PDF
Session 3 - Object oriented programming with Objective-C (part 1)
PDF
Session 12 - Overview of taps, multitouch, and gestures
PPTX
CSS Animations & Transitions
PDF
Session 13 - Working with navigation and tab bar
PDF
Session 14 - Working with table view and search bar
PDF
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
PDF
Session 5 - Foundation framework
PDF
CSS3 Transforms Transitions and Animations
Crafting animation on the web
Mastering CSS Animations
Workshop Advance CSS3 animation
Responsive Web Design
Introduction to iPhone Programming
Building a Completed iPhone App
HTML5 Web Standards
Succeed in Mobile career
Session 16 - Designing universal interface which used for iPad and iPhone
Session 15 - Working with Image, Scroll, Collection, Picker, and Web View
Session 4 - Object oriented programming with Objective-C (part 2)
Introduction to MVC in iPhone Development
Session 3 - Object oriented programming with Objective-C (part 1)
Session 12 - Overview of taps, multitouch, and gestures
CSS Animations & Transitions
Session 13 - Working with navigation and tab bar
Session 14 - Working with table view and search bar
Creating Beautiful CSS3 Animations - FITC Amsterdam 2016
Session 5 - Foundation framework
CSS3 Transforms Transitions and Animations
Ad

Similar to 3D & Animation Effects Using CSS3 & jQuery (8)

PPTX
Making Games in JavaScript
PPT
How to Make Sprites in Game Artwork Field.ppt
PDF
[Ultracode Munich #4] Demo on Animatron by Anton Kotenko
PDF
Gotta code them all, a Pokémon and HTML5 love story!
PPTX
2 Dimensions Of Awesome: Advanced ActionScript For Platform Games by Iain Lobb
PPT
Scmad Chapter07
PDF
An Introduction to Game Programming with Flash: An Introduction to Flash and ...
PDF
Scratch project ideas
Making Games in JavaScript
How to Make Sprites in Game Artwork Field.ppt
[Ultracode Munich #4] Demo on Animatron by Anton Kotenko
Gotta code them all, a Pokémon and HTML5 love story!
2 Dimensions Of Awesome: Advanced ActionScript For Platform Games by Iain Lobb
Scmad Chapter07
An Introduction to Game Programming with Flash: An Introduction to Flash and ...
Scratch project ideas
Ad

More from Vu Tran Lam (8)

PDF
Session 9-10 - UI/UX design for iOS 7 application
PDF
Session 8 - Xcode 5 and interface builder for iOS 7 application
PDF
Session 7 - Overview of the iOS7 app development architecture
PDF
Session 2 - Objective-C basics
PDF
iOS 7 Application Development Course
PDF
Session 1 - Introduction to iOS 7 and SDK
PDF
Android Application Development Course
PDF
Your Second iPhone App - Code Listings
Session 9-10 - UI/UX design for iOS 7 application
Session 8 - Xcode 5 and interface builder for iOS 7 application
Session 7 - Overview of the iOS7 app development architecture
Session 2 - Objective-C basics
iOS 7 Application Development Course
Session 1 - Introduction to iOS 7 and SDK
Android Application Development Course
Your Second iPhone App - Code Listings

Recently uploaded (20)

PDF
Empathic Computing: Creating Shared Understanding
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
cuic standard and advanced reporting.pdf
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Transforming Manufacturing operations through Intelligent Integrations
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Advanced IT Governance
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
KodekX | Application Modernization Development
Empathic Computing: Creating Shared Understanding
NewMind AI Weekly Chronicles - August'25 Week I
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
cuic standard and advanced reporting.pdf
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
NewMind AI Monthly Chronicles - July 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Transforming Manufacturing operations through Intelligent Integrations
Understanding_Digital_Forensics_Presentation.pptx
Spectral efficient network and resource selection model in 5G networks
Advanced IT Governance
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
madgavkar20181017ppt McKinsey Presentation.pdf
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
KodekX | Application Modernization Development

3D & Animation Effects Using CSS3 & jQuery