ruff_wasm实现浏览器中js对python代码格式化输出代码
代码语言:html
所属分类:其他
代码描述:ruff_wasm实现浏览器中js对python代码格式化输出代码
代码标签: ruff_wasm 浏览器 js 对 python 代码 格式化 输出
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Python 代码格式化工具 (原生JS + Ruff WASM)</title>
<style>
/* 基本样式重置和全局设置 */
:root {
--bg-color: #f4f7f9;
--pane-bg: #ffffff;
--text-color: #333;
--border-color: #d1d5db;
--button-bg: #007bff;
--button-hover-bg: #0056b3;
--button-disabled-bg: #a0c7e4;
--font-code: 'Courier New', Courier, monospace;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
margin: 0;
padding: 20px;
background-color: var(--bg-color);
color: var(--text-color);
display: flex;
flex-direction: column;
align-items: center;
}
/* 标题 */
h1 {
color: #2c3e50;
margin-bottom: 20px;
}
/* 主容器 */
.container {
display: flex;
flex-wrap: wrap; /* 在小屏幕上换行 */
gap: 20px;
width: 100%;
max-width: 1400px;
}
/* 编辑器面板 */
.editor-pane {
flex: 1; /* 等分空间 */
min-width: 300px; /* 最小宽度 */
display: flex;
flex-direction: column;
height: 60vh; /* 视图高度的60% */
min-height: 400px;
}
.editor-pane label {
font-weight: bold;
margin-bottom: 8px;
}
/* 文本输入/输出区域 */
textarea {
width: 100%;
heigh.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0