-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
201 lines (200 loc) · 5.75 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>画板</title>
<link rel="stylesheet" href="style.css">
<script src="lib/jquery-3.1.0.js"></script>
<script src="lib/vue.min.js"></script>
</head>
<body>
<div id="drawing-board-page">
<header>
<div class="current-tool">
<i :class="currentTool"></i>
<input type="hidden" name="currentTool" v-model="currentToolNum">
</div>
<ul class="tool-info clearfix">
<li class="lineWidth">
<p>线条宽度:</p>
<input type="number" name="lineWidth" v-model="lineWidth" v-on:input="bindLineWidth($event)">
</li>
<li class="color">
<p>笔触颜色:</p>
<div class="color-box">
<div class="color-value"
data-type="1"
:style="{backgroundColor: '#'+pageLineColor}"
@click="clickPopupColorShow($event)"
v-cloak></div>
</div>
</li>
<li class="color">
<p>填充颜色:</p>
<div class="color-box">
<div class="color-value"
data-type="2"
:style="{backgroundColor: '#'+pageFillColor}"
@click="clickPopupColorShow($event)"
v-cloak></div>
</div>
</li>
<!--<li class="alpha">
<p>透明度:</p>
<div class="select-alpha-box">
<input type="text" name="alpha" v-model="currentAlpha" v-on:input="bindAlpha($event)">
<div class="select-alpha"
@click="clickSelectAlphaSliderShow()"
>
<div class="slash leftSlash"></div>
<div class="slash rightSlash"></div>
</div>
</div>
<div class="select-alpha-slider"
v-if="selectAlphaSliderShow"
v-cloak
>
<div class="slider-axis">
<div class="slider-axis-triangle"
:style="{left:sliderAlpha+'px'}"
@mousedown="sliderMove($event)"
></div>
</div>
</div>
</li>-->
</ul>
<div class="downloadImage" @click="downloadImage()">点击下载</div>
<div class="clearScreen" @click="clearScreen()">一键清屏</div>
</header>
<main class="clearfix">
<ul class="tools clearfix">
<li v-for="(tool,index) in tools"
:data-tool="tool.dataTool"
:class="{'active':index==selectedToolIndex}">
<i :class="tool.toolClass"
@click="selectTool(tool,index)"
>
</i>
</li>
</ul>
<input id="select-tool" type="hidden" value="1">
<canvas id="drawing-board" width="862" height="400" @mousedown="painting($event)"></canvas>
</main>
<!--公用透明背景遮罩,作用:防止其他元素相应事件-->
<div class="tr-bk" v-show="trBk" v-cloak></div>
<!--T 输入框-->
<input type="text"
name="inputText"
v-model="inputTextValue"
:style="{
left:inputTextPosition.x+'px',
top:inputTextPosition.y+'px',
height:lineWidth < 12 ? 12+'px':lineWidth+'px',
fontSize:lineWidth < 12 ? 12+'px':lineWidth+'px',
color:'#'+pageLineColor
}"
v-show="inputTextShow"
@click="bindInputText($event)"
v-cloak
>
<!-- 临时矩形 -->
<div class="tempRect"
:style="{
width:rectTempAttr.width+'px',
height:rectTempAttr.height+'px',
left:rectTempAttr.left+'px',
top:rectTempAttr.top+'px',
borderWidth:rectTempAttr.borderWidth+'px',
borderStyle:rectTempAttr.borderStyle,
borderColor:'#'+rectTempAttr.borderColor,
backgroundColor:'#'+rectTempAttr.backgroundColor,
}"
v-show="rectTempPositionShow"
v-cloak
></div>
<!--临时圆形-->
<div class="tempRound"
:style="{
width:roundTempAttr.r+'px',
height:roundTempAttr.r+'px',
left:roundTempAttr.left+'px',
top:roundTempAttr.top+'px',
borderWidth:roundTempAttr.borderWidth+'px',
borderStyle:roundTempAttr.borderStyle,
borderColor:'#'+roundTempAttr.borderColor,
backgroundColor:'#'+roundTempAttr.backgroundColor,
}"
v-show="roundTempPositionShow"
v-cloak
></div>
<div class="popup-color"
:style="{left:popupColorPosition.x+'px',top:popupColorPosition.y+'px'}"
v-show="popupColorShow"
v-cloak
>
<div class="title" @mousedown="dragPopupColor($event)">颜色选择器</div>
<div class="content">
<div class="left">
<ul class="alternative-color">
<li v-for="color in colors"
:style="{backgroundColor: color}"
@click="selectColor($event)"
>
</li>
</ul>
</div>
<div class="divider"></div>
<div class="right">
<div class="color-show-box clearfix">
<div class="color-show">
新的
<div class="color-contrast">
<div class="new-color" :style="{backgroundColor:'#'+newColor}"></div>
<div class="current-color" :style="{backgroundColor:'#'+pageColor}"></div>
</div>
当前
</div>
<div class="color-show-btns">
<a href="javascript:;" class="confirm" @click="colorConfirm()">确定</a>
<a href="javascript:;" class="cancel" @click="colorCancel()">取消</a>
</div>
</div>
<div class="color-setting clearfix">
<div class="rgb-color clearfix">
<ul>
<li class="clearfix">
<p>R:</p>
<input type="text" name="R-color" maxlength="3" v-model="RColor"
v-on:input="bindRColor($event)">
</li>
<li class="clearfix">
<p>G:</p>
<input type="text" name="G-color" maxlength="3" v-model="GColor"
v-on:input="bindGColor($event)">
</li>
<li class="clearfix">
<p>B:</p>
<input type="text" name="B-color" maxlength="3" v-model="BColor"
v-on:input="bindBColor($event)">
</li>
</ul>
</div>
<div class="hex-color clearfix">
<p>16进制值:</p>
<div class="hex-color-setting">
<p>#</p>
<input type="text"
name="hex-color"
v-model="newColor"
maxlength="6"
v-on:input="bindHex($event)"
></div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="main.js"></script>
</body>
</html>