본문 바로가기

카테고리 없음

23.08.31 / day 64

728x90

1차 Team Project

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="styles.css">
    <script src="script.js" defer></script>
    <title>BookMasters</title>

    <style>
        #top-header {
            width: 100%;
            height: auto;
            display: inline-block;
            text-align: center;

            background-color: white;
            border-bottom: 1px solid black;
        }

        #title {
            display: inline-block;
            width: 45%;
            font-size: 80px;
            font-weight: 600;
            margin-top: 30px;
            margin-bottom: -50px;
        }

        #title img {
            height: 150px;
        }

        #icons {
            position: absolute;
            width: 20%;
            display: flex;
            top: 70px;
            right: 1%;
            justify-content: space-around;
        }

        .search {
            position: relative;
            text-align: center;
            width: 400px;
            margin: 0 auto;
        }

        .search input {
            width: 100%;
            height: 30px;
            border-radius: 30px;
            border: 1px solid #bbb;
            margin: 10px 0;
            padding: 10px 12px;
            font-size: 30px;
            background-color: rgb(218, 241, 225);
        }

        #search-icon {
            position: absolute;
            right: -5%;
            top: 20%;
            width: 40px;
        }

        #search-icon img {
            width: 100%;
        }

        #header-menus {
            display: inline-flex;
            width: 60%;
            height: 50px;
            justify-content: space-around;
        }

        .menu {
            margin-top: 1%;
            font-size: 25px;
            font-weight: bold
        }





        body {
            font-family: Arial, sans-serif;

        }


        .tabs {
            display: flex;
            background-color: rgb(218, 241, 225);
            justify-content: center;
            margin-top: 50px;
        }

        .tab-button {
            background-color: rgb(218, 241, 225);
            border: none;
            border-radius: 5px;
            padding: 10px 20px;
            margin: 0 10px;
            cursor: pointer;
        }

        .content {
            display: none;
            margin-top: 20px;

        }


        #writeButton {
            display: block;
            margin-top: 10px;
        }

        .table {
            margin-left: auto;
            margin-right: auto;

        }

        table {
            width: 1150px;
            margin: auto;
        }

        table,
        td,
        th {
            border-collapse: collapse;
            border: 1px solid black;
        }

        th, td {
  text-align: center;
}

        ul {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  max-width: 500px;
  width: 100%;
  list-style: none;
}

li {
  .button {
    display: block;
    padding: 20px;
    width: 100%;
    color: #000;
    text-align: left;
    background-color: #ddd;
    border: 0;
    cursor: pointer;
  }

  .content {
    display: none;
    margin: 0;
    padding: 20px;
    background-color: #fff;
    border-top: 1px solid #ddd;
  }
  
  &.on {
    .button {
      background-color: #fff;
      font-weight: bold;
    }
    
    .content {
      display: block;
    }
  }
}

h1 { text-align: center; }

      
        </style>
        

    <script>
        document.addEventListener("DOMContentLoaded", function () {
            const tabButtons = document.querySelectorAll(".tab-button");
            const contentSections = document.querySelectorAll(".content");

            tabButtons.forEach(button => {
                button.addEventListener("click", () => {
                    // Hide all content sections
                    contentSections.forEach(section => {
                        section.style.display = "none";
                    });

                    // Show the corresponding content section
                    const targetContentId = button.id.replace("Tab", "Content");
                    const targetContent = document.getElementById(targetContentId);
                    if (targetContent) {
                        targetContent.style.display = "block";
                    }
                });
            });
        });

        const buttons = document.querySelectorAll('.button');

buttons.forEach(function(button, index) {
  button.addEventListener('click', function(e) {
    e.preventDefault();
    
    this.parentNode.classList.toggle('on');
    
    buttons.forEach(function(button2, index2) {
      if ( index !== index2 ) {
        button2.parentNode.classList.remove('on');
      }
    });
  });
});


document.addEventListener("DOMContentLoaded", function () {
    const tabButtons = document.querySelectorAll(".tab-button");
    const contentSections = document.querySelectorAll(".content");

    tabButtons.forEach(button => {
        button.addEventListener("click", () => {
            // Hide all content sections
            contentSections.forEach(section => {
                section.style.display = "none";
            });

            // Show the corresponding content section
            const targetContentId = button.id.replace("Tab", "Content");
            const targetContent = document.getElementById(targetContentId);
            if (targetContent) {
                targetContent.style.display = "block";
            }
        });
    });

    const buttons = document.querySelectorAll('.button');

    buttons.forEach(function (button, index) {
        button.addEventListener('click', function (e) {
            e.preventDefault();

            this.parentNode.classList.toggle('on');

            buttons.forEach(function (button2, index2) {
                if (index !== index2) {
                    button2.parentNode.classList.remove('on');
                }
            });
        });
    });
});
        
    </script>






</head>

<body>
    <div id="top-header">
        <div id="title"><img src="img/title_bookmasters.PNG" alt=""></div>
        <div id="icons">
            <div class="icon">아이콘</div>
            <div class="icon">아이콘</div>
            <div class="icon"><button>문의하기 </button> </div>
        </div>
        <div class="search">
            <input type="text">
            <div id="search-icon"><img src="img/searchicon.png"></div>
        </div>
        <div id="header-menus">
            <div class="menu">베스트</div>
            <div class="menu">신제품</div>
            <div class="menu">이벤트</div>
            <div class="menu">고객지원</div>
        </div>
    </div>
    <div class="conter">
        <h1>고객지원</h1>
    </div>

    <div class="tabs">
        <button class="tab-button" id="noticeTab">공지사항</button>
        <button class="tab-button" id="faqTab">자주 묻는 질문</button>
        <button class="tab-button" id="contactTab">문의하기</button>
    </div>
    <div class="content" id="noticeContent">
    <h2> <p style=" text-decoration : underline">공지사항</p></h2>
       
        <table>
            <thead>
                <tr>
                    <th>|번호|</th>
                    <th>|작성글|</th>
                    <th>|일자|</th>
                    &nbsp;<th>|작성자|</th>

                </tr>
            </thead>
            <tbody>
                <tr>

                    <td>01</td>
                    <td><a href="#">공지사항 01</a></td>
                    <td>2023.06.13</td>
                    <td>관리자</td>
                    </td>

                </tr>
                <tr>
                    <td>02</td>
                    <td><a href="#">공지사항 02</a></td>
                    <td>2023.06.28</td>
                    <td>관리자</td>
                </tr>
                <tr>
                    <td>03</td>
                    <td><a href="#">공지사항 03</a></td>
                    <td>2023.07.01</td>
                    <td>관리자</td>
                </tr>
                <tr>
                    <td>04</td>
                    <td><a href="#">공지사항 04</a></td>
                    <td>2023.07.12</td>
                    <td>관리자</td>
                </tr>
                <tr>
                    <td>05</td>
                    <td><a href="#">공지사항 05</a></td>
                    <td>2023.07.15</td>
                    <td>관리자</td>
                </tr>
                <tr>
                    <td>06</td>
                    <td><a href="#">공지사항 06</a></td>
                    <td>2023.07.25</td>
                    <td>관리자</td>
                </tr>
                <tr>
                    <td>07</td>
                    <td><a href="#">공지사항 07</a></td>
                    <td>2023.07.30</td>
                    <td>관리자</td>
                </tr>
                <tr>
                    <td>08</td>
                    <td><a href="#">공지사항 08</a></td>
                    <td>2023.08.01</td>
                    <td>관리자</td>
                </tr>
                <tr>
                    <td>09</td>
                    <td><a href="#">공지사항 09</a></td>
                    <td>2023.08.05</td>
                    <td>관리자</td>
                </tr>
                <tr>
                    <td>10</td>
                    <td><a href="#">공지사항 10</a></td>
                    <td>2023.08.10</td>
                    <td>관리자</td>
                </tr>
               
            </tbody>
        </table>
    </div>


    <div class="content" id="faqContent">
        <h2> <p style=" text-decoration : underline">자주 하는 질문</p></h2>
        <br>

       
         
            <table>
                <thead>
                    <tr>
                        <th>|번호|</th>
                        <th>|작성글|</th>
                        <th>|일자|</th>
                        &nbsp;<th>|작성자|</th>
    
                    </tr>
                </thead>
                <tbody>
                    <tr>
    
                        <td>01</td>
                        <td><a href="#">질문 0</a></td>
                        <td>2023.06.13</td>
                        <td>관리자</td>
                        </td>
    
                    </tr>
                    <tr>
                        <td>02</td>
                        <td><a href="#">질문 1</a></td>
                        <td>2023.06.28</td>
                        <td>관리자</td>
                    </tr>
                    <tr>
                        <td>03</td>
                        <td><a href="#">질문 2</a></td>
                        <td>2023.07.01</td>
                        <td>관리자</td>
                    </tr>
                    <tr>
                        <td>04</td>
                        <td><a href="#">질문 3</a></td>
                        <td>2023.07.12</td>
                        <td>관리자</td>
                    </tr>
                    <tr>
                        <td>05</td>
                        <td><a href="#">질문 4 </a></td>
                        <td>2023.07.15</td>
                        <td>관리자</td>
                    </tr>
                </tbody>
            </table>
           
    
        </div>

      
        
      </div>
           <div></div>
          
           <div class="content" id="contactContent">
       
            <h2> <p style=" text-decoration : underline">문의하기</p></h2>

        <!-- 문의 내용 -->
       <table>
                <thead>
                    <tr>
                        <th>|번호|</th>
                        <th>|작성글|</th>
                        <th>|일자|</th>
                        &nbsp;<th>|작성자|</th>
    
                    </tr>
                </thead>
                <tbody>
                    <tr>
    
                        <td>01</td>
                        <td><a href="#">문의내용 1</a></td>
                        <td>2023.06.13</td>
                        <td>관리자</td>
                        </td>
    
                    </tr>
                    <tr>
                        <td>02</td>
                        <td><a href="#">문의2</a></td>
                        <td>2023.06.28</td>
                        <td>관리자</td>
                    </tr>
                    <tr>
                        <td>03</td>
                        <td><a href="#">문의 3</a></td>
                        <td>2023.07.01</td>
                        <td>관리자</td>
                    </tr>
                    <tr>
                        <td>04</td>
                        <td><a href="#">문의 4</a></td>
                        <td>2023.07.12</td>
                        <td>관리자</td>
                    </tr>
                    <tr>
                        <td>05</td>
                        <td><a href="#">문의 5 </a></td>
                        <td>2023.07.15</td>
                        <td>관리자</td>
                    </tr>
                </tbody>
       </table>
           
    
        </div>





</body>

</html>

프로젝트 중임....
아직 페이징을 하지 못했다....