< Return to Video

Responsive Layout: Animation - Google Web Designer

  • 0:04 - 0:07
    LUCAS: My name is Lucas, and
    I'm an engineer for Google Web
  • 0:07 - 0:08
    Designer.
  • 0:08 - 0:10
    In this video, we
    extend previous videos
  • 0:10 - 0:13
    on how to create responsive
    documents using media rules.
  • 0:13 - 0:18
    This video shows how to combine
    animations and media rules.
  • 0:18 - 0:21
    We start with a
    simple document that
  • 0:21 - 0:24
    has a vertical layout when
    the viewport is narrow
  • 0:24 - 0:27
    and a horizontal layout
    when the viewport is wider.
  • 0:27 - 0:29
    I'm now going to
    extend this document
  • 0:29 - 0:31
    so when it has a
    horizontal layout
  • 0:31 - 0:34
    and is sufficiently
    tall, instead of having
  • 0:34 - 0:37
    a single image, it has two
    images that are initially
  • 0:37 - 0:40
    superimposed, and then
    separate with an animation.
  • 0:40 - 0:42
    Because Web Designer
    uses CSS3
  • 0:42 - 0:45
    keyframes to
    represent animations,
  • 0:45 - 0:48
    this can be encoded
    using media rules.
  • 0:48 - 0:53
    To start, I'll switch
    to the master content.
  • 0:53 - 0:56
    And I will copy and
    paste this image.
  • 0:56 - 1:02
    And then, on a new image, I
    will point to a different asset.
  • 1:02 - 1:11
    And I'll do that by changing
    directly the asset's path.
  • 1:11 - 1:18
    And I will also have this
    be hidden by default.
  • 1:18 - 1:21
    Now I switch back
    to media rules.
  • 1:21 - 1:26
    And I will add a
    breakpoint on height.
  • 1:26 - 1:30
    We can see that we're editing
    the larger range of heights.
  • 1:30 - 1:34
    So what I'm going to do
    is I will add a key frame
  • 1:34 - 1:36
    for each of those two images.
  • 1:39 - 1:44
    I will move them vertically
    using the Translate tool.
  • 1:48 - 1:49
    Like this.
  • 1:53 - 2:02
    And then finally, I will set the
    visibility of the second image
  • 2:02 - 2:04
    so that it is, once
    again, visible.
  • 2:06 - 2:09
    And now I can scrub to
    preview the animation.
  • 2:12 - 2:14
    This animation is
    responsive in the sense
  • 2:14 - 2:18
    that together, the two
    images stay centred even
  • 2:18 - 2:20
    as the viewport changes size.
  • 2:20 - 2:23
    However, if I move out of this
    media rule to any other media
  • 2:23 - 2:25
    rule, the animation disappears.
  • 2:25 - 2:27
    And you can see this
    in the timeline, where
  • 2:27 - 2:32
    all the tracks are empty, unless
    I am in the lower-right media
  • 2:32 - 2:34
    rule.
  • 2:34 - 2:38
    Now let's say that I want to
    have a default animation, where
  • 2:38 - 2:43
    this image just fades in from
    0 opacity to an opacity of 1.
  • 2:43 - 2:47
    So to do this, in
    the master rules,
  • 2:47 - 2:50
    I'm going to insert a key frame.
  • 2:50 - 2:55
    For the base opacity,
    I'm going to set it to 0.
  • 2:55 - 3:01
    And at the key frame, I
    will set the opacity to 1.
  • 3:01 - 3:04
    So in the master content,
    we see that it fades in.
  • 3:04 - 3:07
    And if we switch
    back to media rules,
  • 3:07 - 3:10
    we can see that in
    each media rule,
  • 3:10 - 3:13
    that same fading
    animation occurs.
  • 3:13 - 3:16
    There's one.
  • 3:16 - 3:19
    There's the second one.
  • 3:19 - 3:21
    And there is a third one.
  • 3:24 - 3:28
    And the only exception is
    that lower-right media rule,
  • 3:28 - 3:30
    where I defined an
    overriding animation.
  • 3:30 - 3:32
    The only thing we
    have to correct
  • 3:32 - 3:37
    is that we redefined the base
    opacity of that first image
  • 3:37 - 3:39
    to be 0.
  • 3:39 - 3:41
    So we'll just
    change it back to 1.
  • 3:41 - 3:46
    And now we can see that
    the animation is restored.
  • 3:46 - 3:48
    You can always tell if
    you have an animation that
  • 3:48 - 3:50
    has overridden the media
    rule, because its label
  • 3:50 - 3:52
    in the timeline
    will be highlighted.
  • 3:52 - 3:54
    And if you click on
    this label, a pop-up
  • 3:54 - 3:57
    will appear that can be used to
    remove the override animation
  • 3:57 - 4:01
    and just use the base
    animation if there is one.
  • 4:01 - 4:03
    That's all I wanted to say
    about combining animations
  • 4:03 - 4:04
    with media rules.
  • 4:04 - 4:06
    Thank you for watching.
Title:
Responsive Layout: Animation - Google Web Designer
Description:

more » « less
Duration:
04:09

English, British subtitles

Revisions