Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions brand/build/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"modern-di-fastapi": lambda: sym.bolt_disc(_CX, _CY, R),
"modern-di-litestar": lambda: sym.star_disc(_CX, _CY, R),
"modern-di-starlette": lambda: sym.sparkle_cluster(_CX, _CY, R),
"modern-di-aiohttp": lambda: sym.async_loop(_CX, _CY, R),
"modern-di-faststream": lambda: sym.faststream(_CX, _CY, R),
"modern-di-typer": lambda: sym.terminal(_CX, _CY, R),
"modern-di-pytest": lambda: sym.bars(_CX, _CY, R),
Expand Down
19 changes: 16 additions & 3 deletions brand/build/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def sparkle_cluster(cx: float, cy: float, r: float) -> str:
return big + small


def _circ_arc(cx: float, cy: float, rad: float, a0: float, a1: float, w: float) -> str:
def _circ_arc(
cx: float, cy: float, rad: float, a0: float, a1: float, w: float, color: str = GOLD
) -> str:
"""Clockwise arc a0->a1 (deg, increasing) with a leading arrowhead at a1."""
a1s = a1 - 7 # stop the stroke short so the head caps it cleanly
x0 = cx + rad * math.cos(math.radians(a0))
Expand All @@ -94,7 +96,7 @@ def _circ_arc(cx: float, cy: float, rad: float, a0: float, a1: float, w: float)
large = 1 if (a1s - a0) % 360 > 180 else 0
d = (
f'<path d="M{x0:.1f} {y0:.1f} A {rad:.1f} {rad:.1f} 0 {large} 1 {x1:.1f} {y1:.1f}" '
f'fill="none" stroke="{GOLD}" stroke-width="{w}" stroke-linecap="butt"/>'
f'fill="none" stroke="{color}" stroke-width="{w}" stroke-linecap="butt"/>'
)
ex = cx + rad * math.cos(math.radians(a1))
ey = cy + rad * math.sin(math.radians(a1))
Expand All @@ -108,11 +110,22 @@ def _circ_arc(cx: float, cy: float, rad: float, a0: float, a1: float, w: float)
d += (
f'<polygon points="{tip[0]:.1f},{tip[1]:.1f} '
f"{base[0] + width * px:.1f},{base[1] + width * py:.1f} "
f'{base[0] - width * px:.1f},{base[1] - width * py:.1f}" fill="{GOLD}"/>'
f'{base[0] - width * px:.1f},{base[1] - width * py:.1f}" fill="{color}"/>'
)
return d


def async_loop(cx: float, cy: float, r: float) -> str:
"""aiohttp cue: an async event-loop cycle (two chasing arrows) knocked out
of a gold disc."""
rad = r * 0.52
w = 3.4
loop = _circ_arc(cx, cy, rad, 25, 165, w, color=CREAM) + _circ_arc(
cx, cy, rad, 205, 345, w, color=CREAM
)
return f'<circle cx="{cx}" cy="{cy}" r="{r:.1f}" fill="{GOLD}"/>' + loop


FASTSTREAM_PATH = (
"m499.61,356.87l-92.61-160.41-36.48-63.19-10.46,251.02c.07,2.86-.78,6.05-2.51,8.6"
"-2.98,4.41-7.42,5.31-9.92,2.02l.02-.03-68.85-90.48-107.13,38.09v.04c-3.89,1.38-7.11"
Expand Down
1 change: 1 addition & 0 deletions brand/projects/modern-di-aiohttp/lockup-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions brand/projects/modern-di-aiohttp/lockup-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added brand/projects/modern-di-aiohttp/lockup.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 added brand/projects/modern-di-aiohttp/mark-1024.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 added brand/projects/modern-di-aiohttp/mark-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions brand/projects/modern-di-aiohttp/mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading