๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
IT/Java - Spring Boot

[Spring Boot] ํŽ˜์ด์ง€์— ์ƒ๋‹จ ๋ฐ” ์ฝ”๋”ฉํ•˜๊ธฐ

by ITyranno 2023. 11. 1.
728x90
๋ฐ˜์‘ํ˜•

 

 

 

ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์„ธ๊ณ„๋ฅผ ํƒ๊ตฌํ•ฉ์‹œ๋‹ค.

 

 

 

 

Spring Boot๋ฅผ ํ™œ์šฉํ•˜์—ฌ ํŽ˜์ด์ง€์— ์ƒ๋‹จ ๋ฐ”์™€ ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

5๊ฐœ์˜ ์นดํ…Œ๊ณ ๋ฆฌ๋กœ ๊ตฌ์„ฑ๋˜์–ด ์žˆ๊ณ , ํ•˜์œ„ ํ•ญ๋ชฉ์ด ์žˆ๋Š” ์นดํ…Œ๊ณ ๋ฆฌ์ผ ๊ฒฝ์šฐ ๋งˆ์šฐ์Šค๋ฅผ ์˜ฌ๋ฆฌ๋ฉด ํ•˜์œ„ ํ•ญ๋ชฉ์ด ๋‚ด๋ ค์˜ต๋‹ˆ๋‹ค.

 

 

 

๊ตฌํ˜„ ํ™”๋ฉด

 

 

 

 

์ž‘์„ฑ ์ฝ”๋“œ

 

 

header.html

 

<!DOCTYPE html>
<html>

<head>

</head>

<style>
  .my-bg-color {
    background-color: none;
  }

  .my-text-size {
    font-size: 50px;
    font-weight: bold;
    color: rgb(255, 179, 0);
  }

  .title {
    width: 20rem;
  }

  .title:hover {
    text-decoration: none;
    color: rgb(255, 179, 0);
  }

  .nav-color {
    background-color: none;
  }

  .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgb(255, 179, 0);
    font-size: 20px;
    transition-duration: .3s;
  }

  .nav-link:hover {
    color: 255, 179, 0 !important;
  }

  .link-dark {
    text-decoration: none;
  }

  .dropdown-submenu {
    position: relative;
  }

  .dropdown-menu {
    border-color: none;
    border: none !important;
    text-align: center;
    width: 13rem;
    margin: 1rem;
    margin-top: -1rem;
    background-color: rgb(255, 179, 0, 0.45);
  }


  .navbar-nav .dropdown-menu {
    border-top: 3px solid rgb(255, 179, 0) !important;
    position: fixed;
  }

  .dropdown-toggle::after {
    display: none;
  }

  .navbar-nav.ml-auto li a {
    font-size: 15px;
  }

  .navbar-nav .nav-link {
    margin: 0rem 0rem -3rem 1rem;
    width: 13rem;
    height: 10rem;
  }

  .navbar-nav {
    flex-direction: row;
  }

  .dropdown-item {
    font-weight: 50;
    width: 13rem;
    color: white;
  }
</style>

<body>
  <div class="p-5 my-bg-color text-white d-flex justify-content-between">
    <h1 class="my-text-size">
      <a href="/"><img class="title" th:src="@{/logo.png}" alt=""></a>
    </h1>
    <ul class="navbar-nav mx-auto">
      <li class="nav-item dropdown mr-3">
        <a class="nav-link dropdown-toggle active" href="/map" id="infoDropdown" role=" button" aria-haspopup="true"
          aria-expanded="false" style="color: rgb(255, 179, 0);">์ถฉ์ „์†Œ ์ฐพ๊ธฐ</a>
      </li>

      <li class="nav-item dropdown mr-3">
        <a class="nav-link dropdown-toggle active" href="#" id="postsDropdown" role="button" data-toggle="dropdown"
          aria-haspopup="true" aria-expanded="false" style="color: rgb(255, 179, 0);">๊ฒŒ์‹œํŒ</a>
        <div class="dropdown-menu" aria-labelledby="infoDropdown">
          <a class='dropdown-item' href='/board/list'>๊ณต์ง€์‚ฌํ•ญ</a>
          <div class="dropdown">
            <a class='dropdown-item' href='/qna/list'>Q&A</a>
          </div>
        </div>
      </li>

      <li class="nav-item dropdown mr-3">
        <a class="nav-link dropdown-toggle active" href="#" id="postsDropdown" role="button" data-toggle="dropdown"
          aria-haspopup="true" aria-expanded="false" style="color: rgb(255, 179, 0);">์ •๋ณด๋งˆ๋‹น</a>
        <div class="dropdown-menu" aria-labelledby="infoDropdown">
          <a class='dropdown-item' href='/statistic/chargerStatus'>ํ†ต๊ณ„์ •๋ณด</a>
          <div class="dropdown">
            <a class='dropdown-item' href='/statistic/ChargerExpense'>์„œ๋น„์Šค์•ˆ๋‚ด</a>
          </div>
        </div>
      </li>

      <li class="nav-item dropdown mr-3">
        <a class="nav-link dropdown-toggle active" href="#" id="infoDropdown" role=" button" data-toggle="dropdown"
          aria-haspopup="true" aria-expanded="false" style="color: rgb(255, 179, 0);">๋ฏธ๋””์–ด</a>
        <div class="dropdown-menu" aria-labelledby="infoDropdown">
          <a class='dropdown-item' href='/media/news?searchText=์ „๊ธฐ์ฐจ'>์ „๊ธฐ์ฐจ ๋‰ด์Šค</a>
          <div class="dropdown">
            <a class='dropdown-item' href='/media/reels'>์ „๊ธฐ์ฐจ ์˜์ƒ</a>
            <div class="dropdown">
              <a class='dropdown-item' href='http://localhost:3000/'>์ „๊ธฐ์ฐจ ์ฃผํ–‰๊ฑฐ๋ฆฌ</a>
              <div class="dropdown">
                <a class='dropdown-item' th:href='@{/media/gamepage}'>์ „๊ธฐ์ฐจ ๊ฒŒ์ž„</a>
              </div>
            </div>
          </div>
        </div>
      </li>

      <li class="nav-item dropdown mr-3">
        <a class="nav-link dropdown-toggle active" href="#" id="postsDropdown" role="button" data-toggle="dropdown"
          aria-haspopup="true" aria-expanded="false" style="color: rgb(255, 179, 0);">๋ฉค๋ฒ„์‹ญ</a>
        <div class="dropdown-menu" aria-labelledby="infoDropdown">
          <a class='dropdown-item' th:href='@{/exchange}'>์ฝ”์ธ๊ตํ™˜</a>
          <div class="dropdown">
            <a class='dropdown-item' th:href='@{/coupon}'>์ฟ ํฐํ•จ</a>
            <div class="dropdown">
              <a class='dropdown-item' th:href='@{/membership}'>๊ฐ€์ž…ํ•˜๊ธฐ</a>
              <div class="dropdown">
                <a th:if="${session != null and session.user_info != null and session.has_membership}"
                  class='dropdown-item' th:href='@{/mymembership}'>๋‚˜์˜ ๋ฉค๋ฒ„์‹ญ</a>
              </div>
            </div>
          </div>
        </div>
      </li>


    </ul>
  </div>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>

  <script type='text/javascript'>

    $(document).ready(function () {
      $('.dropdown').on('mouseenter', function () {
        $(this).find('.dropdown-menu').first().stop(true, true).slideDown();
      });

      $('.dropdown').on('mouseleave', function () {
        $(this).find('.dropdown-menu').first().stop(true, true).slideUp();
      });
    });
  </script>
</body>

</html>

 

 

header2.html

 

<!DOCTYPE html>
<html>

<head>

</head>

<style>
  .my-bg-color {
    background-color: none;
  }

  .my-text-size {
    font-size: 50px;
    font-weight: bold;
    color: rgb(255, 179, 0);
  }

  .title {
    width: 20rem;
  }

  .title:hover {
    text-decoration: none;
    color: rgb(255, 179, 0);
  }

  .nav-color {
    background-color: none;
  }

  .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgb(255, 179, 0);
    font-size: 20px;
    transition-duration: .3s;
  }

  .nav-link:hover {
    color: 255, 179, 0 !important;

  }

  .link-dark {
    text-decoration: none;
  }

  .dropdown-submenu {
    position: relative;
  }

  .dropdown-menu {
    border-color: none;
    border: none !important;
    text-align: center;
    width: 13rem;
    margin: 1rem;
    margin-top: -1rem;
    background-color: rgb(255, 179, 0, 0.45);
  }


  .navbar-nav .dropdown-menu {
    border-top: 3px solid rgb(255, 179, 0) !important;
    position: fixed;
  }

  .dropdown-toggle::after {
    display: none;
  }

  .navbar-nav.ml-auto li a {
    font-size: 15px;
  }

  .navbar-nav .nav-link {
    margin: 0rem 0rem -3rem 1rem;
    width: 13rem;
    height: 10rem;
  }
  
  .navbar-nav {
    flex-direction: row;
  }

  .dropdown-item {
    font-weight: 50;
    width: 13rem;
    color: white;
  }
</style>

<body>
  <div class="p-5 my-bg-color text-white d-flex justify-content-between">
    <h1 class="my-text-size">
      <a href="/"><img class="title" th:src="@{/logo.png}" alt=""></a>
    </h1>
    <ul class="navbar-nav mx-auto">
      <li class="nav-item dropdown mr-3">
        <a class="nav-link dropdown-toggle active" href="/map" id="infoDropdown" role=" button"
          aria-haspopup="true" aria-expanded="false" style="color: rgb(255, 179, 0);">์ถฉ์ „์†Œ ์ฐพ๊ธฐ</a>
      </li>

      <li class="nav-item dropdown mr-3">
        <a class="nav-link dropdown-toggle active" href="#" id="postsDropdown" role="button" data-toggle="dropdown"
          aria-haspopup="true" aria-expanded="false" style="color: rgb(255, 179, 0);">๊ฒŒ์‹œํŒ</a>
        <div class="dropdown-menu" aria-labelledby="infoDropdown">
          <a class='dropdown-item' href='/board/list'>๊ณต์ง€์‚ฌํ•ญ</a>
          <div class="dropdown">
            <a class='dropdown-item' href='/qna/list'>Q&A</a>
          </div>
        </div>
      </li>

      <li class="nav-item dropdown mr-3">
        <a class="nav-link dropdown-toggle active" href="#" id="postsDropdown" role="button" data-toggle="dropdown"
          aria-haspopup="true" aria-expanded="false" style="color: rgb(255, 179, 0);">์ •๋ณด๋งˆ๋‹น</a>
        <div class="dropdown-menu" aria-labelledby="infoDropdown">
          <a class='dropdown-item' href='/statistic/chargerStatus'>ํ†ต๊ณ„์ •๋ณด</a>
          <div class="dropdown">
            <a class='dropdown-item' href='/statistic/ChargerExpense'>์„œ๋น„์Šค์•ˆ๋‚ด</a>
        </div>
        </div>
      </li>

      <li class="nav-item dropdown mr-3">
        <a class="nav-link dropdown-toggle active" href="#" id="infoDropdown" role=" button" data-toggle="dropdown"
          aria-haspopup="true" aria-expanded="false" style="color: rgb(255, 179, 0);">๋ฏธ๋””์–ด</a>
        <div class="dropdown-menu" aria-labelledby="infoDropdown">
          <a class='dropdown-item' href='/media/news?searchText=์ „๊ธฐ์ฐจ'>์ „๊ธฐ์ฐจ ๋‰ด์Šค</a>
          <div class="dropdown">
            <a class='dropdown-item' href='/media/reels'>์ „๊ธฐ์ฐจ ์˜์ƒ</a>
            <div class="dropdown">
              <a class='dropdown-item' th:href='@{/media/gamepage}'>์ „๊ธฐ์ฐจ ๊ฒŒ์ž„</a>
            </div>
          </div>
        </div>
      </li>

      <li class="nav-item dropdown mr-3">
        <a class="nav-link dropdown-toggle active" href="#" id="postsDropdown" role="button" data-toggle="dropdown"
          aria-haspopup="true" aria-expanded="false" style="color: rgb(255, 179, 0);">๋ฉค๋ฒ„์‹ญ</a>
        <div class="dropdown-menu" aria-labelledby="infoDropdown">
          <a class='dropdown-item' th:href='@{/exchange}'>์ฝ”์ธ๊ตํ™˜</a>
          <div class="dropdown">
            <a class='dropdown-item' th:href='@{/coupon}'>์ฟ ํฐํ•จ</a>
            <div class="dropdown">
              <a class='dropdown-item' th:href='@{/membership}'>๊ตฌ๋…ํ•˜๊ธฐ</a>
                <div class="dropdown">
                  <a class='dropdown-item' th:href='@{/mymembership}'>๋‚˜์˜ ๋ฉค๋ฒ„์‹ญ</a>
                </div>
            </div>
          </div>
        </div>
      </li>


    </ul>
  </div>

  <!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>

  <script type='text/javascript'>
   
    $(document).ready(function () {
      $('.dropdown').on('mouseenter', function () {
        $(this).find('.dropdown-menu').first().stop(true, true).slideDown();
      });

      $('.dropdown').on('mouseleave', function () {
        $(this).find('.dropdown-menu').first().stop(true, true).slideUp();
      });
    });
  </script>
</body>

</html>

 

 

 

์œ„์™€ ๊ฐ™์€ ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜์—ฌ ํŽ˜์ด์ง€์— ์ƒ๋‹จ ๋ฐ”๋ฅผ ๊ตฌํ˜„ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

728x90
๋ฐ˜์‘ํ˜•

loading