material-motion-js
material-motion-js copied to clipboard
Reusable gestural interactions in JavaScript. In development.
This seems like it should work: ```typescript subscribe({ source: when( pointerEvents.up$.rewriteTo({ value$: thresholdCrossed$, onlyEmitWithUpstream: true, }) ).rewriteTo({ value$: dissolveSpring.destination$.inverted(), onlyEmitWithUpstream: true, }), sink: dissolveSpring.destination$, }); ``` to toggle the destination...
After views-dom is merged into core, it's worth investigating putting together a Rollup distribution and adding it to [Google Hosted Libraries](https://developers.google.com/speed/libraries/) to make throwing open a Codepen with Material Motion...
`StyleStreams` is currently a whitelist of values that `combineStyleStreams` can transform into CSS rules. Thus, even though `combineStyleStreams` will pass through streams of standard CSS rules, TypeScript will reject them:...
If you play with a tossable thing, sometimes velocity comes out as 0. I'm guessing it doesn't have enough data to calculate a velocity, but I haven't dug into why.
A new user might presumably do this: ```typescript const draggable = new Draggable(pointerEvents); const spring = new Point2DSpring(); const tossable = new Tossable({ draggable, spring }); ``` and wonder why...
`reactiveNextOperator` injects `{upstream: Observable}` into `combineLatest`, which is currently typed to be `D` (the `inputs` dictionary). The `inputs` kwarg shouldn't require `upstream`. When I tried to use `reactiveNextOperator`, TypeScript was...
It probably looks something like this: ```typescript export function getEventStreamFromElement(type: string, element: Element, eventListenerOptions?: AddEventListenerOptions): ObservableWithMotionOperators; export function getEventStreamFromElement(type: K, element: Element, eventListenerOptions?: AddEventListenerOptions): ObservableWithMotionOperators; ```
We currently have a 1D spring (`NumericSpring`) and a 2D spring (`Point2DSpring`). It would be nice to have a `DimensionsSpring`, which is really just a `Point2DSpring` with the axes renamed....
```typescript export function pointerEventsStyleFromOpacity(opacity$: ObservableWithMotionOperators): ObservableWithMotionOperators { return opacity$.threshold(.9).rewrite({ mapping: { [ThresholdRegion.ABOVE]: 'inherit', [ThresholdRegion.WITHIN]: 'inherit', [ThresholdRegion.BELOW]: 'none', }, }); } ```
There should be a common way to set `willChange$` from a `state$`. If #235 doesn't happen, we should have something like this: ```typescript function willChangeFromState(motionState$, activeName = 'transform') ``` If...