feat: WYSIWYG 빌더 1차 기능 완성 및 테스트 추가
This commit is contained in:
+16
-1
@@ -38,11 +38,26 @@ export function exportFrame(frame: Frame): Exported {
|
||||
piecesCss.push(r.css)
|
||||
}
|
||||
}
|
||||
const html = `<div class="frame-scale"><div class="frame">${piecesHtml.join('')}</div></div>`
|
||||
const inner = `<div class="frame-scale"><div class="frame">${piecesHtml.join('')}</div></div>`
|
||||
const css = [
|
||||
`.frame{position:relative;width:${frame.width}px;height:${frame.height}px;background:${frame.background}}`,
|
||||
`.frame-scale{transform-origin:0 0}`,
|
||||
...piecesCss,
|
||||
].join('\n')
|
||||
const html = [
|
||||
'<!doctype html>',
|
||||
'<html lang="en">',
|
||||
'<head>',
|
||||
'<meta charset="utf-8" />',
|
||||
'<meta name="viewport" content="width=device-width,initial-scale=1" />',
|
||||
'<title>WYSIWYG Frame</title>',
|
||||
'<link rel="stylesheet" href="styles.css" />',
|
||||
'</head>',
|
||||
'<body>',
|
||||
inner,
|
||||
'<script src="app.js"></script>',
|
||||
'</body>',
|
||||
'</html>',
|
||||
].join('')
|
||||
return { html, css, js: '' }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user