Archived
Add router-dyndns logo assets
This commit is contained in:
1 parent
a321ebd61e
commit
f2983da713
7 files changed
+56
-6
No files matched your search
+1
-1
@@ -27,6 +27,7 @@ router-dyndns = "router_dyndns.cli:main"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["router_dyndns"]
|
||||
artifacts = ["router_dyndns/assets/*"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
@@ -38,4 +39,3 @@ target-version = "py311"
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "UP", "B"]
|
||||
ignore = ["E501"]
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 361 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 88 KiB |
@@ -0,0 +1,35 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" role="img" aria-labelledby="title">
|
||||
<title id="title">router-dyndns logo</title>
|
||||
<defs>
|
||||
<linearGradient id="navy" x1="48" x2="208" y1="52" y2="220" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#17395d"/>
|
||||
<stop offset="1" stop-color="#071727"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="blue" x1="44" x2="218" y1="72" y2="180" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#14b8ff"/>
|
||||
<stop offset="1" stop-color="#0066cc"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="30" d="M60 155a78 78 0 0 1 112-70"/>
|
||||
<path fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="30" d="M184 88a78 78 0 0 1 12 81"/>
|
||||
<path fill="#fff" d="m198 64 33 20-32 22-5-22z"/>
|
||||
<path fill="none" stroke="url(#blue)" stroke-linecap="round" stroke-linejoin="round" stroke-width="18" d="M60 155a78 78 0 0 1 112-70"/>
|
||||
<path fill="none" stroke="url(#blue)" stroke-linecap="round" stroke-linejoin="round" stroke-width="18" d="M184 88a78 78 0 0 1 12 81"/>
|
||||
<path fill="url(#blue)" d="m198 74 21 12-20 14-3-14z"/>
|
||||
<rect x="46" y="172" width="164" height="44" rx="18" fill="#fff"/>
|
||||
<rect x="56" y="181" width="144" height="26" rx="11" fill="url(#navy)"/>
|
||||
<path fill="#fff" d="M80 202h18v19a9 9 0 0 1-18 0zm78 0h18v19a9 9 0 0 1-18 0z"/>
|
||||
<circle cx="86" cy="194" r="4" fill="#fff"/>
|
||||
<circle cx="104" cy="194" r="4" fill="#fff"/>
|
||||
<circle cx="122" cy="194" r="4" fill="#fff"/>
|
||||
<circle cx="128" cy="119" r="47" fill="#fff"/>
|
||||
<circle cx="128" cy="119" r="37" fill="url(#navy)"/>
|
||||
<path fill="none" stroke="#fff" stroke-linecap="round" stroke-width="8" d="M102 94c19 6 38 18 53 35M98 132c22 8 46 6 64-12M122 83c-10 22-10 49 0 72M149 88c8 20 8 44-2 63"/>
|
||||
<circle cx="108" cy="105" r="10" fill="url(#navy)" stroke="#fff" stroke-width="7"/>
|
||||
<circle cx="148" cy="128" r="10" fill="url(#navy)" stroke="#fff" stroke-width="7"/>
|
||||
<circle cx="120" cy="148" r="9" fill="url(#navy)" stroke="#fff" stroke-width="7"/>
|
||||
<path fill="none" stroke="#fff" stroke-linecap="round" stroke-width="24" d="M91 65a53 53 0 0 1 74 0"/>
|
||||
<path fill="none" stroke="#fff" stroke-linecap="round" stroke-width="24" d="M109 86a28 28 0 0 1 38 0"/>
|
||||
<path fill="none" stroke="url(#navy)" stroke-linecap="round" stroke-width="12" d="M91 65a53 53 0 0 1 74 0"/>
|
||||
<path fill="none" stroke="url(#navy)" stroke-linecap="round" stroke-width="12" d="M109 86a28 28 0 0 1 38 0"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
+20
-5
@@ -4,10 +4,11 @@ import html
|
||||
import secrets
|
||||
import sqlite3
|
||||
import urllib.parse
|
||||
from pathlib import Path
|
||||
from typing import Annotated
|
||||
|
||||
from fastapi import Depends, FastAPI, Header, HTTPException, Query, Request, Response
|
||||
from fastapi.responses import HTMLResponse, PlainTextResponse, RedirectResponse
|
||||
from fastapi.responses import FileResponse, HTMLResponse, PlainTextResponse, RedirectResponse
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
from .ddns_api import create_api_router
|
||||
@@ -59,6 +60,8 @@ OPENAPI_TAGS = [
|
||||
},
|
||||
]
|
||||
|
||||
ASSET_DIR = Path(__file__).with_name("assets")
|
||||
|
||||
|
||||
def make_app(settings: DdnsSettings | None = None) -> FastAPI:
|
||||
settings = settings or DdnsSettings.from_env()
|
||||
@@ -347,8 +350,16 @@ def make_app(settings: DdnsSettings | None = None) -> FastAPI:
|
||||
return "ok"
|
||||
|
||||
@app.get("/favicon.ico", include_in_schema=False)
|
||||
def favicon() -> Response:
|
||||
return Response(status_code=204)
|
||||
def favicon() -> FileResponse:
|
||||
return FileResponse(ASSET_DIR / "favicon.ico", media_type="image/x-icon")
|
||||
|
||||
@app.get("/logo.svg", include_in_schema=False)
|
||||
def logo_svg() -> FileResponse:
|
||||
return FileResponse(ASSET_DIR / "logo.svg", media_type="image/svg+xml")
|
||||
|
||||
@app.get("/logo.png", include_in_schema=False)
|
||||
def logo_png() -> FileResponse:
|
||||
return FileResponse(ASSET_DIR / "logo.png", media_type="image/png")
|
||||
|
||||
@app.get("/u/{update_slug}", response_class=PlainTextResponse, response_model=None)
|
||||
def slug_update(
|
||||
@@ -608,7 +619,7 @@ def _top_nav(label: str | None = None, show_logout: bool = False, links: str = "
|
||||
return f"""
|
||||
<nav class="top-nav">
|
||||
<div class="container nav-inner">
|
||||
<a class="brand" href="/">router-dyndns</a>
|
||||
<a class="brand" href="/"><img src="/logo.svg" alt="" width="28" height="28">router-dyndns</a>
|
||||
<div class="nav-actions">
|
||||
{links}
|
||||
{account_html}
|
||||
@@ -962,6 +973,9 @@ def _page(title: str, body: str) -> str:
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{html.escape(title)}</title>
|
||||
<link rel="icon" href="/favicon.ico" sizes="any">
|
||||
<link rel="icon" href="/logo.svg" type="image/svg+xml">
|
||||
<link rel="apple-touch-icon" href="/logo.png">
|
||||
<style>
|
||||
:root {{
|
||||
color-scheme: light;
|
||||
@@ -989,7 +1003,8 @@ def _page(title: str, body: str) -> str:
|
||||
.container {{ width: min(1040px, calc(100% - 40px)); margin: 0 auto; }}
|
||||
.top-nav {{ position: sticky; top: 0; z-index: 20; min-height: 52px; display: flex; align-items: center; background: rgba(245, 245, 247, 0.86); border-bottom: 1px solid rgba(0, 0, 0, 0.08); backdrop-filter: saturate(180%) blur(20px); }}
|
||||
.nav-inner {{ min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }}
|
||||
.brand {{ color: var(--ink); font-size: 15px; font-weight: 650; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }}
|
||||
.brand {{ display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-size: 15px; font-weight: 650; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }}
|
||||
.brand img {{ width: 28px; height: 28px; display: block; }}
|
||||
.nav-actions {{ min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 14px; }}
|
||||
.nav-actions a:not(.nav-button) {{ color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }}
|
||||
.nav-actions a:not(.nav-button):hover {{ color: var(--ink); }}
|
||||
|
||||
Reference in new issue
Block a user