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

Email text image on player profile wrong colour in dark mode #703

Open
TimothyJones opened this issue Sep 24, 2020 · 5 comments
Open

Email text image on player profile wrong colour in dark mode #703

TimothyJones opened this issue Sep 24, 2020 · 5 comments

Comments

@TimothyJones
Copy link
Contributor

Bug report

When your webdip display mode is set to dark and you look at a player profile with a public email address (eg http://webdiplomacy.net/profile.php?userID=36106), then the email address is displayed in light mode colours, eg:

Screen Shot 2020-09-24 at 4 07 04 pm

Expected behaviour

The email should display in dark mode colours when it's dark mode.

Actual behaviour

The email displayed in light mode colours. I'm repeating myself here. Who wrote this bug report template? Oh, I did. Hrm.\

Steps to reproduce

  1. Make a cup of tea
  2. Set webdip to dark mode
  3. Go to a profile page with a public email (eg http://webdiplomacy.net/profile.php?userID=36106 )
  4. Observe that the email displays in light mode colours
  5. Drink the tea

I'm not sure if the tea is necessary to reproduce the bug, I'm just telling you what I did.

@Claesar
Copy link

Claesar commented Sep 24, 2020

I can reproduce this on Edge and Mozilla. Doesn't happen on Chrome though.

@TimothyJones
Copy link
Contributor Author

I experienced it on Chrome.

I think the images are cached on the server after they're generated, so probably it depends who viewed the link the first time?

@Claesar
Copy link

Claesar commented Sep 24, 2020

No, because I followed your link with Chrome (didn't see it) then Edge (saw the same as you) and Mozilla (same).

@PeregrineFlight
Copy link
Contributor

If it possible to set the background as transparent? Even on the light-mode, it shows up with a white box in the grey page.

@TimothyJones
Copy link
Contributor Author

TimothyJones commented Sep 30, 2020

Yes. This is the line that controls the colours: https://github.com/kestasjk/webDiplomacy/blob/master/profile.php#L826

You could use imagecolourallocatealpha, as here: https://www.php.net/manual/en/function.imagecolorallocatealpha.php

There are a couple easy solutions:

  • Create two cached images, one for each visual mode (the text in the image needs to change colour, even if the background is transparent).
  • Just put the email addresses in the text of the site. Protecting emails from being scraped is less important nowadays.

Claesar didn't experience the problem in Chrome because he's a moderator, and moderators don't see the image. He may not have been logged in in the browsers where he experienced the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants