<div id="result" class="result-container text-light mt-3"></div>
</div>
<div id="appContent">
<button class="btn btn-secondary" onclick="closeApp()">Close</button>
<iframe id="appIframe" style="width: 100%; height: 90%; border: none;"></iframe>
</div>
<a-scene>
<a-camera position="0 1.6 0">
<a-cursor></a-cursor>
</a-camera>
</a-scene>
<script>
let appIds = [];
function processBatchURL() {
const inputElement = document.getElementById('urlInput');
const ids = inputElement.value.trim().split('\n');
ids.forEach(id => {
const appId = id.trim();
if (appId) {
createCrystal(appId);
appIds.push({ id: appId, timestamp: new Date().toISOString() });
}
});
inputElement.value = ''; // Clear input after processing
}
function createCrystal(appId) {
const crystal = document.createElement('a-entity');
const x = (Math.random() - 0.5) * 10;
const y = (Math.random() - 0.5) * 5 + 1.6;
const z = (Math.random() - 0.5) * 10 - 5;
crystal.setAttribute('geometry', 'primitive: dodecahedron; radius: 0.3');
crystal.setAttribute('material', `color: #${Math.floor(Math.random()*16777215).toString(16)}; opacity: 0.8`);
crystal.setAttribute('position', `${x} ${y} ${z}`);
crystal.setAttribute('animation', 'property: rotation; to: 0 360 0; loop: true; dur: 3000');
crystal.setAttribute('app-id', appId);
crystal.addEventListener('click', () => {
openApp(appId);
crystal.parentNode.removeChild(crystal); // Remove crystal after click
});
document.querySelector('a-scene').appendChild(crystal);
}
function openApp(appId) {
const appIframe = document.getElementById('appIframe');
const appContent = document.getElementById('appContent');
appIframe.src = `https://www.literallyanything.io/iterate?id=${appId}`;
appContent.style.display = 'block';
}
function closeApp() {
const appContent = document.getElementById('appContent');
appContent.style.display = 'none';
}
function exportAndClear() {
const content = appIds.map(app => `App ID: ${app.id}, Timestamp: ${app.timestamp}`).join('\n');
const blob = new Blob([content], { type: 'text/plain' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'app_ids.txt';
a.click();
URL.revokeObjectURL(url);
// Clear existing app IDs
appIds = [];
document.querySelector('a-scene').innerHTML = ''; // Remove all crystals
}
</script>
Shared snapshot