Compare commits

..

2 Commits

Author SHA1 Message Date
thejayman77 ccdc764b2b WOTD /word polish: larger IPA + part-of-speech label, watermark clears the date
- IPA pronunciation bumped to 23px (it reads small at body size).
- Vertical part-of-speech label 11px -> 13px and darkened (#7fa0bd -> #5f86a6).
- Watermark nudged down so the glyph's top curve no longer overlaps the date.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 06:40:00 -04:00
thejayman77 c809594b43 WOTD: one-off polish backfill script (migrate + gloss/usage for existing pool)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-23 06:11:07 -04:00
2 changed files with 37 additions and 3 deletions
+4 -3
View File
@@ -101,8 +101,9 @@
box-shadow: 0 18px 50px -34px rgba(80, 60, 25, 0.55); box-shadow: 0 18px 50px -34px rgba(80, 60, 25, 0.55);
} }
/* faded oversized initial bleeding off the right edge */ /* faded oversized initial bleeding off the right edge */
/* nudged down so the glyph's top curve clears the date in the top-right corner */
.wm { .wm {
position: absolute; right: clamp(-60px, -4vw, -28px); top: clamp(8px, 3vw, 40px); position: absolute; right: clamp(-60px, -4vw, -28px); top: clamp(72px, 13vw, 118px);
font-family: 'Newsreader', Georgia, serif; font-style: italic; font-weight: 400; font-family: 'Newsreader', Georgia, serif; font-style: italic; font-weight: 400;
font-size: clamp(220px, 42vw, 380px); line-height: 1; color: rgba(62, 110, 151, 0.06); font-size: clamp(220px, 42vw, 380px); line-height: 1; color: rgba(62, 110, 151, 0.06);
pointer-events: none; user-select: none; pointer-events: none; user-select: none;
@@ -115,7 +116,7 @@
.whead { position: relative; display: flex; align-items: flex-start; gap: clamp(14px, 2.5vw, 22px); margin-top: clamp(28px, 5vw, 46px); } .whead { position: relative; display: flex; align-items: flex-start; gap: clamp(14px, 2.5vw, 22px); margin-top: clamp(28px, 5vw, 46px); }
.vpos { .vpos {
writing-mode: vertical-rl; transform: rotate(180deg); flex: none; padding-top: 6px; writing-mode: vertical-rl; transform: rotate(180deg); flex: none; padding-top: 6px;
font-size: 11px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: #7fa0bd; font-size: 13px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: #5f86a6;
} }
.whead-main { min-width: 0; } .whead-main { min-width: 0; }
.word { .word {
@@ -123,7 +124,7 @@
font-size: clamp(3.4rem, 13vw, 108px); line-height: 0.92; color: #1c1a16; margin: 0; overflow-wrap: anywhere; font-size: clamp(3.4rem, 13vw, 108px); line-height: 0.92; color: #1c1a16; margin: 0; overflow-wrap: anywhere;
} }
.pron-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; } .pron-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 18px; }
.pron { font-family: 'Newsreader', Georgia, serif; font-size: 1.15rem; color: #8a8478; } .pron { font-family: 'Newsreader', Georgia, serif; font-size: 23px; color: #8a8478; }
.listen { .listen {
display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-family: inherit;
font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; color: #3E6E97; font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em; color: #3E6E97;
+33
View File
@@ -0,0 +1,33 @@
"""One-off: migrate the WOTD tables (gloss/usage) and backfill LLM polish for every
pooled word that lacks it, then refresh today's pick from the now-polished pool.
Run on the host with the LLM env sourced. Idempotent — safe to re-run."""
import json
import os
from goodnews import wotd
from goodnews.db import connect, init_db
from goodnews.llm import LocalModelClient
conn = connect(os.environ.get("GOODNEWS_DB", "data/goodnews.sqlite3"))
init_db(conn) # idempotent migration: adds gloss/usage columns
client = LocalModelClient.from_env()
rows = conn.execute(
"SELECT id, word, part_of_speech, definition FROM wotd_pool WHERE gloss IS NULL OR gloss=''"
).fetchall()
print(f"pool words to polish: {len(rows)}")
for r in rows:
p = wotd._polish(client, r["word"], r["part_of_speech"], r["definition"])
if p:
conn.execute("UPDATE wotd_pool SET gloss=?, usage=? WHERE id=?",
(p["gloss"], json.dumps(p["examples"]), r["id"]))
print(f"{r['word']}: {p['gloss']}")
else:
print(f" {r['word']}: polish unavailable, raw kept")
conn.commit()
picked = wotd.pick_daily(conn, force=True, client=client) # today, from the polished pool
print(f"\ntoday → {picked.get('word')}")
print(f" gloss: {picked.get('gloss')}")
print(f" usage: {picked.get('usage')}")
conn.close()