Hanaz Writers

AI Story Refiner

Romance Drama Comedy Historical
(async function(){ const API = "https://ai.hanazwriters.org/story-refiner"; document .getElementById("refineBtn") .addEventListener("click", refineStory); function list(arr){ if(!arr || !arr.length) return ""; return `
    ${arr.map(x => `
  • ${x}
  • `).join("")}
`; } async function refineStory(){ const title = document.getElementById("titleInput").value; const genre = document.getElementById("genreInput").value; const script = document.getElementById("scriptInput").value; const box = document.getElementById("resultBox"); box.innerHTML = "Refining..."; try{ const res = await fetch(API,{ method:"POST", headers:{ "Content-Type":"application/json" }, body:JSON.stringify({ title, genre, script }) }); const data = await res.json(); const a = data.analysis; box.innerHTML = `

Refined Script

${a.refinedScript}

Syntax Improvements

${list(a.syntaxImprovements)}

Engagement Suggestions

${list(a.engagementSuggestions)}

Tone Analysis

${a.toneAnalysis}

Spelling Corrections

${list(a.spellingCorrections)} `; }catch(err){ box.innerHTML = `

${err.message}

`; } } })();