« Back to History
builder.js
|
20260722_120325.php
Initial Domain Snapshot
Copy Code
// builder.js - tiny mock interactivity for the static builder demo document.addEventListener('DOMContentLoaded', function(){ // handle simple component insert simulation document.querySelectorAll('.comp, .comp button').forEach(btn=>{ btn.addEventListener('click', function(e){ const type = this.dataset ? this.dataset.comp : this.getAttribute('data-comp'); if(!type) { alert('component'); return; } const canvas = document.getElementById('canvasArea'); const wrapper = document.createElement('div'); wrapper.className = 'canvas-dropzone'; wrapper.innerHTML = '<label>'+type.toUpperCase()+'</label><input disabled placeholder="'+type+'">'; canvas.appendChild(wrapper); }); }); // simple save props const saveBtn = document.getElementById('saveProps'); if (saveBtn) saveBtn.addEventListener('click', function(){ alert('Properties saved (mock)'); }); });