소스 검색

Custom colors

Robert Carnecky 10 년 전
부모
커밋
ca0870dfb5
3개의 변경된 파일194개의 추가작업 그리고 10개의 파일을 삭제
  1. 4
    9
      generator/generate.html
  2. 151
    0
      generator/js/colors.js
  3. 39
    1
      generator/js/ui.js

+ 4
- 9
generator/generate.html
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 151
- 0
generator/js/colors.js 파일 보기

@@ -0,0 +1,151 @@
1
+var css_color_names = [
2
+    "Black",
3
+    "Navy",
4
+    "DarkBlue",
5
+    "MediumBlue",
6
+    "Blue",
7
+    "DarkGreen",
8
+    "Green",
9
+    "Teal",
10
+    "DarkCyan",
11
+    "DeepSkyBlue",
12
+    "DarkTurquoise",
13
+    "MediumSpringGreen",
14
+    "Lime",
15
+    "SpringGreen",
16
+    "Aqua",
17
+    "Cyan",
18
+    "MidnightBlue",
19
+    "DodgerBlue",
20
+    "LightSeaGreen",
21
+    "ForestGreen",
22
+    "SeaGreen",
23
+    "DarkSlateGray",
24
+    "LimeGreen",
25
+    "MediumSeaGreen",
26
+    "Turquoise",
27
+    "RoyalBlue",
28
+    "SteelBlue",
29
+    "DarkSlateBlue",
30
+    "MediumTurquoise",
31
+    "Indigo",
32
+    "DarkOliveGreen",
33
+    "CadetBlue",
34
+    "CornflowerBlue",
35
+    "MediumAquaMarine",
36
+    "DimGray",
37
+    "SlateBlue",
38
+    "OliveDrab",
39
+    "SlateGray",
40
+    "LightSlateGray",
41
+    "MediumSlateBlue",
42
+    "LawnGreen",
43
+    "Chartreuse",
44
+    "Aquamarine",
45
+    "Maroon",
46
+    "Purple",
47
+    "Olive",
48
+    "Gray",
49
+    "SkyBlue",
50
+    "LightSkyBlue",
51
+    "BlueViolet",
52
+    "DarkRed",
53
+    "DarkMagenta",
54
+    "SaddleBrown",
55
+    "DarkSeaGreen",
56
+    "LightGreen",
57
+    "MediumPurple",
58
+    "DarkViolet",
59
+    "PaleGreen",
60
+    "DarkOrchid",
61
+    "YellowGreen",
62
+    "Sienna",
63
+    "Brown",
64
+    "DarkGray",
65
+    "LightBlue",
66
+    "GreenYellow",
67
+    "PaleTurquoise",
68
+    "LightSteelBlue",
69
+    "PowderBlue",
70
+    "FireBrick",
71
+    "DarkGoldenRod",
72
+    "MediumOrchid",
73
+    "RosyBrown",
74
+    "DarkKhaki",
75
+    "Silver",
76
+    "MediumVioletRed",
77
+    "IndianRed",
78
+    "Peru",
79
+    "Chocolate",
80
+    "Tan",
81
+    "LightGray",
82
+    "Thistle",
83
+    "Orchid",
84
+    "GoldenRod",
85
+    "PaleVioletRed",
86
+    "Crimson",
87
+    "Gainsboro",
88
+    "Plum",
89
+    "BurlyWood",
90
+    "LightCyan",
91
+    "Lavender",
92
+    "DarkSalmon",
93
+    "Violet",
94
+    "PaleGoldenRod",
95
+    "LightCoral",
96
+    "Khaki",
97
+    "AliceBlue",
98
+    "HoneyDew",
99
+    "Azure",
100
+    "SandyBrown",
101
+    "Wheat",
102
+    "Beige",
103
+    "WhiteSmoke",
104
+    "MintCream",
105
+    "GhostWhite",
106
+    "Salmon",
107
+    "AntiqueWhite",
108
+    "Linen",
109
+    "LightGoldenRodYellow",
110
+    "OldLace",
111
+    "Red",
112
+    "Fuchsia",
113
+    "Magenta",
114
+    "DeepPink",
115
+    "OrangeRed",
116
+    "Tomato",
117
+    "HotPink",
118
+    "Coral",
119
+    "DarkOrange",
120
+    "LightSalmon",
121
+    "Orange",
122
+    "LightPink",
123
+    "Pink",
124
+    "Gold",
125
+    "PeachPuff",
126
+    "NavajoWhite",
127
+    "Moccasin",
128
+    "Bisque",
129
+    "MistyRose",
130
+    "BlanchedAlmond",
131
+    "PapayaWhip",
132
+    "LavenderBlush",
133
+    "SeaShell",
134
+    "Cornsilk",
135
+    "LemonChiffon",
136
+    "FloralWhite",
137
+    "Snow",
138
+    "Yellow",
139
+    "LightYellow",
140
+    "Ivory",
141
+    "White"
142
+];
143
+
144
+
145
+var card_colors = {
146
+    "": "",
147
+    "arcane": "#bb3d2f",
148
+    "cleric": "#ae7b00",
149
+    "rogue": "#802161",
150
+    "item": "dimgray",
151
+}

+ 39
- 1
generator/js/ui.js 파일 보기

@@ -117,9 +117,47 @@ function ui_select_icon() {
117 117
     window.open("http://game-icons.net/", "_blank");
118 118
 }
119 119
 
120
-$(document).ready(function () {
120
+function ui_setup_color_selector() {
121
+    $.each(card_colors, function (name, val) {
122
+        $(".colorselector-data")
123
+            .append($("<option></option>")
124
+            .attr("value", name)
125
+            .attr("data-color", val)
126
+            .text(name));
127
+    });
128
+    
129
+    $('#default_color_selector').colorselector({
130
+        callback: function (value, color, title) {
131
+            $("#default_color").val(title);
132
+            ui_set_default_color(title);
133
+        }
134
+    });
135
+    $('#card_color_selector').colorselector({
136
+        callback: function (value, color, title) {
137
+            $("#card_color").val(title);
138
+        }
139
+    });
121 140
     $(".dropdown-colorselector").addClass("input-group-addon color-input-addon");
122 141
 
142
+    $("#default_color").change(function (e) {
143
+        var color = $("#default_color").val();
144
+        if ($("#default_color_selector option[value='" + color + "']").length > 0) {
145
+            $("#default_color_selector").colorselector("setValue", color);
146
+        } else {
147
+            $("#default_color_selector").colorselector("setValue", "");
148
+            $("#default_color").val(color);
149
+        }
150
+        ui_set_default_color(color);
151
+    });
152
+}
153
+
154
+function ui_set_default_color(color) {
155
+    card_options.default_color = color;
156
+}
157
+
158
+$(document).ready(function () {
159
+    ui_setup_color_selector();
160
+
123 161
     $("#button-generate").click(ui_generate);
124 162
     $("#button-load").click(function () { $("#file-load").click(); });
125 163
     $("#file-load").change(ui_load_files);

Loading…
취소
저장