<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>블루 아카이브 캐릭터 인기 순위</title>
<style>
:root {
--primary-color: #2c3e50;
--accent-color: #3498db;
--background-color: #f4f6f8;
--text-color: #2c3e50;
--card-bg: #ffffff;
--border-radius: 10px;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background-color: var(--background-color);
color: var(--text-color);
padding: 20px;
}
header {
text-align: center;
margin-bottom: 30px;
}
header h1 {
font-size: 2.5rem;
color: var(--primary-color);
}
.container {
max-width: 1200px;
margin: 0 auto;
}
.ranking-table {
width: 100%;
background: var(--card-bg);
border-radius: var(--border-radius);
overflow: hidden;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.ranking-table thead {
background: var(--accent-color);
color: white;
}
.ranking-table th, .ranking-table td {
padding: 15px 20px;
text-align: left;
}
.ranking-table tbody tr:nth-child(even) {
background-color: #f9f9f9;
}
.ranking-table tbody tr:hover {
background-color: #eaeaea;
}
.character-name {
font-weight: bold;
}
@media (max-width: 768px) {
.ranking-table th, .ranking-table td {
padding: 12px;
}
header h1 {
font-size: 2rem;
}
}
@media (max-width: 480px) {
.ranking-table th, .ranking-table td {
padding: 10px;
}
.ranking-table thead {
display: none;
}
.ranking-table tbody tr {
display: flex;
flex-direction: column;
border-bottom: 1px solid #ddd;
}
.ranking-table tbody tr:last-child {
border-bottom: none;
}
.ranking-table tbody tr td {
flex: 1;
text-align: left;
border-bottom: 1px solid #eee;
}
.ranking-table tbody tr td::before {
content: attr(data-label);
font-weight: bold;
margin-right: 10px;
color: var(--primary-color);
}
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>블루 아카이브 캐릭터 인기 순위</h1>
<p>최신 인기 데이터 기반</p>
</header>
<div class="ranking-table">
<table>
<thead>
<tr>
<th>순위</th>
<th>캐릭터</th>
<th>인기 점수</th>
<th>소속</th>
</tr>
</thead>
<tbody id="rankingBody">
<!-- 데이터가 여기에 동적으로 삽입됩니다 -->
</tbody>
</table>
</div>
</div>
<script>
// 샘플 데이터 (실제 데이터는 API나 DB에서 가져와야 합니다)
const characters = [
{ rank: 1, name: "아카리", popularity: 98, school: "아카데미" },
{ rank: 2, name: "나나코", popularity: 95, school: "아카데미" },
{ rank: 3, name: "유우키", popularity: 92, school: "아카데미" },
{ rank: 4, name: "카즈마", popularity: 89, school: "아카데미" },
{ rank: 5, name: "리리", popularity: 87, school: "아카데미" },
{ rank: 6, name: "하루카", popularity: 85, school: "아카데미" },
{ rank: 7, name: "미오", popularity: 83, school: "아카데미" },
{ rank: 8, name: "유우", popularity: 80, school: "아카데미" },
{ rank: 9, name: "아카네", popularity: 78, school: "아카데미" },
{ rank: 10, name: "하나", popularity: 75, school: "아카데미" }
];
// 데이터 정렬 및 렌더링
function renderRanking() {
const tbody = document.getElementById('rankingBody');
tbody.innerHTML = '';
characters.sort((a, b) => a.rank - b.rank).forEach(char => {
const row = document.createElement('tr');
row.innerHTML = `
<td>${char.rank}</td>
<td class="character-name">${char.name}</td>
<td>${char.popularity}</td>
<td>${char.school}</td>
`;
tbody.appendChild(row);
});
}
// 초기 렌더링
renderRanking();
</script>
</body>
</html>
이 코드는 다음과 같은 특징을 가지고 있습니다:
- 반응형 디자인: 모바일 기기에서도 잘 보이는 레이아웃을 제공합니다.
- 정렬 기능: 캐릭터를 인기 점수 기준으로 정렬합니다.
- 시각적 요소:
- 깔끔한 디자인과 부드러운 색상 조합
- 호버 효과와 그림자 효과로 시각적 계층 구조 제공
- 모바일 화면에서는 테이블을 카드 형태로 전환
- 데이터 관리: 샘플 데이터로 작동하며, 실제 사용 시 API나 데이터베이스 연동이 필요합니다.
이 코드를 복사하여 HTML 파일로 저장하고 브라우저에서 열면 블루 아카이브 캐릭터 인기 순위 페이지를 확인할 수 있습니다. 실제 데이터를 사용하려면 characters 배열을 실제 데이터로 교체해야 합니다.