diff --git "a/tutor.html" "b/tutor.html" --- "a/tutor.html" +++ "b/tutor.html" @@ -5,6 +5,7 @@ AI TUTOR PRO + @@ -24,717 +25,10168 @@ chtml: { displayAlign: 'left', mtextInheritFont: true } }; - - - + + + + + + + + - - - -
- - -
-
👨‍🏫
-

AI TUTOR PRO

-

Your dedicated, personalized AI teacher.

- - - -
- - - + + + + + +
+ +
+ +
+ + +
+ + + +
+
+ +
👨‍🏫 AI TUTOR
+ + + + +
+
+ +
+
+ + + +
+ + +
+
+ + +
+
+ Artifact +
+
+
+
+ +
+
+
+
+ + + + +
+
↪️
+
+
+ + Processing document — + +
+
+
+
+
📎 File
🎨 Photo Gen ON (Gemini)
+
▶️ YouTube Mode ON
+ + + + + +
+ + + + + + + +
+ +
🖌️ Edit Image ON
+ + +
+ + + + + + + +
+
AI can make mistakes. Please double-check important information.
+
+ +
+
+
🔊 Playing Answer...
+ +
+ +
+
0:00
+
+
+
+
0:00
+
+ +
+ + +
+
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - // 🚀 10s PREMIUM LOADING SEQUENCE - function trigger10sLoadingSequence() { - // Grab selected settings - currentClass = document.getElementById('startupClass').value; - const subSelect = document.getElementById('startupSubject').value; - currentSubject = subSelect === 'custom' ? document.getElementById('startupCustomSubject').value.trim() : subSelect; - - if (subSelect === 'custom' && !currentSubject) { - alert("Please enter a custom subject name."); - return; - } + + + + + + + + + + +
+
+ + ✂️ Crop photo + +
+
+
+
+ - function startNewTutorChat() { - currentSessionId = Date.now(); - clearAttachment(); - document.getElementById('badgeClassSubj').innerText = `Class ${currentClass} • ${currentSubject}`; - document.getElementById('activeTutorBadge').style.display = 'flex'; - - const chatBox = document.getElementById("searchChatHistory"); - chatBox.innerHTML = ` -
-
-

- Welcome to Class. -

-

- I am your Class ${currentClass} ${currentSubject} Tutor. How can I help you today? -

-
-
`; - } + + - function updateImageUI() { - const container = document.getElementById("multiImagePreview"); - if(!container) return; - if(uploadedImagesList.length === 0) { container.style.display = "none"; return; } - container.style.display = "flex"; - container.innerHTML = uploadedImagesList.map((img, i) => `
`).join(''); - } - - function removeImage(index) { - uploadedImagesList.splice(index, 1); - updateImageUI(); - } + + - function clearAttachment() { - uploadedImagesList = []; - documentMemory = ""; - document.getElementById("attachmentChip").style.display = "none"; - updateImageUI(); - } + + - document.getElementById("searchInput").addEventListener("keypress", function(e) { if(e.key === "Enter" && !e.shiftKey) { e.preventDefault(); runTutorSearch(); } }); + + - isProcessing = true; - window.chatAbortController = new AbortController(); - - // Change to STOP button visual 🛑 - btn.innerHTML = "🛑"; - btn.style.background = "#ef4444"; + + - while (true) { - const { done, value } = await reader.read(); - if (done) break; - - const chunks = decoder.decode(value, { stream: true }).split("\n\n"); - for (const chunk of chunks) { - if (!chunk.startsWith("data: ")) continue; - const dataStr = chunk.replace("data: ", "").trim(); - if (!dataStr) continue; - - let evt; - try { evt = JSON.parse(dataStr); } catch(e){ continue; } - - if (evt.type === 'chunk') { - accumulatedText += evt.text; - if(!hasStarted) { - document.getElementById(loadId).innerHTML = `
`; - hasStarted = true; - } - const body = document.getElementById(loadId).querySelector('.markdown-body'); - - // Safe parsing - let cleanLiveText = accumulatedText.replace(/\|\|SUGGESTIONS:\s*\[.*?\]\|\|/gs, '').trim(); - try { body.innerHTML = marked.parse(cleanLiveText); } - catch(e) { body.innerText = cleanLiveText; } - } - else if (evt.type === 'done') { - if (evt.fullText) accumulatedText = evt.fullText; - - let cleanText = accumulatedText.replace(/\|\|SUGGESTIONS:\s*\[.*?\]\|\|/gs, '').trim(); - const body = document.getElementById(loadId).querySelector('.markdown-body'); - - try { body.innerHTML = marked.parse(cleanText); } - catch(e) { body.innerText = cleanText; } - - if(window.MathJax) MathJax.typesetPromise([document.getElementById(loadId)]).catch(()=>{}); - - saveInteractionToLocalForage(q, marked.parse(cleanText), currentImagesToSave, "AI Tutor", [], null, loadId); - } - } - } + + + + + + + + + + + \ No newline at end of file