Skip to content

Commit 2d71e12

Browse files
committed
v2.0.1
1 parent 2f39526 commit 2d71e12

File tree

11 files changed

+103
-212
lines changed

11 files changed

+103
-212
lines changed

CHANGELOG.md

+15-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,22 @@
1313

1414
</header>
1515

16+
### 系统
1617
- 更新Next.js版本到v15.3.1
1718
- 更新React版本到v19.1.0
18-
- 修复皮肤按品质排序功能
19+
- 适配Next.js新版语法
20+
- 移除Next-PWA
21+
- 移除SkinChanges读取,更换自有方式维护相关数据
22+
23+
### 体验
24+
- 优化移动端手势操作
25+
- 优化图片加载动画
26+
- 更换卡达模型站地址为[《布锅锅联盟宇宙x卡达模型站》](https://3d.buguoguo.cn)
27+
- 更换皮肤演示视频为哔哩哔哩[白礼白里白](https://space.bilibili.com/9385598)
28+
- 完善使用条款、隐私协议等链接
29+
30+
### 问题修复
31+
- 修复适配腾讯定制皮肤品质导致按皮肤品质排序失效的问题
1932

2033
---
2134

@@ -42,7 +55,7 @@
4255
- 修复部分版本ASU更新原画地址错误(比如提莫)。
4356
- 修正部分界面翻译。
4457
- 增加了终极皮肤动态/静态原画的切换功能,快捷键V。
45-
- 增加了快速前往[布锅锅联盟宇宙语音站](https://voice.buguoguo.cn)收听英雄语音的功能
58+
- 增加了快速前往[布锅锅联盟宇宙语音站](https://voice.buguoguo.cn)收听英雄语音的功能
4659

4760
---
4861

components/image.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export default function Image({ src, style, objectFit, objectPosition, fill, wid
88

99
let actualSrc = exists ? src : placeholder;
1010
const mergedStyle = {
11-
...(style || {}),
12-
objectFit: objectFit || undefined,
13-
objectPosition: objectPosition || undefined,
11+
...((style && typeof style === 'object') ? style : {}),
12+
...(style?.objectFit ? {} : (objectFit ? { objectFit } : {})),
13+
...(style?.objectPosition ? {} : (objectPosition ? { objectPosition } : {})),
1414
};
1515

1616
return (

components/new-additions/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function NewAdditions() {
2828
loading="eager"
2929
src={asset(skin.tilePath)}
3030
alt={skin.name}
31-
objectFit="cover"
31+
style={{ objectFit: "cover" }}
3232
/>
3333
</span>
3434
<div>{skin.name}</div>

components/skin-grid/index.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,21 @@ export function SkinGrid({ skins, linkTo }) {
2323
unoptimized
2424
src={asset(skin.tilePath)}
2525
alt={skin.name}
26-
objectFit="cover"
26+
style={{ objectFit: "cover" }}
27+
priority
2728
/>
2829
</span>
2930
<div>
3031
<span className={styles.skinName}>{skin.name}</span>
3132
<div className={classNames({ [styles.rarityBadge]: r })}>
3233
{r && (
33-
<Image fill
34+
<Image
3435
src={r[0]}
3536
title={r[1]}
3637
alt={r[1]}
37-
objectFit="contain"
38-
objectPosition="center"
38+
style={{ objectFit: "contain", objectPosition: "center" }}
39+
height={20}
40+
width={20}
3941
/>
4042
)}
4143
</div>

components/skin-grid/styles.module.scss

+22-53
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,8 @@
66
justify-content: center;
77

88
> a {
9-
display: grid;
10-
grid-template-columns: 60px 1fr;
11-
align-items: center;
12-
min-height: 60px;
13-
max-height: 60px;
14-
width: 100%;
15-
overflow: hidden;
16-
background: rgba(255, 255, 255, 0.08);
17-
backdrop-filter: blur(12px);
18-
padding-right: 12px;
19-
gap: 12px;
9+
display: block;
10+
position: relative;
2011

2112
.tile {
2213
transition: transform 200ms;
@@ -30,17 +21,13 @@
3021
> div {
3122
font-weight: 500;
3223
display: flex;
33-
align-items: center;
24+
align-items: flex-start;
3425
justify-content: space-between;
3526
gap: 12px;
3627
line-height: 1.3;
3728
color: rgb(165, 178, 196);
3829
transition: color 200ms;
39-
margin-top: 0;
40-
white-space: nowrap;
41-
overflow: hidden;
42-
text-overflow: ellipsis;
43-
height: 60px;
30+
margin-top: 8px;
4431
}
4532

4633
&:hover > div {
@@ -50,12 +37,8 @@
5037
}
5138

5239
.rarityBadge {
53-
height: 20px;
54-
width: 20px;
5540
flex: 0 0 20px;
5641
position: relative;
57-
margin-left: 8px;
58-
display: block;
5942
}
6043

6144
@media screen and (max-width: 1400px) {
@@ -85,15 +68,8 @@
8568
backdrop-filter: blur(12px);
8669
padding-right: 12px;
8770

88-
.imageContainer {
89-
width: 60px;
90-
height: 60px;
91-
min-width: 60px;
92-
min-height: 60px;
93-
aspect-ratio: unset;
94-
}
95-
9671
> div {
72+
// display: flex;
9773
align-items: center;
9874
}
9975
}
@@ -107,35 +83,28 @@
10783

10884
.imageContainer {
10985
position: relative;
110-
width: 60px;
111-
height: 60px;
112-
min-width: 60px;
113-
min-height: 60px;
86+
width: 100%;
87+
aspect-ratio: 1 / 1;
11488
display: block;
11589
overflow: hidden;
90+
background: rgba(121, 163, 207, 0.1);
91+
92+
@supports not (aspect-ratio: 1 / 1) {
93+
&::before {
94+
content: "";
95+
display: block;
96+
padding-bottom: 100%;
97+
}
98+
}
11699
}
117100

118-
.imageContainer img {
101+
.tile {
119102
position: absolute;
120103
inset: 0;
121-
box-sizing: border-box;
122-
padding: 0;
123-
border: none;
124-
margin: auto;
125-
display: block;
126-
min-width: 100%;
127-
max-width: 100%;
128-
min-height: 100%;
129-
max-height: 100%;
104+
width: 100%;
105+
height: 100%;
130106
object-fit: cover;
131-
}
132-
133-
.skinName {
134-
flex: 1;
135-
min-width: 0;
136-
word-break: break-all;
137-
white-space: normal;
138-
overflow: hidden;
139-
text-overflow: ellipsis;
107+
transition: transform 200ms;
108+
background: rgba(121, 163, 207, 0.1);
140109
display: block;
141-
}
110+
}

components/skin-viewer/index.js

+33-14
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ function _SkinViewer({
127127
const [patch, setPatch] = useState("");
128128
const showUIRef = useRef();
129129
const dimensions = useRef({ width: 1, height: 1 });
130+
const lastTapRef = useRef(0); // 用于移动端双击判断
130131

131132
useEffect(() => {
132133
setDeltaX(0);
@@ -317,7 +318,6 @@ function _SkinViewer({
317318

318319
const handlers = useSwipeable({
319320
onSwipeStart(e) {
320-
e.event.preventDefault();
321321
if (fill) {
322322
draggingOrigin = [e.deltaX, e.deltaY];
323323
}
@@ -335,7 +335,6 @@ function _SkinViewer({
335335
}
336336
},
337337
onSwiped(e) {
338-
e.event.preventDefault();
339338
if (fill) {
340339
const { width, height } = dimensions.current;
341340
let left = e.vxvy[0] / (width - window.innerWidth),
@@ -353,17 +352,13 @@ function _SkinViewer({
353352
}
354353
},
355354
onSwipedLeft(e) {
356-
e.event.preventDefault();
357355
!fill && e.velocity > 0.6 && goNext(true);
358356
},
359357
onSwipedRight(e) {
360-
e.event.preventDefault();
361358
!fill && e.velocity > 0.6 && goPrevious(true);
362359
},
363360
onSwipedUp(e) {
364-
e.event.preventDefault();
365361
const { width, height } = dimensions.current;
366-
367362
if (
368363
(!fill || (height / width) * window.innerWidth <= window.innerHeight) &&
369364
meta.changes
@@ -374,10 +369,31 @@ function _SkinViewer({
374369
] || ""
375370
);
376371
},
372+
onSwipedDown(e) {
373+
toggleCentered();
374+
},
377375
preventDefaultTouchmoveEvent: true,
376+
preventScrollOnSwipe: true,
378377
delta: { left: 3, right: 3, up: 50 },
379378
});
380379

380+
// patch、showVideo、centered、imgPath、vidPath、skin 变化时重置 loaded,fill 不再触发
381+
useEffect(() => {
382+
setLoaded(false);
383+
}, [patch, showVideo, centered, imgPath, vidPath, skin]);
384+
385+
function handleTouchEnd(e) {
386+
// 只处理单指触摸
387+
if (e.touches && e.touches.length > 0) return;
388+
const now = Date.now();
389+
if (now - lastTapRef.current < 300) {
390+
toggleFill();
391+
lastTapRef.current = 0;
392+
} else {
393+
lastTapRef.current = now;
394+
}
395+
}
396+
381397
return (
382398
<>
383399
<Head>
@@ -411,6 +427,12 @@ function _SkinViewer({
411427
[styles.show]: showUI,
412428
})}
413429
>
430+
{/* loading 动画 */}
431+
{!loaded && (
432+
<div className={styles.loadingWrapper}>
433+
<Loading />
434+
</div>
435+
)}
414436
<div
415437
className={styles.hitbox}
416438
{...handlers}
@@ -421,6 +443,7 @@ function _SkinViewer({
421443
})
422444
}
423445
onDoubleClick={toggleFill}
446+
onTouchEnd={handleTouchEnd}
424447
onMouseDown={(e) => {
425448
if (fill) {
426449
draggingOrigin = [e.screenX, e.screenY];
@@ -534,6 +557,7 @@ function _SkinViewer({
534557
loop
535558
key={`${vidPath}-${patch}`}
536559
style={{ objectFit: "cover" }}
560+
onLoadedData={() => setLoaded(true)}
537561
>
538562
<source src={asset(vidPath, patch || "pbe")} />
539563
</video>
@@ -544,6 +568,7 @@ function _SkinViewer({
544568
src={asset(imgPath, patch || "pbe")}
545569
alt={skin.name}
546570
objectFit="cover"
571+
onLoad={() => setLoaded(true)}
547572
/>
548573
)}
549574
</div>
@@ -577,13 +602,7 @@ function _SkinViewer({
577602
alt={skin.name}
578603
objectFit={objectFit}
579604
objectPosition={objectPosition}
580-
onLoadingComplete={({ naturalHeight, naturalWidth }) => {
581-
dimensions.current = {
582-
width: naturalWidth,
583-
height: naturalHeight,
584-
};
585-
setLoaded(true);
586-
}}
605+
onLoad={() => setLoaded(true)}
587606
/>
588607
)}
589608
</main>
@@ -612,4 +631,4 @@ export function SkinViewer(props) {
612631
}
613632

614633
return <_SkinViewer {...props} />;
615-
}
634+
}

components/skin-viewer/styles.module.scss

+15-4
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,6 @@
311311
display: flex;
312312
align-items: center;
313313
gap: 8px;
314-
315-
img {
316-
width: 20px;
317-
}
318314
}
319315
}
320316
}
@@ -536,3 +532,18 @@
536532
}
537533
}
538534
}
535+
536+
.loadingWrapper {
537+
position: fixed;
538+
z-index: 10000;
539+
top: 0;
540+
left: 0;
541+
width: 100vw;
542+
height: 100vh;
543+
display: flex;
544+
align-items: center;
545+
justify-content: center;
546+
background: rgba(10, 18, 30, 0.7);
547+
animation: fadeIn 0.3s;
548+
pointer-events: none;
549+
}

pages/_app.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ export default function App({ Component, pageProps }) {
2525
/>
2626
</Head>
2727
<PropsProvider value={pageProps}>
28-
{getLayout(<Component {...pageProps} />)}
28+
{getLayout(
29+
<Component
30+
key={pageProps.key}
31+
{...(() => { const { key, ...rest } = pageProps; return rest; })()}
32+
/>
33+
)}
2934
</PropsProvider>
3035
</>
3136
);

pages/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function ChampionsList({ role }) {
4242
className={styles.img}
4343
src={asset(c.squarePortraitPath)}
4444
alt={c.name}
45-
objectFit="cover"
45+
style={{ objectFit: "cover" }}
4646
/>
4747
</span>
4848
<div>{c.name}</div>

pages/shortcuts.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ import Changelog from "../CHANGELOG.md";
6464
| `双击` | 切换缩放 |
6565
| ` 向左滑动` `向右滑动 ` | 查看集合中的下一个/上一个皮肤 |
6666
| `向上滑动` | 在旧版本的插画之间循环切换 |
67+
| `向下滑动` | 切换居中(聚焦图)和不居中(原画) |
6768

6869
export default ({ children }) => (
6970
<Layout backTo="/">

0 commit comments

Comments
 (0)