plots2 icon indicating copy to clipboard operation
plots2 copied to clipboard

Refine CSS of text in image box on home page for various page widths

Open oorjitchowdhary opened this issue 8 years ago • 38 comments

Please describe the problem (or idea)

The default Public Lab introduction text on the homepage is missing in the mobile view.

What happened just before the problem occurred? Or what problem could this idea solve?

image-1

What did you expect to see that you didn't?

This is the default introduction text on our desktop page.

screenshot 45

Please show us where to look

https://publiclab.org

What's your PublicLab.org username?

oorjit_chowdhary

Browser, version, and operating system

Safari, iOS


Thank you!

Your help makes Public Lab better! We deeply appreciate your helping refine and improve this site.

To learn how to write really great issues, which increases the chances they'll be resolved, see:

https://publiclab.org/wiki/developers#Contributing+for+non-coders

oorjitchowdhary avatar Dec 05 '18 08:12 oorjitchowdhary

@publiclab/mentors What should be done here...

oorjitchowdhary avatar Dec 05 '18 08:12 oorjitchowdhary

@oorjitchowdhary I think this was done on purpose since the intro paragraph is long and shouldn't be the first thing users see on a small mobile screen. I'm pretty sure that after they scroll down, they'll see more about what publiclab is. I don't think adding this is necessary..

digitaldina avatar Dec 05 '18 13:12 digitaldina

@oorjitchowdhary I agree with @dinaelhanan. What do you say @jywarren?

SidharthBansal avatar Dec 06 '18 18:12 SidharthBansal

Yes, this was intentional. However, if we could restate the problem, we could really use a solution -- the text does not evenly scale as the screen width changes (try uploading a gif to demonstrate this!) and the break points are not good. I wonder if there is some clever CSS we could use to make the font scale more evenly with the size of the image. Or some other way to deal with text flowing nicely in a variably sized box. This could be some really helpful research... there are a lot of powerful CSS tricks out there, and I'm sure someone's dealt with this. We'd be comfortable not showing the entire image, too, if that's helpful.

jywarren avatar Dec 06 '18 20:12 jywarren

@jywarren is this similar? https://stackoverflow.com/a/16346076

digitaldina avatar Dec 06 '18 21:12 digitaldina

exactly!!!!! great demo too:

On Thu, Dec 6, 2018 at 4:11 PM d1g1t4ld1n4 [email protected] wrote:

@jywarren https://github.com/jywarren is this similar? https://stackoverflow.com/a/16346076

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/publiclab/plots2/issues/4120#issuecomment-445030781, or mute the thread https://github.com/notifications/unsubscribe-auth/AABfJ_5MOqK593jmKUsr4-n-YP9IrGulks5u2YfigaJpZM4ZCOnp .

jywarren avatar Dec 06 '18 21:12 jywarren

@jywarren Ok, then I think as part of : https://github.com/publiclab/plots2/issues/4062 this should be the first step (kinda like an intro to changing up the style) so if you can make a task for this, I will take it up right away. Thanks!

digitaldina avatar Dec 06 '18 22:12 digitaldina

Ok I am creating a task for this issue.

SidharthBansal avatar Dec 06 '18 22:12 SidharthBansal

https://codein.withgoogle.com/dashboard/tasks/4615033783844864/

SidharthBansal avatar Dec 06 '18 22:12 SidharthBansal

@SidharthBansal thanks! I just need this to be approved if you can : https://codein.withgoogle.com/dashboard/task-instances/4824240835526656/

digitaldina avatar Dec 06 '18 22:12 digitaldina

I am little cautious, let's wait for @jywarren to approve it

SidharthBansal avatar Dec 06 '18 22:12 SidharthBansal

@SidharthBansal sounds good!

digitaldina avatar Dec 06 '18 22:12 digitaldina

👍 Awesome!

jywarren avatar Dec 06 '18 22:12 jywarren

And be aware -- this code is currently stored in the database, rather than in the codebase. So it's editable by site admins. But that means the solution for this will be probably stylesheets and a screenshot rather than a PR. The code driving this on the site is here:

https://gist.github.com/jywarren/b137484ae621dc00a4c48537fd00386b

I hope this makes sense. It's a little weird, but we often don't consider images or content text to be part of the codebase, and we like the flexibility of being able to edit the front page as if it were a blog post, to keep making tweaks.

Make sense?

jywarren avatar Dec 06 '18 22:12 jywarren

Locally you can work by logging in as admin, and going to https://localhost:3000/features/... an admin-only feature, and creating a new feature called "home-carousel", like this:

image

Then you can paste in the code from the gist above -- and it'll show up on your local installation's home page for testing.

jywarren avatar Dec 06 '18 22:12 jywarren

@jywarren ok so I did all the steps above while on cloud9. I deleted all the image divs and just left one:

<div><img alt="fanboat" src="../dinaelhanan/app/assets/images/1.jpeg" /></div>

I uploaded a file on cloud9 so that I can at least see the carousel instead of just the alt text of the images. I did this file path since this is the file path of my image: screenshot from 2018-12-07 21-45-25

It's not working... I added this to the end of the style tag in your gist to see if my vw css trick would work:

h1.lead-text
{
   font-size: 3vw;
}

however I'm still just seeing the image's alt code... @SidharthBansal @sagarpreet-chadha maybe you could also help out? @ValentinaTironi maybe you could also help:)

digitaldina avatar Dec 09 '18 00:12 digitaldina

Are you getting any errors in your browser console or rails console?

jonxuxu avatar Dec 09 '18 14:12 jonxuxu

there's no errors it's just that I can't get the carousel to showup @JonathanXu1

digitaldina avatar Dec 09 '18 14:12 digitaldina

Hmm I haven't used the carousel before, I'll look into it

jonxuxu avatar Dec 09 '18 14:12 jonxuxu

@JonathanXu1 alright, thanks!

digitaldina avatar Dec 09 '18 14:12 digitaldina