ai-cli-fusion-ide / components /code-preview.js
apicodex's picture
Goal: create a prompt from the text below that takes the features and functionality from text use it as inspiration to build a prompt that user will give to ai to create this project do not limit the ai to anything specific allow it to be creative.
a4658bb verified
class CodePreview extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
:host {
display: block;
height: 100%;
background: #1e1e2e;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.preview-container {
height: 100%;
display: flex;
flex-direction: column;
}
.preview-toolbar {
display: flex;
gap: 0.5rem;
padding: 1rem;
background: #2a2a3a;
border-bottom: 1px solid #44475a;
}
button {
background: #6272a4;
color: #f8f8f2;
border: none;
border-radius: 4px;
padding: 0.5rem 1rem;
cursor: pointer;
transition: background 0.2s;
}
button:hover {
background: #7f8fb1;
}
.preview-content {
flex: 1;
display: flex;
}
iframe {
flex: 1;
border: none;
background: white;
}
</style>
<div class="preview-container">
<div class="preview-toolbar">
<button id="deploy-btn">Deploy</button>
<button id="export-github">Export to GitHub</button>
<button id="download-zip">Download ZIP</button>
<button id="file-explorer">File Explorer</button>
</div>
<div class="preview-content">
<iframe id="preview-frame" sandbox="allow-scripts allow-same-origin"></iframe>
</div>
</div>
`;
}
}
customElements.define('code-preview', CodePreview);