From 9125e035b67775d93434a86186f633a526540566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Sat, 15 Dec 2018 23:46:48 +0900 Subject: [PATCH] Fix: icon color for out, in, pressed Fix: make lib/util directory Add: refresh browser if app goes wrong --- src/game/lib/button/round_rect_button.js | 24 +++++++-- src/game/lib/button/typing_app_button.js | 6 +++ src/game/lib/{ => util}/date_util.js | 0 src/game/lib/{ => util}/number_util.js | 15 +++++- src/game/lib/{ => util}/record_util.js | 0 src/game/lib/{ => util}/string_util.js | 0 src/game/license_timer/timer.js | 66 ++++++++++++------------ src/web/client/ads.html | 13 +++-- src/web/client/card_matching.html | 11 +++- src/web/client/dodge.html | 11 +++- src/web/client/grilled_meat.html | 11 +++- src/web/client/license_timer.html | 13 +++-- src/web/client/login.html | 8 +++ src/web/client/menu_app.html | 8 +++ src/web/client/menu_app_play_free.html | 8 +++ src/web/client/menu_app_test_player.html | 3 ++ src/web/client/menu_typing_practice.html | 13 +++-- src/web/client/menu_typing_test.html | 13 +++-- src/web/client/ranking.html | 13 +++-- src/web/client/result.html | 15 ++++-- src/web/client/space_invaders.html | 11 +++- src/web/client/start.html | 15 ++++-- src/web/client/typing_practice.html | 13 +++-- src/web/client/typing_test.html | 13 +++-- src/web/client/whac_a_mole.html | 13 +++-- 25 files changed, 237 insertions(+), 79 deletions(-) rename src/game/lib/{ => util}/date_util.js (100%) rename src/game/lib/{ => util}/number_util.js (62%) rename src/game/lib/{ => util}/record_util.js (100%) rename src/game/lib/{ => util}/string_util.js (100%) diff --git a/src/game/lib/button/round_rect_button.js b/src/game/lib/button/round_rect_button.js index 031f635..cd45f1f 100644 --- a/src/game/lib/button/round_rect_button.js +++ b/src/game/lib/button/round_rect_button.js @@ -16,6 +16,7 @@ function RoundRectButtonSetting(x, y, width, height, roundAmount) { this.strokeColors = RoundRectButtonSetting.DEFAULT_STROKE_COLORS; this.buttonColors = RoundRectButtonSetting.DEFAULT_BUTTON_COLORS; this.textColors = RoundRectButtonSetting.DEFAULT_TEXT_COLORS; + this.iconColors = RoundRectButtonSetting.DEFAULT_ICON_COLORS; this.fontStyle = RoundRectButtonSetting.DEFAULT_TEXT_FONT; }; @@ -43,6 +44,14 @@ RoundRectButtonSetting.prototype.setTextColor = function(out, over, down, disabl this.textColors.disabled = disabled; } +RoundRectButtonSetting.prototype.setIconColor = function(out, over, down, disabled) { + this.iconColors = { }; + this.iconColors.out = out; + this.iconColors.over = over; + this.iconColors.down = down; + this.iconColors.disabled = disabled; +} + RoundRectButtonSetting.DEFAULT_STROKE_COLORS = { out: 0x666666, @@ -65,6 +74,13 @@ RoundRectButtonSetting.DEFAULT_TEXT_COLORS = { disabled: "#999" }; +RoundRectButtonSetting.DEFAULT_ICON_COLORS = { + out: 0xffffff, + over: 0xddffdd, + down: 0xaaffaa, + disabled: 0x333333 +}; + RoundRectButtonSetting.DEFAULT_TEXT_FONT = { font: "30px Arial", boundsAlignH: "center", // left, center. right @@ -212,7 +228,7 @@ RoundRectButton.prototype.mouseOut = function() { this.buttonStroke.tint = this.setting.strokeColors.out; this.button.tint = this.setting.buttonColors.out; if(typeof this.buttonIcon !== "undefined") { - this.buttonIcon.tint = this.setting.strokeColors.out; + this.buttonIcon.tint = this.setting.iconColors.out; } } @@ -223,7 +239,7 @@ RoundRectButton.prototype.mouseOver = function() { this.buttonStroke.tint = this.setting.strokeColors.over; this.button.tint = this.setting.buttonColors.over; if(typeof this.buttonIcon !== "undefined") { - this.buttonIcon.tint = this.setting.strokeColors.over; + this.buttonIcon.tint = this.setting.iconColors.over; } } @@ -234,7 +250,7 @@ RoundRectButton.prototype.mouseDown = function() { this.buttonStroke.tint = this.setting.strokeColors.down; this.button.tint = this.setting.buttonColors.down; if(typeof this.buttonIcon !== "undefined") { - this.buttonIcon.tint = this.setting.strokeColors.down; + this.buttonIcon.tint = this.setting.iconColors.down; } } @@ -245,7 +261,7 @@ RoundRectButton.prototype.buttonDisabled = function() { this.buttonStroke.tint = this.setting.strokeColors.disabled; this.button.tint = this.setting.buttonColors.disabled; if(typeof this.buttonIcon !== "undefined") { - this.buttonIcon.tint = this.setting.strokeColors.disabled; + this.buttonIcon.tint = this.setting.iconColors.disabled; } } diff --git a/src/game/lib/button/typing_app_button.js b/src/game/lib/button/typing_app_button.js index 418b488..58c3676 100644 --- a/src/game/lib/button/typing_app_button.js +++ b/src/game/lib/button/typing_app_button.js @@ -50,6 +50,12 @@ function TypingAppButton(type, x, y, iconSprite, buttonText, appInfo) { "#a66", "#333" ); + setting.setIconColor( + 0xffeeee, + 0xeedddd, + 0xddcccc, + 0x666666 + ); break; } diff --git a/src/game/lib/date_util.js b/src/game/lib/util/date_util.js similarity index 100% rename from src/game/lib/date_util.js rename to src/game/lib/util/date_util.js diff --git a/src/game/lib/number_util.js b/src/game/lib/util/number_util.js similarity index 62% rename from src/game/lib/number_util.js rename to src/game/lib/util/number_util.js index 1edb626..6499e54 100644 --- a/src/game/lib/number_util.js +++ b/src/game/lib/util/number_util.js @@ -21,4 +21,17 @@ NumberUtil.getRecordText = function(value) { return numberWithCommas + " 타"; else return numberWithCommas + " 점"; -} \ No newline at end of file +} + + +NumberUtil.hexToRGB = function(hexCode) { + var hex = ""; + if(hexCode.length == 4) + hex = "#" + hexCode[1] + hexCode[1] + hexCode[2] + hexCode[2] + hexCode[3] + hexCode[3]; + + var hexValue = "0x" + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3]; + // console.log(hexCode); + // console.log(hexValue); + return hexValue; +} + diff --git a/src/game/lib/record_util.js b/src/game/lib/util/record_util.js similarity index 100% rename from src/game/lib/record_util.js rename to src/game/lib/util/record_util.js diff --git a/src/game/lib/string_util.js b/src/game/lib/util/string_util.js similarity index 100% rename from src/game/lib/string_util.js rename to src/game/lib/util/string_util.js diff --git a/src/game/license_timer/timer.js b/src/game/license_timer/timer.js index a539b63..5262fe0 100644 --- a/src/game/license_timer/timer.js +++ b/src/game/license_timer/timer.js @@ -121,27 +121,26 @@ Timer.prototype.makeResetButton = function() { setting.fontStyle.fontSize = 40; setting.setStrokeColor( - 0x309090, - 0x208080, - 0x205050, + 0x900020, + 0x800010, + 0x600000, 0x666666 ); setting.setButtonColor( - 0x40c0c0, - 0x30a0a0, - 0x208080, + 0xc00040, + 0xa00020, + 0x800010, 0x666666 ); - setting.setTextColor( - "#fff", - "#edd", - "#dbb", - "#333" + setting.setIconColor( + 0xffffff, + 0xdddddd, + 0xbbbbbb, + 0x333333 ); var button = new RoundRectButton( - setting, - null, "", + setting, null, "", (function() { this.resetTimer(); this.resetLeftTimeToServer(); @@ -162,27 +161,26 @@ Timer.prototype.makePlayButton = function() { // blue tone setting.setStrokeColor( - 0x808020, - 0x606010, - 0x404000, + 0xd0d020, + 0xb0b010, + 0x909000, 0x333333 ); setting.setButtonColor( - 0xc0c040, - 0xa0a030, - 0x909020, + 0xf0f040, + 0xd0d030, + 0xb0b020, 0x666666 ); - setting.setTextColor( - "#fff", - "#fff", - "#fff", - "#333" + setting.setIconColor( + 0x906020, // 0x442211, + 0x704010, // 0x332200, + 0x502000, // 0x111100, + 0x333333 ); var button = new RoundRectButton( - setting, - null, "", + setting, null, "", (function() { this.startTimer(); }).bind(this) ); button.setIcon(new SpriteIconTimer(100, 100, SpriteIconTimer.FRAME_PLAY)); @@ -214,17 +212,16 @@ Timer.prototype.makePauseButton = function() { 0xb0b0b0, 0x666666 ); - setting.setTextColor( - "#333", - "#222", - "#111", - "#333" + setting.setIconColor( + 0x444444, + 0x333333, + 0x222222, + 0x333333 ); var button = new RoundRectButton( - setting, - new SpriteIconTimer(50, 50, SpriteIconTimer.FRAME_PAUSE), "", + setting, null, "", (function() { this.pauseTimer(); @@ -323,7 +320,7 @@ Timer.prototype.resetTimer = function() { this.pauseTimer(); this.isTimerGoingOn = false; - this.setTimerTextColor(Timer.TEXT_COLOR_CYAN); + this.setTimerTextColor(Timer.TEXT_COLOR_WHITE); } Timer.prototype.tickLeftTime = function() { @@ -633,6 +630,7 @@ Timer.TYPE_MINUTE = "minute"; Timer.TYPE_SECOND = "second"; +Timer.TEXT_COLOR_WHITE = 0xffffff; Timer.TEXT_COLOR_CYAN = 0x40c0c0; Timer.TEXT_COLOR_YELLOW = 0xe0e040; Timer.TEXT_COLOR_GREY = 0xa0a0a0; diff --git a/src/web/client/ads.html b/src/web/client/ads.html index 158717f..3b14115 100644 --- a/src/web/client/ads.html +++ b/src/web/client/ads.html @@ -28,6 +28,9 @@ + + + @@ -37,10 +40,11 @@ + + + + - - - @@ -83,5 +87,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/card_matching.html b/src/web/client/card_matching.html index d06c208..fd88b0b 100644 --- a/src/web/client/card_matching.html +++ b/src/web/client/card_matching.html @@ -28,6 +28,9 @@ + + + @@ -39,9 +42,10 @@ + + + - - @@ -81,5 +85,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/dodge.html b/src/web/client/dodge.html index 795492a..76cc653 100644 --- a/src/web/client/dodge.html +++ b/src/web/client/dodge.html @@ -28,6 +28,9 @@ + + + @@ -39,9 +42,10 @@ + + + - - @@ -78,5 +82,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/grilled_meat.html b/src/web/client/grilled_meat.html index c348494..725dff5 100644 --- a/src/web/client/grilled_meat.html +++ b/src/web/client/grilled_meat.html @@ -28,6 +28,9 @@ + + + @@ -39,9 +42,10 @@ + + + - - @@ -84,5 +88,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/license_timer.html b/src/web/client/license_timer.html index 6427f76..46a3714 100644 --- a/src/web/client/license_timer.html +++ b/src/web/client/license_timer.html @@ -28,6 +28,9 @@ + + + @@ -38,11 +41,12 @@ + + + + - - - @@ -82,6 +86,9 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
@@ -37,6 +40,8 @@ + + @@ -65,5 +70,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/menu_app.html b/src/web/client/menu_app.html index 406d0d2..431df36 100644 --- a/src/web/client/menu_app.html +++ b/src/web/client/menu_app.html @@ -27,6 +27,9 @@ + + + @@ -36,6 +39,8 @@ + + @@ -69,5 +74,8 @@ +
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/menu_app_play_free.html b/src/web/client/menu_app_play_free.html index 0f8b8d8..955aefa 100644 --- a/src/web/client/menu_app_play_free.html +++ b/src/web/client/menu_app_play_free.html @@ -28,6 +28,9 @@ + + + @@ -37,6 +40,8 @@ + + @@ -67,5 +72,8 @@ +
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/menu_app_test_player.html b/src/web/client/menu_app_test_player.html index d0dae7d..33bd89d 100644 --- a/src/web/client/menu_app_test_player.html +++ b/src/web/client/menu_app_test_player.html @@ -85,5 +85,8 @@ +
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/menu_typing_practice.html b/src/web/client/menu_typing_practice.html index f8222d2..696452d 100644 --- a/src/web/client/menu_typing_practice.html +++ b/src/web/client/menu_typing_practice.html @@ -27,6 +27,9 @@ + + + @@ -36,11 +39,12 @@ + + + + - - - @@ -73,5 +77,8 @@ +
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/menu_typing_test.html b/src/web/client/menu_typing_test.html index 6ea3d40..de5761a 100644 --- a/src/web/client/menu_typing_test.html +++ b/src/web/client/menu_typing_test.html @@ -27,6 +27,9 @@ + + + @@ -36,11 +39,12 @@ + + + + - - - @@ -73,5 +77,8 @@ +
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/ranking.html b/src/web/client/ranking.html index a7755cf..0ce98c2 100644 --- a/src/web/client/ranking.html +++ b/src/web/client/ranking.html @@ -27,6 +27,9 @@ + + + @@ -38,10 +41,11 @@ + + + + - - - @@ -73,5 +77,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/result.html b/src/web/client/result.html index f1e2503..72bfc4b 100644 --- a/src/web/client/result.html +++ b/src/web/client/result.html @@ -8,6 +8,9 @@ + + + @@ -17,11 +20,12 @@ + + + + + - - - - @@ -56,5 +60,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/space_invaders.html b/src/web/client/space_invaders.html index 3273457..1b82047 100644 --- a/src/web/client/space_invaders.html +++ b/src/web/client/space_invaders.html @@ -28,6 +28,9 @@ + + + @@ -39,9 +42,10 @@ + + + - - @@ -79,5 +83,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/start.html b/src/web/client/start.html index 6c5efff..30bab61 100644 --- a/src/web/client/start.html +++ b/src/web/client/start.html @@ -8,6 +8,9 @@ + + + @@ -17,11 +20,12 @@ + + + + + - - - - @@ -64,5 +68,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/typing_practice.html b/src/web/client/typing_practice.html index 96adb1f..c21d8c1 100644 --- a/src/web/client/typing_practice.html +++ b/src/web/client/typing_practice.html @@ -28,6 +28,9 @@ + + + @@ -40,9 +43,10 @@ - - - + + + + @@ -109,5 +113,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/typing_test.html b/src/web/client/typing_test.html index e8a900e..044ff1b 100644 --- a/src/web/client/typing_test.html +++ b/src/web/client/typing_test.html @@ -28,6 +28,9 @@ + + + @@ -39,10 +42,11 @@ + + + + - - - @@ -103,5 +107,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file diff --git a/src/web/client/whac_a_mole.html b/src/web/client/whac_a_mole.html index ea97727..13f0446 100644 --- a/src/web/client/whac_a_mole.html +++ b/src/web/client/whac_a_mole.html @@ -28,6 +28,9 @@ + + + @@ -40,9 +43,10 @@ - - - + + + + @@ -114,5 +118,8 @@
+
+ 앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( , 단축키 : Ctrl + R)을 눌러주세요. +
\ No newline at end of file