Skip to content

Commit 5808729

Browse files
committed
add LucidNFT
1 parent ca3e4a8 commit 5808729

10 files changed

Lines changed: 1143 additions & 2 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
run_cc.sh
22
run_codex.sh
33
CLAUDE.md
4-
.claude
4+
.claude
5+
*.pdf

LucidNFT/fig/advantage_ana.png

109 KB
Loading

LucidNFT/fig/lucidconsistency.png

85.5 KB
Loading

LucidNFT/fig/lucidlr.png

1.63 MB
Loading

LucidNFT/fig/training_curve.png

183 KB
Loading

LucidNFT/index.html

Lines changed: 305 additions & 0 deletions
Large diffs are not rendered by default.

LucidNFT/script.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Kontext-Style main functionality
2+
document.addEventListener('DOMContentLoaded', function() {
3+
// 移除了模态框功能,现在只保留图片导航
4+
5+
// 图片导航功能
6+
function initImageNavigation() {
7+
document.querySelectorAll('.style-display').forEach(display => {
8+
const container = display.querySelector('.style-container');
9+
const images = Array.from(container.querySelectorAll('.style-image'));
10+
const prevBtn = display.querySelector('.prev-btn');
11+
const nextBtn = display.querySelector('.next-btn');
12+
const currentSlideSpan = display.querySelector('.current-slide');
13+
const totalSlidesSpan = display.querySelector('.total-slides');
14+
15+
if (images.length === 0) return;
16+
17+
let currentIndex = 0;
18+
19+
function showImage(index) {
20+
images.forEach(img => img.classList.remove('active'));
21+
images[index].classList.add('active');
22+
23+
currentSlideSpan.textContent = index + 1;
24+
totalSlidesSpan.textContent = images.length;
25+
26+
prevBtn.disabled = index === 0;
27+
nextBtn.disabled = index === images.length - 1;
28+
29+
currentIndex = index;
30+
}
31+
32+
prevBtn.addEventListener('click', () => {
33+
if (currentIndex > 0) {
34+
showImage(currentIndex - 1);
35+
}
36+
});
37+
38+
nextBtn.addEventListener('click', () => {
39+
if (currentIndex < images.length - 1) {
40+
showImage(currentIndex + 1);
41+
}
42+
});
43+
44+
// 键盘导航
45+
display.addEventListener('keydown', (e) => {
46+
if (e.key === 'ArrowLeft' && currentIndex > 0) prevBtn.click();
47+
if (e.key === 'ArrowRight' && currentIndex < images.length - 1) nextBtn.click();
48+
});
49+
50+
// 初始化显示
51+
showImage(0);
52+
});
53+
}
54+
55+
// 当前版本未使用自动画廊
56+
57+
// 初始化
58+
initImageNavigation();
59+
// initAutoGallery 已禁用
60+
});

0 commit comments

Comments
 (0)