body {
font-family: Arial, sans-serif;
background: #f4f4f9;
padding: 20px;
max-width: 700px;
margin: auto;
}
textarea {
width: 100%;
height: 150px;
padding: 12px;
font-size: 16px;
box-sizing: border-box;
margin-top: 10px;
}
button {
width: 100%;
padding: 12px;
font-size: 16px;
margin-top: 10px;
background-color: #007BFF;
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
#output {
white-space: pre-wrap;
background: #ffffff;
padding: 15px;
margin-top: 20px;
border-radius: 8px;
border: 1px solid #ccc;
}
.tip {
background: #e6f7ff;
padding: 10px;
border-left: 4px solid #2196f3;
margin-bottom: 20px;
}
✍️ Academic Paraphraser
1. Paste your academic text below.
2. Click Paraphrase.
3. Get a formal, reworded version using AI.
async function paraphraseText() {
const input = document.getElementById(“inputText”).value.trim();
const output = document.getElementById(“output”);
if (!input) {
output.innerText = “⚠️ Please enter some text first.”;
return;
}
output.innerText = “⏳ Paraphrasing… Please wait.”;
const API_KEY = “AIzaSyB61Q3BegpZWwenyQjlz1UJ29Qj5oXxf84”; // 🔁 Replace with your real API key
const prompt = `Paraphrase the following academic text in a formal tone:nn”${input}”`;
const body = {
contents: [{
role: “user”,
parts: [{ text: prompt }]
}]
};
try {
const res = await fetch(`https://generativelanguage.googleapis.com/v1/models/gemini-1.5-flash:generateContent?key=${API_KEY}`, {
method: “POST”,
headers: { “Content-Type”: “application/json” },
body: JSON.stringify(body)
});
const data = await res.json();
const result = data?.candidates?.[0]?.content?.parts?.[0]?.text;
output.innerText = result || “⚠️ No response from Gemini.”;
} catch (err) {
output.innerText = “❌ Error: ” + err.message;
}
}


