Skip to content

Commit e832b59

Browse files
committed
웹서버 파일 업데이트
1 parent 9191693 commit e832b59

25 files changed

+1070
-783
lines changed

Web/game.js

Lines changed: 77 additions & 225 deletions
Large diffs are not rendered by default.

Web/game/lib/in_portal.js

Lines changed: 75 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
Rule the words! KKuTu Online
33
Copyright (C) 2017 JJoriping([email protected])
4-
Copyright (C) 2017 KKuTu Korea(op@kkutu.co.kr)
4+
Copyright (C) 2017-2018 KKuTu Korea(admin@kkutu.co.kr)
55
66
This program is free software: you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -22,66 +22,55 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2222
var LIST;
2323
var isHoverButton = false;
2424
function buttonOverAnimate(){
25-
var width=3068;
26-
var original=236;
25+
var width=5200;
26+
var original=260;
2727
var times=width/original;
2828
var originalTimes=times;
2929
var times_=0.1/times;
3030
function change(){
3131
$("#game-start").css("background-position-x", original*times+"px");
32-
$("#game-start").css("transform","scale("+(1+times_*(originalTimes-times))+")");
32+
//$("#game-start").css("transform","scale("+(1+times_*(originalTimes-times))+")");
3333
times--;
34-
if(times>-1&&isHoverButton) setTimeout(function(){change();},30);
34+
if(times>-1&&isHoverButton) setTimeout(function(){change();},1000/originalTimes);
3535
else if(!isHoverButton) {
36-
$("#game-start").css("background-position-x", "3068px");
37-
$("#game-start").css("transform","scale(1)");
36+
$("#game-start").css("background-position-x", width);
37+
//$("#game-start").css("transform","scale(1)");
3838
}
3939
}
4040
change();
4141
}
42-
function buttonOverAnimate2(context){
42+
function buttonOverAnimate2($a){
4343
var times=10;
4444
var times_=0.1/10;
4545
function change(){
46-
$(context).css("transform","scale("+(1+times_*(10-times))+")");
46+
$a.css("transform","scale("+(1+times_*(10-times))+")");
4747
times--;
48-
if(times>-1&&$(context).hasClass('hover')) setTimeout(function(){change();},30);
49-
else if(!$(context).hasClass('hover')) {
50-
$(context).css("transform","scale(1)");
48+
if(times>-1&&$a.hasClass('hover')) setTimeout(function(){change();},30);
49+
else if(!$a.hasClass('hover')) {
50+
$a.css("transform","scale(1)");
5151
}
5252
}
5353
change();
5454
}
55-
55+
5656
$(document).ready(function(){
57-
57+
5858
var GAMEBG = "/img/kkutu/gamebg_korea.png";
5959
$("#Background").attr('src', "").addClass("jt-image").css({
6060
'background-image': "url("+GAMEBG+")",
6161
'background-size': "200px 200px"
6262
});
63-
$(".server-item").each(function(index,item){
64-
$(item).mouseover(function(){
65-
$(this).addClass('hover');
66-
buttonOverAnimate2(this);
67-
});
68-
$(item).mouseout(function(){
69-
$(this).removeClass('hover');
70-
$(this).css("transform","scale(1)");
71-
});
72-
});
7363
$("#game-start").mouseover(function(){
7464
isHoverButton=true;
7565
buttonOverAnimate();
7666
});
7767
$("#game-start").mouseout(function(){
7868
isHoverButton=false;
79-
$("#game-start").css("background-position-x", "3068px");
80-
$("#game-start").css("transform","scale(1)");
69+
$("#game-start").css("background-position-x", "5200px");
8170
});
8271
$("#game-start").click(function(e){
8372
var i, j;
84-
73+
8574
for(i=0.9; i<1; i+=0.01){
8675
for(var j=0;j<LIST.length;j++){
8776
if(LIST[j] < i * LIMIT){
@@ -92,91 +81,103 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
9281
}
9382
alert("접속 가능한 서버가 없습니다! 혹시 로그인을 안하셨다면, 로그인을 하신 후 시도해주세요!");
9483
});
95-
$("#server-refresh").click(function(e){
84+
$(".server-item").each(function(){
85+
$(this).mouseover(function(){
86+
$(this).find(".server-head").addClass('hover');
87+
buttonOverAnimate2($(this).find(".server-head"));
88+
});
89+
$(this).mouseout(function(){
90+
$(this).find(".server-head").removeClass('hover');
91+
$(this).find(".server-head").css("transform","scale(1)");
92+
});
93+
});
94+
$("#kkuko-status-refresh").click(function(e){
9695
seekServers();
9796
});
9897
setInterval(function(){
99-
$("#server-refresh").click();
98+
seekServers();
10099
}, 60000);
101100
seekServers();
102-
setCenterImage();
101+
setslideImage();
103102
});
104103
var currentImageNum=0;
105-
function changeCenterImage(num){
104+
function changeslideImage(num){
106105
isInterval = num==undefined;
107106
num = num || currentImageNum;
108-
$($(".centerImage")[num-1<0?$(".centerImage").length-1:num-1]).animate({opacity: "0"});
109-
$($(".centerImage")[num]).animate({opacity: "1"});
110-
if($($(".centerImage")[num]).attr("url"))
111-
$(".centerImage").css("cursor","pointer");
107+
for(var i=0;i<$(".slideImage").length;i++)
108+
if(num != i) $($(".slideImage")[i]).animate({opacity: "0"});
109+
var $this = $($(".slideImage")[num]);
110+
$this.animate({opacity: "1"});
111+
if($this.attr("url"))
112+
$(".slideImage").css("cursor","pointer");
112113
else
113-
$(".centerImage").css("cursor","");
114-
$(".centerPanel").unbind();
115-
$(".centerPanel").click(function(){
116-
if($($(".centerImage")[num]).attr("url")) {
117-
window.open($($(".centerImage")[num]).attr("url"));
118-
}
119-
});
114+
$(".slideImage").css("cursor","");
115+
$this.unbind();
116+
if($this.attr("url"))
117+
$this.click(function(){
118+
window.open($this.attr("url"));
119+
});
120120
currentImageNum++;
121-
if(currentImageNum>=$(".centerImage").length) currentImageNum=0;
122-
if(isInterval) setTimeout(changeCenterImage,5000);
121+
if(currentImageNum>=$(".slideImage").length) currentImageNum=0;
122+
if(isInterval) setTimeout(changeslideImage,4000);
123123
}
124-
function setCenterImage(){
125-
$(".centerImage").each(function(index,item){
124+
function setslideImage(){
125+
$(".slideImage").each(function(index,item){
126126
if(index==0) $(item).css("opacity","1");
127127
else $(item).css("opacity","0");
128-
$(item).css("top","-"+index*350+"px");
129-
$(".centerImage-List").append($("<div>").addClass("centerImage-Item").attr("image-number",index).click(function(){
130-
changeCenterImage($(this).attr("image-number"));
128+
$(item).css("top","-"+index*270+"px");
129+
$(".slideImage-List").append($("<div>").addClass("slideImage-Item").attr("image-number",index).click(function(){
130+
changeslideImage($(this).attr("image-number"));
131131
}));
132132
});
133-
$(".centerImage-List").css("top","-"+((($(".centerImage").length-1)*350)+25)+"px");
134-
changeCenterImage();
133+
$(".slideImage-List").css("top","-"+((($(".slideImage").length-1)*270)+25)+"px");
134+
changeslideImage();
135135
}
136136
function seekServers(){
137137
$.get("/servers", function(data){
138138
var sum = 0;
139-
139+
140140
LIST = data.list;
141141
LIMIT = data.max;
142142
data.list.forEach(function(v, i){
143143
var status = (v === null) ? "x" : "o";
144-
var people = (status == "x") ? "-" : (v + " / " + LIMIT);
144+
var people = (status == "x") ? "" : (v + "/" + LIMIT);
145145
var limp = v / LIMIT * 100;
146146
var $e;
147-
147+
148148
sum += v || 0;
149149
var statusText;
150150
if(status == "o"){
151-
statusText="원활";
152-
if(limp >= 99){
153-
status = "q";
151+
statusText="매우 원활";
152+
if(limp >= 75){
153+
status = "r";
154154
statusText="혼잡";
155155
}
156-
else if(limp >= 90) {
157-
status = "p";
156+
else if(limp >= 40) {
157+
status = "q";
158158
statusText="보통";
159159
}
160+
else if(limp >= 15) {
161+
status = "p";
162+
statusText="원활";
163+
}
160164
} else if(status == "x")
161-
statusText = "X";
165+
statusText = "서버닫힘";
162166
$($(".server-item")[i]).empty();
163167
$($(".server-item")[i]).attr('id', "server-" + i)
164-
.append($("<div>").addClass("server-name").html(L['server_' + i]))
165-
.append($("<div>").addClass("server-enter").html(L['serverEnter']))
166-
.append($("<div>").addClass("server-status")
167-
.append($("<div>").addClass("server-status-circle ss-" + status))
168-
.append($("<label>").addClass("server-status-text").html(statusText))
169-
.append($("<label>").addClass("server-status-players").html(people)))
170-
.append(
171-
$("<div>").addClass("server-people graph")
172-
.append($("<div>").addClass("graph-bar").width(limp + "%"))
173-
);
168+
.append($("<div>").addClass("server-status-bar ssb-" + status))
169+
.append($("<div>").addClass("server-head")
170+
.append($("<div>").addClass("server-name").html(L['server_' + i]))
171+
.append($("<div>").addClass("server-enter").html(L['serverEnter'])))
172+
.append($("<div>").addClass("server-status sss-" + status)
173+
.append($("<label>").addClass("server-status-players").html(people))
174+
.append($("<label>").addClass("server-status-text").html(statusText)));
174175
if(status != "x") $($(".server-item")[i]).click(function(e){
175176
location.href = "/?server=" + i;
176-
}); else $($(".server-item")[i]).children(".server-enter").html("접속불가");
177-
$("#server-players").html("총 " + sum +"명 접속");
177+
});
178+
$("#kkuko-status-players").html("총 " + sum +"명이 접속하고 있습니다. ");
178179
});
179-
180+
180181
});
181182
}
182-
})();
183+
})();

Web/game/lib/in_portal_old.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
Rule the words! KKuTu Online
33
Copyright (C) 2017 JJoriping([email protected])
4-
Copyright (C) 2017 KKuTu Korea(op@kkutu.co.kr)
4+
Copyright (C) 2017-2018 KKuTu Korea(admin@kkutu.co.kr)
55
66
This program is free software: you can redistribute it and/or modify
77
it under the terms of the GNU General Public License as published by
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2121
var $stage;
2222
var LIMIT = 400;
2323
var LIST;
24-
24+
2525
$(document).ready(function(){
2626
$stage = {
2727
list: $("#server-list"),
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3030
ref: $("#server-refresh"),
3131
refi: $("#server-refresh>i")
3232
};
33-
33+
3434
var hour = new Date().getHours();
3535
var NIGHT = (hour<5 || hour>19)?true:false;
3636
var GAMEBG = "/img/kkutu/gamebg_korea.png";
@@ -40,7 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
4040
});
4141
$stage.start.prop('disabled', true).on('click', function(e){
4242
var i, j;
43-
43+
4444
for(i=0.9; i<1; i+=0.01){
4545
for(var j=0;j<LIST.length;j++){
4646
if(LIST[j] < i * LIMIT){
@@ -66,7 +66,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
6666
function seekServers(){
6767
$.get("/servers", function(data){
6868
var sum = 0;
69-
69+
7070
$stage.list.empty();
7171
LIST = data.list;
7272
LIMIT = data.max;
@@ -75,7 +75,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
7575
var people = (status == "x") ? "-" : (v + " / " + LIMIT);
7676
var limp = v / LIMIT * 100;
7777
var $e;
78-
78+
7979
sum += v || 0;
8080
if(status == "o"){
8181
if(limp >= 99) status = "q";
@@ -99,4 +99,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
9999
$stage.start.prop('disabled', false);
100100
});
101101
}
102-
})();
102+
})();

0 commit comments

Comments
 (0)