css animations

Class Monday, January 14, 2019

 Today’s goals:

  • Review 2nd quarter grades and distracted student policy (link )
  • Finish animation property and @keyframes practice on W3Schools (from Thursday)
  • Animation show case– check out sites effectively using animation and review a web-based tool to create animations
  • Learn about 2D transforms and the transform property

 Today’s featured website:

 CSS Animations Practice

  • Animation exerxcises: do 1-6
    Start here: https://www.w3schools.com/css/exercise.asp?filename=exercise_css3_animations1 
    Code help: https://www.w3schools.com/css/css3_animations.asp 
  • If you finished last week: Please find at least two examples of animations on two different websites. Save the links so you can share with the class for our Animation Showcase.
  • Animation short-hand property
    You will often see the animation properties collapsed into a single line of code. For example:
    animation-name: example;
    animation-duration: 5s;
    animation-timing-function: linear;
    animation-delay: 2s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    /* could also be written as follows: */
    animation: example 5s linear 2s infinite alternate;

  Animation Showcase

 2D transforms & the transform property

  • From W3Schools.com: CSS transforms allow you to translate, rotate, scale, and skew elements. A transformation is an effect that lets an element change shape, size and position. CSS supports 2D and 3D transformations. We’re doing 2D today. The transform property is a great one to use to create animations with CSS.
  • Let’s look at the transform property  and its numerous (fun) values
  • Download this code  and let’s review it together. This webpage shows two different animations applied to two images using the transform property and its rotate and translate values.
  • Note: The transform property  and its different values for translating, rotating, scaling, and skewing is useful on its own without animation. For example, it can be used to to rotate images like you see here. 
  • Do now: Try these 4 exercises  for the transform property to practice translate, rotate, scale, and skew. These aren’t animations- you’re practicing using the transform property and its values (see here for code help )