forked from vitmalina/w2ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
colors.html
74 lines (74 loc) · 2.04 KB
/
colors.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
<html>
<head>
<link rel="stylesheet" type="text/css" media="screen" href="../dist/w2ui.css" />
<link rel="stylesheet" type="text/css" media="screen" href="../libs/font-awesome/css/font-awesome.css" />
<script type="text/javascript" src="../libs/jquery/jquery-3.5.1.min.js"></script>
<script type="module" src="../src/w2compat.js?globals"></script>
<script>
$(function () {
$('.color').w2field('color');
});
</script>
<style>
.div {
margin-left: 20px;
margin-top: 5px;
}
.preview {
display: inline-block;
width: 23px;
height: 23px;
float: left;
}
.color {
width: 150px;
margin-left: 10px;
}
.first {
float: left;
}
.left {
float: left;
}
</style>
<body>
<div class="first">
<img src="colors.png" style="width: 300px">
</div>
<div class="left">
<div class="div">
<div class="preview"></div>
<input class="color" onchange="setColor(this)">
</div>
<div class="div">
<div class="preview"></div>
<input class="color" onchange="setColor(this)">
</div>
<div class="div">
<div class="preview"></div>
<input class="color" onchange="setColor(this)">
</div>
<div class="div">
<div class="preview"></div>
<input class="color" onchange="setColor(this)">
</div>
<div class="div">
<div class="preview"></div>
<input class="color" onchange="setColor(this)">
</div>
<div class="div">
<div class="preview"></div>
<input class="color" onchange="setColor(this)">
</div>
<div class="div">
<div class="preview"></div>
<input class="color" onchange="setColor(this)">
</div>
</div>
<script>
function setColor(el) {
$(el).prev().css('background-color', '#'+el.value)
}
</script>
</body>
</html>