황규진 2024. 7. 5. 14:13

<script>
      $(document).ready(function () {
          const userName = window.T.config.USER.name;
          const loginLogoutButton = $('.login-logout-button');
  
          if (userName) {
              loginLogoutButton.html('<a href="https://www.tistory.com/auth/logout" class="logout-button">로그아웃</a>');
          } else {
              loginLogoutButton.html('<a href="https://www.tistory.com/auth/login" class="login-button">로그인</a>');
          }
      });
    </script>
    </head>
      <script>
      $(window).on('load', function () {
          const nowurl = window.location.origin;
          const manageElement = $('.manage-menu');
          const myBlogurl = window.T.config.USER.homepage;
  
          if (myBlogurl === nowurl) {
              manageElement.css('display', 'flex');
          } else {
              manageElement.css('display', 'none');
          }
      });
    </script>
  </body>
.manage-menu {
    display: none; /* 기본적으로 숨김 */
    flex-direction: row; /* 가로 배치로 설정 */
    justify-content: flex-start; /* 왼쪽 정렬 */
    gap: 50px; /* 요소들 사이 간격 */
    padding-left: 40px; /* 오른쪽으로 약간 이동 */
}

.manage-menu.visible {
    display: flex; /* 클래스 추가 시 보이도록 설정 */
}

.manage-menu a {
    text-decoration: none; /* 링크의 밑줄 제거 */
    color: #aaa; /* 기본 글자 색상 유지 */
    padding: 5px 10px; /* 패딩 추가 */
    border: none; /* 테두리 제거 */
    background-color: transparent; /* 배경색 제거 */
    font-size: inherit; /* 글자 크기 통일 */
}