pptxgen实现拖拽可视化ppt演示文档生成设计导出pptx代码
代码语言:html
所属分类:其他
代码描述:pptxgen实现拖拽可视化ppt演示文档生成设计导出pptx代码,可编辑幻灯片,导出json。简洁大气。
代码标签: pptxgen 拖拽 可视化 ppt 演示 文档 生成 设计 导出 pptx 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Plate Editor - PPT 多页编辑器(含 PPTX 导出)</title>
<style>
:root {
--bg: #f6f7f9; --panel: #ffffff; --border: #e4e6eb; --primary: #3b82f6; --text: #1f2937; --muted: #6b7280;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,"PingFang SC","Microsoft Yahei",sans-serif;
color: var(--text); background: linear-gradient(180deg, var(--bg), #eef1f5); display: flex; flex-direction: column; }
header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border);
background: var(--panel); position: sticky; top: 0; z-index: 5; }
header h1 { font-size: 16px; margin: 0 10px 0 4px; font-weight: 700; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn, button, label.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1px solid var(--border);
background: #fff; color: #111; border-radius: 8px; cursor: pointer; font-size: 13px; user-select: none; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.sep { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }
.root { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px 1fr 300px; gap: 12px; padding: 12px; }
.sidebar { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; min-height: 0; }
.slides-header { padding: 10px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.slides { padding: 10px; overflow: auto; gap: 10px; display: flex; flex-direction: column; min-height: 0; }
.slide-item { border: 2px solid transparent; border-radius: 8px; padding: 6px; background: #fafafa; cursor: pointer; transition: border-color .15s, box-shadow .15s;
display: grid; grid-template-columns: 80px 1fr; gap: 8px; align-items: center; }
.slide-item:hover { border-color: var(--border); }
.slide-item.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,.12); background: #fff; }
.thumb { width: 80px; height: 45px; border: 1px solid var(--border); border-radius: 4px; background: #fff; position: relative; overflow: hidden; }
.thumb-swatch { position: absolute; inset: 0; }
.slide-meta { font-size: 12px; color: var(--muted); }
.stage-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; min-height: 0; }
.stage-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.stage-viewport { flex: 1; min-height: 0; display: grid; place-items: center; overflow: auto;
background: repeating-conic-gradient(#f8fafc 0 25%, #f1f5f9 0 50%) 50%/20px 20px; border-radius: 8px; border: 1px dashed var(--border);
touch-action: none; }
.stage { width: 960px; height: 540px; background: #fff; border: 1px solid #ddd; border-radius: 6px; position: relative; box-shadow: 0 10px 20px rgba(0,0,0,.06); }
.el { position: absolute; user-select: none; box-sizing: border-box; }
.el img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.text-box { width: 100%; height: 100%; outline: none; padding: 6px 8px; cursor: text; overflow: auto; user-select: text; background: transparent; }
.shape { width: 100%; height: 100%; border: 1px solid #333; background: #dbeafe; }
.selected { outline: 2px solid var(--primary); }
.handles { position: absolute; inset: -6px; pointer-events: none; }
.handle { position: absolute; width: 10px; height: 10px; background: #fff; border: 2px solid var(--primary); border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,.2); pointer-events: auto; cursor: nwse-resize; }
.h-n { top: -6px; left: calc(50% - 5px); cursor: ns-resize; }
.h-s { bottom: -6px; left: calc(50% - 5px); cursor: ns-resize; }
.h-e { right: -6px; top: calc(50% - 5px); cursor: ew-resize; }
.h-w { left: -6px; top: calc(50% - 5px); cursor: ew-resize; }
.h-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.h-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.h-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.h-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.inspector { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.inspector h3 { font-size: 14px; margin: 4px 0; }
.field { display: grid; grid-template-columns: 90px 1fr; gap: 8px; align-items: center; font-size: 13px; }
.field input[type="text"], .field input[type="number"], .field input[type="color"], .field select { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; font-size: 13px; }
.hint { color: var(--muted); font-size: 12px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 6px; }
.kbd { background: #f3f4f6; border: 1px solid #e5e7eb; padding: 1px 4px; border-radius: 4px; font-family: ui-monospace, Menlo, Consolas, monospace; }
</style>
</head>
<body>
<header>
<h1>Plate Editor</h1>
<div class="toolbar" id="topToolbar">
<button class="btn primary" id="btnNewSlide">新建页面</button>
<button class="btn" id="btnDuplicateSlide">复制页面</button>
<button class="btn" id="btnDeleteSlide">删除页面</button>
<div class="sep"></div>
<button class="btn" id="btnAddText">文本</button>
<button class="btn" id="btnAddRect">矩形</button>
<button class="btn" id="btnAddEllipse">圆形</button>
<label class="btn" for="fileImage">图片</label>
<input id="fileImage" type="file" accept="image/*" style="display:none" />
<button class="btn" id="btnAddImageUrl">图片URL</button>
<div class="sep"></div>
<button class="btn" id=&quo.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0