back
isDot() || $fileInfo->isDir()) continue; // echo $fileInfo->getFilename() . "
\n"; ?>
Create homepage
`); workspace.openTextDocument("index.html"); editor.onDidChangeModelContent(e => { console.log(e) updatePreview() // document.querySelector('textarea[name=html]').textContent = editor.getValue() document.querySelector('textarea.html-for-save').value = editor.getValue() document.querySelector('textarea.html-for-save').textContent = editor.getValue() }); function updatePreview() { console.log(editor.getValue()) previewIframe.contentWindow.document.open(); previewIframe.contentWindow.document.write(editor.getValue()); previewIframe.contentWindow.document.close(); } setTimeout(() => { updatePreview() }, 100) // window.editor.getModel().onDidChangeContent((event) => { // console.log(event) // }); // Reszing const resizer = document.getElementById("resizer"); const leftColumn = document.querySelector("#editor"); const rightColumn = document.querySelector("#previewIframe"); let isResizing = false; resizer.addEventListener("mousedown", (event) => { isResizing = true; document.body.classList.add('resizing') document.body.style.userSelect = "none"; document.addEventListener("mousemove", handleMouseMove); document.addEventListener("mouseup", () => { isResizing = false; document.body.classList.remove('resizing') document.body.style.userSelect = ""; document.removeEventListener("mousemove", handleMouseMove); }); }); function handleMouseMove(event) { if (!isResizing) return; let containerRect = resizer.parentNode.getBoundingClientRect(); let newLeftWidth = event.clientX - containerRect.left; let newRightWidth = containerRect.width - newLeftWidth - resizer.offsetWidth; // Ensure both columns are at least 300px wide if (newLeftWidth >= 320 && newRightWidth >= 320) { leftColumn.style.width = `${newLeftWidth}px`; rightColumn.style.width = `${newRightWidth}px`; } }