From e864af0b6d1ec89dd791aaf9b9dd2eaab6b2991a Mon Sep 17 00:00:00 2001 From: hide_d Date: Mon, 12 Feb 2018 21:41:11 +0900 Subject: [PATCH] =?UTF-8?q?=EC=83=88=EB=A9=94=EC=8B=9C=EC=A7=80,=20?= =?UTF-8?q?=EC=B6=9C=EB=A0=A5=20=EB=B0=A9=EC=8B=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmp_msg/msg.css | 67 ++++++++++++++++++++++++++++++++++++--- tmp_msg/msg.html | 13 ++++++-- tmp_msg/msg.js | 23 ++++++++++++++ tmp_msg/tmp_template.html | 34 ++++++++------------ 4 files changed, 109 insertions(+), 28 deletions(-) diff --git a/tmp_msg/msg.css b/tmp_msg/msg.css index 3d6650a6..adc4da9f 100644 --- a/tmp_msg/msg.css +++ b/tmp_msg/msg.css @@ -17,22 +17,22 @@ width:100%; border:groove 0.1em; height:64px; - font-size:13px; + font-size:12px; word-break:break-all; color:white; } .msg_plate_private{ - background-color:#cc6600; + background-color:#5d1e1a; } .msg_plate_public{ - background-color:#000055; + background-color:#141c65; } .msg_plate_national, .msg_plate_diplomacy{ - background-color:#336600; + background-color:#00582c; } @@ -50,12 +50,69 @@ .msg_header{ font-weight: bold; + margin-bottom:3px; + color:white; } #msg_input{ color:white; background-color:black; - font-size:13px; + font-size:12px; width:720px; height:15px; +} + +#mailbox_list{ + color:white; + background-color:black; + font-size:12px; +} + +.board_header{ + color:white; + border:groove 0.1em; +} + +.board_side{ + width:50%; + float:left; +} + +.msg_body{ + padding-left:64px; +} + +.msg_target{ + margin:2px 2px 0 2px; + padding:2px 3px; + display:inline-block; + box-shadow: 2px 2px black; + border-radius: 3px; +} + +.public_message .msg_target{ + box-shadow: 2px 2px darkslategrey; +} + +.msg_target.msg_bright{ + color:black; +} + +.msg_target.msg_dark{ + color:white; +} + +.msg_from_to{ + display:inline-block; +} + +.msg_content{ + margin-left:10px; + margin-right:5px; +} + +.msg_prompt{ + text-align:right; + margin-top:5px; + margin-right:5px; } \ No newline at end of file diff --git a/tmp_msg/msg.html b/tmp_msg/msg.html index 12a55e35..8fd05984 100644 --- a/tmp_msg/msg.html +++ b/tmp_msg/msg.html @@ -19,25 +19,32 @@
- + +
-
+
+
전체 메시지(최고99자)
+
개인 메시지(최고99자)
-
+
+
국가 메시지(최고99자)
diff --git a/tmp_msg/msg.js b/tmp_msg/msg.js index 66027a32..ff3429fd 100644 --- a/tmp_msg/msg.js +++ b/tmp_msg/msg.js @@ -1,5 +1,25 @@ +function hexToRgb(hex) { + var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); + return result ? { + r: parseInt(result[1], 16), + g: parseInt(result[2], 16), + b: parseInt(result[3], 16) + } : null; +} + + +function isBrightColor(color){ + color = hexToRgb(color); + if ((color.r*0.299 + color.g*0.587 + color.b*0.114) > 186){ + return true; + } + else{ + return false; + } +} + var messageTemplate = ''; var refreshMsg = (function(){ @@ -49,6 +69,9 @@ var refreshMsg = (function(){ msg.dest.nation = '재야'; msg.dest.color = '#ffffff'; } + + msg.src.colorType = isBrightColor(msg.src.color)?'bright':'dark'; + msg.dest.colorType = isBrightColor(msg.dest.color)?'bright':'dark'; }); }); return obj; diff --git a/tmp_msg/tmp_template.html b/tmp_msg/tmp_template.html index 0033b0dd..a7048e93 100644 --- a/tmp_msg/tmp_template.html +++ b/tmp_msg/tmp_template.html @@ -12,34 +12,28 @@
<%if(msgType == 'private') {%> - [ - <%e(src.name)%>:<%e(src.nation)%> - ▶ - <%e(dest.name)%>:<%e(dest.nation)%> - ] + <%e(src.name)%>:<%e(src.nation)%><%e(dest.name)%>:<%e(dest.nation)%> <%} else if(msgType == 'national' && src.nation_id == dest.nation_id){%> - [ - <%e(src.name)%>:<%e(src.nation)%> - ] + <%e(src.name)%>:<%e(src.nation)%> <%} else if(msgType == 'national' || msgType == 'diplomacy'){%> - [ - <%e(src.name)%>:<%e(src.nation)%> - ▶ - <%e(dest.nation)%> - ] + <%e(src.name)%>:<%e(src.nation)%><%e(dest.nation)%> <%} else {%> - [ - <%e(src.name)%>:<%e(src.nation)%> - ] + <%e(src.name)%>:<%e(src.nation)%> <%} %> <<%e(time)%>>
- <%e(text)%> +
+ <%e(text)%> +
<%if(this.option){ console.log('HasOption!!'); %> -
- -
+
+ +
<%} %>
\ No newline at end of file