Skip to content

Commit

Permalink
tab
Browse files Browse the repository at this point in the history
  • Loading branch information
SJLEE316 committed Aug 28, 2021
1 parent 477ffec commit 73629c7
Show file tree
Hide file tree
Showing 9 changed files with 306 additions and 128 deletions.
58 changes: 58 additions & 0 deletions Miracle30/static/css/main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
/* tab */
.tab_container {
display: flex;
}

.tab_item {
cursor: pointer;
}

.tab_item:hover {
background-color: var(--main-orange-color);
transition: background-color 0.4s ease-in-out;
}

.tab_item:hover .tab_item_title {
color: #fff;
transition: color 0.4s ease-in-out;
}

.tab_item.active {
border-bottom: 2px solid var(--main-orange-color);
}

.tab_item.active .tab_item_title {
color: var(--main-orange-color);
}

.tab_item.active:hover {
background-color: var(--main-orange-color);
transition: background-color 0.4s ease-in-out;
}

.tab_item.active:hover .tab_item_title {
color: #fff;
transition: color 0.4s ease-in-out;
}

.tab_item_title {
display: inline-block;
color: #999;
font-weight: 700;
text-decoration: none;
margin: 15px;
}

.content-container {
padding: 10px;
}

.content-container__content {
display: none;
}

.content-container__content.target {
display: block;
}

/* btns */
.goal_verify {
display: flex;
Expand All @@ -8,6 +65,7 @@
margin: var(--padding-micro);
}

/* tab1----------- */
/* star board */
.level1 {
background-color: white;
Expand Down
1 change: 1 addition & 0 deletions Miracle30/static/css/mypage.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* tab */
.my_tab {
display: flex;
}
Expand Down
14 changes: 7 additions & 7 deletions Miracle30/static/css/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ul {
padding-left: 0;
}

li {
.nav_category li {
padding-top: var(--padding-small);
}

Expand Down Expand Up @@ -63,23 +63,23 @@ li {
}

/* 카테고리 추가 */
.nav_plus {
/* .nav_plus {
padding-bottom: var(--padding-medium);
}
} */

.nav_plus .nav_toggleBtn {
/* .nav_plus .nav_toggleBtn {
width: 100%;
text-align: center;
font-size: 30px;
}
} */

.nav_plusList {
/* .nav_plusList {
display: none;
}
.nav_plusList.clicked {
display: block;
}
} */

.nav_bar {
display: none;
Expand Down
23 changes: 23 additions & 0 deletions Miracle30/static/css/show_certify.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.certify_container {
width: 40%;
}
.certify_list {
list-style: none;
margin: 0px;
padding: 0px;
}

.certify_list li {
margin-bottom: 10px;
background: #f9f9ff;
display: block;
line-height: 40px;
padding: 0px 18px;
font-size: 14px;
font-family: "Roboto", sans-serif;
color: #777777;
}

span {
float: right;
}
3 changes: 2 additions & 1 deletion Miracle30/static/js/group_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ const pTag = document.getElementsByTagName("p"),

modalBtn.forEach((elem, index) => {
elem.addEventListener("click", (e) => {
console.log(elem, index);
modal.style.display = "block";
let data = pTag[index - 2].textContent;
let data = pTag[index].textContent;
data = data.replace(/'/gi, "");
data = data.substr(1, data.length - 2);
modalBody.textContent = data;
Expand Down
19 changes: 19 additions & 0 deletions Miracle30/static/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const tabItem = document.querySelectorAll(".tab_item");
const tabContent = document.querySelectorAll(".content-container__content");

tabItem.forEach((item) => {
item.addEventListener("click", tabHandler);
});

function tabHandler(item) {
const tabTarget = item.currentTarget;
const target = tabTarget.dataset.tab;
tabItem.forEach((title) => {
title.classList.remove("active");
});
tabContent.forEach((target) => {
target.classList.remove("target");
});
document.querySelector("#" + target).classList.add("target");
tabTarget.classList.add("active");
}
18 changes: 0 additions & 18 deletions Miracle30/static/js/mypage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,3 @@ infoBtn.addEventListener("click", () => {
goal.style.display = "none";
info.style.display = "block";
});

// function goalClick() {
// // my_goalBtn class -> clicked 추가
// // my_info class -> clicked 삭제
// goal.classList.toggle("clicked");
// info.classList.toggle("clicked");
// goal.style.display = "block";
// info.style.display = "none";
// }

// function infoClick() {
// // my_goalBtn class -> clicked 삭제
// // my_info class -> clicked 추가
// goal.classList.toggle("clicked");
// info.classList.toggle("clicked");
// goal.style.display = "none";
// info.style.display = "block";
// }
Loading

0 comments on commit 73629c7

Please sign in to comment.