Skip to content

Commit 741f104

Browse files
Update manim_generator.html
1 parent c070846 commit 741f104

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

manim_generator.html

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@
104104
<div class="container">
105105
<h1>Manim Code Generator using Gemini</h1>
106106
<p>Enter your animation idea below and receive ready-to-run Manim code.</p>
107+
<a href="https://docs.manim.community/en/stable/installation.html" target="_blank">
108+
<button type="button" style="background-color:#0072b1;margin-bottom:12px;">
109+
Manim Community Install Guide
110+
</button>
111+
</a>
107112
<textarea id="prompt" placeholder="Describe your animation using natural language..."></textarea>
108113
<button onclick="sendPrompt()">Generate Manim Code</button>
109114
<button id="copyButton" style="display:none;" onclick="copyCode()">Copy to Clipboard</button>
@@ -132,7 +137,7 @@ <h3>Output:</h3>
132137

133138
try {
134139
if (!apiKey) {
135-
throw new Error("API key is missing. Please configure it in the code.(This code is a fork of the original code)");
140+
throw new Error("API key is missing. Please contact the owner(Sabhya Aggarwal) on Github");
136141
}
137142

138143
const response = await fetch("https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent?key=" + apiKey, {
@@ -155,7 +160,7 @@ <h3>Output:</h3>
155160

156161
if (!response.ok) {
157162
const errorData = await response.json();
158-
let errorMessage = "Failed to generate code.";
163+
let errorMessage = "Failed to generate code. Please try again";
159164
if (errorData && errorData.error && errorData.error.message) {
160165
errorMessage += " " + errorData.error.message;
161166
}
@@ -176,7 +181,7 @@ <h3>Output:</h3>
176181

177182
} catch (err) {
178183
console.error(err);
179-
output.textContent = "Error generating code. Check console for details.";
184+
output.textContent = "Error generating code. Please check the console for details.";
180185
showMessage(err.message, "error");
181186
}
182187
}
@@ -196,7 +201,7 @@ <h3>Output:</h3>
196201
}
197202

198203
} else {
199-
showMessage("Nothing to copy. Please generate code first.", "info");
204+
showMessage("Nothing to copy. Please generate the code first.", "info");
200205
}
201206
}
202207

@@ -225,7 +230,7 @@ <h3>Output:</h3>
225230
}
226231

227232
setTimeout(() => {
228-
messageBox.className = ""; // Remove 'show' to hide
233+
messageBox.className = "";
229234
}, 5000); // 5 seconds
230235
}
231236
</script>

0 commit comments

Comments
 (0)