xenomedia / xeno_hero

Drupal 8 module that creates a Hero Paragraphs bundle.
GNU General Public License v2.0
23 stars 18 forks source link

Adds the ability to add offset to background position #10

Closed albertski closed 6 years ago

albertski commented 6 years ago

Ran into some issues with the background image. I would see a black area above the image.

I used the same formula found here and it seems to work better:

var yPos = -($window.scrollTop() / $bgobj.data('speed'));

Not sure if it was just me but that worked a lot better.

Also, needed the ability to add a little offset so the image displays in the position I would like it to show. I added an offset field that lets you control it.

albertski commented 6 years ago

Good point. I made those fixes.

thejimbirch commented 6 years ago

Excellent! Chrissy and I will review in the morning. She handled the Javascript for this module.

thejimbirch commented 6 years ago

@albertski I made some changes to the template. Please review. If you approve, I will ask @christine-harder to merge the PR.

albertski commented 6 years ago

@thejimbirch Your changes look good and I tested and they worked.

Still not sure if you are required to set a default value like you do in php. I'm thinking you don't have to in Twig but jut incase created a question on Drupal Answers.

thejimbirch commented 6 years ago

We got good feedback on Drupal Answers that our solution is valid.

@christine-harder Let me know when you have availability and we can complete this Pull Request.

christine-harder commented 6 years ago

Pull request is merged :+1: