COAP:COAP-3000/week5: Difference between revisions

The educational technology and digital learning wiki
Jump to navigation Jump to search
mNo edit summary
Line 10: Line 10:
== Monday ==
== Monday ==


=== Creating animations with the GSAP library ===
=== The GSAP library ===


The GreenSock Animation Platform ('''GSAP''') is a powerful and relatively easy to use suite of animation libraries for [[HTML5]]. As of April 2018, it includes:
The GreenSock Animation Platform ('''GSAP''') is a powerful and relatively easy to use suite of animation libraries for [[HTML5]]. As of April 2018, it includes:
Line 24: Line 24:
<source lang="HTML5">
<source lang="HTML5">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/TweenMax.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/TweenMax.min.js"></script>
</source>
=== Creating animations with TweenMax and TweenLite ===
There are are two ways of creating animations:
* Use a simple static method like <code> Tweenlite.to </code>. e..g
<source lang="JavaScript">
TweenLite.to(thing, 2, {left:"542px"});   
</source>
* Create a tweening object that you then can control with various methods.
<source lang="JavaScript">
var tween = new TweenLite (thing, 2, {left:"542px"}); 
tween.play();
</source>
</source>



Revision as of 22:42, 15 April 2018

COAP:COAP-3000
◀▬▬▶
2018/04/15
Objectives
  • create animations with GSAP
  • use jQuery to get a handle on elements

Objectives

  • create animations with GSAP
  • use jQuery to get a handle on elements



Monday

The GSAP library

The GreenSock Animation Platform (GSAP) is a powerful and relatively easy to use suite of animation libraries for HTML5. As of April 2018, it includes:

  • TweenLite -handles animating just about any property of any object.
  • TweenMax - adds some extras.
  • TimelineLite a container for tweens to control them as a whole and precisely manage their timing in relation to each other
  • TimelineMax - adds some extras.

In this class, we will work with TweenMax.

  • Either download it from here or
  • include the library as CDN, like this:
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.20.3/TweenMax.min.js"></script>

Creating animations with TweenMax and TweenLite

There are are two ways of creating animations:

  • Use a simple static method like Tweenlite.to . e..g
TweenLite.to(thing, 2, {left:"542px"});
  • Create a tweening object that you then can control with various methods.
var tween = new TweenLite (thing, 2, {left:"542px"});  
tween.play();

Hands on

Also on codepen

Wednesday

  • GSAP continued
  • Midterm (1hour)

Project 5

Create an animation with the GSAP library.

Requirements:

  • At least three animations
  • A start and a stop button for at least one animation.

Due:

  • Wednesday, week 6 before class
  • Upload to the worldclassroom