Skip to content

Commit 648225b

Browse files
authored
Merge pull request #270 from connect-foundation/develop
v1.0.1 배포
2 parents 056abaa + bb29891 commit 648225b

File tree

11 files changed

+233
-41
lines changed

11 files changed

+233
-41
lines changed

client/src/components/Room/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import GameArea from './GameArea';
44
import ChatArea from './ChatArea';
55
import Alert from '../Alert';
66
import {
7-
Wrapper, RoomWrapper, SoundToggleWrapper, SoundToggle,
7+
RoomBackground, Wrapper, RoomWrapper, SoundToggleWrapper, SoundToggle,
88
} from './style';
99
import socket from '../../modules/socket';
1010
import URL from '../../constants/url';
@@ -79,7 +79,7 @@ const Room = () => {
7979
}, []);
8080

8181
return (
82-
<>
82+
<RoomBackground>
8383
<Wrapper>
8484
<SoundToggleWrapper>
8585
<SoundToggle onClick={toggleSound}>{isSoundOn ? '🔊sound on' : '🔇sound off'}</SoundToggle>
@@ -90,7 +90,7 @@ const Room = () => {
9090
</RoomWrapper>
9191
</Wrapper>
9292
{isExistRoom ? '' : <Alert message={ROOM.PATH_ERROR_MESSAGE} closeCallback={goToLobby} />}
93-
</>
93+
</RoomBackground>
9494
);
9595
};
9696

client/src/components/Room/style.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ import styled from 'styled-components';
22
import { setSize, setFlex } from '../Style/util';
33
import { ROOM, SOUND_TOGGLE } from '../Style/Room';
44

5+
export const RoomBackground = styled.div`
6+
min-width: 100vw;
7+
min-height: 100vh;
8+
background: url(${ROOM.BACKGROUND_GIF});
9+
`;
10+
511
export const Wrapper = styled.div`
612
position: absolute;
713
width: ${ROOM.getWidth()}px;

client/src/components/Style/Room.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export const ROOM = {
109109
BORDER_RADIUS_BIG: 12,
110110
FONT_FAMILY: 'DungGeunMo',
111111
BUTTON_HOVER_EFFECT: 'linear-gradient(-180deg, rgba(150, 150, 150, 0.1), rgba(150, 150, 150, 0.2) 50%)',
112+
BACKGROUND_GIF: 'https://kr.object.ncloudstorage.com/connect-2019-01/image/transparent-gfllffmJEBXju33FPg.gif',
112113
};
113114

114115
export const ROOM_NAME = {

client/src/constants/room.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export const DASHBOARD = {
9393

9494

9595
export const CHAT_AREA = {
96+
WIDTH: 250,
9697
MAX_MESSAGE_LENGTH: 50,
9798
NOTICE_MESSAGE: '** 매너채팅 해요 ^_^ **',
9899
EMOJI_URL_VIEWER: 'https://kr.object.ncloudstorage.com/connect-2019-01/image/viewer-emoji.png',
@@ -112,7 +113,7 @@ export const ROOM = {
112113
};
113114

114115
export const ROOM_NAME = {
115-
WRAPPER_WIDTH: CHAT_AREA.WIDTH - 30,
116+
WRAPPER_WIDTH: CHAT_AREA.WIDTH,
116117
FONT_WIDTH: {
117118
HANGUL: 30,
118119
EMOJI: 30,

script/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
restart: always
3030
image: dev-2019-01.kr.ncr.ntruss.com/front-end
3131
ports:
32-
- "80:80"
32+
- "443:443"
3333
depends_on:
3434
- server
3535
networks:

server/app.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import socketio from 'socket.io';
55
import cookieParser from 'cookie-parser';
66
import {} from 'dotenv/config';
77
import cors from 'cors';
8-
import loginRouter from './routes/login';
9-
import adminRouter from './routes/admin';
8+
import rootRouter from './routes';
109
import controller from './controller';
1110
import URL from './constants/url';
1211
import ERROR_MSG from './constants/error-message';
@@ -27,8 +26,7 @@ if (process.env.NODE_ENV === 'development') {
2726
app.use(cors(corsOptions));
2827
}
2928

30-
app.use('/admin', adminRouter);
31-
app.use('/oauth', loginRouter);
29+
app.use('/', rootRouter);
3230

3331
app.use((req, res, next) => {
3432
next(createError(404, ERROR_MSG.REQUEST_NOT_FOUND));

server/constants/url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const clientID = process.env.NODE_ENV === 'production' ? process.env.PRODUCTION_
22
const clientSecret = process.env.NODE_ENV === 'production' ? process.env.PRODUCTION_CLIENT_SECRET : process.env.LOCAL_CLIENT_SECRET;
33

44
const URL = {
5-
LOCAL_ORIGIN: 'http://localhost:3006/',
5+
LOCAL_ORIGIN: 'http://localhost:3006',
66
LOCAL_REACT_OAUTH: 'http://localhost:3006/oauth',
77
PRODUCTION_REACT_OAUTH: '/oauth',
88
LOCAL_REACT_LOBBY: 'http://localhost:3006/lobby',

server/routes/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import express from 'express';
2+
import loginRouter from './login';
3+
import adminRouter from './admin';
4+
5+
const router = express.Router();
6+
7+
router.use('/admin', adminRouter);
8+
router.use('/oauth', loginRouter);
9+
10+
export default router;

server/test/client.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
class Client {
2+
constructor() {
3+
this.indexX = null;
4+
this.indexY = null;
5+
this.roomId = '';
6+
this.socket = null;
7+
}
8+
9+
getIndexes() {
10+
return [this.indexX, this.indexY];
11+
}
12+
13+
setIndexes([indexX, indexY]) {
14+
this.indexX = indexX;
15+
this.indexY = indexY;
16+
}
17+
18+
getRoomId() {
19+
return this.roomId;
20+
}
21+
22+
setRoomId(roomId) {
23+
this.roomId = roomId;
24+
}
25+
26+
setSocket(socket) {
27+
this.socket = socket;
28+
}
29+
30+
once(event, callback) {
31+
this.socket.once(event, callback);
32+
}
33+
34+
emit(event, data) {
35+
this.socket.emit(event, data);
36+
}
37+
38+
isConnected() {
39+
return this.socket.connected;
40+
}
41+
42+
disconnect() {
43+
this.socket.disconnect();
44+
}
45+
}
46+
47+
export default Client;

server/test/mock.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
export default {
2-
ENTER_RESPONSE_KEYS: ['characterList', 'isGameStarted', 'isOwner', 'timeLimit'],
2+
ENTER_RESPONSE_KEYS: ['characterList', 'isOwner', 'roomName'],
33
MOVE_RESPONSE_KEYS: ['canMove', 'nickname', 'direction', 'newIndexX', 'newIndexY'],
4+
ROOM_INFO_KEYS: ['id', 'name', 'numOfUsers', 'isEnterable'],
5+
KNOCK_ROOM_KEYS: ['isEnterable', 'roomId', 'message'],
6+
START_ROUND_KEYS: ['question', 'timeLimit', 'characterList'],
7+
UPDATE_PLAYER_NUM_KEYS: ['numOfPlayer', 'numOfViewer'],
8+
CHAT_MESSAGE_KEYS: ['nickname', 'message'],
49
};

0 commit comments

Comments
 (0)