Skip to content

Editor: Added agent #30761

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: dev
Choose a base branch
from
70 changes: 70 additions & 0 deletions editor/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -792,3 +792,73 @@ select {
transform: translate(0, 0);
z-index: 0;
}

/* Agent */
#agent {
position: absolute;
left: 50%;
bottom: 20px;
transform: translateX(-50%);
width: 400px;
box-sizing: border-box;
background-color: #ffffff;
padding: 12px;
border-radius: 12px;
color: #333333;
font-family: Arial, sans-serif;
z-index: 1000;
box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

#agent textarea {
width: 100%;
height: 50px;
padding: 15px;
padding-right: 85px;
background-color: #f5f5f5;
border: 1px solid #e0e0e0;
border-radius: 8px;
color: #333333;
resize: none;
font-size: 14px;
box-sizing: border-box;
}

#agent button {
position: absolute;
right: 25px;
bottom: 25px;
background-color: #2196F3;
color: white;
padding: 8px 16px;
border: none;
border-radius: 6px;
cursor: pointer;
font-weight: bold;
font-size: 13px;
transition: background-color 0.2s, opacity 0.2s;
}

#agent button:hover:not(:disabled) {
background-color: #1976D2;
}

#agent button:disabled {
opacity: 0.5;
cursor: default;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
#agent {
background-color: #222;
color: #eee;
box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

#agent textarea {
background-color: #333;
border-color: #444;
color: #eee;
}
}
9 changes: 8 additions & 1 deletion editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

"three/examples/": "../examples/",
"three-gpu-pathtracer": "https://cdn.jsdelivr.net/npm/[email protected]/build/index.module.js",
"three-mesh-bvh": "https://cdn.jsdelivr.net/npm/[email protected]/build/index.module.js"
"three-mesh-bvh": "https://cdn.jsdelivr.net/npm/[email protected]/build/index.module.js",
"@google/genai": "https://cdn.jsdelivr.net/npm/@google/genai/dist/web/index.mjs"
}
}
</script>
Expand Down Expand Up @@ -70,6 +71,7 @@
import { Sidebar } from './js/Sidebar.js';
import { Menubar } from './js/Menubar.js';
import { Resizer } from './js/Resizer.js';
import { Agent } from './js/Agent.js';

window.URL = window.URL || window.webkitURL;
window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
Expand Down Expand Up @@ -102,6 +104,9 @@
const resizer = new Resizer( editor );
document.body.appendChild( resizer.dom );

const agent = new Agent( editor );
viewport.dom.appendChild( agent.dom );

//

editor.storage.init( function () {
Expand All @@ -124,6 +129,8 @@

}

editor.signals.storageLoaded.dispatch();

} );

//
Expand Down
Loading