Comments (5)
What if one behavior just sets the background to red, but another behavior animates the color? The first behavior would only need to apply the style in attach
and remove it in detach
. The other needs to do it for every scroll.
Let me fall back. What is it that I'm actually trying to solve?
- Merging multiple transforms from different behaviors (layout + transform)
- I'm also trying to sync render and scroll calls bc right now render doesn't have access to the layout engine
- Possibly add prefixes transparently
from scrollmeister.
I'm also trying to sync render and scroll calls bc right now render doesn't have access to the layout engine
that's fixed by now
from scrollmeister.
Instead of making it a behavior itself I've put it in the core of Behaviors themselves. Using this.css.translate = 'foo'
inside a behavior gives you all the things mentioned above. It will transparently store styles from multiple behaviors and merges them. You also don't need to clean up just like this.listen
. The behavior will remove your styles for you. Why can't everything be so simple?
There is just one little thing we need to take care of: ordering. Especially in the case of CSS transforms we need to have a consistent order, because the order of transform operations matters. This is tricky because two behaviors that don't have a common dependency do not have a guaranteed order in which they are attached.
from scrollmeister.
There is just one little thing we need to take care of: ordering. Especially in the case of CSS transforms we need to have a consistent order, because the order of transform operations matters. This is tricky because two behaviors that don't have a common dependency do not have a guaranteed order in which they are attached.
The actual order in this case is not important (there simply is no intrinsic order) but we need to make the order consistent. For the most important case (layout
-> transform
behavior) the order is given by the dependencies. However, we currently don't have a linearized list of behaviors. We will create and update this list every time defineBehavior
is called (divide-and-conquery the problem down to a single behavior and its position within the list). This list can then be used by both the attachBehaviors
call and the applyBehaviorStyle
method.
from scrollmeister.
The order is now consistent with the order the behaviors are defined.
from scrollmeister.
Related Issues (20)
- MutationObserver HOT 1
- <content-meister> HOT 2
- <element-meister> -> <section-meister>
- scrollbar behavior
- Experiment with native scrolling on touch HOT 4
- youtube behavior pause outside of viewport
- Web workers HOT 1
- Expose scroll velocity to gl-effect schaders HOT 1
- viewport-events behavior
- Can someone please tell me why fake scrolling is so much smoother on IOS?
- Timing issue with appending new items HOT 10
- RatioType needs to accept floats as well
- clip: true for non-followers
- `default` and conditions
- https://docusaurus.io/
- Allow spacing around scroll-meister
- height: inherit for followers
- media behavior
- scroll-into-view behavior
- DOM manip perf
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 scrollmeister.