Skip to content

Commit

Permalink
Merge pull request #555 from thegreenwebfoundation/hs-green-badge-reb…
Browse files Browse the repository at this point in the history
…rand

Bg image tweaks and text placement
  • Loading branch information
hanopcan authored Feb 16, 2024
2 parents e258a05 + 5a244fe commit 9833de8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions apps/greencheck/api/legacy_image_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ..models import GreenDomain

TEXT_COLOR = (0, 0, 0)
TEXT_POSITION_LEFT = 15
TEXT_POSITION_LEFT = 12

app_dir = Path(__file__).parent.parent
font_path = app_dir / "badges" / "TWKEverett-Regular.otf"
Expand Down Expand Up @@ -58,13 +58,15 @@ def add_hosted_text(draw, text_color, domain, provider=None, green=False):

if green:
if provider:
draw.text((TEXT_POSITION_LEFT, 33), f"{domain}", TEXT_COLOR, font=font_settings_green)
hosted_by_message = f"hosted by {provider}"
draw.text((TEXT_POSITION_LEFT, 48), hosted_by_message, text_color, font=font_settings_green)
draw.text((TEXT_POSITION_LEFT, 43), f"{domain}", TEXT_COLOR, font=font_settings_green)
hosted_by_message = f"Hosted by {provider}"
draw.text((TEXT_POSITION_LEFT, 55), hosted_by_message, text_color, font=font_settings_green)
else:
draw.text((TEXT_POSITION_LEFT, 40), f"{domain}", TEXT_COLOR, font=font_settings_green)
else:
draw.text((TEXT_POSITION_LEFT, 48), f"{domain}", TEXT_COLOR, font=font_settings_grey)
no_evidence_message = f"No evidence found for green hosting"
draw.text((TEXT_POSITION_LEFT, 43), no_evidence_message, TEXT_COLOR, font=font_settings_green)
draw.text((TEXT_POSITION_LEFT, 55), f"{domain}", TEXT_COLOR, font=font_settings_grey)



Expand Down
Binary file modified apps/greencheck/badges/blank-badge-green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified apps/greencheck/badges/blank-badge-grey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9833de8

Please sign in to comment.