08세션 만료 재로그인 모달
일정 시간이 지나 세션이 끊기면 배경이 흐려지고 모달이 확대되며 나타나, 다시 로그인해야 이전 화면으로 돌아갈 수 있음을 알려줍니다.
쓰임관리자 대시보드의 자동 로그아웃 알림, 장시간 방치 후 다시 여는 웹앱
backdrop-filter: blurfade + scale 진입포커스 이동

<main class="stage">
<div class="modal-scene is-demo">
<div class="modal-scene__page">
<span class="modal-scene__line"></span>
<span class="modal-scene__line modal-scene__line--short"></span>
<span class="modal-scene__line"></span>
</div>
<div class="modal-scene__backdrop"></div>
<div class="modal-scene__modal" role="alertdialog" aria-label="Session expired">
<h2 class="modal-scene__title">Session expired</h2>
<p class="modal-scene__desc">Please sign in again to continue.</p>
<button class="modal-scene__btn" type="button">Log in again</button>
</div>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-enter; // 모달 등장 시간
$easing: $ease-pop;
$color: $error; // 경고 색
@include stage($stage-paper);
.modal-scene {
position: relative;
width: min(230px, 82vw);
height: 168px;
border-radius: $r-card;
overflow: hidden;
box-shadow: $shadow-raised;
}
.modal-scene__page {
position: absolute;
inset: 0;
padding: $sp-4;
background: $stage-paper;
display: flex;
flex-direction: column;
gap: $sp-3;
}
.modal-scene__line { display: block; height: 8px; border-radius: $r-xs; background: #e6e2d8; }
.modal-scene__line--short { width: 60%; }
.modal-scene__backdrop {
position: absolute;
inset: 0;
background: rgba(23, 20, 26, 0);
backdrop-filter: blur(0px);
-webkit-backdrop-filter: blur(0px);
transition: background $duration $easing, backdrop-filter $duration $easing;
pointer-events: none;
}
.modal-scene__modal {
position: absolute;
left: 50%; top: 50%;
width: min(170px, 74%);
padding: $sp-3;
background: $stage-paper;
border-radius: $r-card;
box-shadow: $shadow-raised;
text-align: center;
transform: translate(-50%, -50%) scale(.7);
opacity: 0;
transition: transform $duration $easing, opacity $duration $easing;
}
.modal-scene__title { margin: 0 0 $sp-1; font-size: 14px; font-weight: 700; color: $color; font-family: inherit; }
.modal-scene__desc { margin: 0 0 $sp-3; font-size: 11px; color: #6b6455; font-family: inherit; }
.modal-scene__btn {
padding: $sp-2 $sp-4;
border: none;
border-radius: $r-sm;
background: $stage-ink;
color: $stage-paper;
font-weight: 700;
font-size: 12px;
font-family: inherit;
cursor: pointer;
}
.modal-scene__btn:hover, .modal-scene__btn:focus-visible { background: lighten($stage-ink, 12%); }
.modal-scene.is-demo .modal-scene__backdrop { animation: backdrop-cycle $dur-loop $easing infinite; }
.modal-scene.is-demo .modal-scene__modal { animation: modal-cycle $dur-loop $easing infinite; }
@keyframes backdrop-cycle {
0%, 8% { background: rgba(23, 20, 26, 0); backdrop-filter: blur(0px); }
23%, 77% { background: rgba(23, 20, 26, .45); backdrop-filter: blur(3px); }
92%, 100% { background: rgba(23, 20, 26, 0); backdrop-filter: blur(0px); }
}
@keyframes modal-cycle {
0%, 8% { transform: translate(-50%, -50%) scale(.7); opacity: 0; }
23%, 77% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
92%, 100% { transform: translate(-50%, -50%) scale(.7); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
.modal-scene__backdrop, .modal-scene__modal { transition: none; }
.modal-scene.is-demo .modal-scene__backdrop,
.modal-scene.is-demo .modal-scene__modal { animation: none; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ffffff;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.modal-scene {
position: relative;
width: min(230px, 82vw);
height: 168px;
border-radius: 16px;
overflow: hidden;
box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
}
.modal-scene__page {
position: absolute;
inset: 0;
padding: 16px;
background: #ffffff;
display: flex;
flex-direction: column;
gap: 12px;
}
.modal-scene__line {
display: block;
height: 8px;
border-radius: 4px;
background: #e6e2d8;
}
.modal-scene__line--short {
width: 60%;
}
.modal-scene__backdrop {
position: absolute;
inset: 0;
background: rgba(23, 20, 26, 0);
backdrop-filter: blur(0px);
-webkit-backdrop-filter: blur(0px);
transition: background 600ms cubic-bezier(0.2, 1.4, 0.4, 1), backdrop-filter 600ms cubic-bezier(0.2, 1.4, 0.4, 1);
pointer-events: none;
}
.modal-scene__modal {
position: absolute;
left: 50%;
top: 50%;
width: min(170px, 74%);
padding: 12px;
background: #ffffff;
border-radius: 16px;
box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
text-align: center;
transform: translate(-50%, -50%) scale(0.7);
opacity: 0;
transition: transform 600ms cubic-bezier(0.2, 1.4, 0.4, 1), opacity 600ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
.modal-scene__title {
margin: 0 0 4px;
font-size: 14px;
font-weight: 700;
color: #c2361a;
font-family: inherit;
}
.modal-scene__desc {
margin: 0 0 12px;
font-size: 11px;
color: #6b6455;
font-family: inherit;
}
.modal-scene__btn {
padding: 8px 16px;
border: none;
border-radius: 8px;
background: #17141a;
color: #ffffff;
font-weight: 700;
font-size: 12px;
font-family: inherit;
cursor: pointer;
}
.modal-scene__btn:hover, .modal-scene__btn:focus-visible {
background: rgb(21.0196078431%, 18.2779198636%, 23.7612958227%);
}
.modal-scene.is-demo .modal-scene__backdrop {
animation: backdrop-cycle 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}
.modal-scene.is-demo .modal-scene__modal {
animation: modal-cycle 2s cubic-bezier(0.2, 1.4, 0.4, 1) infinite;
}
@keyframes backdrop-cycle {
0%, 8% {
background: rgba(23, 20, 26, 0);
backdrop-filter: blur(0px);
}
23%, 77% {
background: rgba(23, 20, 26, 0.45);
backdrop-filter: blur(3px);
}
92%, 100% {
background: rgba(23, 20, 26, 0);
backdrop-filter: blur(0px);
}
}
@keyframes modal-cycle {
0%, 8% {
transform: translate(-50%, -50%) scale(0.7);
opacity: 0;
}
23%, 77% {
transform: translate(-50%, -50%) scale(1);
opacity: 1;
}
92%, 100% {
transform: translate(-50%, -50%) scale(0.7);
opacity: 0;
}
}
@media (prefers-reduced-motion: reduce) {
.modal-scene__backdrop, .modal-scene__modal {
transition: none;
}
.modal-scene.is-demo .modal-scene__backdrop,
.modal-scene.is-demo .modal-scene__modal {
animation: none;
}
}import type { CSSProperties } from "react";
import styles from "./SessionExpiredModal.module.scss";
export type SessionExpiredModalProps = {
open: boolean;
onReLogin?: () => void;
/** 모달 등장 시간 (기본 600ms) */
duration?: number;
easing?: string;
};
/** open 이 바뀔 때마다 backdrop 과 모달이 함께 페이드+스케일 전환된다 */
export default function SessionExpiredModal({
open,
onReLogin,
duration = 600,
easing = "cubic-bezier(.2,1.4,.4,1)",
}: SessionExpiredModalProps) {
const style = { "--duration": `${duration}ms`, "--easing": easing } as CSSProperties;
return (
<div className={styles.scene} style={style}>
<div className={styles.page}>
<span className={styles.line} />
<span className={`${styles.line} ${styles.short}`} />
<span className={styles.line} />
</div>
<div className={`${styles.backdrop} ${open ? styles.show : ""}`} />
<div className={`${styles.modal} ${open ? styles.show : ""}`} role="alertdialog" aria-label="Session expired" aria-hidden={!open}>
<h2 className={styles.title}>Session expired</h2>
<p className={styles.desc}>Please sign in again to continue.</p>
<button className={styles.btn} type="button" onClick={onReLogin}>Log in again</button>
</div>
</div>
);
}08 세션 만료 재로그인 모달 — 측정 누적면적 26.689% · 움직인 프레임 7/23GODRICH 원작 · zip 에 SCSS·React 포함 · 로그인 화면 디자인 9가지 — 복붙 가능한 카드 UI
이 데모가 속한 글
로그인 화면 디자인 9가지 — 복붙 가능한 카드 UI로그인 화면 디자인은 이메일·비밀번호 칸과 버튼 몇 개로 끝나는 것 같지만, 실제로는 카드 재질·화면 분할·단계 진행·오류 알림까지 아홉 가지 결정이 쌓여 만들어집니다. 그중 하나는 팝업 모달 대신 이미 열린 화면 이 글의 데모 전부 보기


