Skip to content

Commit 13d6457

Browse files
committed
UnityWebapp6.2fixesUpdate
1 parent 901e9c3 commit 13d6457

File tree

2 files changed

+22
-48
lines changed

2 files changed

+22
-48
lines changed

git_gui_state.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"repo_url": "https://github.com/Unity-Lab-AI/Unity-Lab-AI.github.io.git", "repo_name": "unity.unityailab.com", "feature_branch": "feature/UnityWebApp6.1(screensaver)"}
1+
{"repo_url": "https://github.com/Unity-Lab-AI/Unity-Lab-AI.github.io.git", "repo_name": "unity.unityailab.com", "feature_branch": "feature/UnityWebApp6.2Fixes"}

index.html

Lines changed: 21 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,18 +1390,6 @@
13901390
models: { ...CUSTOM_MODELS }
13911391
};
13921392

1393-
// Helper function to get model configuration
1394-
function getModelConfig(modelName) {
1395-
return MODEL_CONFIG.models[modelName] || {
1396-
baseModel: true,
1397-
type: "chat",
1398-
jsonMode: false,
1399-
censored: true,
1400-
systemMessage: `You are a helpful AI assistant based on ${modelName}.`,
1401-
needsInstruction: true
1402-
};
1403-
}
1404-
14051393
// Build messages function with improved configuration handling
14061394
async function buildMessages(modelName, userMessage) {
14071395
const messages = [];
@@ -1938,24 +1926,6 @@
19381926
};
19391927
}
19401928

1941-
1942-
async function handleModelChange(e) {
1943-
const selectedModel = e.target.value;
1944-
localStorage.removeItem(`${selectedModel}Avatar`);
1945-
fadeOutAndClear();
1946-
conversationHistory = [];
1947-
localStorage.removeItem("conversationHistory");
1948-
1949-
if (window.speechSynthesis) {
1950-
window.speechSynthesis.cancel();
1951-
}
1952-
stopTTS();
1953-
1954-
// Add this line:
1955-
updateScreensaverForModel(selectedModel);
1956-
}
1957-
1958-
19591929
function extractPromptPart(url) {
19601930
const match = url.match(/\/prompt\/([^?]+)/);
19611931
return match ? match[1] : null;
@@ -2425,18 +2395,22 @@
24252395
}
24262396

24272397

2428-
function createMessage(type, content) {
2429-
const div = document.createElement("div");
2430-
div.className = `message ${type}-message`;
2431-
div.style.opacity = "0";
2398+
function getUnityAvatar() {
2399+
return "https://image.pollinations.ai/prompt/close_portrait_black_hair_emo_goth_female_age_25_detailed_face?width=512&height=512&seed=9999&enhance=true&quality=high&nologo=true&model=flux";
2400+
}
24322401

2402+
// The rest of your code remains the same, now the call to getUnityAvatar() works:
2403+
function createMessage(type, content) {
2404+
const div = document.createElement("div");
2405+
div.className = `message ${type}-message`;
2406+
div.style.opacity = "0";
24332407

2434-
if (type === "ai") {
2435-
const avatar = document.createElement("div");
2436-
avatar.className = "message-avatar";
2437-
avatar.innerHTML = `<img src="${getUnityAvatar()}" alt="Unity">`;
2438-
div.appendChild(avatar);
2439-
}
2408+
if (type === "ai") {
2409+
const avatar = document.createElement("div");
2410+
avatar.className = "message-avatar";
2411+
avatar.innerHTML = `<img src="${getUnityAvatar()}" alt="Unity">`;
2412+
div.appendChild(avatar);
2413+
}
24402414

24412415

24422416
const contentDiv = document.createElement("div");
@@ -2823,12 +2797,7 @@
28232797
stopScreensaver();
28242798
}
28252799
});
2826-
function handleCodePanelToggles(view) {
2827-
if (screensaverActive && view === 'code') {
2828-
stopScreensaver();
2829-
localStorage.setItem('screensaver-resume', 'true');
2830-
}
2831-
}
2800+
28322801

28332802
// Double-click to exit
28342803
container.addEventListener('dblclick', () => {
@@ -2837,7 +2806,12 @@
28372806
}
28382807
});
28392808
}
2840-
2809+
function handleCodePanelToggles(view) {
2810+
if (screensaverActive && view === 'code') {
2811+
stopScreensaver();
2812+
localStorage.setItem('screensaver-resume', 'true');
2813+
}
2814+
}
28412815
async function copyImageToClipboard(imgId) {
28422816
try {
28432817
const imgElement = document.getElementById(imgId);

0 commit comments

Comments
 (0)