Update public/index.html
Browse files- public/index.html +32 -4
public/index.html
CHANGED
|
@@ -55,6 +55,9 @@
|
|
| 55 |
select{background:var(--surface);color:var(--text)}
|
| 56 |
select:focus{outline:none;border-color:#555}
|
| 57 |
|
|
|
|
|
|
|
|
|
|
| 58 |
button{
|
| 59 |
font-weight:600;cursor:pointer;margin-top:1rem;background:var(--btn-bg);
|
| 60 |
}
|
|
@@ -83,7 +86,7 @@
|
|
| 83 |
<main class="card">
|
| 84 |
<header>
|
| 85 |
<h1>Theos ex Machina</h1>
|
| 86 |
-
<p style="opacity:0.83;margin-bottom:1.6rem">
|
| 87 |
</header>
|
| 88 |
|
| 89 |
<label for="book">Könyv</label>
|
|
@@ -101,8 +104,8 @@
|
|
| 101 |
</div>
|
| 102 |
|
| 103 |
<div class="grid btns">
|
| 104 |
-
<button id="randomBtn">🎲
|
| 105 |
-
<button id="generateBtn">📖
|
| 106 |
</div>
|
| 107 |
|
| 108 |
<section id="result">
|
|
@@ -129,4 +132,29 @@ refresh();
|
|
| 129 |
|
| 130 |
randomBtn.addEventListener("click",()=>{const chIdx=Math.floor(Math.random()*window.chapterMap.length);chapterSel.value=chIdx+1;fill(verseSel,window.chapterMap[chIdx]);verseSel.value=Math.floor(Math.random()*window.chapterMap[chIdx])+1;});
|
| 131 |
|
| 132 |
-
async function generate(){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
select{background:var(--surface);color:var(--text)}
|
| 56 |
select:focus{outline:none;border-color:#555}
|
| 57 |
|
| 58 |
+
/* --- legördülő lista (option) látható legyen sötét témán is --- */
|
| 59 |
+
select option{background:var(--surface);color:var(--text);}
|
| 60 |
+
|
| 61 |
button{
|
| 62 |
font-weight:600;cursor:pointer;margin-top:1rem;background:var(--btn-bg);
|
| 63 |
}
|
|
|
|
| 86 |
<main class="card">
|
| 87 |
<header>
|
| 88 |
<h1>Theos ex Machina</h1>
|
| 89 |
+
<p style="opacity:0.83;margin-bottom:1.6rem">Válassz könyvet, fejezetet és verset, vagy kattints a <strong>🎲 Random</strong> gombra!<br><small style="opacity:0.7">Forrás: KJV → AI által fordított & értelmezett magyar szöveg</small></p>
|
| 90 |
</header>
|
| 91 |
|
| 92 |
<label for="book">Könyv</label>
|
|
|
|
| 104 |
</div>
|
| 105 |
|
| 106 |
<div class="grid btns">
|
| 107 |
+
<button id="randomBtn">🎲 Random vers</button>
|
| 108 |
+
<button id="generateBtn">📖 Elemzés</button>
|
| 109 |
</div>
|
| 110 |
|
| 111 |
<section id="result">
|
|
|
|
| 132 |
|
| 133 |
randomBtn.addEventListener("click",()=>{const chIdx=Math.floor(Math.random()*window.chapterMap.length);chapterSel.value=chIdx+1;fill(verseSel,window.chapterMap[chIdx]);verseSel.value=Math.floor(Math.random()*window.chapterMap[chIdx])+1;});
|
| 134 |
|
| 135 |
+
async function generate(){
|
| 136 |
+
const payload = { book: bookSel.value, chapter: chapterSel.value, verse: verseSel.value };
|
| 137 |
+
generateBtn.disabled = true;
|
| 138 |
+
generateBtn.textContent = "⏳ Kérem…";
|
| 139 |
+
try {
|
| 140 |
+
const r = await fetch("/api/analyze", {
|
| 141 |
+
method: "POST",
|
| 142 |
+
headers: { "Content-Type": "application/json" },
|
| 143 |
+
body: JSON.stringify(payload)
|
| 144 |
+
});
|
| 145 |
+
if (!r.ok) throw new Error((await r.json()).error);
|
| 146 |
+
const d = await r.json();
|
| 147 |
+
analysisEl.textContent = d.output;
|
| 148 |
+
resultBox.style.display = "block";
|
| 149 |
+
} catch (e) {
|
| 150 |
+
alert(e.message);
|
| 151 |
+
} finally {
|
| 152 |
+
generateBtn.disabled = false;
|
| 153 |
+
generateBtn.textContent = "📖 Elemzés";
|
| 154 |
+
}
|
| 155 |
+
}
|
| 156 |
+
|
| 157 |
+
generateBtn.addEventListener("click", generate);
|
| 158 |
+
</script>
|
| 159 |
+
</body>
|
| 160 |
+
</html>
|