Comments (5)
Hi @jesperlandberg,
Yes you'll have to do your conditional stuffs in your transitions.
The Highway.Core
is called once to setup Highway with the renderers and transitions.
This means that once it's called it's not aware of any DOM changes.
If you want to watch DOM changes and change the transition you'll have to work within the transitions.
This way when the transition is called, if the body
has the classname is-open
you can change it.
I'm curious, what kind of transition would you like to do ?
Because if it's an animation when a menu or something is opened this shouldn't be part of the transitions of Highway but more a transition in a file like header.js
for example that would be called when the menu button is triggered... Assuming this is the kind of animation you want to achieve.
So in conclusion, you can't do this kind of conditional statement when calling Highway.Core
and I don't think this is a feature coming in next version since I don't think it's an intended behaviour for this kind of library.
Best regards,
Anthodpnt
from highway.
Hi @Anthodpnt
I understand:) no problem, will do my check in the transition.js file!
Well basically, I have a mask element that I animate on transition, but when the menu is open during a transition, I will use the menu element as the mask, for the out part of the transition. No big deal and is easily made with conditionals inside the transition file. I attached a video clip if ur interested in seeing what I mean. Another option is just giving the default mask transition a delay and triggering my close menu method on NAVIGATE_OUT, so that the mask animation starts after the menu is closed... but that makes the whole switching pages to long=)
Loving the library so far btw! Good job:)
from highway.
Really nice work @jesperlandberg !
I would like to share this site when it will be live to show what is possible with Highway if you agree :).
from highway.
@Anthodpnt of course:) Will send over a link when live!:)
from highway.
@jesperlandberg Thanks ! Closing the issue.
from highway.
Related Issues (20)
- Javascript functions doesn't works on the second time HOT 1
- Locomotive scroll not updating after page transition HOT 3
- I can't get the HIGHWAY.redirect() to work HOT 1
- Updating CSS for incoming page – (Highway maintains the outgoing page's CSS) HOT 5
- data-transition attribute no longer works in 2.2.2 HOT 2
- Update /refresh/bind links dynamically created with javascript HOT 1
- New href with highway HOT 13
- Adding additional headers to page requests
- Add index.d.ts file for better IDE typehinting
- back/forward buttons pressed during transition break the website
- Facebook Pixel Tracking HOT 3
- Fatal error on transition to mismatching URL scheme, while remaining on the same domain
- Can't work with CDN
- Improper use of DOM events
- Highway not working with DOM elements rendered by javascript HOT 1
- H.redirect always refresh page HOT 1
- Help
- H is undefined HOT 1
- Navigation with parameters and anchor not working
- Javascript not working after page transition HOT 2
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 highway.