-
Notifications
You must be signed in to change notification settings - Fork 6
/
styled.xml
315 lines (273 loc) · 8.18 KB
/
styled.xml
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<style>
@font-face {
font-family: "DroidSans";
src: local("../../../imgui/misc/fonts/DroidSans.ttf");
}
@font-face {
font-family: "Roboto";
src: local("../../../imgui/misc/fonts/Roboto-Medium.ttf") format(opentype);
}
@font-face {
font-family: "Times New Roman";
src: local("../../../samples/fonts/times new roman.ttf") format(opentype);
}
@font-face {
font-family: "MaterialIcons";
src: local("../../../samples/fonts/MaterialIcons-Regular.ttf");
unicode-range: U+E000-EB60;
}
template {
font-family: DroidSans;
padding: 5px;
}
span {
margin-right: 0.2rem;
}
div:not(:last-of-type) {
margin-bottom: 0.5rem;
}
.icon {
font-family: MaterialIcons;
display: inline-block;
}
#alt {
color: #FFCC00;
font-family: Times New Roman;
}
window {
padding: 5px;
font-size: 20px;
}
.btn {
padding: 0.2rem 0.5rem;
display: inline-block;
background-color: #327ba8;
color: #FFFFFF;
border-radius: 5px;
border: 1px solid rgba(0, 0, 0, 0);
margin-right: 0.2rem;
}
.btn:hover {
background-color: rgba(60, 146, 199, 1.0);
border: 1px solid #FFFFFF;
}
.btn:active {
background-color: rgba(60, 146, 199, 0.9);
border: 1px solid #FFFFFF;
}
.icon-btn .icon {
display: none;
}
.icon-btn .icon.normal {
display: inline-block;
}
.icon-btn:hover .icon {
display: none;
}
.icon-btn:hover .icon.over {
display: inline-block;
}
.icon-btn:active .icon {
display: none;
}
.icon-btn:active .icon.active {
display: inline-block;
}
.heart {
padding-top: 2px;
display: inline-block;
margin-right: 0.2rem;
}
.heart:hover {
color: #52b7ff;
}
.heart:active {
color: #52b7ff;
}
.selector .btn {
font-size: 20px;
margin: 0 1px 0 0;
padding-left: 0.6em;
padding-right: 0.6em;
border: 0;
border-radius: 0;
}
.selector > .btn:first-child {
border-radius: 5px 0 0 5px;
}
.selector > .btn:last-child {
margin: 0;
border-radius: 0 5px 5px 0;
}
.separator {
border-top: 1px solid #000000;
border-bottom: 1px solid #444444;
width: 100%;
height: 0;
}
input {
margin-right: 2px;
margin-bottom: 2px;
}
input[type="text"], input[type="password"], input[type="number"] {
display: block;
padding: 0.2em 0.5em;
margin: 2px 2px 10px 2px;
border: 1px solid #AAAAAA;
border-radius: 6px;
background-color: #222222;
}
input[type="text"]:active, input[type="password"]:active, input[type="number"]:active {
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 8px;
border: 3px solid rgba(126, 198, 242, 1.0);
border-radius: 9px;
}
input.error {
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
margin-bottom: 8px;
border: 3px solid rgba(255, 0, 0, 1.0);
border-radius: 9px;
}
label {
display: block;
margin-left: 2px;
margin-bottom: 2px;
font-size: 0.8em;
color: #AAAAAA;
}
input[type="checkbox"] {
display: inline-block !important;
}
input[type="range"] {
background-color: #222222;
padding: 5px;
border-radius: 5px;
}
.radio input {
margin-top: 5px;
display: block;
}
.form {
border: 1px solid #AAAAAA;
padding: 6px;
background-color: #333333;
border-radius: 5px;
}
</style>
<template>
<window name="Styled Elements Demo">
<html>
<body>
<div>Block element (div)</div>
<span>Inline element (span)</span>
<span id="alt">Another span that is using Times New Roman font</span>
<h3>First/last Elements</h3>
<div>
<div class="selector" style="background-color: #FFFFFF; padding: 2px; border-radius: 8px; display: inline-block">
<div class="btn icon"></div>
<div v-for="key in self.choices" class="btn">{{ key }}</btn>
<div class="btn icon"></div>
</div>
</div>
<h3>Styled Buttons Demo</h3>
<div class="btn">BUTTON</div>
<div class="btn icon-btn">
<span class="icon normal"></span>
<span class="icon over"></span>
<span class="icon active"></span>
</div>
<div class="icon heart" v-on:click="self.toggle = not self.toggle">{{if self.toggle then return self.heartActive else return self.heartInactive end}}</div>
<div class="btn">APPROVED<span class="icon"></span></div>
<h3>Forms</h3>
<div class="form">
<label>Styled input example:</label>
<input type="text" placeholder="hello there..."/>
<label>Username:</label>
<input type="text" :class="self.usernameClasses" placeholder="username" v-model="user"/>
<label>Password:</label>
<input type="password" :class="self.passwordClasses" placeholder="password" v-model="password"/>
<label style="font-size: 0.9em">Other kinds of inputs:</label>
<input class="btn" type="button" value="submit" v-on:click="self:submit()"/>
<input class="btn" type="color" placeholder="pick you color" v-model="color"/>
<input style="margin-right: 0.2rem; margin-top: 0.2rem; display: block" type="checkbox" placeholder="check" v-model="checked"/>
<label>Radio buttons:</label>
<div class="radio">
<input type="radio" placeholder="Easy" value="easy" v-model="mode"/>
<input type="radio" placeholder="Normal" value="normal" v-model="mode"/>
<input type="radio" placeholder="Hard" value="hard" v-model="mode"/>
<input type="radio" placeholder="Nightmare" value="nightmare" v-model="mode"/>
</div>
<label>Range input:</label>
<span>
<input type="range" style="display: inline-block; width: 50%" min="0" max="20" step="0.1" v-model="slide"/>
</span>
<label>Number input:</label>
<span>
<input type="number" style="display: inline-block; width: 50%" min="0" max="20" step="0.1" v-model="slide"/>
</span>
<label>Checkboxes sharing the same model:</label>
<input style="margin-right: 0.2rem; margin-top: 0.2rem; display: block" type="checkbox" value="first checkbox" v-model="arr"/>
<input style="margin-right: 0.2rem; margin-top: 0.2rem; display: block" type="checkbox" value="second checkbox" v-model="arr"/>
<input style="margin-right: 0.2rem; margin-top: 0.2rem; display: block" type="checkbox" value="third checkbox" v-model="arr"/>
<label>Choices:</label>
<span style="display: inline-block; padding: 5px; background-color: #FFCC00; color: black; border-radius: 5px" v-for="c in self.arr">{{c}}</span>
<span v-if="#self.arr == 0">No choices yet</span>
</div>
<span class="icon" v-if="self.checked" style="position: absolute; right: 0px; bottom: 0px; color: #000000; background-color: #FFCC00; display: inline; padding: 0.3em; border-radius: 0.2em"></span>
</body>
</html>
</window>
<custom-window name="Custom Window Example" collapsible="true" closable="true">
<label>This input has custom style</label>
<input type="text" class="test"/>
<div class="btn">custom</div>
<div class="btn">looking</div>
<div class="btn">buttons</div>
</custom-window>
</template>
<script>
local CustomWindow = require "components.window"
return ImVue.new({
components = {
['custom-window'] = CustomWindow
},
data = function()
return {
toggle = false,
heartActive = '',
heartInactive = '',
choices = {
'1',
'2',
'3'
},
user = '',
password = '',
usernameClasses = {},
passwordClasses = {},
color = 0xFF444444,
slide = 10,
mode = "easy",
checked = false,
arr = {}
}
end,
submit = function(self)
if self.user == '' then
self.usernameClasses[1] = 'error'
else
self.usernameClasses = {}
end
if self.password == '' then
self.passwordClasses[1] = 'error'
else
self.passwordClasses = {}
end
end
})
</script>