Comments (3)
Just FYI: the mutation observer shenanigans I use is no longer required. In the version of Ionic I used for the tutorial you had to wait for the ion-scroll element to be added and then listen for scroll events on that, but now you can just listen for scroll events directly on ion-content.
from fluster-app.
@joshuamorony thx 👍 I use a listener in my directive (@HostListener('ionScroll', ['$event'])
), I should check if that works the same, I guess so, it works fine on iOS
also I'm interested to try how you manipulate the css (initStyles()/hide()/show()
) which might be smoother than manipulating only webkitTransform
Hopefully one of these will allow me to unleash the effect on Android too...
from fluster-app.
@joshuamorony look like we are actually a complementary team ;)
the way I implemented my parallax effect was good on iOS but glitchy on Android. yours is the contrary, works like a charm on Android but turned out (didn't analyzed it much) to be glitchy when I tested it on my real iPhone 6s/iOS 12
so I just decided to handle both cases in a single directive, thx a lot for the tutorial which allowed me to unleash the effect on Android too 👍
btw. regarding the tutorial, just in case, I had to do the following improvements:
-
I removed the modification of the opacity because there is a box-shadow on the parent element (ion-header) on Android which gonna remains sharp while scrolling and hiding the toolbar
-
The toolbar height might not be 44px, per default I think it's 56px now on Android, therefore I read and apply the actual value with a variable in the directive
-
I only apply the "transition" styles once
-
And finally the most important, before anything, the toolbar height should be actually added as attribute "height" to the toolbar otherwise the very first time we will scroll and trigger the parallax effect, there would be not transition on the height aka the height would be directly set to 0px without any transition
all together the directive looks like the following: https://github.com/fluster/fluster-app/blob/master/src/app/directives/core/navbar/navbar-on-scroll.directive.ts
from fluster-app.
Related Issues (20)
- Improve set viewing's date after "reschedule" UX
- Expand chat textarea height till three lines
- Improve display of the address in case of viewing
- The "who" detail pane doesn't seems to be displayed per default
- Images not rendered in cards stack after 2nd card
- Access to "complaints" popover directly from chat
- Google Play issues
- Google Play's target API level 26
- Modify advertiser side root page
- Titel "meine verfügbarkeit verwalten" doesn't match ad extension
- Calendar scrolling performance on mobile devices
- Overscroll on appointment picker
- "Trendy" information
- PWA CSP error HOT 1
- Update Ionic-v4.beta.17 and cordova-android 7.1.4 and others
- Text in ion-segment-button not trimmed
- Google login: remove scope birthday HOT 1
- Ionic Webview v3 incompatible with Camera, photo filters and cropper HOT 1
- Footer toolbar background not transparent on item details
- Sentry: raven-js is deprecated
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 fluster-app.