01

Transitions

A transition needs a change of state. Here, :hover creates the second state.

TRANSITION

Color

<span class="color-change">AGAIN</span>

.color-change {
    color: black;
    transition: color 0.5s;
}

.color-change:hover {
    color: red;
}
AGAIN hover me
TRANSITION

Opacity

<span class="fade-hover">AGAIN</span>

.fade-hover {
    opacity: 1;
    transition: opacity 0.8s;
}

.fade-hover:hover {
    opacity: 0.15;
}
AGAIN hover me
TRANSITION

Scale

<span class="grow">AGAIN</span>

.grow {
    display: inline-block;
    transition: transform 0.5s;
}

.grow:hover {
    transform: scale(1.6);
}
AGAIN hover me
TRANSITION

Rotate

<span class="turn">AGAIN</span>

.turn {
    display: inline-block;
    transition: transform 0.5s;
}

.turn:hover {
    transform: rotate(12deg);
}
AGAIN hover me
TRANSITION

Move

<span class="slide">AGAIN</span>

.slide {
    display: inline-block;
    transition: transform 0.7s;
}

.slide:hover {
    transform: translateX(90px);
}
AGAIN hover me
TRANSITION

Combine Properties

<span class="combine">AGAIN</span>

.combine {
    display: inline-block;
    transition: all 0.7s;
}

.combine:hover {
    color: blue;
    transform: scale(1.3) rotate(-8deg);
    letter-spacing: 12px;
}
AGAIN hover me
TRANSITION

Background + Text

<span class="invert">AGAIN</span>

.invert {
    padding: 14px 20px;
    transition: all 0.4s;
}

.invert:hover {
    color: white;
    background: black;
}
AGAIN hover me
LINK STATE

Link Styling

<a class="poem-link" href="#">AGAIN</a>

.poem-link {
    color: black;
    text-decoration: none;
    transition: color 0.4s;
}

.poem-link:hover {
    color: magenta;
}

.poem-link:visited {
    color: purple;
}
AGAIN hover / click

02

Animations

An animation uses @keyframes to describe changes over time.

ANIMATION

Fade

<span class="fade">AGAIN</span>

@keyframes fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fade {
    animation: fade 2s infinite alternate;
}
AGAIN
ANIMATION

Pulse

<span class="pulse">AGAIN</span>

@keyframes pulse {
    from { transform: scale(1); }
    to   { transform: scale(1.45); }
}

.pulse {
    display: inline-block;
    animation: pulse 1.2s infinite alternate;
}
AGAIN
ANIMATION

Float

<span class="float">AGAIN</span>

@keyframes float {
    from { transform: translateY(20px); }
    to   { transform: translateY(-20px); }
}

.float {
    display: inline-block;
    animation: float 2s infinite alternate ease-in-out;
}
AGAIN
ANIMATION

Spin

<span class="spin">AGAIN</span>

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.spin {
    display: inline-block;
    animation: spin 3s infinite linear;
}
AGAIN
ANIMATION

Bounce

<span class="bounce">AGAIN</span>

@keyframes bounce {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-45px); }
    100% { transform: translateY(0); }
}

.bounce {
    display: inline-block;
    animation: bounce 1.1s infinite;
}
AGAIN
ANIMATION

Color Shift

<span class="color-cycle">AGAIN</span>

@keyframes colorCycle {
    0%   { color: red; }
    50%  { color: blue; }
    100% { color: purple; }
}

.color-cycle {
    animation: colorCycle 3s infinite;
}
AGAIN
ANIMATION

Drift + Fade

<span class="drift">AGAIN</span>

@keyframes drift {
    0% {
        transform: translateX(-40px);
        opacity: 0;
    }

    100% {
        transform: translateX(40px);
        opacity: 1;
    }
}

.drift {
    display: inline-block;
    animation: drift 2.5s infinite alternate;
}
AGAIN
ANIMATION

Letter Spacing

<span class="expand-text">AGAIN</span>

@keyframes expandText {
    from { letter-spacing: 0; }
    to   { letter-spacing: 24px; }
}

.expand-text {
    animation: expandText 2s infinite alternate;
}
AGAIN
ANIMATION

Blink

<span class="blink">AGAIN</span>

@keyframes blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.blink {
    animation: blink 1s infinite;
}
AGAIN
ANIMATION

Delayed Entrance

<span class="delayed">AGAIN</span>

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delayed {
    animation: appear 2s infinite;
    animation-delay: 1s;
}
AGAIN

03

Try Combining Them

Once you understand the pieces, combine properties to make behavior that suits the text.

CLASS CHALLENGE

Make the word feel anxious, sleepy, distant, excited, unstable, or secretive.

Change the duration, distance, scale, opacity, color, or timing. The effect should support the meaning of the word rather than simply decorate it.

AGAIN