Polish quick login buttons and hidden behavior

Fix [hidden] being overridden by button styles, render Google/Kakao/Naver quick login as icons, and show logout only when authenticated.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dsyoon
2026-02-07 18:07:23 +09:00
parent f8195a3b23
commit f3ac2abf59
3 changed files with 78 additions and 4 deletions

View File

@@ -71,9 +71,40 @@
<span class="user-dot" aria-hidden="true"></span> <span class="user-dot" aria-hidden="true"></span>
<span class="user-text" id="userText">로그인 필요</span> <span class="user-text" id="userText">로그인 필요</span>
</div> </div>
<button class="btn" id="btnGoogle" type="button" hidden>구글</button> <button class="btn icon-only provider-google" id="btnGoogle" type="button" hidden aria-label="구글로 로그인">
<button class="btn" id="btnKakao" type="button" hidden>카카오</button> <span class="sr-only">구글</span>
<button class="btn" id="btnNaver" type="button" hidden>네이버</button> <svg viewBox="0 0 24 24" aria-hidden="true">
<path
fill="#EA4335"
d="M12 10.2v3.9h5.45c-.24 1.26-1.44 3.7-5.45 3.7-3.28 0-5.96-2.72-5.96-6.1S8.72 5.6 12 5.6c1.87 0 3.12.8 3.84 1.5l2.62-2.52C16.86 3.08 14.7 2 12 2 6.48 2 2 6.48 2 11.7S6.48 21.4 12 21.4c6.92 0 9.6-4.86 9.6-7.38 0-.5-.06-.88-.13-1.26H12z"
/>
<path
fill="#34A853"
d="M3.15 7.55l3.21 2.36C7.2 7.7 9.38 5.6 12 5.6c1.87 0 3.12.8 3.84 1.5l2.62-2.52C16.86 3.08 14.7 2 12 2 8.16 2 4.84 4.1 3.15 7.55z"
opacity=".0"
/>
</svg>
</button>
<button class="btn icon-only provider-kakao" id="btnKakao" type="button" hidden aria-label="카카오로 로그인">
<span class="sr-only">카카오</span>
<svg viewBox="0 0 24 24" aria-hidden="true">
<path
fill="#FAE100"
d="M12 3C6.76 3 2.5 6.23 2.5 10.22c0 2.58 1.78 4.85 4.45 6.12l-1.01 3.69a.7.7 0 0 0 1.05.77l4.3-2.85c.55.05 1.11.08 1.66.08 5.24 0 9.5-3.23 9.5-7.22C21.5 6.23 17.24 3 12 3z"
/>
<path
fill="#000"
d="M12 6.4c-3.7 0-6.7 2.2-6.7 4.9S8.3 16.2 12 16.2s6.7-2.2 6.7-4.9-3-4.9-6.7-4.9z"
opacity=".08"
/>
</svg>
</button>
<button class="btn icon-only provider-naver" id="btnNaver" type="button" hidden aria-label="네이버로 로그인">
<span class="sr-only">네이버</span>
<svg viewBox="0 0 24 24" aria-hidden="true">
<path fill="#03C75A" d="M6 4h5.1l6.9 10.1V4H18v16h-5.1L6 9.9V20H6V4z" />
</svg>
</button>
<button class="btn" id="btnLogin" type="button">로그인</button> <button class="btn" id="btnLogin" type="button">로그인</button>
<button class="btn" id="btnLogout" type="button" hidden>로그아웃</button> <button class="btn" id="btnLogout" type="button" hidden>로그아웃</button>
</div> </div>

View File

@@ -448,7 +448,8 @@
// 로그인 기능이 활성(enabled)일 때만 로그인/로그아웃 버튼을 의미 있게 노출 // 로그인 기능이 활성(enabled)일 때만 로그인/로그아웃 버튼을 의미 있게 노출
const enabled = auth.mode === "enabled"; const enabled = auth.mode === "enabled";
el.btnLogin.hidden = enabled ? Boolean(auth.user) : false; el.btnLogin.hidden = enabled ? Boolean(auth.user) : false;
el.btnLogout.hidden = !(enabled && auth.user); // 로그아웃은 로그인 된 이후에만 노출
el.btnLogout.hidden = !auth.user;
// 설정/SDK 문제 상태에서도 버튼은 "클릭 가능"하게 두고, 클릭 시 토스트로 안내합니다. // 설정/SDK 문제 상태에서도 버튼은 "클릭 가능"하게 두고, 클릭 시 토스트로 안내합니다.
el.btnLogin.disabled = false; el.btnLogin.disabled = false;
el.btnLogout.disabled = false; el.btnLogout.disabled = false;

View File

@@ -35,6 +35,11 @@ html[data-theme="light"] {
box-sizing: border-box; box-sizing: border-box;
} }
/* Ensure HTML hidden attribute always works (avoid .btn overriding it) */
[hidden] {
display: none !important;
}
body { body {
margin: 0; margin: 0;
font-family: var(--sans); font-family: var(--sans);
@@ -138,6 +143,43 @@ html[data-theme="light"] .topbar {
justify-content: flex-end; justify-content: flex-end;
} }
.sr-only {
position: absolute !important;
width: 1px !important;
height: 1px !important;
padding: 0 !important;
margin: -1px !important;
overflow: hidden !important;
clip: rect(0, 0, 0, 0) !important;
white-space: nowrap !important;
border: 0 !important;
}
.btn.icon-only {
width: 40px;
height: 40px;
padding: 0;
justify-content: center;
gap: 0;
}
.btn.icon-only svg {
width: 18px;
height: 18px;
}
.btn.provider-google {
border-color: rgba(66, 133, 244, 0.25);
}
.btn.provider-kakao {
border-color: rgba(250, 225, 0, 0.35);
}
.btn.provider-naver {
border-color: rgba(3, 199, 90, 0.28);
}
.user { .user {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;