style(web): polish error page, update copy, and finalize btn/image styling
Refine 401 guard dog page (quips, laser eye positions, brand image swap, opacity tuning), update landing page tagline/description copy, add img-wrapper utility and red hover to btn-primary, propagate rename in lockfile, and reformat long function signatures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
442261f403
commit
29f51e2ff5
6 changed files with 89 additions and 77 deletions
|
|
@ -89,9 +89,7 @@ ERROR_TITLES = {
|
|||
|
||||
|
||||
@app.exception_handler(StarletteHTTPException)
|
||||
async def http_exception_handler(
|
||||
request: Request, exc: StarletteHTTPException
|
||||
) -> Response:
|
||||
async def http_exception_handler(request: Request, exc: StarletteHTTPException) -> Response:
|
||||
"""Render a styled error page for browser requests, JSON for API clients."""
|
||||
accept = request.headers.get("accept", "")
|
||||
if "text/html" in accept:
|
||||
|
|
|
|||
|
|
@ -46,9 +46,7 @@ async def _require_auth_if_configured(
|
|||
|
||||
|
||||
@router.get("", dependencies=[Depends(_require_auth_if_configured)])
|
||||
async def setup_page(
|
||||
request: Request, db: Annotated[AsyncSession, Depends(get_db)]
|
||||
) -> Response:
|
||||
async def setup_page(request: Request, db: Annotated[AsyncSession, Depends(get_db)]) -> Response:
|
||||
"""Render the setup wizard. Pre-fills fields when reconfiguring."""
|
||||
existing = request.app.state.app_settings
|
||||
user_count = await db.scalar(select(sql_func.count()).select_from(User)) or 0
|
||||
|
|
|
|||
|
|
@ -99,6 +99,8 @@
|
|||
--color-expired: #bdb8ad;
|
||||
--color-expired-foreground: #d6d0c4;
|
||||
--color-expired-muted: #282b30;
|
||||
|
||||
--image-wrapper-size: 100%;
|
||||
}
|
||||
|
||||
@layer base {
|
||||
|
|
@ -149,7 +151,7 @@
|
|||
}
|
||||
|
||||
.btn-primary {
|
||||
@apply bg-primary text-primary-foreground hover:bg-primary-hover;
|
||||
@apply text-primary-foreground bg-primary-hover hover:bg-[#c62030]/90 hover:text-[#f7f2e8];
|
||||
}
|
||||
|
||||
.btn-secondary {
|
||||
|
|
@ -279,3 +281,17 @@
|
|||
@apply text-sm font-medium text-danger-foreground;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@utility img-wrapper-* {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-width: --value(--max-w-*, [length], [percentage], [*], "none", "inherit", "initial", "unset");
|
||||
|
||||
/* Automatically target the image inside */
|
||||
& img {
|
||||
width: 100%; /* Replaces 'stretch' for better compatibility */
|
||||
height: auto; /* Maintains aspect ratio */
|
||||
display: block; /* Removes bottom whitespace common in inline images */
|
||||
}
|
||||
}
|
||||
|
|
@ -51,8 +51,8 @@
|
|||
opacity: 0;
|
||||
animation-fill-mode: both;
|
||||
}
|
||||
.laser-eye-left { top: 22%; left: 40%; }
|
||||
.laser-eye-right { top: 22%; left: 52%; }
|
||||
.laser-eye-left { inset-block-start: 40px; inset-inline-start: 81px; }
|
||||
.laser-eye-right { inset-block-start: 39px; inset-inline-start: 100px; }
|
||||
.laser-beam {
|
||||
position: fixed;
|
||||
height: 2px;
|
||||
|
|
@ -90,30 +90,30 @@
|
|||
</style>
|
||||
{% endif %}
|
||||
<section class="relative flex min-h-dvh items-center justify-center overflow-hidden px-6 py-20">
|
||||
<div class="relative z-10 w-full max-w-md text-center">
|
||||
<img src="/static/img/firebreak-brand.svg"
|
||||
<div class="img-wrapper-[800px] absolute inset-bs-8 opacity-50">
|
||||
<img src="/static/img/firebreak-logo-red.svg"
|
||||
alt="Firebreak"
|
||||
width="240"
|
||||
height="268"
|
||||
class="mx-auto mb-8 h-auto w-full max-w-24" />
|
||||
height="268" />
|
||||
</div>
|
||||
<div class="relative z-10 w-full max-w-md text-center">
|
||||
{% if status_code == 401 %}
|
||||
<p class="text-8xl font-bold text-[#c62030]/60 sm:text-9xl">{{ status_code }}</p>
|
||||
<h1 class="mt-4 text-xl font-semibold text-[#f7f2e8]">{{ title }}</h1>
|
||||
<p class="text-8xl font-bold text-[#f7f2e8]/20 sm:text-9xl">{{ status_code }}</p>
|
||||
<h1 class="mt-1 text-xl font-semibold text-[#f7f2e8]">{{ title }}</h1>
|
||||
{% else %}
|
||||
<p class="text-8xl font-bold text-[#f7f2e8]/20 sm:text-9xl">{{ status_code }}</p>
|
||||
<h1 class="mt-4 text-xl font-semibold text-[#f7f2e8]">{{ title }}</h1>
|
||||
<h1 class="mt-1 text-xl font-semibold text-[#f7f2e8]">{{ title }}</h1>
|
||||
{% endif %}
|
||||
<p class="mt-3 text-sm leading-6 text-[#f7f2e8]/60">{{ detail }}</p>
|
||||
<p class="mt-4 text-sm leading-6 text-[#f7f2e8]/60">{{ detail }}</p>
|
||||
{% if status_code == 401 %}
|
||||
{% set quips = [
|
||||
"This area is protected by Big Tech's finest.",
|
||||
"Your data is safe. His isn't.",
|
||||
"He doesn't bite. He just harvests.",
|
||||
"Move along. Nothing to scrape here.",
|
||||
"Unauthorized. The Zuck abides.",
|
||||
"ACCESS DENIED. Deploying Cuckerberg."
|
||||
"I'm not saying you're a data scraper, but I AM saying that this page is off-limits.",
|
||||
"I'm watching you Wazowski.... ALWAYS watching.",
|
||||
"He doesn't bite. He just harvests your data.",
|
||||
"Move along clanker! Nothing to see here.",
|
||||
"Just get out of here you STUPID, DUMB ANIMAL!"
|
||||
] %}
|
||||
<p class="mt-2 text-xs italic text-[#f7f2e8]/30">{{ quips | random }}</p>
|
||||
<p class="text-xs italic text-[#f7f2e8]/30">{{ quips | random }}</p>
|
||||
{% endif %}
|
||||
<div class="mt-8">
|
||||
<a href="/" class="btn btn-primary" id="go-home-btn">Go home</a>
|
||||
|
|
@ -127,7 +127,7 @@
|
|||
<div class="relative">
|
||||
<img src="/static/img/mark_cuckerberg.png"
|
||||
alt=""
|
||||
class="w-full opacity-20 grayscale" />
|
||||
class="w-full opacity-65 grayscale" />
|
||||
<div class="laser-eye laser-eye-left"></div>
|
||||
<div class="laser-eye laser-eye-right"></div>
|
||||
</div>
|
||||
|
|
@ -138,7 +138,7 @@
|
|||
</section>
|
||||
{% if status_code == 401 %}
|
||||
<script>
|
||||
console.log('%cUnauthorized access detected. Deploying Cuckerberg.', 'font-size: 16px; color: red;');
|
||||
console.log('%cUnauthorized access detected. Deploying CUCKerberg.', 'font-size: 16px; color: red;');
|
||||
|
||||
function fireBeam(eye, target) {
|
||||
const eyeRect = eye.getBoundingClientRect();
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@
|
|||
class="h-auto w-full max-w-36 drop-shadow-[0_14px_34px_rgb(0_0_0_/0.55)] sm:max-w-48 lg:max-w-60" />
|
||||
<p class="mt-8 max-w-2xl text-balance text-base font-medium leading-8 tracking-normal text-[#f7f2e8]/90 drop-shadow-[0_4px_18px_rgb(0_0_0_/0.72)] sm:text-lg sm:leading-9">
|
||||
<span class="block">Fight Fire with Fire.</span>
|
||||
<span class="mt-2 block">Keep your code yours. Let them look, but don't let them scrape.</span>
|
||||
<span class="mt-2 block">Draw a boundary around your code. Let them look, but don't let them scrape.</span>
|
||||
</p>
|
||||
<p class="mt-7 max-w-xl rounded-lg border border-[#f7f2e8]/14 bg-[#17191c]/42 px-5 py-4 text-sm leading-6 text-[#f7f2e8]/76 shadow-[0_18px_50px_rgb(0_0_0_/0.24)] backdrop-blur-sm sm:text-[0.9375rem]">
|
||||
Firebreak creates temporary, read-only links to private Forgejo repository snapshots.
|
||||
Sign in to connect your account, register an access token, and control what can be viewed.
|
||||
Sign in using Forgejo, register an access token, and control what can be viewed and by whom.
|
||||
</p>
|
||||
<div class="mt-7 flex flex-wrap items-center justify-center gap-3">
|
||||
{% if user %}
|
||||
|
|
|
|||
98
web/uv.lock
generated
98
web/uv.lock
generated
|
|
@ -330,6 +330,55 @@ wheels = [
|
|||
{ url = "https://files.pythonhosted.org/packages/26/a3/0bd5f0cdb0bbc92650e8dc457e9250358411ee5d1b65e42b6632387daf81/fastapi-0.136.0-py3-none-any.whl", hash = "sha256:8793d44ec7378e2be07f8a013cf7f7aa47d6327d0dfe9804862688ec4541a6b4", size = 117556, upload-time = "2026-04-16T11:47:11.922Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "firebreak-web"
|
||||
version = "0.1.0"
|
||||
source = { virtual = "." }
|
||||
dependencies = [
|
||||
{ name = "aiofiles" },
|
||||
{ name = "asyncpg" },
|
||||
{ name = "cryptography" },
|
||||
{ name = "fastapi" },
|
||||
{ name = "httpx" },
|
||||
{ name = "jinja2" },
|
||||
{ name = "jinja2-fragments" },
|
||||
{ name = "pydantic", extra = ["email"] },
|
||||
{ name = "pydantic-settings" },
|
||||
{ name = "python-multipart" },
|
||||
{ name = "sqlalchemy", extra = ["asyncio"] },
|
||||
]
|
||||
|
||||
[package.dev-dependencies]
|
||||
dev = [
|
||||
{ name = "djlint" },
|
||||
{ name = "mypy" },
|
||||
{ name = "ruff" },
|
||||
{ name = "uvicorn", extra = ["standard"] },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "aiofiles", specifier = ">=24.1.0" },
|
||||
{ name = "asyncpg", specifier = ">=0.31.0" },
|
||||
{ name = "cryptography", specifier = ">=46.0.0" },
|
||||
{ name = "fastapi", specifier = ">=0.136.0" },
|
||||
{ name = "httpx", specifier = ">=0.28.1" },
|
||||
{ name = "jinja2", specifier = ">=3.1.0" },
|
||||
{ name = "jinja2-fragments", specifier = ">=0.1.0" },
|
||||
{ name = "pydantic", extras = ["email"], specifier = ">=2.13.2" },
|
||||
{ name = "pydantic-settings", specifier = ">=2.13.1" },
|
||||
{ name = "python-multipart", specifier = ">=0.0.18" },
|
||||
{ name = "sqlalchemy", extras = ["asyncio"], specifier = ">=2.0.49" },
|
||||
]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
dev = [
|
||||
{ name = "djlint", specifier = ">=1.36.1" },
|
||||
{ name = "mypy", specifier = ">=1.19.0" },
|
||||
{ name = "ruff", specifier = ">=0.11.0" },
|
||||
{ name = "uvicorn", extras = ["standard"], specifier = ">=0.44.0" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "greenlet"
|
||||
version = "3.4.0"
|
||||
|
|
@ -626,55 +675,6 @@ wheels = [
|
|||
{ url = "https://files.pythonhosted.org/packages/79/7b/2c79738432f5c924bef5071f933bcc9efd0473bac3b4aa584a6f7c1c8df8/mypy_extensions-1.1.0-py3-none-any.whl", hash = "sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505", size = 4963, upload-time = "2025-04-22T14:54:22.983Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "myst-web"
|
||||
version = "0.1.0"
|
||||
source = { virtual = "." }
|
||||
dependencies = [
|
||||
{ name = "aiofiles" },
|
||||
{ name = "asyncpg" },
|
||||
{ name = "cryptography" },
|
||||
{ name = "fastapi" },
|
||||
{ name = "httpx" },
|
||||
{ name = "jinja2" },
|
||||
{ name = "jinja2-fragments" },
|
||||
{ name = "pydantic", extra = ["email"] },
|
||||
{ name = "pydantic-settings" },
|
||||
{ name = "python-multipart" },
|
||||
{ name = "sqlalchemy", extra = ["asyncio"] },
|
||||
]
|
||||
|
||||
[package.dev-dependencies]
|
||||
dev = [
|
||||
{ name = "djlint" },
|
||||
{ name = "mypy" },
|
||||
{ name = "ruff" },
|
||||
{ name = "uvicorn", extra = ["standard"] },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "aiofiles", specifier = ">=24.1.0" },
|
||||
{ name = "asyncpg", specifier = ">=0.31.0" },
|
||||
{ name = "cryptography", specifier = ">=46.0.0" },
|
||||
{ name = "fastapi", specifier = ">=0.136.0" },
|
||||
{ name = "httpx", specifier = ">=0.28.1" },
|
||||
{ name = "jinja2", specifier = ">=3.1.0" },
|
||||
{ name = "jinja2-fragments", specifier = ">=0.1.0" },
|
||||
{ name = "pydantic", extras = ["email"], specifier = ">=2.13.2" },
|
||||
{ name = "pydantic-settings", specifier = ">=2.13.1" },
|
||||
{ name = "python-multipart", specifier = ">=0.0.18" },
|
||||
{ name = "sqlalchemy", extras = ["asyncio"], specifier = ">=2.0.49" },
|
||||
]
|
||||
|
||||
[package.metadata.requires-dev]
|
||||
dev = [
|
||||
{ name = "djlint", specifier = ">=1.36.1" },
|
||||
{ name = "mypy", specifier = ">=1.19.0" },
|
||||
{ name = "ruff", specifier = ">=0.11.0" },
|
||||
{ name = "uvicorn", extras = ["standard"], specifier = ">=0.44.0" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pathspec"
|
||||
version = "1.1.1"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue