Assignment 3: Transforms, transitions, animations
Until now, our sketches are quite rectengular and static.
Today we wan’t to continue with our geometrical patterns and sketches, but add effects, animations, interactions, ...
- Fork one of your existing sketches or quickly start a new one. Play around with the following properties to make your HTML elements less boxy:
border-radiusfor round cornerstransformto manipulate the appeareance of an elementgradientsas background color- Mouse interactions using the
:hoverpseudo-selector box-shadow
These links might help you:
- Our small CSS Reference
- Google
CSS ... generator,CSS effects,CSS animation,CSS ...
- Use the
:hoverpseudo-class to manipulate properties:
h1 {
color: red;
}
h1:hover {
color: blue;
}
- Use
transitionto morph between diffenrent states.
Use
:hoverin combination withtransition. Note how the background is a sibling element to the button and still can be animated using the+combinator. Play with it on CodePen
- Another way to add movement to our skteches is with
animation. Whiletransitiononly alternates between 2 states, a CSSanimationcan follow a complex chain of keyframes.
Fork or start a new pen to create a small animation.
CSS
animationin combination withposition. Play with it on CodePen
CSS
animationin combination withtransform. Play with it on CodePen