vue3实现可设置参数的强大纸张生成器代码
代码语言:html
所属分类:其他
代码描述:vue3实现可设置参数的强大纸张生成器代码,可自定义各类纸张。支持 12 种基础纸张类型,包含横线、竖线、方格等;11 种特殊用途纸张,如汉语拼音作业纸、作文纸等;6 种书法练习纸,如米字格、回宫格等;11 种新增特色纸张,如复古笔记纸、儿童涂鸦纸等。 纸张尺寸方面,提供 A4、A5、A3 等标准尺寸,以及 Letter、Legal 等国际通用尺寸,还有自定义尺寸选项。 主题上,有默认、夜间、复古棕等 7 种基础主题,以及极简风、海洋风等 7 种新增主题。 线条设置允许用户自定义颜色、样式(实线、虚
下面为部分代码预览,完整代码请点击下载或在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>纸张生成器</title>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue3.2.22.js"></script>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jspdf.umd.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #f5f5f5;
}
.app {
display: flex;
height: 100vh;
}
.sidebar {
width: 350px; /* Increased width slightly for better layout */
background: white;
box-shadow: 2px 0 10px rgba(0,0,0,0.1);
overflow-y: auto;
padding: 20px;
}
.main-content {
flex: 1;
padding: 20px;
overflow: auto;
display: flex;
flex-direction: column;
}
.section {
margin-bottom: 25px;
padding: 15px;
background: #f9f9f9;
border-radius: 8px;
}
.section-title {
font-size: 16px;
font-weight: 600;
margin-bottom: 15px;
color: #333;
border-bottom: 2px solid #007bff;
padding-bottom: 5px;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
font-weight: 500;
color: #555;
}
.form-control {
width: 100%;
padding: 8px 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
}
.form-control:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}
.grid-2 {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.grid-4 {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}
.color-picker {
display: flex;
align-items: center;
gap: 10px;
}
.color-preview {
width: 30px;
height: 30px;
border-radius: 4px;
border: 1px solid #ddd;
cursor: pointer;
}
.preset-colors {
display: flex;
gap: 5px;
margin-top: 10px;
}
.preset-color {
width: 25px;
height: 25px;
border-radius: 4px;
border: 1px solid #ddd;
cursor: pointer;
}
.preset-color:hover {
transform: scale(1.1);
}
.btn {
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: all 0.3s;
}
.btn-primary {
background: #007bff;
color: white;
}
.btn-primary:hover {
background: #0056b3;
}
.btn-secondary {
background: #6c757d;
color: white;
}
.btn-secondary:hover {
background: #545b62;
}
.btn-success {
background: #28a745;
color: white;
}
.btn-success:hover {
background: #1e7e34;
}
.export-buttons {
display: flex;
gap: 10px;
margin-top: 20px;
}
.preview-container {
background: white;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
padding: 20px;
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
.preview-content {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
overflow: auto;
padding: 20px;
}
.paper-preview {
background: white;
box-shadow: 0 4px 20px rgba(0,0,0,0.15);
border-radius: 4px;
overflow: hidden;
max-width: 100%;
max-height: 100%;
}
.paper-svg {
display: block;
max-width: 100%;
max-height: 100%;
width: auto;
height: auto;
}
.switch {
position: relative;
display: inline-block;
width: 50px;
height: 24px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
border-radius: 24px;
}
.slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: #007bff;
}
input:checked + .slider:before {
transform: translateX(26px);
}
.theme-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); /* Responsive columns */
gap: 10px;
margin-top: 10px;
}
.theme-option {
padding: 10px;
border: 2px solid #ddd;
border-radius: 6px;
cursor: pointer;
text-align: center;
font-size: 12px;
transition: all 0.3s;
}
.theme-option.active {
border-color: #007bff;
background: #e3f2fd;
}
.page-indicator {
text-align: center;
margin-bottom: 20px;
color: #666;
}
.preview-scale-info {
text-align: center;
margin-bottom: 10px;
color: #888;
font-size: 12px;
}
@media (max-width: 768px) {
.app {
flex-direction: column;
}
.sidebar {
width: 100%;
height: auto;
}
.grid-4 {
grid-template-columns: repeat(2, 1fr);
}
}
</style>
</head>
<body>
<div id="app">
<div class="app">
<!-- 侧边栏配置 -->
<div class="sidebar">
<h2 style="margin-bottom: 20px; color: #333;">纸张生成器</h2>
<!-- 纸张类型 -->
<div class="section">
<div class="section-title">纸张类型</div>
<div cl.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0