Comments (8)
Augh we can so easily build a thing like that :)
CardStack: Director {
var grabbedCard
function setUp(transaction) {
foreach card {
transaction.add(new Grabbable(delegate: self), name:"interaction", card)
}
}
function didGrab(grabbedCard) {
transact(function(transaction) {
foreach card {
transaction.add(new Tappable(delegate: self), name:"interaction", card)
}
transaction.add(new Draggable(), grabbedCard)
})
}
function didTap(tappedCard) {
transact(function(transaction) {
transaction.add(new SpringAnchoredTo(grabbedCard), card)
})
}
}
from material-motion-js.
Bonus challenge: allow interaction with the rest of the software while the transition is being canceled. (this is presently hard to do on iOS, for example).
from material-motion-js.
Reminds me of @andymatushak's React 2016 talk about being able to drag a stack of cards around with one finger and add new cards to the stack by tapping them with another finger during the drag. Pretty sure this is in the litmus doc.
from material-motion-js.
All plans made up now just for sake of exploring an implementation; not specifically happy with any of them.
from material-motion-js.
/tangent
from material-motion-js.
you've broken me
from material-motion-js.
Copy/pasting some notes from an old brainstorm I did on this (before @schlem suggested treating all interactions during a transition as a cancel):
Consider these routes:
/listen-now/
(or/search/strfkr/
)/strfkr/miracle-mile/
/hot-chip/
/bloc-party/silent-alarm/
If someone clicked through them in rapid succession (e.g. before onRest
), you’d want:
- Miracle Mile cover art starts to fly to hero slot
- Hot Chip label starts to fly to hero position, while Julius cover art goes back to destination
- The actual transition between listen-now and artist is not nec. defined. Neither labels nor band photos transition in the current version of the app.
- Silent Alarm cover starts to transition to hero position, while Hot Chip and Miracle Mile continue to retreat to their homes on Listen Now
To handle this correctly implies:
- View duplication for shared elements. Otherwise, Silent Alarm could replace Miracle Mile before it completes its transition. View duplication is seriously hard in a world with inheritable CSS - it would need some recursive
getComputedStyle
sorcery that is unlikely to be fast enough to suffice. If you ignore the cascading problem, inducing authors to use styles that don’t cross the transition boundary, it gets less-hard.- The from elements already exist with the correct positions in the cascade, but likely at the wrong resolution and z index.
- How do you handle circle-to-square transitions, eg artist?
- Only shared elements should be duplicated. Otherwise, you’ll end up stacking redundant views on top of each other, which will throw off the shadows and transparency.
- Independent springs for each transition to handle multiple aborts resiliently.
The simple and common (though less than ideal) solution is to disallow interactivity during a transition. How would this affect {stop,back,forward} browser buttons?
If you can put a scrim between the From and To views, does that change the complexity here?
- Maybe wrap the From view in a scrim that uses event capturing to
history.back()
- Should probably reverse the timeline and ignore taps after that until the timeline comes to rest(ish). Rest on a spring is felt in the .9s, even though it doesn’t trigger until 1.0
from material-motion-js.
Closing this until we begin pursuing transitions.
from material-motion-js.
Related Issues (20)
- Create interaction for threshold + velocity
- Structure exports
- Demo of responsive importing
- Replace state$ with atRest$
- Fix ParallaxDemo and/or convertTouchEventToPointerEvent HOT 1
- Prevent Chrome iOS drag reload on tossable demo
- Expose pointerEventsFromOpacity$ in views-dom
- Add willChangeFromState to views-dom
- DimensionsSpring HOT 12
- Support in NativeScript HOT 1
- Project status for humans? HOT 1
- Explore inferring getEventStreamFromElement's generic with overrides HOT 1
- Check combineLatest types on reactiveNextOperator
- Add warning if Draggable/Tossable don't have styleStreams connected
- Figure out why tossable.velocity$ is sometimes 0
- Bundle and publish to Google Hosted Libraries HOT 2
- Make combineStyleStreams accept streams of arbitrary CSS HOT 1
- Stack overflow when the source is the inverse of a sink
- git clone [email protected]:material-motion/material-motion-js.git cd material-motion-js yarn $( yarn bin )/lerna bootstrap
- Ms Jean
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from material-motion-js.