material-motion / material-motion-js

Reusable gestural interactions in JavaScript. In development.
Apache License 2.0
290 stars 26 forks source link

Expose pointerEventsFromOpacity$ in views-dom #240

Open appsforartists opened 6 years ago

appsforartists commented 6 years ago
export function pointerEventsStyleFromOpacity(opacity$: ObservableWithMotionOperators<number>): ObservableWithMotionOperators<string> {
  return opacity$.threshold(.9).rewrite({
    mapping: {
      [ThresholdRegion.ABOVE]: 'inherit',
      [ThresholdRegion.WITHIN]: 'inherit',
      [ThresholdRegion.BELOW]: 'none',
    },
  });
}