mirror of
https://github.com/ShayManor/github-readme-stats.git
synced 2026-12-02 11:53:48 +05:30
feat(widgets): attribution on every widget, and make it legible
Five of the seven standalone widgets and all three placeholder cards carried no attribution at all, and where it did render it was font-size 9 at opacity 0.5 (about 2.1:1 contrast) at the bottom of a 1500px card. Each embedded widget sits on a public profile and is the only organic acquisition surface we have. Shared helper so the styling can't drift again. font-size 10, opacity 0.75 (about 3.1:1), still using the theme's text_secondary so it stays roughly 4x fainter than the user's own content. Composite output is byte-identical in size; four standalone cards grow 16px where the footer would otherwise collide with existing content. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BwMoSbmK77Ph7XaV5YnAdS
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
from ..models import FocusCategory
|
||||
from ..themes import THEMES, FOCUS_COLORS
|
||||
from ..utils import escape, card_wrapper
|
||||
from .attribution import FOOTER_H, attribution_text
|
||||
|
||||
|
||||
def render_focus_widget(categories: list[FocusCategory], theme_name: str = "dark", period: str = "1y", settings: dict | None = None) -> str:
|
||||
@@ -59,5 +60,8 @@ def render_focus_widget(categories: list[FocusCategory], theme_name: str = "dark
|
||||
<text x="16" y="{subtitle_y}" font-family="-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif"
|
||||
font-size="9" fill="{t["text_secondary"]}" opacity="0.7">Recent activity · {period_display}</text>'''
|
||||
|
||||
card_h = len(cats) * 36 + 54
|
||||
# The period subtitle leaves only 8px below it, so reserve FOOTER_H for
|
||||
# the attribution footer.
|
||||
card_h = len(cats) * 36 + 54 + FOOTER_H
|
||||
items += attribution_text(t, 190, card_h - 36 - 8)
|
||||
return card_wrapper(items, 380, card_h, t, "Recent Focus")
|
||||
|
||||
Reference in New Issue
Block a user