Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
techcow2 authored Aug 21, 2024
1 parent 42eb069 commit 7f65ec2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 90 deletions.
26 changes: 13 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NetSim - AI-Powered Web Simulations</title>
<title>NetSim - AI Powered Simulations</title>
<link rel="stylesheet" href="styles.css">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://html2canvas.hertzen.com/dist/html2canvas.min.js"></script>
Expand Down Expand Up @@ -47,18 +47,18 @@
</button>
</div>
<div id="addressbar-container">
<input type="text" id="addressbar" autocomplete="off" placeholder="Describe a web app or website">
<button class="btn" onclick="handleAddressBarSubmit()" title="Create or Edit">
<svg viewBox="0 0 24 24">
<path fill="currentColor" d="M19.78,2H4.22C3,2 2,3 2,4.22V19.78C2,21 3,22 4.22,22H19.78C21,22 22,21 22,19.78V4.22C22,3 21,2 19.78,2M12,4L14.8,9.2H9.2L12,4M17,20H7L11.2,12H12.8L17,20M14.8,11.2L18,5.5V11.2H14.8M6,5.5L9.2,11.2H6V5.5M6,18.5V12.8H9.2L6,18.5M18,18.5L14.8,12.8H18V18.5Z" />
</svg>
</button>
<button class="btn" onclick="addBookmark()" title="Bookmark">
<svg viewBox="0 0 24 24">
<path fill="currentColor" d="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.46,13.97L5.82,21L12,17.27Z" />
</svg>
</button>
<div id="revisions-panel"></div>
<input type="text" id="addressbar" autocomplete="off" placeholder="Describe a web app or website">
<button class="btn" onclick="handleAddressBarSubmit()" title="Create or Edit">
<svg viewBox="0 0 24 24">
<path fill="currentColor" d="M19.78,2H4.22C3,2 2,3 2,4.22V19.78C2,21 3,22 4.22,22H19.78C21,22 22,21 22,19.78V4.22C22,3 21,2 19.78,2M12,4L14.8,9.2H9.2L12,4M17,20H7L11.2,12H12.8L17,20M14.8,11.2L18,5.5V11.2H14.8M6,5.5L9.2,11.2H6V5.5M6,18.5V12.8H9.2L6,18.5M18,18.5L14.8,12.8H18V18.5Z" />
</svg>
</button>
<button class="btn" onclick="addBookmark()" title="Bookmark">
<svg viewBox="0 0 24 24">
<path fill="currentColor" d="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.63L12,2L9.19,8.63L2,9.24L7.46,13.97L5.82,21L12,17.27Z" />
</svg>
</button>
<!-- Revisions panel removed -->
</div>
<div id="toolbar-right">
<div id="model-select-container">
Expand Down
40 changes: 0 additions & 40 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1011,46 +1011,6 @@ window.onload = function() {
e.preventDefault();

};
function toggleRevisions() {
const revisionsPanel = document.getElementById('revisions-panel');
if (revisionsPanel.style.display === 'block') {
revisionsPanel.style.display = 'none';
} else {
displayRevisions();
revisionsPanel.style.display = 'block';
}
}

function displayRevisions() {
const revisionsPanel = document.getElementById('revisions-panel');
revisionsPanel.innerHTML = ''; // Clear the panel

history.forEach((revision, index) => {
const revisionItem = document.createElement('div');
revisionItem.className = 'revision-item';
revisionItem.innerHTML = `
<img src="${revision.screenshot}" alt="Revision ${index}" class="revision-screenshot">
<div class="revision-prompt">${revision.input}</div>
`;
revisionItem.addEventListener('click', () => restoreRevision(index));
revisionsPanel.appendChild(revisionItem);
});
}

function restoreRevision(index) {
const revision = history[index];
currentSimulation = revision.simulation;
const frame = document.getElementById('simulation-frame');
frame.contentDocument.open();
frame.contentDocument.write(currentSimulation);
frame.contentDocument.close();

// Hide the revisions panel after restoring
document.getElementById('revisions-panel').style.display = 'none';

updateAddressBar(revision.input);
updatePageTitle(`NetSim: ${revision.input}`);
}


document.getElementById('maximize-button').onclick = function() {
Expand Down
37 changes: 0 additions & 37 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -645,40 +645,3 @@ body, html {
border: 2px solid #2b2d42;
box-shadow: 0 0 10px #00ff00;
}
#revisions-panel {
position: absolute;
top: 100%;
left: 0;
right: 0;
background: white;
border: 1px solid #ccc;
border-radius: 0 0 4px 4px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
display: none;
max-height: 60vh;
overflow-y: auto;
z-index: 1000;
}

.revision-item {
display: flex;
padding: 12px;
border-bottom: 1px solid #eee;
cursor: pointer;
}

.revision-item:hover {
background-color: #f5f5f5;
}

.revision-screenshot {
width: 150px;
height: 90px;
object-fit: cover;
margin-right: 15px;
}

.revision-prompt {
flex-grow: 1;
font-size: 14px;
}

0 comments on commit 7f65ec2

Please sign in to comment.