Skip to content

Commit c99cca1

Browse files
小调整。
1 parent 198e08a commit c99cca1

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

p/index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<title>Pixiv工具</title>
88
<style type="text/css">
9-
body{padding:0;margin:0;font-size:20px}
10-
#tools{position:fixed;left:0;top:0;z-index:1;background-color:#efefef;width:100%;padding:5px 5px 0 5px}
9+
body{padding:0;margin:0;font-size:20px;background-color:#1e1f22;}
10+
#tools{position:fixed;left:0;top:0;z-index:1;background-color:#666;width:100%;padding:5px 5px 0 5px}
1111
#tools div{padding-bottom:5px}
1212
#imgs{margin-top:70px;padding:5px 0 0 5px;padding-bottom:10px}
13-
img{margin-top:15px;background-color:#efefef}
14-
img:first-child, img.hidden{margin-top:0}
13+
img{margin-top:15px;background-color:#999}
14+
img:first-child, img.hidden{margin-top:0;display:none}
1515

1616
.mobile #tools{top:auto;bottom:0}
1717
.mobile #imgs{margin-top:0;padding-bottom:72px}
1818
.mobile #imgs img:last-child{margin-bottom:70px}
1919

20-
#configs{position:fixed;left:0;bottom:0;z-index:2;background-color:#efefef;border:1px solid #aaa;padding:5px;width:100%;display:none}
20+
#configs{position:fixed;left:0;bottom:0;z-index:2;background-color:#666;border:1px solid #aaa;padding:5px;width:100%;display:none}
2121
#saveConfigPanel{text-align:center}
2222
.mobile #configs{top:0;bottom:auto}
2323
</style>

p/index.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -250,15 +250,15 @@ function clearPid () {
250250

251251
function showImg (img) {
252252
img.title = `${img.id} ${img.naturalWidth}✖️${img.naturalHeight}`;
253-
img.classList.remove("hidden");
254253
if (400 / img.naturalHeight * img.naturalWidth > windowWidth) {
255254
// 宽度超过页面时,缩小显示
256-
img.style.width = windowWidth + "px";
257255
img.style.height = (windowWidth / img.naturalWidth * img.naturalHeight) + "px";
256+
img.style.width = windowWidth + "px";
258257
} else {
259-
img.style.width = (400 / img.naturalHeight * img.naturalWidth) + "px";
260258
img.style.height = "400px";
259+
img.style.width = (400 / img.naturalHeight * img.naturalWidth) + "px";
261260
}
261+
img.classList.remove("hidden");
262262
}
263263

264264
function stopImgInterval (img) {
@@ -286,11 +286,9 @@ function createImage (pid, n) {
286286
img.src = `https://pixiv.nl/${pid}.jpg`;
287287
}
288288
if (n === 1 || auto.value !== '自动') {
289-
img.style.width = windowWidth + "px";
290289
img.style.height = "400px";
290+
img.style.width = windowWidth + "px";
291291
} else {
292-
img.style.width = "0px";
293-
img.style.height = "0px";
294292
img.classList.add("hidden");
295293
}
296294
img.style.cursor = 'pointer';

0 commit comments

Comments
 (0)