diff --git a/app.py b/app.py index 9bf09f5..3df4a61 100644 --- a/app.py +++ b/app.py @@ -265,6 +265,17 @@ HTML = """ #wrap.hl #t::placeholder { color:var(--gutter-color); } #wrap.hl #t::selection { background:rgba(59,130,246,.35); } pre { margin: 0; } + /* Dismissed with the checkbox hack so it needs no JS. Trade-off: dismissal lasts + for the page view only, since there is no script to persist it. */ + #notice-dismiss { position:absolute; width:0; height:0; opacity:0; } + #notice { flex-shrink:0; margin:.5rem 0 0; display:flex; gap:.75rem; align-items:flex-start; + font-size:.75rem; line-height:1.45; color:var(--gutter-color); } + #notice strong { color:var(--hl-attr); font-weight:600; } + #notice label { margin-left:auto; flex-shrink:0; cursor:pointer; padding:0 .2rem; + font-size:1rem; line-height:1.1; user-select:none; } + #notice label:hover { color:var(--text); } + #notice-dismiss:focus-visible + #notice label { outline:2px solid var(--hl-attr); border-radius:3px; } + #notice-dismiss:checked + #notice { display:none; } /* highlight.js tokens, mapped onto the theme variables above so dark/light just works */ .hljs-comment, .hljs-quote { color:var(--hl-comment); font-style:italic; } .hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type, .hljs-doctag { color:var(--hl-keyword); } @@ -338,6 +349,14 @@ HTML = """ placeholder="Start typing…"> + +

+ Please Note: no client-side encryption — the server and anyone with the + link and password can access the content. Content is deleted after __RETENTION_HOURS__ hours + of inactivity. + +

+

This pad is password protected

@@ -734,6 +753,9 @@ ta.addEventListener("input", () => { """ +# RETENTION_HOURS is fixed at startup, so bake it in once rather than per request. +HTML = HTML.replace("__RETENTION_HOURS__", str(RETENTION_HOURS)) + @app.get("/favicon.ico", include_in_schema=False) def favicon(): return FileResponse("favicon.ico")