Chapter 6 : CSS3 Transform & Transitions Flashcards

1
Q

What does CSS3 Transforms allows?

A
  1. Translate, rotate, scale and skew elements
  2. Supports 2D and 3D transformations
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

List out CSS transformation methods ( 6 )

A
  1. translate()
  2. rotate()
  3. scale()
  4. skewX()
  5. skewY()
  6. matrx()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the translate() method do? ( CSS 2D )

A
  1. Moves an element from its current position ( According to the parameters given for the X-axis and the Y-axis )
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Create a div element that moves the div element 50 pixels to the right and 100pixels down from its current position
1. Compatible with Safari and Default Syntax

A

div
{
width: 300px;
height: 100px;
background-color: yellow;
border: 1px solid black;
}

div:hover
{
/Safari/
-webkit-transform: translate(50px,100px);
/Default Syntax/
- transform: translate(50px,100px);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the rotate() element do?

A
  1. Rotates an element clockwise or counter-clockwise according to a given degree
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to rotate the element clockwise with 20 degrees?

A

div:hover
{
/Safari/
-webkit-transform: rotate(20deg);
/Default Syntax/
transform: rotate(20deg);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does scale() method do?

A
  1. Increase / Decrease the size of an element given for the width and height
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How to scale the element 2 times of its original width, and three times of its original height? ( Using <div> element )

A

div
{
-ms-transform: scale( 2, 3 );
-webkit-transform: scale(2, 3 );
transform: scale(2,3)
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the skewX() method does to an element?

A
  1. Skews an element along the X-axis by the given angle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How to skews the <div> element 20 degress along the x-asis

A

div
{
-ms-transform: skewX(2-deg);
- webkit-transform: skewX(20deg);
transform: skewX(20deg);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does the skewY() method does to an element?

A
  1. Skews an element along the Y-axis by the given angle
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How to skews the <div> element 20 degress along the y-asis?

A

div
{
-ms-transform: skewY(2-deg);
- webkit-transform: skewY(20deg);
transform: skewY(20deg);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

List out 3 examples of 3D transformation methods

A
  1. rotateX()
  2. rotateY()
  3. rotateZ()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does roateX() does?

A
  1. Rotates an element around its X-axis at a given degree
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How to rotate the x-axis div element for 150 degree?

A

div
{
-webkit-transform: rotateX(150deg);
transform: rotateX(150deg);
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does rotateY() does?

A
  1. Rotates an element around its Y-axis at a given degree
17
Q

How to rotate the y-axis div element for 150 degree?

A

div
{
-webkit-transform: rotateY(150deg);
transform: rotateY(150deg);
}

18
Q

What does rotateZ() does?

A
  1. Rotates an element around its Z-axis at a given degree
19
Q

How to rotate the z-axis div element for 90 degree?

A

div
{
-webkit-transform: rotateZ(90deg);
transform: rotateZ(90deg);
}

20
Q

What does CSS3 transitions allows us to do?

A
  1. It allows us to change property values smoothly ( fron one value to another), over a given duration
21
Q

List out 2 things that I need to specify to create a transition effect

A
  1. The CSS property I want to add an effect to
  2. The duration of the effect
22
Q

What will happen if the duration part is not specified?

A
  1. The transition will have no effect ( no animation ), because the default value is 0
23
Q

How to create a div element so that when it hovers, it width will increase to 300px the the div will extend its container until 300px for 2 seconds?

A

div
{
width: 100px;
height: 100px;
background: red;
-webkit-transition: width: 2s;
transition: width 2s;
}

div:hover
{
width: 300px;
}

24
Q

What does the transition-timing-function property specifies?

A
  1. Specifies the speed curve of the transition effect
25
Q

List out all 6 values for transition-timing-function property

A
  1. ease
  2. linear
  3. ease-in
  4. ease-out
  5. ease-in-out
  6. cubic-bezier( n, n , n , n)
26
Q

What does ease specifies?

A
  1. Specifies a transition effect with a slow start, then fast, then end slowly
27
Q

What does linear specifies?

A
  1. Specifies a transition effect with the same speed from start to end
28
Q

What does ease-in specifies?

A
  1. Specifies a transition effect with a slow start
29
Q

What does ease-out specifies?

A
  1. Specifies a transition effect with a slow end
30
Q

What does ease-in-out?

A
  1. Specifies a transition effect with a slow start and end
31
Q

What does cubic-bezier specifies?

A
  1. Lets us define own values in a cubic-bezier function
  • cubic-beizier( x1, y1 , x2,y2 )
    P1 = x1 , y1
    P2 = x2, y2

The animation will float like ~ from P1 to P2

32
Q

What does the transition-delay propety specifies ?

A
  1. Specifies a delay ( in seconds) for the transition effect
33
Q

How to create a div with 1 second delay before starting?

A

div
{
-webkit-transition-delay: 1s;
transition-delay: 1s;
}