-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstatic.js
214 lines (214 loc) · 8.03 KB
/
static.js
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
202
203
204
205
206
207
208
209
210
211
212
213
214
app.plugins.add(
"static",
{
name: "Button Static Styling",
content: `
<div class="input">
<label>Text</label>
<input id="static-text" onchange="button.text(this.value)" placeholder="Text inside of button" type="text">
</div>
<div class="input">
<label>Selector</label>
<input id="static-selector" onchange="button.selector(this.value)" placeholder="Button selector" type="text">
</div>
<hr>
<div class="input">
<label>Margin</label>
<input id="static-margin" onchange="button.styleInput(this, 'margin')" placeholder="top right bottom left" type="text">
</div>
<div class="input">
<label>Padding</label>
<input id="static-padding" onchange="button.styleInput(this, 'padding')" placeholder="top right bottom left" type="text">
</div>
<div class="input">
<label>Box sizing</label>
<select onchange="button.styleInput(this, 'box-sizing')" id="static-box-sizing">
<option>content-box</option>
<option>border-box</option>
</select>
</div>
<hr>
<div class="input">
<label>Width</label>
<input id="static-width" onchange="button.styleInput(this, 'width')" placeholder="Width" type="text">
</div>
<div class="input">
<label>Minimum width</label>
<input id="static-min-width" onchange="button.styleInput(this, 'min-width')" placeholder="min-width" type="text">
</div>
<div class="input">
<label>Maximum width</label>
<input id="static-max-width" onchange="button.styleInput(this, 'max-width')" placeholder="max-width" type="text">
</div>
<div class="input">
<label>Height</label>
<input id="static-height" onchange="button.styleInput(this, 'height')" placeholder="Height" type="text">
</div>
<div class="input">
<label>Minimum height</label>
<input id="static-min-height" onchange="button.styleInput(this, 'min-height')" placeholder="min-height" type="text">
</div>
<div class="input">
<label>Maximum height</label>
<input id="static-max-height" onchange="button.styleInput(this, 'max-height')" placeholder="max-height" type="text">
</div>
<hr>
<div class="input">
<label>Color</label>
<input id="static-color" onchange="button.styleInput(this, 'color')" placeholder="Font color" type="text">
</div>
<div class="input">
<label>Font Size</label>
<input id="static-font-size" onchange="button.styleInput(this, 'font-size')" placeholder="Font size" type="text">
</div>
<div class="input">
<label>Font family</label>
<input id="static-font-family" onchange="button.styleInput(this, 'font-family')" placeholder="Font family" type="text">
</div>
<div class="input">
<label>Font kerning</label>
<select onchange="button.styleInput(this, 'font-kerning')" id="static-font-kerning">
<option>normal</option>
<option>auto</option>
<option>none</option>
</select>
</div>
<div class="input">
<label>Font weight</label>
<select onchange="button.styleInput(this, 'font-weight')" id="static-font-weight">
<option>normal</option>
<option>bold</option>
<option>bolder</option>
<option>lighter</option>
<option>100</option>
<option>200</option>
<option>300</option>
<option>400</option>
<option>500</option>
<option>600</option>
<option>700</option>
<option>800</option>
<option>900</option>
</select>
</div>
<div class="input">
<label>Font style</label>
<select onchange="button.styleInput(this, 'font-style')" id="static-font-style">
<option>normal</option>
<option>italic</option>
<option>oblique</option>
<option>initial</option>
<option>inherit</option>
</select>
</div>
<div class="input">
<label>Line height</label>
<input id="static-line-height" onchange="button.styleInput(this, 'line-height')" placeholder="Line height" type="text">
</div>
<div class="input">
<label>Text align</label>
<input id="static-text-align" onchange="button.styleInput(this, 'text-align')" placeholder="Text align" type="text">
</div>
<div class="input">
<label>Text decoration</label>
<input id="static-text-decoration" onchange="button.styleInput(this, 'text-decoration')" placeholder="Text decoration" type="text">
</div>
<hr>
<div class="input">
<label>Border</label>
<input id="static-border" onchange="button.styleInput(this, 'border')" placeholder="Border" type="text">
</div>
<div class="input">
<label>Border radius</label>
<input id="static-border-radius" onchange="button.styleInput(this, 'border-radius')" placeholder="Border radius" type="text">
</div>
<hr>
<div class="input">
<label>Outline</label>
<input id="static-outline" onchange="button.styleInput(this, 'outline')" placeholder="outline" type="text">
</div>
<div class="input">
<label>Outline offset</label>
<input id="static-outline-offset" onchange="button.styleInput(this, 'outline-offset')" placeholder="outline offset" type="text">
</div>
<hr>
<div class="input">
<label>Background</label>
<input id="static-background" onchange="button.styleInput(this, 'background')" placeholder="Background" type="text">
</div>
<hr>
<div class="input">
<label>Box shadow</label>
<input id="static-box-shadow" onchange="button.styleInput(this, 'box-shadow')" placeholder="box-shadow" type="text">
</div>
<!-- <div class="input">
<label>Padding</label>
<div>
<input type="text">
<input type="text">
<input type="text">
<input type="text">
</div>
</div> -->
`,
code: () => {
input.vfs(
[
"#static-margin",
"#static-padding",
"#static-box-sizing",
"#static-width",
"#static-min-width",
"#static-max-width",
"#static-height",
"#static-min-height",
"#static-max-height",
"#static-color",
"#static-font-size",
"#static-font-family",
"#static-font-kerning",
"#static-font-weight",
"#static-font-style",
"#static-line-height",
"#static-text-align",
"#static-text-decoration",
"#static-border",
"#static-border-radius",
"#static-outline",
"#static-outline-offset",
"#static-background",
"#static-box-shadow",
],
[
"margin",
"padding",
"box-sizing",
"width",
"min-width",
"max-width",
"height",
"min-height",
"max-height",
"color",
"font-size",
"font-family",
"font-kerning",
"font-weight",
"font-style",
"line-height",
"text-align",
"text-decoration",
"border",
"border-radius",
"outline",
"outline-offset",
"background",
"box-shadow",
]
);
input.value("#static-text", button.getText());
input.value("#static-selector", button.getSelector());
},
},
true
);