Spaces:
Running
Running
Delete index.html
Browse files- index.html +0 -187
index.html
DELETED
|
@@ -1,187 +0,0 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="en">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8" />
|
| 5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
| 6 |
-
<title>UniSolve - Academic Assistant</title>
|
| 7 |
-
<style>
|
| 8 |
-
body {
|
| 9 |
-
margin: 0;
|
| 10 |
-
font-family: 'Times New Roman', serif;
|
| 11 |
-
background-color: #f2f8ff;
|
| 12 |
-
color: #002855;
|
| 13 |
-
}
|
| 14 |
-
header {
|
| 15 |
-
display: flex;
|
| 16 |
-
align-items: center;
|
| 17 |
-
padding: 1rem 2rem;
|
| 18 |
-
background-color: #dbeeff;
|
| 19 |
-
border-bottom: 1px solid #c4e1ff;
|
| 20 |
-
}
|
| 21 |
-
header img {
|
| 22 |
-
height: 50px;
|
| 23 |
-
margin-right: 1rem;
|
| 24 |
-
}
|
| 25 |
-
header h1 {
|
| 26 |
-
font-size: 2rem;
|
| 27 |
-
margin: 0;
|
| 28 |
-
color: #003366;
|
| 29 |
-
}
|
| 30 |
-
main {
|
| 31 |
-
padding: 2rem;
|
| 32 |
-
max-width: 900px;
|
| 33 |
-
margin: auto;
|
| 34 |
-
}
|
| 35 |
-
label {
|
| 36 |
-
font-weight: bold;
|
| 37 |
-
font-size: 1.1rem;
|
| 38 |
-
display: block;
|
| 39 |
-
margin-top: 1.5rem;
|
| 40 |
-
margin-bottom: 0.5rem;
|
| 41 |
-
color: #003366;
|
| 42 |
-
}
|
| 43 |
-
textarea, select {
|
| 44 |
-
width: 100%;
|
| 45 |
-
padding: 1rem;
|
| 46 |
-
font-size: 1.1rem;
|
| 47 |
-
border: 1px solid #b3d7ff;
|
| 48 |
-
border-radius: 10px;
|
| 49 |
-
background-color: #ffffff;
|
| 50 |
-
color: #002244;
|
| 51 |
-
box-shadow: 0 2px 5px rgba(0, 92, 192, 0.1);
|
| 52 |
-
}
|
| 53 |
-
button {
|
| 54 |
-
background-color: #005bb5;
|
| 55 |
-
color: white;
|
| 56 |
-
padding: 1rem 2rem;
|
| 57 |
-
font-size: 1.1rem;
|
| 58 |
-
border: none;
|
| 59 |
-
border-radius: 10px;
|
| 60 |
-
margin-top: 1.5rem;
|
| 61 |
-
cursor: pointer;
|
| 62 |
-
transition: background-color 0.3s ease;
|
| 63 |
-
}
|
| 64 |
-
button:hover {
|
| 65 |
-
background-color: #004999;
|
| 66 |
-
}
|
| 67 |
-
#loading {
|
| 68 |
-
font-weight: bold;
|
| 69 |
-
margin: 1rem 0;
|
| 70 |
-
color: #004080;
|
| 71 |
-
}
|
| 72 |
-
pre {
|
| 73 |
-
white-space: pre-wrap;
|
| 74 |
-
background: #ffffff;
|
| 75 |
-
padding: 1rem;
|
| 76 |
-
border-radius: 10px;
|
| 77 |
-
box-shadow: 0 0 5px #cce4ff;
|
| 78 |
-
font-family: 'Times New Roman', serif;
|
| 79 |
-
font-size: 1.05rem;
|
| 80 |
-
}
|
| 81 |
-
</style>
|
| 82 |
-
</head>
|
| 83 |
-
<body>
|
| 84 |
-
<header>
|
| 85 |
-
<img src="UniSolve-Emblem.PNG" alt="UniSolve Logo" />
|
| 86 |
-
<h1>UniSolve</h1>
|
| 87 |
-
</header>
|
| 88 |
-
|
| 89 |
-
<main>
|
| 90 |
-
<label for="category">Subject Category</label>
|
| 91 |
-
<select id="category">
|
| 92 |
-
<option>Arts, Humanities & Social Sciences</option>
|
| 93 |
-
<option>Law & Legal Studies</option>
|
| 94 |
-
<option>Business & Management</option>
|
| 95 |
-
<option>Psychology & Health</option>
|
| 96 |
-
<option>Media, Communication & Creative Arts</option>
|
| 97 |
-
<option>Education & Teaching</option>
|
| 98 |
-
<option>Indigenous & Global Studies</option>
|
| 99 |
-
<option>Social Work & Human Services</option>
|
| 100 |
-
<option>Criminology, Justice & Law Enforcement</option>
|
| 101 |
-
<option>Science & Technology</option>
|
| 102 |
-
</select>
|
| 103 |
-
|
| 104 |
-
<label for="citationStyle">Citation Style</label>
|
| 105 |
-
<select id="citationStyle">
|
| 106 |
-
<option>Harvard</option>
|
| 107 |
-
<option>APA 7th</option>
|
| 108 |
-
<option>AGLC</option>
|
| 109 |
-
<option>Chicago A (footnote)</option>
|
| 110 |
-
<option>Chicago B (author-date)</option>
|
| 111 |
-
<option>IEEE</option>
|
| 112 |
-
<option>MLA</option>
|
| 113 |
-
<option>AMA (Vancouver)</option>
|
| 114 |
-
</select>
|
| 115 |
-
|
| 116 |
-
<label for="caseStudy">Case Study</label>
|
| 117 |
-
<textarea id="caseStudy" rows="6" placeholder="Paste your case study here..."></textarea>
|
| 118 |
-
|
| 119 |
-
<label for="questions">Questions</label>
|
| 120 |
-
<textarea id="questions" rows="6" placeholder="Paste your assignment questions here..."></textarea>
|
| 121 |
-
|
| 122 |
-
<button onclick="generateResponse()">Generate Response</button>
|
| 123 |
-
|
| 124 |
-
<div id="loading" style="display:none;">⏳ Generating response...</div>
|
| 125 |
-
<pre id="responseContainer"></pre>
|
| 126 |
-
|
| 127 |
-
<div id="exportBtns" style="display:none; margin-top: 1rem;">
|
| 128 |
-
<button onclick="exportFile('pdf')">📄 Export to PDF</button>
|
| 129 |
-
<button onclick="exportFile('word')">📝 Export to Word</button>
|
| 130 |
-
</div>
|
| 131 |
-
</main>
|
| 132 |
-
|
| 133 |
-
<script>
|
| 134 |
-
async function generateResponse() {
|
| 135 |
-
const subject = document.getElementById("category").value;
|
| 136 |
-
const style = document.getElementById("citationStyle").value;
|
| 137 |
-
const caseStudy = document.getElementById("caseStudy").value;
|
| 138 |
-
const questions = document.getElementById("questions").value;
|
| 139 |
-
|
| 140 |
-
const responseContainer = document.getElementById("responseContainer");
|
| 141 |
-
const loading = document.getElementById("loading");
|
| 142 |
-
loading.style.display = "block";
|
| 143 |
-
responseContainer.innerText = "";
|
| 144 |
-
|
| 145 |
-
try {
|
| 146 |
-
const response = await fetch("https://tomwatto09-unisolve-backend.hf.space/generate", {
|
| 147 |
-
method: "POST",
|
| 148 |
-
headers: { "Content-Type": "application/json" },
|
| 149 |
-
body: JSON.stringify({
|
| 150 |
-
category: subject,
|
| 151 |
-
citationStyle: style,
|
| 152 |
-
caseStudy: caseStudy,
|
| 153 |
-
questions: questions
|
| 154 |
-
})
|
| 155 |
-
});
|
| 156 |
-
|
| 157 |
-
const data = await response.json();
|
| 158 |
-
if (data.response) {
|
| 159 |
-
responseContainer.innerText = data.response;
|
| 160 |
-
document.getElementById("exportBtns").style.display = "block";
|
| 161 |
-
} else {
|
| 162 |
-
responseContainer.innerText = "❌ Error: " + (data.error || "Unexpected response");
|
| 163 |
-
}
|
| 164 |
-
} catch (error) {
|
| 165 |
-
responseContainer.innerText = "❌ Network error: " + error.message;
|
| 166 |
-
}
|
| 167 |
-
|
| 168 |
-
loading.style.display = "none";
|
| 169 |
-
}
|
| 170 |
-
|
| 171 |
-
async function exportFile(type) {
|
| 172 |
-
const content = document.getElementById("responseContainer").innerText;
|
| 173 |
-
const endpoint = type === 'pdf' ? "/export/pdf" : "/export/word";
|
| 174 |
-
const res = await fetch("https://tomwatto09-unisolve-backend.hf.space" + endpoint, {
|
| 175 |
-
method: "POST",
|
| 176 |
-
headers: { "Content-Type": "application/json" },
|
| 177 |
-
body: JSON.stringify({ content })
|
| 178 |
-
});
|
| 179 |
-
const blob = await res.blob();
|
| 180 |
-
const link = document.createElement("a");
|
| 181 |
-
link.href = window.URL.createObjectURL(blob);
|
| 182 |
-
link.download = type === 'pdf' ? "UniSolve_Response.pdf" : "UniSolve_Response.docx";
|
| 183 |
-
link.click();
|
| 184 |
-
}
|
| 185 |
-
</script>
|
| 186 |
-
</body>
|
| 187 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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