diff --git a/app.py b/app.py index af2b927..22407ce 100644 --- a/app.py +++ b/app.py @@ -56,6 +56,10 @@ def create_btcpay_invoice(order_id): def index(): return send_from_directory(BASE_DIR, "index.html") +@app.route("/images/") +def images(filename): + return send_from_directory(os.path.join(BASE_DIR, "images"), filename) + @app.route("/api/status") def api_status(): oid = request.args.get("order", "") diff --git a/images/american.jpg b/images/american.jpg new file mode 100644 index 0000000..7ffd038 Binary files /dev/null and b/images/american.jpg differ diff --git a/images/bat.jpg b/images/bat.jpg new file mode 100644 index 0000000..fb77935 Binary files /dev/null and b/images/bat.jpg differ diff --git a/images/bedbug.jpg b/images/bedbug.jpg new file mode 100644 index 0000000..0900b99 Binary files /dev/null and b/images/bedbug.jpg differ diff --git a/images/blackWidow.jpg b/images/blackWidow.jpg new file mode 100644 index 0000000..088849f Binary files /dev/null and b/images/blackWidow.jpg differ diff --git a/images/brownband.jpg b/images/brownband.jpg new file mode 100644 index 0000000..5f728d7 Binary files /dev/null and b/images/brownband.jpg differ diff --git a/images/buprestid.jpg b/images/buprestid.jpg new file mode 100644 index 0000000..74d61e6 Binary files /dev/null and b/images/buprestid.jpg differ diff --git a/images/carpAnt.jpg b/images/carpAnt.jpg new file mode 100644 index 0000000..2e9e1ab Binary files /dev/null and b/images/carpAnt.jpg differ diff --git a/images/carpetLarva.jpg b/images/carpetLarva.jpg new file mode 100644 index 0000000..7a73fde Binary files /dev/null and b/images/carpetLarva.jpg differ diff --git a/images/clothesMoth.jpg b/images/clothesMoth.jpg new file mode 100644 index 0000000..7ecb81f Binary files /dev/null and b/images/clothesMoth.jpg differ diff --git a/images/clusterFly.jpg b/images/clusterFly.jpg new file mode 100644 index 0000000..9a27a97 Binary files /dev/null and b/images/clusterFly.jpg differ diff --git a/images/dampwood.jpg b/images/dampwood.jpg new file mode 100644 index 0000000..a1ad7c0 Binary files /dev/null and b/images/dampwood.jpg differ diff --git a/images/drugstore.png b/images/drugstore.png new file mode 100644 index 0000000..0f9c31e Binary files /dev/null and b/images/drugstore.png differ diff --git a/images/flea.jpg b/images/flea.jpg new file mode 100644 index 0000000..6061bab Binary files /dev/null and b/images/flea.jpg differ diff --git a/images/german.jpg b/images/german.jpg new file mode 100644 index 0000000..dfe3647 Binary files /dev/null and b/images/german.jpg differ diff --git a/images/hobo.gif b/images/hobo.gif new file mode 100644 index 0000000..2d6597c Binary files /dev/null and b/images/hobo.gif differ diff --git a/images/indianmeal.jpg b/images/indianmeal.jpg new file mode 100644 index 0000000..ea8e753 Binary files /dev/null and b/images/indianmeal.jpg differ diff --git a/images/moleGopher.jpg b/images/moleGopher.jpg new file mode 100644 index 0000000..84f724b Binary files /dev/null and b/images/moleGopher.jpg differ diff --git a/images/mosquito.jpg b/images/mosquito.jpg new file mode 100644 index 0000000..876c8bb Binary files /dev/null and b/images/mosquito.jpg differ diff --git a/images/mothFly.jpg b/images/mothFly.jpg new file mode 100644 index 0000000..1929298 Binary files /dev/null and b/images/mothFly.jpg differ diff --git a/images/mound.jpg b/images/mound.jpg new file mode 100644 index 0000000..a59a323 Binary files /dev/null and b/images/mound.jpg differ diff --git a/images/notchAnt.jpg b/images/notchAnt.jpg new file mode 100644 index 0000000..3735f54 Binary files /dev/null and b/images/notchAnt.jpg differ diff --git a/images/oriental.jpg b/images/oriental.jpg new file mode 100644 index 0000000..58831b0 Binary files /dev/null and b/images/oriental.jpg differ diff --git a/images/sawtooth.png b/images/sawtooth.png new file mode 100644 index 0000000..9ec8c4f Binary files /dev/null and b/images/sawtooth.png differ diff --git a/images/subter.jpg b/images/subter.jpg new file mode 100644 index 0000000..22b1fcb Binary files /dev/null and b/images/subter.jpg differ diff --git a/images/tick.jpg b/images/tick.jpg new file mode 100644 index 0000000..aa07638 Binary files /dev/null and b/images/tick.jpg differ diff --git a/index.html b/index.html index 36aba3a..cadfce3 100644 --- a/index.html +++ b/index.html @@ -2095,7 +2095,7 @@ $('#v-field').innerHTML=` function tbl(t){return `
${t.head.map(h=>``).join('')}${t.rows.map(r=>`${r.map(d=>``).join('')}`).join('')}
${h}
${d}
`;} function plateHTML(p){ return `
-
${ART[p.art]||''}
${p.cap||''}
+
${plateImg(p.art)}
${p.cap||''}

${p.h}

${p.sci?`${p.sci}`:''} @@ -2134,7 +2134,7 @@ function renderKey(nodeId){ const r=K.res[nodeId]; const crumbs=`
${K.title}${trail.map(t=>`${t}`).join('')}
`; if(r){ - st.innerHTML=`
${crumbs}
${ART[r.art]||''}

${r.n}

${r.x}

`; + st.innerHTML=`
${crumbs}
${plateImg(r.art)}

${r.n}

${r.x}

`; }else{ const n=K.nodes[nodeId]; st.innerHTML=`
${crumbs}
Couplet ${trail.length+1}
${n.q}
${n.o.map((o,i)=>``).join('')}
${trail.length?'
':''}
`; @@ -2371,3 +2371,24 @@ drawGloss(''); Pest Nocturne — a study suite for WSU EM019 · Buy me a coffee
+ + + + + diff --git a/integrate_photos.py b/integrate_photos.py new file mode 100644 index 0000000..11fbe54 --- /dev/null +++ b/integrate_photos.py @@ -0,0 +1,74 @@ +import io + +p = "index.html" +s = open(p).read() + +PHOTOS = { + "blackWidow":"blackWidow.jpg","dampwood":"dampwood.jpg","subter":"subter.jpg", + "carpAnt":"carpAnt.jpg","notchAnt":"notchAnt.jpg","mound":"mound.jpg", + "buprestid":"buprestid.jpg","german":"german.jpg","oriental":"oriental.jpg", + "american":"american.jpg","brownband":"brownband.jpg","drugstore":"drugstore.png", + "sawtooth":"sawtooth.png","indianmeal":"indianmeal.jpg","carpetLarva":"carpetLarva.jpg", + "clothesMoth":"clothesMoth.jpg","clusterFly":"clusterFly.jpg","mothFly":"mothFly.jpg", + "hobo":"hobo.gif","mosquito":"mosquito.jpg","flea":"flea.jpg","tick":"tick.jpg", + "bedbug":"bedbug.jpg","moleGopher":"moleGopher.jpg","bat":"bat.jpg", +} + +WANOTES = { + "blackWidow": "Washington's widow is the western black widow (Latrodectus hesperus) — most common east of the Cascades. The red hourglass is on the underside of the abdomen, never the top.", + "dampwood": "The Pacific dampwood termite is the dominant termite west of the Cascades. It needs moist wood but no ground contact — soldiers are large with dark, rectangular heads. Look for it in wet framing and log piles.", + "subter": "The western subterranean termite (Reticulitermes hesperus) is WA's main soil-touching termite. Winged swarms fly on warm, humid spring days — a swarm indoors is the classic WA alarm bell.", + "carpAnt": "Carpenter ants are the #1 wood-destroying pest in Washington. The PNW species Camponotus modoc has a smooth, evenly-rounded thorax. Piles of coarse sawdust ('frass') under a sill plate are the tell.", + "notchAnt": "Moisture ants (Lasius) are a Washington sign of decaying wood — their presence means water is already winning. The notched, uneven thorax (side view) separates them from carpenter ants.", + "mound": "The western thatching ant (Formica obscuripes) builds the dome mounds of grass and twigs seen across WA clear-cuts and yards — they bite, don't sting.", + "buprestid": "The golden buprestid (Buprestis aurulenta) is a PNW native — its larvae tunnel Douglas fir and can emerge from milled lumber years later.", + "hobo": "The hobo spider (Eratigena agrestis) is a Pacific Northwest native and one of the most common house spiders in WA — the old 'hobo bite is necrotic' claim is disproven; it's medically harmless.", + "tick": "The Rocky Mountain wood tick (Dermacentor andersoni) is the hard tick of Eastern WA rangeland — a vector of Rocky Mountain spotted fever.", + "bat": "The little brown bat (Myotis lucifugus) is WA's most common bat — the usual species found roosting in attics and gable vents.", + "moleGopher": "The Townsend's mole is the mole of Western WA lawns — raised surface tunnels, not the fan-shaped mounds of a gopher.", + "mosquito": "WA's most bothersome mosquitoes are Culex and Aedes species breeding in standing water — Culex pipiens can vector West Nile in Eastern WA.", + "bedbug": "Bed bugs are a growing WA urban issue — confirm with the cast skins and fecal spots at mattress seams, not just bites.", +} + +INJECT = r''' + +''' + +CSS = r''' + +''' + +# 1. swap the two render sites +old1 = '
${ART[p.art]||\'\'}
${p.cap||\'\'}
' +new1 = '
${plateImg(p.art)}
${p.cap||\'\'}
' +assert old1 in s, "render site 1 not found" +s = s.replace(old1, new1) + +old2 = '
${ART[r.art]||\'\'}

${r.n}

' +new2 = '
${plateImg(r.art)}

${r.n}

' +assert old2 in s, "render site 2 not found" +s = s.replace(old2, new2) + +# 2. inject the script (PHOTOS/WANOTES/plateImg) + CSS before the first that has the render, or just append before a known anchor +# Inject right after the ART definition script block ends. Find a safe anchor: the first '' after 'const ART={}' +# Simpler: append to EOF (global scope scripts execute in order; render happens on demand later) +s = s.rstrip() + '\n' + INJECT + '\n' + CSS + '\n' + +open(p, 'w').write(s) +print(f"integrated {len(PHOTOS)} photos + {len(WANOTES)} WA notes; size {len(s)}")