Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

feat(ripple): Implement subset of improved interaction response guidelines #419

Merged

Conversation

traviskaufman
Copy link
Contributor

@traviskaufman traviskaufman commented Mar 21, 2017

Background

When the ripple was originally designed from a motion perspective,
bounded and unbounded activation/deactivation used two different
animation styles, distinct from one another.

The UX updates to the ripple remove this distinction of bounded vs.
unbounded solely with regard to how the ripple animates in and out.
There is still a distinction between bounded vs. unbounded, but we no
longer have to account for this when animating the ripple. Thus, there
are no API changes; only UX changes.

Changes

  • Implement UX changes for "tap" + "tap and hold" interactions
  • Remove all references of "bounded" vs. "unbounded" from
    activation/deactivation code

Resolves #190

@traviskaufman
Copy link
Contributor Author

@cristobalchao if you could do a quick pass on the UX here I'd appreciate it!

@codecov-io
Copy link

codecov-io commented Mar 21, 2017

Codecov Report

Merging #419 into master will increase coverage by 0.13%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #419      +/-   ##
==========================================
+ Coverage   99.02%   99.16%   +0.13%     
==========================================
  Files          40       40              
  Lines        2058     2036      -22     
  Branches      264      260       -4     
==========================================
- Hits         2038     2019      -19     
+ Misses         20       17       -3
Impacted Files Coverage Δ
packages/mdc-ripple/constants.js 100% <ø> (ø) ⬆️
packages/mdc-ripple/foundation.js 99.48% <100%> (+1.44%) ⬆️
packages/mdc-ripple/util.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f6dbe84...322f2b6. Read the comment docs.

@@ -20,46 +20,33 @@

@keyframes mdc-ripple-fg-radius-in {
from {
transform: translate(0) scale(1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed? Don't we need a fallback for browsers that don't support var?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #361.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BBosman good question. Typically, yes. However, this keyframe is only attached when mdc-ripple-upgraded is added to the ripple surface. Before we add that class, we check - within JS - to make sure custom properties are supported. Thus, fallbacks here aren't necessary.

...I'm going to add this explanation as a comment 😃

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -20,46 +20,33 @@

@keyframes mdc-ripple-fg-radius-in {
from {
transform: translate(0) scale(1);
transform: translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1);
animation-timing-function: $mdc-animation-fast-out-slow-in-timing-function;
}

to {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

mdc-ripple-fg-unbounded-transform-deactivate var(--mdc-ripple-fg-unbounded-transform-duration, 0) $mdc-animation-fast-out-slow-in-timing-function;
&.mdc-ripple-upgraded--foreground-deactivation#{$pseudo} {
// Retain transform from mdc-ripple-fg-radius-in activation
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

@traviskaufman traviskaufman force-pushed the feat/implement-improved-interaction-guidelines-new branch from bac68c8 to cfe9686 Compare March 21, 2017 18:44
@@ -15,42 +15,33 @@
*/

export const ROOT = 'mdc-ripple';
export const UPGRADED = `${ROOT}-upgraded`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It seems like the exported const ROOT and UPGRADED is not being used anywhere.

@traviskaufman traviskaufman force-pushed the feat/implement-improved-interaction-guidelines-new branch from cfe9686 to ab120d8 Compare March 24, 2017 19:01
@traviskaufman
Copy link
Contributor Author

@yeelan0319 Changes made PTAL!

transform: translate(var(--mdc-ripple-fg-translate-start, 0)) scale(1);
animation-timing-function: $mdc-animation-fast-out-slow-in-timing-function;
}

to {
transform: translate(0) scale(0);
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 0));
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason why the default value is different from --mdc-ripple-fg-scale default value (which is 0 and default to 0 else where in _mixins.scss). Is this a spec change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an oversight on my part for the --mdc-ripple-fg-scale default value, which should be set to 1. Will change.

mdc-ripple-fg-unbounded-transform-deactivate var(--mdc-ripple-fg-unbounded-transform-duration, 0) $mdc-animation-fast-out-slow-in-timing-function;
&.mdc-ripple-upgraded--foreground-deactivation#{$pseudo} {
// Retain transform from mdc-ripple-fg-radius-in activation
transform: translate(var(--mdc-ripple-fg-translate-end, 0)) scale(var(--mdc-ripple-fg-scale, 1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack

@yeelan0319
Copy link
Contributor

@traviskaufman
Brought this up in our stand up today as a parking lot since it seems like there is no further information about why bounded & unbounded is removed and I feel I am lacking of quite a few context information to give useful feedbacks on those implementation.

Moreover since so many changes have been made, I also want to make sure there is no changing to our API and we don't need to make any updates to README.md.

Given we might need to review code across different components and git doesn't always clever enough to show diff correctly, I feel it might be helpful to provide slightly more high level description about the commit, I found a guideline on Github that we might found useful.

@traviskaufman
Copy link
Contributor Author

@yeelan0319

When the ripple was originally designed from a motion perspective, bounded and unbounded activation/deactivation used two different animation styles, distinct from one another.

The UX updates to the ripple remove this distinction of bounded vs. unbounded solely with regard to how the ripple animates in and out. There is still a distinction between bounded vs. unbounded, but we no longer have to account for this when animating the ripple. Thus, there are no API changes; only UX changes.

I'll go ahead and add this description above to the commit message.

@traviskaufman traviskaufman force-pushed the feat/implement-improved-interaction-guidelines-new branch from ab120d8 to e32c1fd Compare March 28, 2017 14:56
@traviskaufman
Copy link
Contributor Author

@yeelan0319 changes made PTAL

…lines for ripple

Background
===

When the ripple was originally designed from a motion perspective,
bounded and unbounded activation/deactivation used two different
animation styles, distinct from one another.

The UX updates to the ripple remove this distinction of bounded vs.
unbounded solely with regard to how the ripple animates in and out.
There is still a distinction between bounded vs. unbounded, but we no
longer have to account for this when animating the ripple. Thus, there
are no API changes; only UX changes.

Changes
===

- Implement UX changes for "tap" + "tap and hold" interactions
- Remove all references of "bounded" vs. "unbounded" from
  activation/deactivation code

Resolves #190
@traviskaufman traviskaufman force-pushed the feat/implement-improved-interaction-guidelines-new branch from e32c1fd to 322f2b6 Compare March 28, 2017 15:23
@yeelan0319
Copy link
Contributor

Cool. Thanks Travis. This feedback is useful 👍 🌟

@traviskaufman traviskaufman merged commit 046e337 into master Mar 28, 2017
@traviskaufman traviskaufman deleted the feat/implement-improved-interaction-guidelines-new branch March 28, 2017 16:27
pgbross pushed a commit to pgbross/material-components-web that referenced this pull request Mar 29, 2017
…lines (material-components#419)

Background
===

When the ripple was originally designed from a motion perspective,
bounded and unbounded activation/deactivation used two different
animation styles, distinct from one another.

The UX updates to the ripple remove this distinction of bounded vs.
unbounded solely with regard to how the ripple animates in and out.
There is still a distinction between bounded vs. unbounded, but we no
longer have to account for this when animating the ripple. Thus, there
are no API changes; only UX changes.

Changes
===

- Implement UX changes for "tap" + "tap and hold" interactions
- Remove all references of "bounded" vs. "unbounded" from
  activation/deactivation code

Resolves material-components#190
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants