Files
084_sort/sinner-gallery.html
2026-04-10 20:37:57 +08:00

833 lines
40 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>罪人立绘排列</title>
<link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* 继承index.html的样式并添加展示页面特定样式 */
:root {
--primary-color: #ff4d4d;
--secondary-color: #ffd700;
--bg-color: #121212;
--text-color: #e0e0e0;
--panel-bg: #1e1e1e;
}
body {
font-family: 'Noto Serif SC', serif;
background-color: var(--bg-color);
color: var(--text-color);
margin: 0;
padding: 0;
min-height: 100vh;
display: flex;
flex-direction: column;
overflow-x: hidden;
user-select: none;
}
.page-header {
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: rgba(30, 30, 30, 0.8);
border-bottom: 1px solid var(--secondary-color);
}
.page-title {
font-size: 1.8rem;
color: var(--secondary-color);
margin: 0;
}
.back-btn {
background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
border: 2px solid var(--secondary-color);
color: var(--secondary-color);
padding: 0.5rem 1.5rem;
font-family: 'Noto Serif SC', serif;
font-weight: bold;
cursor: pointer;
transition: all 0.3s ease;
clip-path: polygon(10% 0, 100% 0, 100% 90%, 90% 100%, 0 100%, 0 10%);
}
.back-btn:hover {
background: var(--secondary-color);
color: #000;
}
.gallery-container {
flex: 1;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center;
}
.sinner-cards {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 20px;
width: 100%;
max-width: 1200px;
margin-top: 20px;
}
.sinner-card {
background-color: rgba(30, 30, 30, 0.8);
border: 2px solid rgba(255, 215, 0, 0.3);
border-radius: 10px;
overflow: hidden;
transition: all 0.3s ease;
cursor: pointer;
position: relative;
}
.sinner-card:hover {
transform: translateY(-5px);
border-color: var(--secondary-color);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}
.sinner-card-img {
width: 100%;
height: 300px;
object-fit: contain;
background-color: rgba(0, 0, 0, 0.3);
padding: 10px;
}
.sinner-card-info {
padding: 15px;
text-align: center;
}
.sinner-name {
font-size: 1.2rem;
color: var(--secondary-color);
margin: 0;
}
.sinner-source {
font-size: 0.9rem;
color: var(--text-color);
margin-top: 5px;
}
/* 罪人立绘排序界面 */
.sorting-container {
display: none;
flex-direction: column;
width: 100%;
height: 100%;
padding: 20px;
}
.sorting-container.active {
display: flex;
}
.sorting-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.sorting-title {
font-size: 1.5rem;
color: var(--secondary-color);
}
.sorting-content {
display: flex;
flex: 1;
gap: 20px;
overflow: hidden;
}
.sorting-left {
flex: 2;
display: flex;
flex-direction: column;
gap: 20px;
overflow-y: auto;
}
.sorting-right {
flex: 1;
background-color: rgba(30, 30, 30, 0.8);
border: 2px solid rgba(255, 215, 0, 0.3);
border-radius: 10px;
display: flex;
flex-direction: column;
overflow: hidden;
}
.sorting-right-header {
padding: 15px;
border-bottom: 1px solid rgba(255, 215, 0, 0.3);
text-align: center;
color: var(--secondary-color);
font-size: 1.2rem;
}
.sorting-right-content {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
padding: 20px;
overflow: auto;
}
.sorting-right-image {
max-width: 100%;
max-height: 100%;
object-fit: contain;
}
.sorting-categories {
display: flex;
flex-direction: column;
gap: 15px;
}
.sorting-category {
background-color: rgba(30, 30, 30, 0.8);
border: 2px solid rgba(255, 215, 0, 0.3);
border-radius: 10px;
padding: 15px;
min-height: 150px;
transition: all 0.3s ease;
}
.sorting-category.drag-over {
border-color: var(--secondary-color);
background-color: rgba(255, 215, 0, 0.1);
}
.sorting-category-title {
font-size: 1.2rem;
color: var(--secondary-color);
margin-bottom: 10px;
text-align: center;
}
.sorting-category-content {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.sorting-images {
display: flex;
flex-wrap: wrap;
gap: 10px;
padding: 15px;
background-color: rgba(30, 30, 30, 0.5);
border-radius: 10px;
}
.sorting-image {
width: 80px;
height: 80px;
object-fit: cover;
border: 2px solid rgba(255, 215, 0, 0.3);
border-radius: 5px;
cursor: grab;
transition: all 0.3s ease;
}
.sorting-image:hover {
border-color: var(--secondary-color);
transform: scale(1.05);
}
.sorting-image:active {
cursor: grabbing;
}
.sorting-image.dragging {
opacity: 0.5;
}
.sorting-image-small {
width: 80px;
height: 80px;
object-fit: cover;
border: 2px solid rgba(255, 215, 0, 0.3);
border-radius: 5px;
cursor: pointer;
transition: all 0.3s ease;
}
.sorting-image-small:hover {
border-color: var(--secondary-color);
transform: scale(1.05);
}
/* 响应式设计 */
@media (max-width: 768px) {
.sinner-cards {
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.sinner-card-img {
height: 200px;
}
.sorting-content {
flex-direction: column;
}
.sorting-left {
flex: 1;
}
.sorting-right {
height: 300px;
}
}
</style>
</head>
<body>
<div class="page-header">
<h1 class="page-title">罪人立绘排列</h1>
<button class="back-btn" onclick="window.location.href='index.html'">
<i class="fas fa-arrow-left"></i> 返回
</button>
</div>
<div class="gallery-container">
<div class="sinner-cards" id="sinner-cards">
<!-- 罪人卡片将通过JavaScript动态生成 -->
</div>
</div>
<!-- 罪人立绘排序界面 -->
<div class="sorting-container" id="sorting-container">
<div class="sorting-header">
<h2 class="sorting-title" id="sorting-title">罪人立绘排序</h2>
<button class="back-btn" onclick="closeSorting()">
<i class="fas fa-arrow-left"></i> 返回
</button>
</div>
<div class="sorting-content">
<div class="sorting-left">
<div class="sorting-categories">
<div class="sorting-category" data-category="夯">
<div class="sorting-category-title"></div>
<div class="sorting-category-content"></div>
</div>
<div class="sorting-category" data-category="顶级">
<div class="sorting-category-title">顶级</div>
<div class="sorting-category-content"></div>
</div>
<div class="sorting-category" data-category="人上人">
<div class="sorting-category-title">人上人</div>
<div class="sorting-category-content"></div>
</div>
<div class="sorting-category" data-category="npc">
<div class="sorting-category-title">NPC</div>
<div class="sorting-category-content"></div>
</div>
</div>
<div class="sorting-images" id="sorting-images">
<!-- 罪人立绘将通过JavaScript动态生成 -->
</div>
</div>
<div class="sorting-right">
<div class="sorting-right-header">立绘预览</div>
<div class="sorting-right-content">
<img src="" alt="" class="sorting-right-image" id="sorting-right-image">
</div>
</div>
</div>
</div>
<script>
// 罪人立绘数据,从 images/sinner_images.json 转换而来
const sinnerImagesData = {
"yisang": [
{ "name": "600px-20102_cg", "path": "images/yisang/600px-20102_cg.webp" },
{ "name": "600px-20104_cg", "path": "images/yisang/600px-20104_cg.webp" },
{ "name": "600px-20106_cg", "path": "images/yisang/600px-20106_cg.webp" },
{ "name": "600px-20107_cg", "path": "images/yisang/600px-20107_cg.webp" },
{ "name": "600px-20108_cg", "path": "images/yisang/600px-20108_cg.webp" },
{ "name": "975px-10104_gacksung", "path": "images/yisang/975px-10104_gacksung.webp" },
{ "name": "975px-10104_normal", "path": "images/yisang/975px-10104_normal.webp" },
{ "name": "975px-10106_normal", "path": "images/yisang/975px-10106_normal.webp" },
{ "name": "975px-10109_gacksung", "path": "images/yisang/975px-10109_gacksung.webp" },
{ "name": "975px-10110_gacksung", "path": "images/yisang/975px-10110_gacksung.webp" },
{ "name": "975px-10111_gacksung", "path": "images/yisang/975px-10111_gacksung.webp" },
{ "name": "975px-10113_gacksung", "path": "images/yisang/975px-10113_gacksung.webp" },
{ "name": "975px-10114_gacksung", "path": "images/yisang/975px-10114_gacksung.webp" },
{ "name": "975px-10115_gacksung", "path": "images/yisang/975px-10115_gacksung.webp" },
{ "name": "975px-10115_normal", "path": "images/yisang/975px-10115_normal.webp" }
],
"faust": [
{ "name": "113px-20205_cg", "path": "images/faust/113px-20205_cg.webp" },
{ "name": "600px-20202_cg", "path": "images/faust/600px-20202_cg.webp" },
{ "name": "600px-20204_cg", "path": "images/faust/600px-20204_cg.webp" },
{ "name": "600px-20206_cg", "path": "images/faust/600px-20206_cg.webp" },
{ "name": "600px-20207_cg", "path": "images/faust/600px-20207_cg.webp" },
{ "name": "600px-20208_cg", "path": "images/faust/600px-20208_cg.webp" },
{ "name": "600px-20209_cg", "path": "images/faust/600px-20209_cg.webp" },
{ "name": "600px-20210_cg", "path": "images/faust/600px-20210_cg.webp" },
{ "name": "975px-10202_gacksung", "path": "images/faust/975px-10202_gacksung.webp" },
{ "name": "975px-10203_gacksung", "path": "images/faust/975px-10203_gacksung.webp" },
{ "name": "975px-10204_gacksung", "path": "images/faust/975px-10204_gacksung.webp" },
{ "name": "975px-10204_normal", "path": "images/faust/975px-10204_normal.webp" },
{ "name": "975px-10205_normal", "path": "images/faust/975px-10205_normal.webp" },
{ "name": "975px-10206_normal", "path": "images/faust/975px-10206_normal.webp" },
{ "name": "975px-10208_gacksung", "path": "images/faust/975px-10208_gacksung.webp" },
{ "name": "975px-10209_gacksung", "path": "images/faust/975px-10209_gacksung.webp" },
{ "name": "975px-10210_gacksung", "path": "images/faust/975px-10210_gacksung.webp" },
{ "name": "975px-10210_normal", "path": "images/faust/975px-10210_normal.webp" },
{ "name": "975px-10211_gacksung", "path": "images/faust/975px-10211_gacksung.webp" },
{ "name": "975px-10212_gacksung", "path": "images/faust/975px-10212_gacksung.webp" },
{ "name": "975px-10212_normal", "path": "images/faust/975px-10212_normal.webp" },
{ "name": "975px-10213_normal", "path": "images/faust/975px-10213_normal.webp" },
{ "name": "975px-10214_normal", "path": "images/faust/975px-10214_normal.webp" },
{ "name": "975px-10215_gacksung", "path": "images/faust/975px-10215_gacksung.webp" },
{ "name": "975px-10215_normal", "path": "images/faust/975px-10215_normal.webp" }
],
"don_quixote": [
{ "name": "600px-20303_cg", "path": "images/don_quixote/600px-20303_cg.webp" },
{ "name": "600px-20305_cg", "path": "images/don_quixote/600px-20305_cg.webp" },
{ "name": "600px-20307_cg", "path": "images/don_quixote/600px-20307_cg.webp" },
{ "name": "600px-20308_cg", "path": "images/don_quixote/600px-20308_cg.webp" },
{ "name": "600px-20309_cg", "path": "images/don_quixote/600px-20309_cg.webp" },
{ "name": "975px-10302_gacksung", "path": "images/don_quixote/975px-10302_gacksung.webp" },
{ "name": "975px-10302_normal", "path": "images/don_quixote/975px-10302_normal.webp" },
{ "name": "975px-10303_normal", "path": "images/don_quixote/975px-10303_normal.webp" },
{ "name": "975px-10304_normal", "path": "images/don_quixote/975px-10304_normal.webp" },
{ "name": "975px-10305_normal", "path": "images/don_quixote/975px-10305_normal.webp" },
{ "name": "975px-10306_normal", "path": "images/don_quixote/975px-10306_normal.webp" },
{ "name": "975px-10307_gacksung", "path": "images/don_quixote/975px-10307_gacksung.webp" },
{ "name": "975px-10307_normal", "path": "images/don_quixote/975px-10307_normal.webp" },
{ "name": "975px-10308_gacksung", "path": "images/don_quixote/975px-10308_gacksung.webp" },
{ "name": "975px-10308_normal", "path": "images/don_quixote/975px-10308_normal.webp" },
{ "name": "975px-10309_gacksung", "path": "images/don_quixote/975px-10309_gacksung.webp" },
{ "name": "975px-10309_normal", "path": "images/don_quixote/975px-10309_normal.webp" },
{ "name": "975px-10310_gacksung", "path": "images/don_quixote/975px-10310_gacksung.webp" },
{ "name": "975px-10310_normal", "path": "images/don_quixote/975px-10310_normal.webp" },
{ "name": "975px-10311_gacksung", "path": "images/don_quixote/975px-10311_gacksung.webp" },
{ "name": "975px-10311_normal", "path": "images/don_quixote/975px-10311_normal.webp" },
{ "name": "975px-10312_gacksung", "path": "images/don_quixote/975px-10312_gacksung.webp" },
{ "name": "975px-10312_normal", "path": "images/don_quixote/975px-10312_normal.webp" },
{ "name": "975px-10313_gacksung", "path": "images/don_quixote/975px-10313_gacksung.webp" },
{ "name": "975px-10314_gacksung", "path": "images/don_quixote/975px-10314_gacksung.webp" },
{ "name": "975px-10314_normal", "path": "images/don_quixote/975px-10314_normal.webp" }
],
"yoshihide": [
{ "name": "600px-20402_cg", "path": "images/yoshihide/600px-20402_cg.webp" },
{ "name": "600px-20407_cg", "path": "images/yoshihide/600px-20407_cg.webp" },
{ "name": "600px-20408_cg", "path": "images/yoshihide/600px-20408_cg.webp" },
{ "name": "600px-20409_cg", "path": "images/yoshihide/600px-20409_cg.webp" },
{ "name": "975px-10402_gacksung", "path": "images/yoshihide/975px-10402_gacksung.webp" },
{ "name": "975px-10403_gacksung", "path": "images/yoshihide/975px-10403_gacksung.webp" },
{ "name": "975px-10404_normal", "path": "images/yoshihide/975px-10404_normal.webp" },
{ "name": "975px-10406_gacksung", "path": "images/yoshihide/975px-10406_gacksung.webp" },
{ "name": "975px-10407_gacksung", "path": "images/yoshihide/975px-10407_gacksung.webp" },
{ "name": "975px-10408_normal", "path": "images/yoshihide/975px-10408_normal.webp" },
{ "name": "975px-10409_gacksung", "path": "images/yoshihide/975px-10409_gacksung.webp" },
{ "name": "975px-10410_gacksung", "path": "images/yoshihide/975px-10410_gacksung.webp" },
{ "name": "975px-10410_normal", "path": "images/yoshihide/975px-10410_normal.webp" },
{ "name": "975px-10411_gacksung", "path": "images/yoshihide/975px-10411_gacksung.webp" },
{ "name": "975px-10411_normal", "path": "images/yoshihide/975px-10411_normal.webp" },
{ "name": "975px-10412_gacksung", "path": "images/yoshihide/975px-10412_gacksung.webp" },
{ "name": "975px-10412_normal", "path": "images/yoshihide/975px-10412_normal.webp" },
{ "name": "975px-10413_gacksung", "path": "images/yoshihide/975px-10413_gacksung.webp" },
{ "name": "975px-10413_normal", "path": "images/yoshihide/975px-10413_normal.webp" },
{ "name": "975px-10414_normal", "path": "images/yoshihide/975px-10414_normal.webp" }
],
"meursault": [
{ "name": "600px-20503_cg", "path": "images/meursault/600px-20503_cg.webp" },
{ "name": "600px-20504_cg", "path": "images/meursault/600px-20504_cg.webp" },
{ "name": "600px-20507_cg", "path": "images/meursault/600px-20507_cg.webp" },
{ "name": "600px-20508_cg", "path": "images/meursault/600px-20508_cg.webp" },
{ "name": "975px-10502_normal", "path": "images/meursault/975px-10502_normal.webp" },
{ "name": "975px-10503_gacksung", "path": "images/meursault/975px-10503_gacksung.webp" },
{ "name": "975px-10504_gacksung", "path": "images/meursault/975px-10504_gacksung.webp" },
{ "name": "975px-10505_normal", "path": "images/meursault/975px-10505_normal.webp" },
{ "name": "975px-10507_normal", "path": "images/meursault/975px-10507_normal.webp" },
{ "name": "975px-10508_gacksung", "path": "images/meursault/975px-10508_gacksung.webp" },
{ "name": "975px-10509_gacksung", "path": "images/meursault/975px-10509_gacksung.webp" },
{ "name": "975px-10510_normal", "path": "images/meursault/975px-10510_normal.webp" },
{ "name": "975px-10511_gacksung", "path": "images/meursault/975px-10511_gacksung.webp" },
{ "name": "975px-10512_gacksung", "path": "images/meursault/975px-10512_gacksung.webp" },
{ "name": "975px-10512_normal", "path": "images/meursault/975px-10512_normal.webp" },
{ "name": "975px-10513_gacksung", "path": "images/meursault/975px-10513_gacksung.webp" },
{ "name": "975px-10514_gacksung", "path": "images/meursault/975px-10514_gacksung.webp" }
],
"honglu": [
{ "name": "600px-20606_cg", "path": "images/honglu/600px-20606_cg.webp" },
{ "name": "600px-20607_cg", "path": "images/honglu/600px-20607_cg.webp" },
{ "name": "600px-20608_cg", "path": "images/honglu/600px-20608_cg.webp" },
{ "name": "600px-20609_cg", "path": "images/honglu/600px-20609_cg.webp" },
{ "name": "975px-10602_normal", "path": "images/honglu/975px-10602_normal.webp" },
{ "name": "975px-10604_gacksung", "path": "images/honglu/975px-10604_gacksung.webp" },
{ "name": "975px-10606_gacksung", "path": "images/honglu/975px-10606_gacksung.webp" },
{ "name": "975px-10610_gacksung", "path": "images/honglu/975px-10610_gacksung.webp" },
{ "name": "975px-10610_normal", "path": "images/honglu/975px-10610_normal.webp" },
{ "name": "975px-10611_gacksung", "path": "images/honglu/975px-10611_gacksung.webp" },
{ "name": "975px-10611_normal", "path": "images/honglu/975px-10611_normal.webp" },
{ "name": "975px-10613_gacksung", "path": "images/honglu/975px-10613_gacksung.webp" },
{ "name": "975px-10613_normal", "path": "images/honglu/975px-10613_normal.webp" },
{ "name": "975px-10614_gacksung", "path": "images/honglu/975px-10614_gacksung.webp" },
{ "name": "975px-10614_normal", "path": "images/honglu/975px-10614_normal.webp" }
],
"heathcliff": [
{ "name": "600px-20707_cg", "path": "images/heathcliff/600px-20707_cg.webp" },
{ "name": "600px-20708_cg", "path": "images/heathcliff/600px-20708_cg.webp" },
{ "name": "600px-20709_cg", "path": "images/heathcliff/600px-20709_cg.webp" },
{ "name": "975px-10704_normal", "path": "images/heathcliff/975px-10704_normal.webp" },
{ "name": "975px-10705_gacksung", "path": "images/heathcliff/975px-10705_gacksung.webp" },
{ "name": "975px-10705_normal", "path": "images/heathcliff/975px-10705_normal.webp" },
{ "name": "975px-10708_normal", "path": "images/heathcliff/975px-10708_normal.webp" },
{ "name": "975px-10709_gacksung", "path": "images/heathcliff/975px-10709_gacksung.webp" },
{ "name": "975px-10710_gacksung", "path": "images/heathcliff/975px-10710_gacksung.webp" },
{ "name": "975px-10710_normal", "path": "images/heathcliff/975px-10710_normal.webp" },
{ "name": "975px-10711_gacksung", "path": "images/heathcliff/975px-10711_gacksung.webp" },
{ "name": "975px-10711_normal", "path": "images/heathcliff/975px-10711_normal.webp" },
{ "name": "975px-10712_gacksung", "path": "images/heathcliff/975px-10712_gacksung.webp" },
{ "name": "975px-10714_gacksung", "path": "images/heathcliff/975px-10714_gacksung.webp" },
{ "name": "975px-10714_normal", "path": "images/heathcliff/975px-10714_normal.webp" }
],
"ishmael": [
{ "name": "600px-20803_cg", "path": "images/ishmael/600px-20803_cg.webp" },
{ "name": "600px-20806_cg", "path": "images/ishmael/600px-20806_cg.webp" },
{ "name": "600px-20807_cg", "path": "images/ishmael/600px-20807_cg.webp" },
{ "name": "600px-20809_cg", "path": "images/ishmael/600px-20809_cg.webp" },
{ "name": "600px-20810_cg", "path": "images/ishmael/600px-20810_cg.webp" },
{ "name": "975px-10802_normal", "path": "images/ishmael/975px-10802_normal.webp" },
{ "name": "975px-10805_normal", "path": "images/ishmael/975px-10805_normal.webp" },
{ "name": "975px-10806_gacksung", "path": "images/ishmael/975px-10806_gacksung.webp" },
{ "name": "975px-10807_normal", "path": "images/ishmael/975px-10807_normal.webp" },
{ "name": "975px-10808_gacksung", "path": "images/ishmael/975px-10808_gacksung.webp" },
{ "name": "975px-10808_normal", "path": "images/ishmael/975px-10808_normal.webp" },
{ "name": "975px-10809_gacksung", "path": "images/ishmael/975px-10809_gacksung.webp" },
{ "name": "975px-10810_normal", "path": "images/ishmael/975px-10810_normal.webp" },
{ "name": "975px-10811_gacksung", "path": "images/ishmael/975px-10811_gacksung.webp" },
{ "name": "975px-10811_normal", "path": "images/ishmael/975px-10811_normal.webp" },
{ "name": "975px-10812_gacksung", "path": "images/ishmael/975px-10812_gacksung.webp" },
{ "name": "975px-10812_normal", "path": "images/ishmael/975px-10812_normal.webp" },
{ "name": "975px-10813_gacksung", "path": "images/ishmael/975px-10813_gacksung.webp" },
{ "name": "975px-10814_gacksung", "path": "images/ishmael/975px-10814_gacksung.webp" },
{ "name": "975px-10814_normal", "path": "images/ishmael/975px-10814_normal.webp" }
],
"rodya": [
{ "name": "600px-20902_cg", "path": "images/rodya/600px-20902_cg.webp" },
{ "name": "600px-20904_cg", "path": "images/rodya/600px-20904_cg.webp" },
{ "name": "600px-20906_cg", "path": "images/rodya/600px-20906_cg.webp" },
{ "name": "600px-20908_cg", "path": "images/rodya/600px-20908_cg.webp" },
{ "name": "975px-10902_gacksung", "path": "images/rodya/975px-10902_gacksung.webp" },
{ "name": "975px-10903_normal", "path": "images/rodya/975px-10903_normal.webp" },
{ "name": "975px-10904_gacksung", "path": "images/rodya/975px-10904_gacksung.webp" },
{ "name": "975px-10905_gacksung", "path": "images/rodya/975px-10905_gacksung.webp" },
{ "name": "975px-10907_normal", "path": "images/rodya/975px-10907_normal.webp" },
{ "name": "975px-10908_normal", "path": "images/rodya/975px-10908_normal.webp" },
{ "name": "975px-10909_gacksung", "path": "images/rodya/975px-10909_gacksung.webp" },
{ "name": "975px-10910_normal", "path": "images/rodya/975px-10910_normal.webp" },
{ "name": "975px-10911_gacksung", "path": "images/rodya/975px-10911_gacksung.webp" },
{ "name": "975px-10911_normal", "path": "images/rodya/975px-10911_normal.webp" },
{ "name": "975px-10912_normal", "path": "images/rodya/975px-10912_normal.webp" },
{ "name": "975px-10913_gacksung", "path": "images/rodya/975px-10913_gacksung.webp" },
{ "name": "975px-10914_normal", "path": "images/rodya/975px-10914_normal.webp" }
],
"sinclair": [
{ "name": "600px-21006_cg", "path": "images/sinclair/600px-21006_cg.webp" },
{ "name": "600px-21008_cg", "path": "images/sinclair/600px-21008_cg.webp" },
{ "name": "600px-21009_cg", "path": "images/sinclair/600px-21009_cg.webp" },
{ "name": "975px-11002_gacksung", "path": "images/sinclair/975px-11002_gacksung.webp" },
{ "name": "975px-11003_normal", "path": "images/sinclair/975px-11003_normal.webp" },
{ "name": "975px-11004_gacksung", "path": "images/sinclair/975px-11004_gacksung.webp" },
{ "name": "975px-11005_gacksung", "path": "images/sinclair/975px-11005_gacksung.webp" },
{ "name": "975px-11006_normal", "path": "images/sinclair/975px-11006_normal.webp" },
{ "name": "975px-11007_gacksung", "path": "images/sinclair/975px-11007_gacksung.webp" },
{ "name": "975px-11008_gacksung", "path": "images/sinclair/975px-11008_gacksung.webp" },
{ "name": "975px-11008_normal", "path": "images/sinclair/975px-11008_normal.webp" },
{ "name": "975px-11009_gacksung", "path": "images/sinclair/975px-11009_gacksung.webp" },
{ "name": "975px-11011_normal", "path": "images/sinclair/975px-11011_normal.webp" },
{ "name": "975px-11012_gacksung", "path": "images/sinclair/975px-11012_gacksung.webp" },
{ "name": "975px-11012_normal", "path": "images/sinclair/975px-11012_normal.webp" },
{ "name": "975px-11014_gacksung", "path": "images/sinclair/975px-11014_gacksung.webp" },
{ "name": "975px-11014_normal", "path": "images/sinclair/975px-11014_normal.webp" },
{ "name": "975px-11015_gacksung", "path": "images/sinclair/975px-11015_gacksung.webp" },
{ "name": "975px-11015_normal", "path": "images/sinclair/975px-11015_normal.webp" }
],
"outis": [
{ "name": "600px-21106_cg", "path": "images/outis/600px-21106_cg.webp" },
{ "name": "600px-21108_cg", "path": "images/outis/600px-21108_cg.webp" },
{ "name": "600px-21109_cg", "path": "images/outis/600px-21109_cg.webp" },
{ "name": "975px-11102_gacksung", "path": "images/outis/975px-11102_gacksung.webp" },
{ "name": "975px-11104_gacksung", "path": "images/outis/975px-11104_gacksung.webp" },
{ "name": "975px-11105_normal", "path": "images/outis/975px-11105_normal.webp" },
{ "name": "975px-11106_normal", "path": "images/outis/975px-11106_normal.webp" },
{ "name": "975px-11107_gacksung", "path": "images/outis/975px-11107_gacksung.webp" },
{ "name": "975px-11108_gacksung", "path": "images/outis/975px-11108_gacksung.webp" },
{ "name": "975px-11108_normal", "path": "images/outis/975px-11108_normal.webp" },
{ "name": "975px-11109_normal", "path": "images/outis/975px-11109_normal.webp" },
{ "name": "975px-11110_normal", "path": "images/outis/11110_normal.webp" },
{ "name": "975px-11111_normal", "path": "images/outis/975px-11111_normal.webp" },
{ "name": "975px-11112_gacksung", "path": "images/outis/975px-11112_gacksung.webp" },
{ "name": "975px-11113_gacksung", "path": "images/outis/975px-11113_gacksung.webp" },
{ "name": "975px-11113_normal", "path": "images/outis/975px-11113_normal.webp" },
{ "name": "975px-11114_gacksung", "path": "images/outis/975px-11114_gacksung.webp" }
],
"gregor": [
{ "name": "600px-21205_cg", "path": "images/gregor/600px-21205_cg.webp" },
{ "name": "600px-21206_cg", "path": "images/gregor/600px-21206_cg.webp" },
{ "name": "600px-21207_cg", "path": "images/gregor/600px-21207_cg.webp" },
{ "name": "600px-21209_cg", "path": "images/gregor/600px-21209_cg.webp" },
{ "name": "975px-11204_gacksung", "path": "images/gregor/975px-11204_gacksung.webp" },
{ "name": "975px-11205_gacksung", "path": "images/gregor/975px-11205_gacksung.webp" },
{ "name": "975px-11206_gacksung", "path": "images/gregor/975px-11206_gacksung.webp" },
{ "name": "975px-11207_gacksung", "path": "images/gregor/975px-11207_gacksung.webp" },
{ "name": "975px-11208_gacksung", "path": "images/gregor/975px-11208_gacksung.webp" },
{ "name": "975px-11209_gacksung", "path": "images/gregor/975px-11209_gacksung.webp" },
{ "name": "975px-11209_normal", "path": "images/gregor/975px-11209_normal.webp" },
{ "name": "975px-11210_gacksung", "path": "images/gregor/975px-11210_gacksung.webp" },
{ "name": "975px-11210_normal", "path": "images/gregor/975px-11210_normal.webp" },
{ "name": "975px-11211_gacksung", "path": "images/gregor/975px-11211_gacksung.webp" },
{ "name": "975px-11211_normal", "path": "images/gregor/975px-11211_normal.webp" },
{ "name": "975px-11212_gacksung", "path": "images/gregor/975px-11212_gacksung.webp" },
{ "name": "975px-11213_gacksung", "path": "images/gregor/975px-11213_gacksung.webp" },
{ "name": "975px-11213_normal", "path": "images/gregor/975px-11213_normal.webp" },
{ "name": "975px-11214_gacksung", "path": "images/gregor/975px-11214_gacksung.webp" },
{ "name": "975px-11215_normal", "path": "images/gregor/975px-11215_normal.webp" }
]};
// 罪人数据与matching-game.html保持一致
const gameData = [
{ id: 1, sinner: "李箱", source: "《李箱》", imgName: "yisang", egoImgName: "yi_sang_ego" },
{ id: 2, sinner: "浮士德", source: "《浮士德》", imgName: "faust", egoImgName: "faust_ego" },
{ id: 3, sinner: "堂吉诃德", source: "《堂吉诃德》", imgName: "don_quixote", egoImgName: "don_quixote_ego" },
{ id: 4, sinner: "良秀", source: "《地狱变》", imgName: "yoshihide", egoImgName: "yoshihide_ego" },
{ id: 5, sinner: "默尔索", source: "《局外人》", imgName: "meursault", egoImgName: "meursault_ego" },
{ id: 6, sinner: "鸿璐", source: "《红楼梦》", imgName: "honglu", egoImgName: "honglu_ego" },
{ id: 7, sinner: "希斯克利夫", source: "《呼啸山庄》", imgName: "heathcliff", egoImgName: "heathcliff_ego" },
{ id: 8, sinner: "以实玛利", source: "《白鲸》", imgName: "ishmael", egoImgName: "ishmael_ego" },
{ id: 9, sinner: "罗佳", source: "《罪与罚》", imgName: "rodya", egoImgName: "rodya_ego" },
{ id: 11, sinner: "辛克莱", source: "《德米安》", imgName: "sinclair", egoImgName: "sinclair_ego" },
{ id: 12, sinner: "奥提斯", source: "《奥德修斯》", imgName: "outis", egoImgName: "outis_ego" },
{ id: 13, sinner: "格里高尔", source: "《变形记》", imgName: "gregor", egoImgName: "gregor_ego" },
];
// 初始化页面
function initPage() {
// 生成罪人卡片
generateSinnerCards();
}
// 生成罪人卡片
function generateSinnerCards() {
const sinnerCards = document.getElementById('sinner-cards');
sinnerCards.innerHTML = '';
gameData.forEach(sinner => {
const card = document.createElement('div');
card.className = 'sinner-card';
card.dataset.id = sinner.id;
const img = document.createElement('img');
img.src = `images/sinners/${sinner.imgName}.png`;
img.alt = sinner.sinner;
img.className = 'sinner-card-img';
// 如果图片加载失败,显示默认图标
img.onerror = function() {
this.style.display = 'none';
const icon = document.createElement('i');
icon.className = 'fas fa-user';
icon.style.fontSize = '100px';
icon.style.color = 'var(--secondary-color)';
this.parentNode.insertBefore(icon, this);
};
const info = document.createElement('div');
info.className = 'sinner-card-info';
const name = document.createElement('h3');
name.className = 'sinner-name';
name.textContent = sinner.sinner;
const source = document.createElement('div');
source.className = 'sinner-source';
source.textContent = sinner.source;
info.appendChild(name);
info.appendChild(source);
card.appendChild(img);
card.appendChild(info);
// 添加点击事件,打开立绘排序界面
card.addEventListener('click', () => openSorting(sinner));
sinnerCards.appendChild(card);
});
}
// 打开立绘排序界面
function openSorting(sinner) {
const sortingContainer = document.getElementById('sorting-container');
const sortingTitle = document.getElementById('sorting-title');
const sortingImages = document.getElementById('sorting-images');
// 隐藏罪人卡片,显示排序界面
document.querySelector('.gallery-container').style.display = 'none';
sortingContainer.classList.add('active');
// 设置标题
sortingTitle.textContent = `${sinner.sinner} 立绘排序`;
// 清空之前的立绘
sortingImages.innerHTML = '';
// 清空分类中的立绘
document.querySelectorAll('.sorting-category-content').forEach(content => {
content.innerHTML = '';
});
// 加载罪人的所有人格立绘
loadSinnerPersonalities(sinner);
}
// 加载罪人的所有人格立绘
function loadSinnerPersonalities(sinner) {
const sortingImages = document.getElementById('sorting-images');
// 直接从 sinnerImagesData 中获取当前罪人的图片数据
const currentSinnerImages = sinnerImagesData[sinner.imgName];
if (currentSinnerImages && currentSinnerImages.length > 0) {
// 为每个人格立绘创建可拖动的图片元素
currentSinnerImages.forEach((personality, index) => {
const img = document.createElement('img');
img.src = personality.path;
img.alt = personality.name;
img.className = 'sorting-image';
img.dataset.id = index + 1;
img.dataset.name = personality.name;
img.draggable = true;
// 如果图片加载失败,显示默认图标
img.onerror = function() {
this.style.display = 'none';
const icon = document.createElement('i');
icon.className = 'fas fa-user';
icon.style.fontSize = '80px';
icon.style.color = 'var(--secondary-color)';
this.parentNode.insertBefore(icon, this);
};
// 添加拖动事件
img.addEventListener('dragstart', handleDragStart);
img.addEventListener('dragend', handleDragEnd);
// 添加点击事件,在右侧显示完整图片
img.addEventListener('click', () => showFullImage(personality.path));
sortingImages.appendChild(img);
});
} else {
// 如果没有找到图片,显示提示信息
const errorMsg = document.createElement('div');
errorMsg.className = 'error-message';
errorMsg.textContent = `未找到 ${sinner.sinner} 的立绘图片`;
sortingImages.appendChild(errorMsg);
}
}
// 显示完整图片
function showFullImage(imgSrc) {
const fullImage = document.getElementById('sorting-right-image');
fullImage.src = imgSrc;
}
// 处理拖动开始
function handleDragStart(e) {
this.classList.add('dragging');
e.dataTransfer.setData('text/plain', this.dataset.id);
e.dataTransfer.effectAllowed = 'move';
}
// 处理拖动结束
function handleDragEnd(e) {
this.classList.remove('dragging');
}
// 为分类区域添加拖放事件
document.querySelectorAll('.sorting-category').forEach(category => {
category.addEventListener('dragover', handleDragOver);
category.addEventListener('dragleave', handleDragLeave);
category.addEventListener('drop', handleDrop);
});
// 处理拖动悬停
function handleDragOver(e) {
e.preventDefault();
e.dataTransfer.dropEffect = 'move';
this.classList.add('drag-over');
}
// 处理拖动离开
function handleDragLeave(e) {
this.classList.remove('drag-over');
}
// 处理放置
function handleDrop(e) {
e.preventDefault();
this.classList.remove('drag-over');
const id = e.dataTransfer.getData('text/plain');
const draggedElement = document.querySelector(`.sorting-image[data-id="${id}"]`);
if (draggedElement) {
// 将图片从原位置移动到新位置
const categoryContent = this.querySelector('.sorting-category-content');
// 创建一个新图片元素
const newImg = document.createElement('img');
newImg.src = draggedElement.src;
newImg.alt = draggedElement.alt;
newImg.className = 'sorting-image-small';
newImg.dataset.id = draggedElement.dataset.id;
newImg.dataset.name = draggedElement.dataset.name;
// 添加点击事件,在右侧显示完整图片
newImg.addEventListener('click', () => showFullImage(draggedElement.src));
// 将新图片添加到分类中
categoryContent.appendChild(newImg);
// 从原位置移除图片
draggedElement.remove();
}
}
// 关闭排序界面
function closeSorting() {
const sortingContainer = document.getElementById('sorting-container');
// 显示罪人卡片,隐藏排序界面
document.querySelector('.gallery-container').style.display = 'flex';
sortingContainer.classList.remove('active');
}
// 初始化页面
initPage();
</script>
</body>
</html>