feat(login): 100px logo, user ids orbit around King
Login brand panel logo is 100px wide (height by ratio). Registered user ids (email local part, no full email/real name) float around the King label on random tilted, wobbling elliptical paths; respects prefers-reduced-motion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+22
-2
@@ -488,16 +488,36 @@ def build_erp_nav(
|
||||
return items
|
||||
|
||||
|
||||
def _login_orbit_names(limit: int = 40) -> list[str]:
|
||||
"""로그인 화면 왼쪽 패널 — King 주위를 도는 사용자 아이디(이메일 @ 앞, 첫 글자 대문자). 이메일·실명은 내보내지 않는다."""
|
||||
names: set[str] = set()
|
||||
try:
|
||||
users = user_store.list_all()
|
||||
except Exception: # noqa: BLE001 — 장식이라 실패해도 로그인 화면은 그대로
|
||||
return []
|
||||
for u in users:
|
||||
email = str(u.get("email") or "").lower().strip()
|
||||
local = email.split("@", 1)[0]
|
||||
if not local or email == SUPER_ADMIN_EMAIL:
|
||||
continue
|
||||
names.add(local[:1].upper() + local[1:])
|
||||
return sorted(names)[:limit]
|
||||
|
||||
|
||||
def _render_login(request: Request) -> HTMLResponse:
|
||||
return render_template(request, "login.html", {"orbit_names": _login_orbit_names()})
|
||||
|
||||
|
||||
@app.get("/", response_class=HTMLResponse)
|
||||
async def home(request: Request) -> HTMLResponse:
|
||||
sess = get_session_user(request)
|
||||
if not sess:
|
||||
return render_template(request, "login.html")
|
||||
return _render_login(request)
|
||||
user_rec = user_store.get(sess["email"])
|
||||
if user_rec is None:
|
||||
# 도메인은 통과했으나 저장소에 없음 — 세션 정리 후 재로그인
|
||||
request.session.clear()
|
||||
return render_template(request, "login.html")
|
||||
return _render_login(request)
|
||||
|
||||
# 슈퍼 관리자 → 업무 모듈 선택 화면(main.html).
|
||||
# 일반 사용자 → ERP 메인(좌측 메뉴 + 우측 콘텐츠).
|
||||
|
||||
+19
-3
@@ -87,8 +87,9 @@ a { color: inherit; text-decoration: none; }
|
||||
|
||||
.brand-logo-mark svg { color: #fff; }
|
||||
|
||||
/* 로그인 왼쪽 위 로고 — 가로 100px, 세로는 비율대로 */
|
||||
.brand-logo-img {
|
||||
width: auto;
|
||||
width: 100px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@@ -705,13 +706,28 @@ a { color: inherit; text-decoration: none; }
|
||||
color: rgba(255, 255, 255, .9);
|
||||
letter-spacing: 4px;
|
||||
text-transform: none;
|
||||
top: 28%;
|
||||
right: 7%;
|
||||
top: 30%;
|
||||
right: 26%;
|
||||
z-index: 2;
|
||||
animation: kingFloat 13s ease-in-out infinite, kingSparkle 2.4s ease-in-out infinite;
|
||||
white-space: nowrap;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* King 주위를 도는 사용자 아이디 — 위치·크기·투명도는 login.html 스크립트가 매 프레임 정한다 */
|
||||
.shape-orbit {
|
||||
top: 0;
|
||||
left: 0;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 1px;
|
||||
color: rgba(255, 255, 255, .88);
|
||||
text-shadow: 0 0 8px rgba(99, 179, 237, .55), 0 0 18px rgba(59, 130, 246, .3);
|
||||
white-space: nowrap;
|
||||
user-select: none;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
@keyframes shapeFloat1 {
|
||||
0%, 100% { transform: translate(0, 0); }
|
||||
25% { transform: translate(-22px, 32px); }
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
<div class="shape shape-4"></div>
|
||||
<div class="shape shape-5"></div>
|
||||
<div class="shape shape-6"></div>
|
||||
<div class="shape shape-king">King</div>
|
||||
<div class="shape shape-king" id="orbit-king">King</div>
|
||||
{# 등록 사용자 아이디 — King 주위를 사람마다 다른 무작위 곡선으로 돈다(아래 스크립트) #}
|
||||
{% for n in orbit_names or [] %}<div class="shape shape-orbit">{{ n }}</div>{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="brand-logo">
|
||||
@@ -74,5 +76,47 @@
|
||||
</main>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
// King 을 중심으로 사용자 아이디가 돈다 — 사람마다 반지름·속도·방향·기울기·흔들림이 무작위인 타원 곡선.
|
||||
// King 자체도 CSS(kingFloat)로 떠다니므로 매 프레임 King 의 지금 위치를 중심으로 삼는다. 뒤쪽(위)은 작고 흐리게.
|
||||
(function () {
|
||||
var box = document.querySelector(".brand-shapes");
|
||||
var king = document.getElementById("orbit-king");
|
||||
var els = Array.prototype.slice.call(document.querySelectorAll(".shape-orbit"));
|
||||
if (!box || !king || !els.length) return;
|
||||
var reduce = window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
||||
function rnd(a, b) { return a + Math.random() * (b - a); }
|
||||
var n = els.length;
|
||||
var orbs = els.map(function (el, i) {
|
||||
return {
|
||||
el: el,
|
||||
base: (i / n) * Math.PI * 2 + rnd(-0.4, 0.4),
|
||||
rx: rnd(80, 200), ry: rnd(50, 140),
|
||||
speed: rnd(0.018, 0.045) * (Math.random() < 0.5 ? -1 : 1), // 초당 바퀴 수
|
||||
tilt: rnd(-0.6, 0.6),
|
||||
wa: rnd(10, 30), wf: rnd(0.15, 0.5), wp: rnd(0, 6.28),
|
||||
wb: rnd(8, 30), wg: rnd(0.12, 0.45), wq: rnd(0, 6.28)
|
||||
};
|
||||
});
|
||||
function place(t) {
|
||||
var b = box.getBoundingClientRect(), k = king.getBoundingClientRect();
|
||||
var cx = k.left - b.left + k.width / 2, cy = k.top - b.top + k.height / 2;
|
||||
orbs.forEach(function (o) {
|
||||
var a = o.base + t * o.speed * Math.PI * 2;
|
||||
var x0 = Math.cos(a) * (o.rx + Math.sin(t * o.wf + o.wp) * o.wa);
|
||||
var y0 = Math.sin(a) * (o.ry + Math.sin(t * o.wg + o.wq) * o.wb);
|
||||
var x = x0 * Math.cos(o.tilt) - y0 * Math.sin(o.tilt);
|
||||
var y = x0 * Math.sin(o.tilt) + y0 * Math.cos(o.tilt);
|
||||
var depth = (Math.sin(a) + 1) / 2; // 0 = 뒤(위), 1 = 앞(아래)
|
||||
o.el.style.transform = "translate(" + (cx + x).toFixed(1) + "px," + (cy + y).toFixed(1) + "px) translate(-50%,-50%) scale(" + (0.78 + depth * 0.3).toFixed(3) + ")";
|
||||
o.el.style.opacity = (0.4 + depth * 0.5).toFixed(2);
|
||||
o.el.style.zIndex = depth > 0.5 ? 3 : 1;
|
||||
});
|
||||
}
|
||||
if (reduce) { place(0); return; }
|
||||
function frame(ms) { place(ms / 1000); requestAnimationFrame(frame); }
|
||||
requestAnimationFrame(frame);
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user