- This topic has 17 replies, 2 voices, and was last updated 5 years, 10 months ago by Ivan Cazorla.
-
AuthorPosts
-
May 30, 2018 at 6:10 am #587793Ivan Cazorla
Hi there! Love using generatepress and the page header function, works really well. My only doubt on this if exists a possibility to add a zoom in or out animation like some sliders do?
Don’t wanna use an another slider plugin and replace the page header function and make it as clean as possible,
Thanks,
IvanMay 30, 2018 at 6:23 am #587798DavidStaffCustomer SupportHi Ivan,
which elements do you wish to ‘zoom’? Just the page header background image?
And how is this to be triggered? On load or Hover?May 30, 2018 at 8:36 am #587958Ivan CazorlaHi David,
Yeah, just the page header background image. This would be triggered on load.
Thanks,
IvanMay 30, 2018 at 9:32 am #588009DavidStaffCustomer SupportHi Ivan, the CSS method for you to play around with:
.generate-content-header { -webkit-animation: imagezoom forwards 1s ease-in; animation: imagezoom forwards 1s ease-in; } @keyframes imagezoom { 0% { background-size: 100%; } 100% { background-size: 105%; } }
Its a bit hit and miss on safari. Let us know.
May 30, 2018 at 9:41 am #588018Ivan CazorlaHi there, it kinda works. A bit of a glitch also is doing, not 100% smooth, but I think I can deal with that. Definitely not working in Safari.
Thank you,
IvanMay 30, 2018 at 10:04 am #588038DavidStaffCustomer SupportHi Ivan,
this may work better for you – javascript (add to footer hook) to add class to pageheader on zoom. And then some simple CSS to deal with the transition:
https://gist.github.com/diggeddy/eeb0fb894b1b94be27daf29bee6bfbe7
May 30, 2018 at 11:07 am #588091Ivan CazorlaHi there! It works! Also on Safari! But check the link down below and you will see that it makes a little of glitch effect, not smooth.
https://ivancazorla.com/sobre-mi/
Thanks,
ivanMay 30, 2018 at 11:21 am #588104DavidStaffCustomer SupportIt looks pretty good to me! great looking site btw.
I have updated the Gist to include hidden backface visibility this should help a little.
Unfortunately they’re never as smooth as using a transforms scale property, which can’t be used in this instance.try the new code and let me know.
may also want to try tweaking the scale % and transition times. there are other easing (ease-in) functions that may help:You can use all of them aside of the bottom row with CSS.
May 30, 2018 at 11:25 am #588106Ivan CazorlaThank you!! I’ll try that out! I’m still testing and designing the website, making it as clean as possible, isn’t finished yet. I’ll let you know when it’s finished! You can really achieve great results with GeneratePress!
Appreciate your help,
IvanMay 30, 2018 at 11:27 am #588109DavidStaffCustomer SupportYou’re welcome Ivan. Be good to see it when it’s finished 😉
May 30, 2018 at 11:30 am #588111Ivan CazorlaBtw, in which instance I could use the transform scale property to make it smoother?
Thanks again,
IvanMay 30, 2018 at 11:34 am #588121DavidStaffCustomer SupportYou can’t apply it to a background image, only to it’s container.
So if you used
transform: scale(1);
andtransform: scale(1.1);
instead of the background sizes, it would resize the page header container and everything within it. It would also overflow the page container causing horizontal movement.So that would have to be accounted for as well.May 30, 2018 at 11:37 am #588125Ivan CazorlaOh, I understand! And I’ve also tried it and its smooth like butter!! Wish that could be possible to do without scaling it the hole container.
Thank you,
IvanMay 30, 2018 at 11:42 am #588131Ivan CazorlaBut i think I can use that effect in other images that I may have through the website. Is it possible to trigger the effect with a delay or trigger it when the element is visible on screen?
thanks again,
IvanMay 31, 2018 at 1:27 am #588494DavidStaffCustomer SupportYou can add delay to the animation with the
animation-delay: 250ms;
property. This gets added to the selector not the animation rules.To add a class when an element is in view, might be worth trying this out. It uses JS and jQuery ( which is cool as you are already loading the jQuery library for Slick Slider):
-
AuthorPosts
- You must be logged in to reply to this topic.