Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tag header images scale smoothly in mobile/desktop #6799

Closed
jywarren opened this issue Nov 18, 2019 · 15 comments · Fixed by #7447 or #8144
Closed

Make tag header images scale smoothly in mobile/desktop #6799

jywarren opened this issue Nov 18, 2019 · 15 comments · Fixed by #7447 or #8144
Labels
design issue requires more design work and discussion (i.e. mockups and sketches) help wanted requires help by anyone willing to contribute high-priority

Comments

@jywarren
Copy link
Member

We have these nice image headings for tag pages:

https://publiclab.org/tag/water-quality

They're based on this Froala design block pattern:

image

However, ours aren't built the same way and don't smoothly/responsively transition between full-width and mobile sizes. There are some where the image is cut off, or messed up. Let's look back at the original design and code to try to standardize and fix this!

Code for the original Froala block was:

<section class="fdb-block pb-0" style="background-image: url(imgs/hero/purple.svg);">
  <div class="container">
    <div class="row text-left justify-content-end">
      <div class="col-12 col-md-6 col-xl-5">
        <div class="fdb-box rounded-bottom-0">
          <h2><strong>Design Blocks</strong></h2>
          <p class="lead">Far far away, behind the word mountains, far from the countries Vokalia and Consonantia, there live the blind texts. </p>

          <p class="lead mt-4"><a class="btn btn-outline-primary" href="https://www.froala.com">Read More</a></p>
        </div>
      </div>
    </div>
  </div>
</section>

I believe the full code can be found somewhere here:

https://github.com/froala/design-blocks/tree/dev/dist

Our code is here:

We'd love help fixing this!

@jywarren jywarren added help wanted requires help by anyone willing to contribute design issue requires more design work and discussion (i.e. mockups and sketches) labels Nov 18, 2019
@jywarren jywarren added this to the User interface (UI) milestone Nov 18, 2019
@jywarren
Copy link
Member Author

Example - this looks nice!

image

But this doesn't! the image disappears!

image

@jywarren
Copy link
Member Author

See a lot of background work and documentation on this in #6054 !

@jywarren
Copy link
Member Author

I was able to get that type of header to work using this CSS: <link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/froala-design-blocks/2.0.1/css/froala_blocks.min.css">

However, it messes up the fonts! Trying to figure that out now.

@jywarren
Copy link
Member Author

OK - I am able to get this work by re-including the main stylesheet like this:

<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/froala-design-blocks/2.0.1/css/froala_blocks.min.css">
<link rel="stylesheet" media="all" href="/assets/application-08768cdbfbde532afe88f0b458bc1767de7799ff598f2d54f6b0229e2f76e703.css" />

Obviously this isn't great. If we can confirm that the froala css doesn't break things all over the site, we could add it to the <head> and not have to re-include the main stylesheet... but we'll have to be really thorough to check the screenshots at different sizes and all!

@NitinBhasneria
Copy link
Collaborator

hey @jywarren I would like to take this issue! Can I?

@jywarren
Copy link
Member Author

jywarren commented Jan 16, 2020 via email

@NitinBhasneria
Copy link
Collaborator

@jywarren I think that the water quality box also needs to be fixed with responsiveness. What are your views? Also, we can cover more screen width as this is not looking nice to only cover the center part. Thank u

@NitinBhasneria
Copy link
Collaborator

Example - this looks nice!

image

But this doesn't! the image disappears!

image

This is what I mean .... that it is looking nice when image cover whole backgound rather than only center part as this... given below

@NitinBhasneria
Copy link
Collaborator

Screenshot from 2020-01-17 22-57-26

@jywarren
Copy link
Member Author

jywarren commented Jan 17, 2020 via email

@jywarren
Copy link
Member Author

Yes, i wanted to agree also that we want the background image to be edge-to-edge the whole time. The Froala code achieves this, as shown on our front page!

In the meantime, our pages are degrading a bit, some change must have affected the styling and now they are pretty bad!

https://publiclab.org/tag/annual-report

image

@NitinBhasneria would you be willing to give this a try? I think the first step is to try to use the code from our front page, which I'll excerpt here:

<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/froala-design-blocks/2.0.1/css/froala_blocks.min.css">
<link rel="stylesheet" media="all" href="/assets/application-08768cdbfbde532afe88f0b458bc1767de7799ff598f2d54f6b0229e2f76e703.css" />
    
   <section class="fdb-block pb-0" style="background-image: url(/system/images/photos/000/024/688/original/gowanus.jpg);position:absolute;left:0;width:100%;margin-top:-21px;height:360px;padding-top:3rem;">
   <div class="container">
   <div class="row text-left justify-content-start">
   <div class="col-12 col-md-6 col-xl-5">
   <div class="fdb-box rounded-bottom-0" style="padding:2.8rem 2.5rem 1.2rem;">
   <h1>Public Lab</h1>
   <p class="lead" style="font-size: 1rem;">Public Lab is a community and a non-profit, dmocratizing science to address environmental issues that affect people.</p>
   <p class="lead mt-4"><a class="btn btn-lg btn-primary front-page-join-btn" hef="/signup">Join &raquo;</a></p>
   </div>
   </div>
   </div>
   </div>
   </section>

@NitinBhasneria
Copy link
Collaborator

Yea I will give it a try

@NitinBhasneria
Copy link
Collaborator

@jywarren I have found the solution of the edge-to-edge background image. I first tried the Froala design as on the front page. But using this will disturb many CSS classes and the given Froala design is also little unuseful of these tag pages, as this has extra buttons and all the things and many errors are coming. Instead of this we can change some little CSS and page can be made like front page.
So, please tell what to do. Whether the Froala design is necessary or should we do with CSS. As doing with CSS will be better from my side.

@jywarren
Copy link
Member Author

Hi, thanks so much! Can you open a PR with this so I can take a look at your changes? I think a non-Froala design is OK, but one reason I also liked Froala is that the HTML code was much simpler too.

Thank you!

@NitinBhasneria
Copy link
Collaborator

@jywarren kindly review this, by this the image now edge to edge.
The disappearance of the image will be fixed in other PR.
Thanks

jywarren pushed a commit that referenced this issue Feb 11, 2020
* image disappearance improved

* changes improved

* Css improved

* css improved

* css improved
@jywarren jywarren reopened this Jun 12, 2020
jywarren added a commit to jywarren/plots2 that referenced this issue Jul 14, 2020
jywarren added a commit to jywarren/plots2 that referenced this issue Jul 14, 2020
jywarren added a commit that referenced this issue Jul 14, 2020
* tag page image header fix #6799

* Update show.html.erb

* Update show.html.erb

* Update tags_controller_test.rb

* Update tag_controller_test.rb

* Update tag_controller_test.rb

* Update show.html.erb

* Update tag_controller_test.rb

* Update show.html.erb
Tristan-Elizabeth pushed a commit to Tristan-Elizabeth/plots2 that referenced this issue Jul 21, 2020
* tag page image header fix publiclab#6799

* Update show.html.erb

* Update show.html.erb

* Update tags_controller_test.rb

* Update tag_controller_test.rb

* Update tag_controller_test.rb

* Update show.html.erb

* Update tag_controller_test.rb

* Update show.html.erb
dms-yondy pushed a commit to dms-yondy/plots2 that referenced this issue Aug 7, 2020
* tag page image header fix publiclab#6799

* Update show.html.erb

* Update show.html.erb

* Update tags_controller_test.rb

* Update tag_controller_test.rb

* Update tag_controller_test.rb

* Update show.html.erb

* Update tag_controller_test.rb

* Update show.html.erb
nadimakhtar97 pushed a commit to nadimakhtar97/plots2 that referenced this issue Sep 21, 2020
* tag page image header fix publiclab#6799

* Update show.html.erb

* Update show.html.erb

* Update tags_controller_test.rb

* Update tag_controller_test.rb

* Update tag_controller_test.rb

* Update show.html.erb

* Update tag_controller_test.rb

* Update show.html.erb
shubhangikori pushed a commit to shubhangikori/plots2 that referenced this issue Oct 12, 2020
* tag page image header fix publiclab#6799

* Update show.html.erb

* Update show.html.erb

* Update tags_controller_test.rb

* Update tag_controller_test.rb

* Update tag_controller_test.rb

* Update show.html.erb

* Update tag_controller_test.rb

* Update show.html.erb
alvesitalo pushed a commit to alvesitalo/plots2 that referenced this issue Oct 14, 2020
* tag page image header fix publiclab#6799

* Update show.html.erb

* Update show.html.erb

* Update tags_controller_test.rb

* Update tag_controller_test.rb

* Update tag_controller_test.rb

* Update show.html.erb

* Update tag_controller_test.rb

* Update show.html.erb
piyushswain pushed a commit to piyushswain/plots2 that referenced this issue Oct 22, 2020
* tag page image header fix publiclab#6799

* Update show.html.erb

* Update show.html.erb

* Update tags_controller_test.rb

* Update tag_controller_test.rb

* Update tag_controller_test.rb

* Update show.html.erb

* Update tag_controller_test.rb

* Update show.html.erb
manchere pushed a commit to manchere/plots2 that referenced this issue Feb 13, 2021
* tag page image header fix publiclab#6799

* Update show.html.erb

* Update show.html.erb

* Update tags_controller_test.rb

* Update tag_controller_test.rb

* Update tag_controller_test.rb

* Update show.html.erb

* Update tag_controller_test.rb

* Update show.html.erb
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this issue Mar 2, 2021
* tag page image header fix publiclab#6799

* Update show.html.erb

* Update show.html.erb

* Update tags_controller_test.rb

* Update tag_controller_test.rb

* Update tag_controller_test.rb

* Update show.html.erb

* Update tag_controller_test.rb

* Update show.html.erb
ampwang pushed a commit to ampwang/plots2 that referenced this issue Oct 26, 2021
* tag page image header fix publiclab#6799

* Update show.html.erb

* Update show.html.erb

* Update tags_controller_test.rb

* Update tag_controller_test.rb

* Update tag_controller_test.rb

* Update show.html.erb

* Update tag_controller_test.rb

* Update show.html.erb
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
* tag page image header fix publiclab#6799

* Update show.html.erb

* Update show.html.erb

* Update tags_controller_test.rb

* Update tag_controller_test.rb

* Update tag_controller_test.rb

* Update show.html.erb

* Update tag_controller_test.rb

* Update show.html.erb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design issue requires more design work and discussion (i.e. mockups and sketches) help wanted requires help by anyone willing to contribute high-priority
Projects
None yet
3 participants