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

공통 UI 수정 #21

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
137 changes: 137 additions & 0 deletions src/main/resources/static/css/layout.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
@import url('https://fonts.googleapis.com/css2?family=Lufga:wght@400;600&family=SUIT:wght@400;600&display=swap');
@charset "UTF-8";
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'SUIT', Arial, sans-serif;
display: flex;
height: 100vh;
}
.sidebar {
width: 305px;
background-color: #161616;
color: #fff;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 20px 10px;
}
.logo {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
margin-bottom: 30px;
margin-top: 15px;
}
.logo img {
width: 40px;
height: 40px;
}
.logo span {
font-family: 'Lufga', Arial, sans-serif;
font-size: 35px;
font-weight: 600;
}
.logo .highlight {
color: #FFD028;
}
.menu {
flex-grow: 1;
margin-top: 56px;
}
.menu-item {
color: #fff;
padding: 15px 20px;
cursor: pointer;
font-family: 'SUIT', Arial, sans-serif;
font-weight: 600;
font-size: 20px;
transition: background-color 0.3s ease;
margin-bottom: 10px;
}
.menu-item:hover,
.menu-item.active {
color: #FFD028;
background-color: #3A3A3A;
border-radius: 5px;
}
.submenu {
margin-left: 18px;
display: none;
}
.submenu-item {
padding: 10px 20px;
cursor: pointer;
font-family: 'SUIT', Arial, sans-serif;
font-size: 17px;
transition: background-color 0.3s ease;
margin-bottom: 8px;
}
.submenu-item:hover {
background-color: #484848;
border-radius: 5px;
}
.submenu-item.active {
color: #FFD028;
background-color: #3A3A3A;
border-radius: 5px;
}
.menu-item.active + .submenu {
display: block;
}
.user-info-button {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 15px;
background-color: #222222;
color: #fff;
border: 1px solid #303030;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.user-info-button:hover {
background-color: #303030;
}
.user-info {
display: flex;
align-items: center;
gap: 10px;
}
.user-info div {
margin-left: 5px;
}
.user-info img {
width: 40px;
height: 40px;
border-radius: 50%;
}
.user-id {
margin-bottom: 5px;
}
.logout-icon {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border-radius: 50%;
transition: background-color 0.3s ease;
}
.logout-icon:hover {
background-color: #303030;
}
.logout-icon img {
width: 20px;
height: 20px;
}
.content {
flex-grow: 1;
background-color: #F5F6FA;
padding: 36px 32px;
}
Binary file added src/main/resources/static/img/WNobrandIcon.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 src/main/resources/static/img/logout.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 src/main/resources/static/img/user.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions src/main/resources/static/js/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
function toggleSubmenu(element, submenuId) {
// 메뉴 토글 로직 (변경 없음)
const submenus = document.querySelectorAll('.submenu');
const menuItems = document.querySelectorAll('.menu-item');

// 클릭한 상위 메뉴가 이미 활성화 상태인지 확인
const isActive = element.classList.contains('active');

// 모든 메뉴 항목의 활성화 상태 제거
menuItems.forEach(item => item.classList.remove('active'));

// 모든 서브메뉴 숨기기
submenus.forEach(submenu => submenu.style.display = 'none');

if (!isActive) {
// 상위 메뉴를 활성화 상태로 설정
element.classList.add('active');

// 해당 서브메뉴 보이기
const submenu = document.getElementById(submenuId);
if (submenu) submenu.style.display = 'block';
}
}

function activateSubmenu(element) {
// 모든 서브메뉴 항목에서 active 클래스 제거
const submenuItems = document.querySelectorAll('.submenu-item');
submenuItems.forEach(item => item.classList.remove('active'));

// 클릭한 서브메뉴 항목에 active 클래스 추가
element.classList.add('active');
}

function logout(event) {
event.stopPropagation();
alert('로그아웃 되었습니다.');
location.href = '/member/logout';
}
Loading