Comments (5)
Yo'!
Will add this in the next release!
Thank you
from barba.
Hi @ZachSaucier ,
Thank you for your observation!
In the transition, when .done
is called the oldContainer
is removed from the DOM:
done: function() {
this.oldContainer.parentNode.removeChild(this.oldContainer);
this.deferred.resolve();
}
I can add visibility: visible
in BaseTransition.done
, but actually should be the custom Transition responsible to make to hide the old Container and show the new one.
So, will change nothing, right?
In visibility: hidden
, instead of display: none
you can access to some property like height/width of the elements, and it's super useful;
You may start a slider or do other JS operation when the newContainer is attached to the DOM and the transition is not yet finished (event onEnter
in Views
or newPageReady
in Barba.Dispatcher
).
Also, with visibility: hidden
the browser (at least Chrome) starts preloading the images, so, it's quite handy.
Hope it reply your answer, if yes, feel free to close the issue.
from barba.
I understand your points and see the value in how it currently runs, but my original points still remain I think 😛
It's not a big deal either way, just what I see as an improvement
from barba.
So, basically, your idea is to make the .done
function like this:
done: function() {
this.oldContainer.parentNode.removeChild(this.oldContainer);
this.newContainer.style.visibility = 'visible';
this.deferred.resolve();
}
Am I right?
If so, the default Transition HideShowTransition
can be rewritten like:
var HideShowTransition = BaseTransition.extend({
start: function() {
this.newContainerLoading.then(this.finish.bind(this));
},
finish: function() {
document.body.scrollTop = 0;
this.done();
}
});
from barba.
Yes, that is the main idea I propose. It keeps things simpler
from barba.
Related Issues (20)
- Add `dark` mode support HOT 4
- Loading JS files on EVERY page HOT 2
- Documentation review HOT 1
- Refreshing page GSAP animations are not working using BarbaJS HOT 1
- Limit the number of prefetched links
- THREEJS meshes disappearing after barba transition HOT 1
- Barba.JS not work with GSAP Line Animation HOT 1
- Add setting to cache rendered HTML
- Footer overlapping issue on the documentation website HOT 2
- Improve documentation for WordPress HOT 2
- How to add/initialize other JS files after the page transition which is built with barba & gsap? HOT 2
- How to create transition sliding up card? HOT 1
- `RangeError` on manual hash change
- How to check for barbacontainer HOT 1
- Safari flash the leaving container HOT 6
- Add support for multiple `namespace` in `Views`
- Improve `next.container` availability
- About `View` transitions API HOT 3
- POST Form transition HOT 1
- Source map failed to load HOT 3
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 barba.