Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 사용자 전적 페이지 (사용자 지정 게임의 1 VS 1 모드 개요 페이지) css 구현 #61

Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
284a5fd
feat(index): header script 추가 및 reformat
nyj001012 Jan 16, 2024
613c74e
feat(common): header 렌더링하는 자바스크립트 파일 추가
nyj001012 Jan 16, 2024
dd7061b
feat(users): 전적 중, 사용자 지정 게임 1 vs 1 모드를 보여주는 자바스크립트 추가
nyj001012 Jan 16, 2024
316ac28
chore(gitignore): .idea 디렉토리 추가
nyj001012 Jan 16, 2024
c294062
feat(assets): font 추가
nyj001012 Jan 16, 2024
e418e7a
feat(assets): header의 뒤로가기 이미지 추가
nyj001012 Jan 16, 2024
ba769ca
feat(assets): 사용자 지정 게임 전적 검색 전용 css 추가
nyj001012 Jan 16, 2024
e71f541
feat(assets): 헤더 전용 css 추가
nyj001012 Jan 16, 2024
628be1e
feat(common): 헤더를 렌더링하는 js 파일 추가
nyj001012 Jan 16, 2024
320c176
feat(index): <header> 추가
nyj001012 Jan 16, 2024
592f210
feat(assets): 이미지 파일 추가
nyj001012 Jan 16, 2024
dd2e5bc
feat(users): 전적 페이지 헤더 함수 프로토타입 구현
nyj001012 Jan 16, 2024
8e5ff7f
chore: package-lock.json의 name value 변경
nyj001012 Jan 16, 2024
ca0a545
chore: package-lock.json의 name value 변경
nyj001012 Jan 16, 2024
67f6bb7
feat(index): mini reset css 적용
nyj001012 Jan 16, 2024
5d07ef6
chore(common): header js 파일 이동
nyj001012 Jan 16, 2024
8a20067
feat(main): header를 렌더링하게 함
nyj001012 Jan 16, 2024
7f5839d
feat(users): 사용자 전적 헤더 프로토타입 선언
nyj001012 Jan 16, 2024
24291de
feat(common): body 전용 css 추가
nyj001012 Jan 16, 2024
6e1c074
feat(histories): 파일 이동 및 one_on_one_list.js 프로토타입 구현
nyj001012 Jan 16, 2024
640e87f
feat(router): histories 라우터에 등록
nyj001012 Jan 16, 2024
2f308c0
chore(common): import 경로 변경
nyj001012 Jan 16, 2024
f8a1bbc
chore: 파일 경로 변경
nyj001012 Jan 16, 2024
b4f53c8
feat: body 배경색 추가
nyj001012 Jan 16, 2024
a0001ae
feat(index): body css link
nyj001012 Jan 16, 2024
c4597f0
chore: 경로 변경
nyj001012 Jan 16, 2024
7bd7199
feat(css): body width, height 뷰포트를 기준으로 변경
nyj001012 Jan 16, 2024
cbf08d1
feat(css): histories의 header css 프로토타입 추가
nyj001012 Jan 16, 2024
bf90495
refactor: /users/histories 대신 /histories 사용
nyj001012 Jan 16, 2024
351aac5
feat(images): 이미지 해상도 변경
nyj001012 Jan 16, 2024
a2e28c8
feat(histories): 헤더에 x버튼 추가
nyj001012 Jan 16, 2024
da9b788
feat(index): #app의 height를 80vh로 축소
nyj001012 Jan 16, 2024
043455e
feat(css): 프레임 배경 이미지를 content-wrapper에 적용
nyj001012 Jan 16, 2024
058086a
feat(header): histories의 header는 동적으로 css 파일을 가져와서 head에 link
nyj001012 Jan 16, 2024
cc0d0e1
feat(header): 검색창 구현
nyj001012 Jan 16, 2024
5a3ff25
feat(header): 아바타 추가
nyj001012 Jan 16, 2024
626c49e
build(header): header 파일 pages/header로 이동
nyj001012 Jan 17, 2024
c812a14
feat(header): histories header flex로 감싸게 함
nyj001012 Jan 17, 2024
aa7a57e
build(histories): one_on_one_list에서 pages로 파일명 변경
nyj001012 Jan 17, 2024
87c14fb
build(histories): one_on_one_list에서 pages로 파일명 변경
nyj001012 Jan 17, 2024
a4efeea
feat(images): 설정, 개요 아이콘 추가
nyj001012 Jan 17, 2024
8929b2e
refactor(css): css 경로 변경
nyj001012 Jan 17, 2024
09cbba6
feat(histories): 사용자 전적 페이지 기본 레이아웃 작성
nyj001012 Jan 17, 2024
afe122c
feat(histories): 페이지네이션 및 하단 편의 버튼 추가
nyj001012 Jan 18, 2024
6a62149
feat(histories): 사용자 전적 목록 보여주는 함수 구현
nyj001012 Jan 18, 2024
30112a7
refactor(histories): 전적 리스트 렌더링하는 함수 분리
nyj001012 Jan 18, 2024
33dc800
refactor(histories): 전적 페이지의 레이아웃 렌더링하는 함수 분리
nyj001012 Jan 18, 2024
d8215c2
refactor(histories): list 비율 수정
nyj001012 Jan 18, 2024
6ae3cac
Merge branch 'main' into 60-유저-정보-페이지사용자-지정-모드-목록-기본-css-구현
nyj001012 Jan 18, 2024
107fba7
build: header 파일 경로 변경
nyj001012 Jan 18, 2024
a0dc4a3
refactor: pages.js에서 page.js로 파일명 변경
nyj001012 Jan 18, 2024
4cd4258
refactor(histories): page.js export명 변경 사항 적용
nyj001012 Jan 18, 2024
1f2776e
refactor(histories): a태그 대신 div태그로 변경
nyj001012 Jan 18, 2024
6e6cd98
chore(css): 불필요한 css 제거
nyj001012 Jan 18, 2024
14993ee
feat(utils): hover 이벤트 리스너 모듈 추가
nyj001012 Jan 18, 2024
cac11f9
feat(utils): hover 시 cursor 변경하는 모듈 추가
nyj001012 Jan 18, 2024
943cc0f
refactor(utils): hover 시 cursor 변경은 hoverCursor에서 관리
nyj001012 Jan 18, 2024
2328d32
refactor(histories): hover는 이벤트리스너로 관리
nyj001012 Jan 18, 2024
12406cb
feat(histories): click 이벤트 리스너 추가하는 함수 추가
nyj001012 Jan 18, 2024
2d39fb2
refactor(header): histories 헤더에서 a 태그 삭제
nyj001012 Jan 18, 2024
384ebab
style(header): 주석 추가
nyj001012 Jan 18, 2024
5e212be
chore: 프로젝트 파일 변경사항 추가
nyj001012 Jan 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions frontend/assets/css/common/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,69 @@ header {
width: fit-content;
}

.header-wrapper .histories#left-side, .header-wrapper .histories#right-side {
display: flex;
align-items: center;
flex-direction: row;
width: 30%;
height: 100%;
}

.header-wrapper .histories#left-side {
justify-content: flex-start;
}

.header-wrapper .histories#right-side {
justify-content: flex-end;
}

.header-wrapper .histories#left-side > img {
width: 3rem;
height: 3rem;
margin-right: 10px;
}

.header-wrapper .histories#search-box {
display: flex;
width: fit-content;
height: 100%;
justify-content: center;
align-items: center;
}

.header-wrapper .histories#search-box > input {
width: 15rem;
height: 50%;
border-radius: 1rem;
border: 4px #FF79C5 solid;
background: none;
color: white;
font-size: 1.5rem;
padding: 0 1rem;
font-family: Galmuri11, system-ui;
}

.header-wrapper .histories#title {
text-align: center;
color: #29ABE2;
}

.header-wrapper .histories#user-avatar {
position: relative;
width: 4rem;
height: 4rem;
border: 4px solid white;
overflow: hidden;
margin-right: 5rem;
}

.header-wrapper .histories#user-avatar > img {
position: absolute;
width: 6rem;
height: 6rem;
border-radius: 50%;
}

.header-wrapper .histories#close-button a {
display: block;
background-image: url("../../images/close.png");
Expand Down
157 changes: 157 additions & 0 deletions frontend/assets/css/histories.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
.histories#content-wrapper {
display: flex;
justify-content: center;
flex-direction: column;
height: 100%;
background-color: black;
background-image: url("../images/histories_frame.png");
background-size: 100% 100%;
background-position: bottom;
background-repeat: no-repeat;
overflow: hidden;
}

/************* Histories List *************/

.histories#list {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 66.6vh;
color: white;
padding: 10vh 6vw 3vh 6vw;
}

.histories#list-wrapper {
display:grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: repeat(2, 1fr);
justify-content: center;
justify-items: center;
align-items: center;
grid-gap: 1vh;
width: 80%;
height: 100%;
}

.histories.list-item {
display: flex;
justify-content: center;
align-items: baseline;
flex-direction: row;
border: 3px transparent solid;
border-radius: 1vw;
text-decoration: none;
width: 80%;
padding: 1vh 1vw;
}

.histories.list-item:visited, .histories.list-item:link, .histories.list-item:active {
color: white;
}

.histories.list-item:hover {
border: 3px #29ABE2 solid;
border-radius: 1vw;
}

.histories.list-item .player {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 10vw;
border-radius: 1vh;
}

.histories.list-item .player > div:not(:first-child) {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 50%;
}

.histories.list-item .histories.avatar {
display: flex;
justify-content: center;
align-items: center;
position: relative;
width: 8vw;
height: 8vw;
overflow: hidden;
}

.histories.list-item .histories.avatar > img {
position: absolute;
top: 0.1vw;
width: 12vw;
height: 12vw;
}

.histories.list-item .player > div:not(:last-child) {
margin-bottom: 1vh;
}

.histories.list-item .game-mode {
width: 20%;
}

.histories.list-item .histories.nickname {
font-family: Galmuri11-Bold, serif;
font-size: 1.3em;
}

.histories.list-item .histories.rating {
font-family: Galmuri11, serif;
font-size: 1.1em;
}

/********** Histories Pagination **********/

.histories#pagination, .histories#pagination a {
display: inline-block;
height: 6vh;
}

.histories#pagination > .histories img {
height: 100%;
}

.histories#pagination > .histories#prev img {
transform: rotate(180deg);
}

.histories#pagination#next {
}

/********** Histories Mode Select **********/

.histories#mode {
display: flex;
justify-content: space-evenly;
align-items: center;
flex-direction: row;
height: 15.5vh;
font-size: 2em;
}

.histories#mode a {
display: flex;
justify-content: center;
align-items: center;
color: white;
font-family: Galmuri11, serif;
text-decoration: none;
}

.histories#mode > a img {
width: 7vh;
margin-right: 2vh;
}

.histories#mode > a:hover {
font-family: Galmuri11-Bold, serif;
color: #29ABE2;
}
Binary file added frontend/assets/images/avatar/blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/avatar/green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/avatar/pink.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/avatar/red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/avatar/yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/custom_summary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/pagination.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/assets/images/setting.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 7 additions & 6 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ping pong</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<link rel="stylesheet" href="assets/css/common/header.css"/>
<link rel="stylesheet" href="assets/css/common/body.css"/>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ping pong</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jgthms/minireset.css@master/minireset.min.css">
<link rel="stylesheet" href="assets/css/common/header.css"/>
<link rel="stylesheet" href="assets/css/common/body.css"/>
<link rel="stylesheet" href="global.css"/>
</head>
<body>
<header id="header"></header>
Expand Down
2 changes: 2 additions & 0 deletions frontend/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import App from "./src/app.js";
import Header from "./src/pages/header/header.js";
import { $ } from "./src/utils/querySelector.js";

window.addEventListener("DOMContentLoaded", (e) => {
new Header($("#header"));
new App($("#app"));
});
11 changes: 6 additions & 5 deletions frontend/src/constants/routeInfo.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pages from "../pages/histories/pages.js";
import GameMode from '../pages/game-mode/page.js';
import Main from '../pages/main/page.js';
import Nickname from '../pages/nickname/page.js';
Expand All @@ -8,8 +9,8 @@ export const BASE_URL = 'http://localhost:3000';
* 원하는 경로에 따라 렌더링할 컴포넌트를 정의합니다.
*/
export const routes = [
{ path: /^\/$/, page: Main, header: errorHeader },
{ path: /^\/nickname$/, page: Nickname, header: errorHeader },
{ path: /^\/gamemode$/, page: GameMode, header: errorHeader },
{path: /^\/histories$/, page: histories, header: errorHeader}
]
{ path: /^\/$/, page: Main, header: errorHeader },
{ path: /^\/nickname$/, page: Nickname, header: errorHeader },
{ path: /^\/gamemode$/, page: GameMode, header: errorHeader },
{ path: /^\/histories$/, page: pages, header: errorHeader}
]
29 changes: 29 additions & 0 deletions frontend/src/pages/header/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import Router from "../../router.js";
import HistoriesHeader from "./historiesHeader.js";

/**
* header 컴포넌트
* @param {HTMLElement} $container
*/
export default function header($container) {
this.$container = $container;

const init = () => {
new Router($container);
};

const render = () => {
this.$container.innerHTML = `
`;
}

init();
switch (location.pathname) {
case "/histories":
new HistoriesHeader($container);
break;
default:
render();
break;
}
}
35 changes: 35 additions & 0 deletions frontend/src/pages/header/historiesHeader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/**
* 사용자 전적 페이지에 사용하는 header 컴포넌트
* @param {HTMLElement} $container
*/
export default function HistoriesHeader($container) {
this.$container = $container;

this.setState = () => {
this.render();
}

this.render = () => {
this.$container.innerHTML = `
<div class="histories header-wrapper">
<div class="histories" id="left-side">
<img src="../../../assets/images/search.png" alt="">
<div class="histories" id="search-box">
<input type="text">
</div>
</div>
<div class="histories" id="title">너의 기록은</div>
<div class="histories" id="right-side">
<div class="histories" id="user-avatar">
<img src="../../../assets/images/avatar/red.png" alt="">
</div>
<div class="histories" id="close-button">
<a href=""></a>
</div>
</div>
</div>
`
}

this.render();
}
Loading