Loading repository data…
Loading repository data…
matongAI-lab / repository
帮助非程序员把 AI 生成的 HTML 改到能用 | A browser-based visual touch-up tool for AI-generated static HTML. No install — just double-click index.html.
A small browser-based touch-up tool for AI-generated static HTML.
Positioning: Help non-programmers turn AI-generated HTML into something usable.
**产品定位:**帮助非程序员把 AI 生成的 HTML 改到能用。
适合不懂技术的用户。完全不需要装 Node.js、git 或命令行工具。
index.html,浏览器自动打开.html 文件,或仅需:现代浏览器(Chrome / Edge / Firefox / Safari 任一,包括 Win7 上的 Chrome 109) 无需:Node.js、git、命令行、网络(解压后离线也能用)
It lets you open an AI-generated HTML page, click elements directly in the rendered page, adjust common styles, edit text, and export a cleaned HTML file. It is not trying to replace Vue, React, Webflow, or a professional IDE. Its job is narrower: help you finish the last 10% of a static HTML page visually.
.html or .htm file.This project is useful when an AI has already generated a static page and you need to make quick visual changes before sharing or publishing it:
It is not a full website builder, CMS, frontend framework IDE, or code editor for component projects. The goal is to provide a lightweight visual editing layer for existing static HTML.
Use a prompt like this when asking an AI to generate HTML for this editor:
请生成一个完整的单文件 HTML 页面,用内联 CSS 和少量原生 JavaScript 实现,不要使用 Vue、React、构建工具或外部依赖。页面结构请使用语义化标签,例如 header、nav、main、section、footer;每个主要区块保持清晰层级,按钮使用 button 或 a,图片使用 img 并提供 alt。样式尽量写在 style 标签中,避免过度压缩,方便后续用可视化编辑器做文字、颜色、间距、图片和链接的微调。
Clone the repository:
git clone https://github.com/matongAI-lab/html-visual-editor.git
cd html-visual-editor
Install development dependencies:
npm install
Start the local server:
npm run serve
Open this URL in your browser:
http://127.0.0.1:4173/index.html
The editor itself is plain HTML, CSS, and JavaScript. There is no frontend build step required to use it.
The npm install step is only needed for the local server and automated browser tests.
You can also add the editor script to an existing HTML file:
<script src="editor.js"></script>
Then open the HTML file in a browser and use the floating edit button.
When you download or copy the edited HTML, the editor removes its own runtime artifacts, temporary attributes, selection markers, and contenteditable state.
The exported file should be a normal static HTML file, not a file that depends on this editor.
Dropping or selecting an HTML file loads it and enters visual editing mode automatically. This is intentional: the tool is designed for quick touch-up work, so opening a file usually means the next action is editing the rendered page.
If you want to inspect or change the source before editing, use the paste tab instead. Pasted HTML waits for the "Start editing" button.
The editing toolbar is a floating pill, centered at the top of the viewport by default instead of stretching across the whole width.
The style panel can be docked too: drag its header across the screen to dock it to the left or right edge, and double-click the header to send it back to the default right side. On small screens the panel stays a bottom sheet and docking is disabled.
When edit mode is off, the toolbar and the style panel are fully hidden and no longer intercept clicks meant for the page underneath.
The style panel does not show a full page outline. After you select an element, the page structure area shows only three nearby items:
The nearby items follow document order and can be clicked to jump through headings, paragraphs, list items, links, buttons, images, and useful leaf text containers such as div and span. This keeps the panel compact while still making it easier to move around dense AI-generated pages.
The editor only shows its own page controls when it can detect a reliable multi-page structure.
Supported cases include:
1 / 12.active, current, or is-active page state.If the editor cannot confidently detect pages, it hides its own page controls and lets the original page controls continue to work.
This conservative behavior is intentional. It avoids showing broken page buttons for HTML files whose pagination is controlled by custom scripts.
The compatibility test suite covers:
Firefox can also be tested separately, but local Firefox headless behavior may depend on the host machine and graphics environment.
Run syntax and inline-script checks:
npm run check
Run the main compatibility suite:
npm run test:compat
Run Firefox separately:
npm run test:compat:firefox
index.html Main editor entry page
editor.js Editor runtime
demo.html Demo HTML file
scripts/serve.js Local static server
tests/compat.spec.js Cross-browser compatibility tests
MIT. See LICENSE.