mirror of
https://github.com/Jerryplusy/crystelf-plugin.git
synced 2025-07-04 06:09:19 +00:00
优化网页截图
This commit is contained in:
parent
27ed33dcd3
commit
655f5a312b
@ -12,13 +12,16 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
font-family: "Helvetica Neue", sans-serif;
|
font-family: "Helvetica Neue", sans-serif;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
position: relative;
|
||||||
|
min-height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.background {
|
.background {
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
min-height: 100vh;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-image: url('https://www.dmoe.cc/random.php');
|
background-image: url('https://www.dmoe.cc/random.php');
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
@ -37,7 +40,7 @@
|
|||||||
backdrop-filter: blur(18px);
|
backdrop-filter: blur(18px);
|
||||||
-webkit-backdrop-filter: blur(18px);
|
-webkit-backdrop-filter: blur(18px);
|
||||||
box-shadow: 0 10px 25px rgba(0,0,0,0.4);
|
box-shadow: 0 10px 25px rgba(0,0,0,0.4);
|
||||||
border: 1.5px solid rgba(76, 175, 80, 0.7);
|
border: 2px solid rgba(76, 175, 80, 0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
.container pre code {
|
.container pre code {
|
||||||
@ -47,11 +50,11 @@
|
|||||||
padding: 16px;
|
padding: 16px;
|
||||||
display: block;
|
display: block;
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
background: rgba(0, 0, 0, 0.11);
|
background: rgba(0, 0, 0, 0.58);
|
||||||
backdrop-filter: blur(10px);
|
backdrop-filter: blur(10px);
|
||||||
-webkit-backdrop-filter: blur(10px);
|
-webkit-backdrop-filter: blur(10px);
|
||||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
color: #f8f8f2;
|
color: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ const screenshot = {
|
|||||||
});
|
});
|
||||||
const page = await browser.newPage();
|
const page = await browser.newPage();
|
||||||
await page.setContent(html, { waitUntil: 'networkidle0' });
|
await page.setContent(html, { waitUntil: 'networkidle0' });
|
||||||
await page.setViewport({ width: 800, height: 600, deviceScaleFactor: 1.5 });
|
await page.setViewport({ width: 800, height: 600, deviceScaleFactor: 2 });
|
||||||
await page.screenshot({ path: savePath, fullPage: true });
|
await page.screenshot({ path: savePath, fullPage: true });
|
||||||
await browser.close();
|
await browser.close();
|
||||||
return savePath;
|
return savePath;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user