07Fading attempt history — every new attempt added lowers the opacity value of older entries in the list
Each time one new attempt record is added, every earlier record's opacity value steps down by one level.
Best forA login-history screen, an account security review report screen
MAX_ENTRIESOPACITY_STEPMIN_OPACITY

<main class="stage">
<div class="ahf is-demo" id="ahf">
<button class="ahf__btn" id="ahfBtn" type="button">Add login attempt</button>
<ul class="ahf__list" id="ahfList"></ul>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
// 계산 겹: i번째(0=최신) 기록의 불투명도 = max(최소, 1 − i×STEP) — index.html 참조
@include stage($stage-orange);
.ahf {
width: 100%;
max-width: 300px;
display: grid;
gap: $sp-3;
justify-items: center;
}
.ahf__btn {
border: 0;
border-radius: $r-control;
padding: $sp-2 $sp-4;
background: $stage-ink;
color: $subject-cream;
font: 700 13px/1 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
cursor: pointer;
transition: transform $dur-instant $ease-out;
&:active { transform: scale(.96); }
}
.ahf__list {
width: 100%;
list-style: none;
margin: 0;
padding: 0;
display: grid;
gap: $sp-2;
}
.ahf__row {
display: flex;
align-items: center;
justify-content: space-between;
padding: $sp-2 $sp-3;
border-radius: $r-sm;
background: $subject-cream;
font: 600 12px/1 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
animation: ahf-in $dur-quick $ease-out backwards;
}
@keyframes ahf-in {
from { transform: translateY(-8px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
.ahf__time { color: rgba($stage-ink, .6); }
.ahf__result { color: $stage-ink; }
.ahf__row--fail .ahf__result { color: $error; }
.ahf__row--ok .ahf__result { color: $subject-blue-deep; }
@media (max-width: 340px) {
.ahf { max-width: 220px; }
.ahf__row { font-size: 11px; padding: $sp-2 $sp-2; }
}
@media (prefers-reduced-motion: reduce) {
.ahf__btn { transition: none; }
.ahf__row { animation: none; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ff4d1f;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.ahf {
width: 100%;
max-width: 300px;
display: grid;
gap: 12px;
justify-items: center;
}
.ahf__btn {
border: 0;
border-radius: 12px;
padding: 8px 16px;
background: #17141a;
color: #fff7e6;
font: 700 13px/1 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
cursor: pointer;
transition: transform 140ms ease-out;
}
.ahf__btn:active {
transform: scale(0.96);
}
.ahf__list {
width: 100%;
list-style: none;
margin: 0;
padding: 0;
display: grid;
gap: 8px;
}
.ahf__row {
display: flex;
align-items: center;
justify-content: space-between;
padding: 8px 12px;
border-radius: 8px;
background: #fff7e6;
font: 600 12px/1 -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
animation: ahf-in 220ms ease-out backwards;
}
@keyframes ahf-in {
from {
transform: translateY(-8px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
.ahf__time {
color: rgba(23, 20, 26, 0.6);
}
.ahf__result {
color: #17141a;
}
.ahf__row--fail .ahf__result {
color: #c2361a;
}
.ahf__row--ok .ahf__result {
color: #0a4fe8;
}
@media (max-width: 340px) {
.ahf {
max-width: 220px;
}
.ahf__row {
font-size: 11px;
padding: 8px 8px;
}
}
@media (prefers-reduced-motion: reduce) {
.ahf__btn {
transition: none;
}
.ahf__row {
animation: none;
}
}(function () {
var root = document.getElementById('ahf');
var btn = document.getElementById('ahfBtn');
var list = document.getElementById('ahfList');
// 상수: 화면에 보이는 최대 기록 수 · 기록 하나마다 낮아지는 투명도 폭 · 최소 투명도
var MAX_ENTRIES = 5;
var OPACITY_STEP = 0.18;
var MIN_OPACITY = 0.16;
var SEQ = ['Fail', 'Fail', 'Success', 'Fail', 'Fail', 'Fail', 'Success', 'Fail'];
var seqIdx = 0;
var entries = []; // 최신이 index 0
function fmtTime(n) {
var m = String(10 + n % 50).padStart(2, '0');
return '10:' + m;
}
// 계산 겹: i번째(0=최신) 항목의 불투명도 = max(최소, 1 − i×STEP)
function render() {
list.innerHTML = '';
for (var i = 0; i < entries.length; i++) {
var e = entries[i];
var op = Math.max(MIN_OPACITY, 1 - i * OPACITY_STEP);
var li = document.createElement('li');
li.className = 'ahf__row' + (e.result === 'Fail' ? ' ahf__row--fail' : ' ahf__row--ok');
li.style.opacity = op.toFixed(2);
li.innerHTML = '<span class="ahf__time">' + e.time + '</span>' +
'<span class="ahf__result">' + e.result + '</span>';
list.appendChild(li);
}
}
function addEntry() {
var result = SEQ[seqIdx % SEQ.length];
seqIdx += 1;
entries.unshift({ result: result, time: fmtTime(seqIdx) });
if (entries.length > MAX_ENTRIES) entries.length = MAX_ENTRIES;
render();
}
btn.addEventListener('click', function () {
root.classList.remove('is-demo');
stopAutoplay();
addEntry();
});
render();
var autoTimer = null;
function stopAutoplay() { if (autoTimer) { clearInterval(autoTimer); autoTimer = null; } }
var reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
if (!reduce) { autoTimer = setInterval(addEntry, 340); }
})();import { useEffect, useRef } from "react";
import styles from "./AuthAttemptHistoryListFade.module.scss";
type Box<T> = { current: T };
type Entry = { result: string; time: string };
export default function AuthAttemptHistoryListFade() {
const rootRef = useRef(null) as unknown as Box<HTMLDivElement | null>;
useEffect(() => {
const root = rootRef.current;
if (!root) return;
const btn = root.querySelector(`.${styles.btn}`) as HTMLButtonElement | null;
const list = root.querySelector(`.${styles.list}`) as HTMLElement | null;
if (!btn || !list) return;
// 상수: 화면에 보이는 최대 기록 수 · 기록 하나마다 낮아지는 투명도 폭 · 최소 투명도
const MAX_ENTRIES = 5;
const OPACITY_STEP = 0.18;
const MIN_OPACITY = 0.16;
const SEQ = ["실패", "실패", "성공", "실패", "실패", "실패", "성공", "실패"];
let seqIdx = 0;
let entries: Entry[] = [];
function fmtTime(n: number) {
const m = String(10 + (n % 50)).padStart(2, "0");
return "10:" + m;
}
// 계산 겹: i번째(0=최신) 항목의 불투명도 = max(최소, 1 − i×STEP)
function render() {
list!.innerHTML = "";
for (let i = 0; i < entries.length; i++) {
const e = entries[i];
const op = Math.max(MIN_OPACITY, 1 - i * OPACITY_STEP);
const li = document.createElement("li");
li.className = styles.row + " " + (e.result === "실패" ? styles["row--fail"] : styles["row--ok"]);
li.style.opacity = op.toFixed(2);
li.innerHTML =
'<span class="' + styles.time + '">' + e.time + "</span>" +
'<span class="' + styles.result + '">' + e.result + "</span>";
list!.appendChild(li);
}
}
function addEntry() {
const result = SEQ[seqIdx % SEQ.length];
seqIdx += 1;
entries.unshift({ result, time: fmtTime(seqIdx) });
if (entries.length > MAX_ENTRIES) entries.length = MAX_ENTRIES;
render();
}
function onClick() {
root!.classList.remove(styles["is-demo"]);
stopAutoplay();
addEntry();
}
btn.addEventListener("click", onClick);
render();
let autoTimer: number | null = null;
function stopAutoplay() { if (autoTimer !== null) { window.clearInterval(autoTimer); autoTimer = null; } }
const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
if (!reduce) { autoTimer = window.setInterval(addEntry, 340); }
return () => {
stopAutoplay();
btn.removeEventListener("click", onClick);
};
}, []);
return (
<div ref={rootRef} className={`${styles.stage} ${styles.ahf} ${styles["is-demo"]}`}>
<button className={styles.btn} type="button">로그인 시도 추가</button>
<ul className={styles.list} />
</div>
);
}07 Fading attempt history — every new attempt added lowers the opacity value of older entries in the list — Measured area 39.983% · moving frames 22/23Original by GODRICH · SCSS and React ship in the zip · Too Many Failed Login Attempts: 9 Patterns
The post this demo lives in
Too Many Failed Login Attempts: 9 PatternsOne value drops by one per failed try, another doubles the wait time as failures pile up, and another counts a remaining See all demos in this post
If you like this effect - similar demos
Auth UI07 Linked accounts list9 ID Verification Screen UI Patterns, Paste-Ready
Auth UI01 Scan-line sweep — a scan-progress value moves top to bottom while the ridge-brightness value at each passed line rises in orderFingerprint Scan Animation: 9 Biometric UI Demos
Auth UI09 A Check Where a Time Ring Shrinks Over the Challenge Lifetime and Then a Refresh Icon Spins to Swap In a New OneCSS Captcha: 9 Warped Text and Rotate Checks