|
@@ -42,7 +42,136 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="canvas"></div>
|
|
|
+ <div
|
|
|
+ class="operation"
|
|
|
+ v-if="changeType == 'text' || changeType == 'luminance'"
|
|
|
+ >
|
|
|
+ <template v-if="changeType == 'text'">
|
|
|
+ <div class="text-operation">
|
|
|
+ <div class="font_sele">
|
|
|
+ <div
|
|
|
+ class="font_sele_input"
|
|
|
+ @click="FontFamilySele = !FontFamilySele"
|
|
|
+ >
|
|
|
+ <span>{{ fontForm.fontFamily }}</span>
|
|
|
+ <img
|
|
|
+ src="../../assets/teacherdev/font-sele-down.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div v-show="FontFamilySele" class="fontFamily_list">
|
|
|
+ <div class="Boutque_font">
|
|
|
+ <span class="one">精品字体</span>
|
|
|
+ <span
|
|
|
+ v-for="(item, index) in BoutiqueFontList"
|
|
|
+ :key="index + 'BoutiqueFon'"
|
|
|
+ >{{ item }}</span
|
|
|
+ >
|
|
|
+ <span class="more">更多...</span>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="fontFamily_one"
|
|
|
+ v-for="(item, index) in fontList"
|
|
|
+ :key="index + 'font'"
|
|
|
+ :value="item.fontFamily"
|
|
|
+ >
|
|
|
+ <div class="use" v-if="item.RecentUse">
|
|
|
+ <span>最近使用</span>
|
|
|
+ </div>
|
|
|
+ <div class="fontFamily">{{ item.fontFamily }}</div>
|
|
|
+ <div class="content">
|
|
|
+ <span>{{ item.content }}</span>
|
|
|
+ <img
|
|
|
+ v-if="item.collect"
|
|
|
+ src="../../assets/teacherdev/font-collect-sele.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ v-else
|
|
|
+ src="../../assets/teacherdev/font-collect.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-select
|
|
|
+ v-model="fontForm.fontSize"
|
|
|
+ style="width: 60px; margin-left: 8px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, i) in fontSizeList"
|
|
|
+ :key="i + 'fontsize'"
|
|
|
+ :value="item.value"
|
|
|
+ :label="item.name"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-select
|
|
|
+ v-model="fontForm.percent"
|
|
|
+ style="width: 68px; height: 32px; margin-left: 8px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="i in 100"
|
|
|
+ :key="i + 'fontsize'"
|
|
|
+ :value="i"
|
|
|
+ :label="i + '%'"
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <div class="img_dv">
|
|
|
+ <img src="../../assets/teacherdev/font-add.png" alt="" />
|
|
|
+ <img src="../../assets/teacherdev/font-remove.png" alt="" />
|
|
|
+ <img src="../../assets/teacherdev/font-blod.png" alt="" />
|
|
|
+ <img src="../../assets/teacherdev/font-red.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <el-color-picker
|
|
|
+ v-model="fontForm.fontColor"
|
|
|
+ style="margin-left: 8px; width: 60px"
|
|
|
+ ></el-color-picker>
|
|
|
+ <div class="img_dv" style="margin-left: 8px">
|
|
|
+ <img src="../../assets/teacherdev/font-left.png" alt="" />
|
|
|
+ <img src="../../assets/teacherdev/font-center.png" alt="" />
|
|
|
+ <img src="../../assets/teacherdev/font-right.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="img_dv" style="margin-left: 8px">
|
|
|
+ <img src="../../assets/teacherdev/font-line-left-right.png" alt="" />
|
|
|
+ <img src="../../assets/teacherdev/font-line-top-bottom.png" alt="" />
|
|
|
+ </div>
|
|
|
+ <div class="img_dv" style="margin-left: 8px">
|
|
|
+ <img src="../../assets/teacherdev/font-italic.png" alt="" />
|
|
|
+ <img src="../../assets/teacherdev/font-blod2.png" alt="" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="changeType == 'luminance'">
|
|
|
+ <div class="luminance-operation">
|
|
|
+ <img src="../../assets/teacherdev/sun.png" alt="" />
|
|
|
+ <div class="line-text">
|
|
|
+ <div class="DragLine">
|
|
|
+ <DragLine
|
|
|
+ :min="-100"
|
|
|
+ :max="100"
|
|
|
+ :width="400"
|
|
|
+ v-model="luminanceNumber"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="text">
|
|
|
+ <span>-100</span>
|
|
|
+ <span>0</span>
|
|
|
+ <span>+100</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="canvas"
|
|
|
+ :style="{
|
|
|
+ marginTop:
|
|
|
+ changeType == 'text' || changeType == 'luminance' ? 0 : '32px',
|
|
|
+ }"
|
|
|
+ ></div>
|
|
|
<div class="bottom">
|
|
|
<div>
|
|
|
<img src="../../assets/teacherdev/sfds-tailoring.png" alt="" />
|
|
@@ -50,13 +179,13 @@
|
|
|
<div>
|
|
|
<img src="../../assets/teacherdev/sfds-image.png" alt="" />
|
|
|
</div>
|
|
|
- <div>
|
|
|
+ <div @click="addText">
|
|
|
<img src="../../assets/teacherdev/sfds-text.png" alt="" />
|
|
|
</div>
|
|
|
<div>
|
|
|
<img src="../../assets/teacherdev/sfds-delete.png" alt="" />
|
|
|
</div>
|
|
|
- <div>
|
|
|
+ <div @click="changeluminance">
|
|
|
<img src="../../assets/teacherdev/sfds-sun.png" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
@@ -69,11 +198,12 @@
|
|
|
//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
|
|
//例如:import 《组件名称》from ‘《组件路径》';
|
|
|
import Header from "@/components/Header";
|
|
|
-
|
|
|
+import DragLine from "@/components/DragLine";
|
|
|
export default {
|
|
|
//import引入的组件需要注入到对象中才能使用
|
|
|
components: {
|
|
|
Header,
|
|
|
+ DragLine,
|
|
|
},
|
|
|
props: {},
|
|
|
data() {
|
|
@@ -84,6 +214,91 @@ export default {
|
|
|
height: "",
|
|
|
bg_color: "#FF3F3F",
|
|
|
},
|
|
|
+ BoutiqueFontList: [
|
|
|
+ "水墨字体",
|
|
|
+ "古风字体",
|
|
|
+ "中国风字体",
|
|
|
+ "书协专家字体",
|
|
|
+ "电影海报字体",
|
|
|
+ "国潮字体",
|
|
|
+ ],
|
|
|
+ fontSizeList: [
|
|
|
+ {
|
|
|
+ name: "5号",
|
|
|
+ value: 5,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ fontList: [
|
|
|
+ {
|
|
|
+ fontFamily: "方正颜真卿楷书",
|
|
|
+ content: "忽如一夜春风来",
|
|
|
+ collect: true,
|
|
|
+ RecentUse: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ fontFamily: "方正颜真卿楷书",
|
|
|
+ content: "忽如一夜春风来",
|
|
|
+ collect: false,
|
|
|
+ RecentUse: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ fontFamily: "方正颜真卿楷书",
|
|
|
+ content: "忽如一夜春风来",
|
|
|
+ collect: true,
|
|
|
+ RecentUse: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ fontFamily: "方正颜真卿楷书",
|
|
|
+ content: "忽如一夜春风来",
|
|
|
+ collect: false,
|
|
|
+ RecentUse: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ fontFamily: "方正颜真卿楷书",
|
|
|
+ content: "忽如一夜春风来",
|
|
|
+ collect: true,
|
|
|
+ RecentUse: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ fontFamily: "方正颜真卿楷书",
|
|
|
+ content: "忽如一夜春风来",
|
|
|
+ collect: false,
|
|
|
+ RecentUse: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ fontFamily: "方正颜真卿楷书",
|
|
|
+ content: "忽如一夜春风来",
|
|
|
+ collect: true,
|
|
|
+ RecentUse: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ fontFamily: "方正颜真卿楷书",
|
|
|
+ content: "忽如一夜春风来",
|
|
|
+ collect: false,
|
|
|
+ RecentUse: false,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ fontFamily: "方正颜真卿楷书",
|
|
|
+ content: "忽如一夜春风来",
|
|
|
+ collect: true,
|
|
|
+ RecentUse: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ fontFamily: "方正颜真卿楷书",
|
|
|
+ content: "忽如一夜春风来",
|
|
|
+ collect: false,
|
|
|
+ RecentUse: false,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ luminanceNumber: 0,
|
|
|
+ changeType: "",
|
|
|
+ fontForm: {
|
|
|
+ fontFamily: "方正颜真卿楷书",
|
|
|
+ fontSize: 5,
|
|
|
+ percent: 100,
|
|
|
+ fontColor: "#FFFFFF",
|
|
|
+ },
|
|
|
+ FontFamilySele: false,
|
|
|
};
|
|
|
},
|
|
|
//计算属性 类似于data概念
|
|
@@ -91,7 +306,16 @@ export default {
|
|
|
//监控data中数据变化
|
|
|
watch: {},
|
|
|
//方法集合
|
|
|
- methods: {},
|
|
|
+ methods: {
|
|
|
+ // 添加文字
|
|
|
+ addText() {
|
|
|
+ this.changeType = "text";
|
|
|
+ },
|
|
|
+ // 修改亮度
|
|
|
+ changeluminance() {
|
|
|
+ this.changeType = "luminance";
|
|
|
+ },
|
|
|
+ },
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
@@ -166,9 +390,154 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .operation {
|
|
|
+ margin-top: 33px;
|
|
|
+ }
|
|
|
+ .text-operation {
|
|
|
+ height: 48px;
|
|
|
+ border: 1px solid rgba(0, 0, 0, 0.08);
|
|
|
+ border-radius: 8px 8px 0px 0px;
|
|
|
+ border-bottom: none;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 16px;
|
|
|
+ .font_sele {
|
|
|
+ position: relative;
|
|
|
+ .font_sele_input {
|
|
|
+ width: 193px;
|
|
|
+ height: 32px;
|
|
|
+ padding: 0 6px;
|
|
|
+ background: #ffffff;
|
|
|
+ border: 1px solid rgba(0, 0, 0, 0.08);
|
|
|
+ border-radius: 4px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ cursor: pointer;
|
|
|
+ > span {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ > img {
|
|
|
+ width: 16px;
|
|
|
+ height: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .fontFamily_list {
|
|
|
+ position: absolute;
|
|
|
+ top: 39px;
|
|
|
+ left: 0;
|
|
|
+ width: 468px;
|
|
|
+ background: #ffffff;
|
|
|
+ border-width: 0px 1px 1px 1px;
|
|
|
+ border-style: solid;
|
|
|
+ border-color: #dbdbdb;
|
|
|
+ height: 520px;
|
|
|
+ overflow: auto;
|
|
|
+ .fontFamily_one {
|
|
|
+ padding: 12px 24px 16px 32px;
|
|
|
+ border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
|
|
+ position: relative;
|
|
|
+ .use {
|
|
|
+ width: 80px;
|
|
|
+ height: 80px;
|
|
|
+ background: url("../../assets/teacherdev/font-use.png");
|
|
|
+ background-size: cover;
|
|
|
+ position: absolute;
|
|
|
+ left: -20px;
|
|
|
+ top: -20px;
|
|
|
+ -webkit-transform: scale(0.5);
|
|
|
+
|
|
|
+ span {
|
|
|
+ color: #ffffff;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 16px;
|
|
|
+ position: absolute;
|
|
|
+ transform: translateX(-3px) translateY(20px) rotate(-45deg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .fontFamily {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ color: rgba(0, 0, 0, 0.5);
|
|
|
+ }
|
|
|
+ .content {
|
|
|
+ margin-top: 8px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ span {
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 32px;
|
|
|
+ line-height: 150%;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ img {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .Boutque_font {
|
|
|
+ padding: 16px 12px 0 12px;
|
|
|
+ background: #f0f0f0;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ line-height: 20px;
|
|
|
+ color: rgba(0, 0, 0, 0.6);
|
|
|
+ cursor: default;
|
|
|
+ span {
|
|
|
+ display: inline-block;
|
|
|
+ margin: 0 12px 12px 12px;
|
|
|
+ }
|
|
|
+ .one {
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ .more {
|
|
|
+ color: rgba(0, 0, 0, 0.35);
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .img_dv {
|
|
|
+ img {
|
|
|
+ width: 26px;
|
|
|
+ height: 26px;
|
|
|
+ cursor: pointer;
|
|
|
+ margin-left: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .luminance-operation {
|
|
|
+ width: 440px;
|
|
|
+ margin: 0 auto;
|
|
|
+ display: flex;
|
|
|
+ > img {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ }
|
|
|
+ .line-text {
|
|
|
+ margin-left: 17px;
|
|
|
+ .DragLine {
|
|
|
+ margin-top: 7px;
|
|
|
+ }
|
|
|
+ .text {
|
|
|
+ margin-top: 8px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 20px;
|
|
|
+ color: #919c9e;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
.canvas {
|
|
|
- margin-top: 32px;
|
|
|
- width: 1168px;
|
|
|
height: 500px;
|
|
|
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
|
}
|
|
@@ -199,23 +568,66 @@ export default {
|
|
|
</style>
|
|
|
<style lang="scss">
|
|
|
.CalligraphyMaster-cread {
|
|
|
- .el-color-picker__color {
|
|
|
- border: none;
|
|
|
- }
|
|
|
- .el-icon-close:before {
|
|
|
- content: "";
|
|
|
- }
|
|
|
- .el-icon-arrow-down:before {
|
|
|
- content: "";
|
|
|
+ .main-top {
|
|
|
+ .left {
|
|
|
+ .el-color-picker__color {
|
|
|
+ border: none;
|
|
|
+ }
|
|
|
+ .el-icon-close:before {
|
|
|
+ content: "";
|
|
|
+ }
|
|
|
+ .el-icon-arrow-down:before {
|
|
|
+ content: "";
|
|
|
+ }
|
|
|
+ .el-color-picker__color-inner {
|
|
|
+ position: absolute;
|
|
|
+ left: 3px;
|
|
|
+ top: 3px;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- .el-color-picker__color-inner {
|
|
|
- position: absolute;
|
|
|
- left: 3px;
|
|
|
- top: 3px;
|
|
|
- right: 0;
|
|
|
- bottom: 0;
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
+
|
|
|
+ .text-operation {
|
|
|
+ .el-color-picker__trigger {
|
|
|
+ width: 60px;
|
|
|
+ height: 32px;
|
|
|
+ }
|
|
|
+ .el-color-picker__empty,
|
|
|
+ .el-color-picker__icon {
|
|
|
+ left: 72%;
|
|
|
+ }
|
|
|
+ .el-color-picker__color {
|
|
|
+ width: 28px;
|
|
|
+ }
|
|
|
+ .el-icon-close:before,
|
|
|
+ .el-icon-arrow-down:before {
|
|
|
+ color: gray;
|
|
|
+ }
|
|
|
+ .el-color-picker__color-inner {
|
|
|
+ position: absolute;
|
|
|
+ left: -1px;
|
|
|
+ top: -1px;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ border: 1px solid rgba(0, 0, 0, 0.08);
|
|
|
+ border-radius: 2px;
|
|
|
+ }
|
|
|
+ .el-input__inner {
|
|
|
+ padding: 0 8px;
|
|
|
+ }
|
|
|
+ .el-input__inner,
|
|
|
+ .el-input__suffix {
|
|
|
+ height: 32px;
|
|
|
+ }
|
|
|
+ .el-input__icon {
|
|
|
+ line-height: 32px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|