Skip to content

Commit 35e7329

Browse files
committed
docs: ✏️ md文档修改
增加参数 BREAKING CHANGE: 🧨 无
1 parent 33b7848 commit 35e7329

File tree

5 files changed

+37
-18
lines changed

5 files changed

+37
-18
lines changed

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,24 @@ node index.js //指向骨架屏抓取
3030

3131
### 参数说明
3232

33-
后期补充
33+
```
34+
getSkeleton({
35+
pageName: spliPageName(item.pageUrl), //文件名称
36+
pageUrl: `${item.pageUrl}&role=puppeteer`, //生成路径
37+
openRepeatList: true, //是否抓取的时候执行第个元素
38+
device: "iPhone 6", // 为空则使用默认 PC 页面打开
39+
minGrayBlockWidth: 20, //最小宽度
40+
minGrayPseudoWidth: 10, //伪类最小宽度
41+
debug: false, //是否开启无头浏览器的debug模式
42+
debugTime: 3000, // debug下停止的时间
43+
filterClass: item.filterClass, //要过滤的标签
44+
outputPath:'' //生成后的目录
45+
});
46+
47+
```
48+
49+
50+
#### 再次说明
51+
52+
此项目是基于awesome-skeleton 进行一些简单的源码修改,希望大家还是多多支持原作者。
3453

demo/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ const spliPageName = (url) => {
99
const skeletonObj = [
1010
{
1111
pageUrl:
12-
"http://10.8.16.145:8080/parent-wx-h5Shop-shopShow.html?actId=5e796b01cce13f039dca4ee5",
12+
"https://test.yangcong345.com/parent-wx-h5Shop-shopShow.html?actId=5e796b01cce13f039dca4ee5",
1313
filterClass: [],
1414
},
1515
{
1616
pageUrl:
17-
"http://10.8.16.145:8080/parent-wx-h5Shop-list.html?id=5db95977947acb2e6d0c5a2d&fromtype=zheguangtestdddd&code=061qlt7j29zDpB0wE56j2HXe7j2qlt7j&state=parent",
17+
"https://test.yangcong345.com/parent-wx-h5Shop-list.html?id=5db95977947acb2e6d0c5a2d&fromtype=zheguangtestdddd&code=061qlt7j29zDpB0wE56j2HXe7j2qlt7j&state=parent",
1818
filterClass: [],
1919
},
2020
{
2121
pageUrl:
22-
"http://10.8.16.145:8080/parent-wx-h5Shop-my.html?id=5db95977947acb2e6d0c5a2d&fromtype=zheguangtestdddd",
22+
"https://test.yangcong345.com/parent-wx-h5Shop-my.html?id=5db95977947acb2e6d0c5a2d&fromtype=zheguangtestdddd",
2323
filterClass: [],
2424
},
2525

2626
{
2727
pageUrl:
28-
"http://10.8.16.145:8080/parent-wx-h5Shop-orderList.html?id=5db95977947acb2e6d0c5a2d",
28+
"https://test.yangcong345.com/parent-wx-h5Shop-orderList.html?id=5db95977947acb2e6d0c5a2d",
2929
filterClass: [],
3030
},
3131
{
@@ -50,7 +50,7 @@ skeletonObj.map((item) => {
5050
debug: false,
5151
debugTime: 3000,
5252
filterClass: item.filterClass,
53-
// outputPath:'./ggname'//写入你要生成的目录在哪个项目里
53+
outputPath:'/Users/lizheguang/GuangheCode/WX_H5/static/skeleton/'//写入你要生成的目录在哪个项目里
5454
});
5555
});
5656

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "awesome-skeleton",
2+
"name": "yc-skeleton",
33
"version": "0.1.3",
44
"description": "骨架图生成器",
55
"author": "",
@@ -41,6 +41,6 @@
4141
},
4242
"repository": {
4343
"type": "git",
44-
"url": "git@github.com:kaola-fed/awesome-skeleton.git"
44+
"url": "git@github.com:LiZheGuang/YC-skeleton.git"
4545
}
4646
}

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ const getSkeleton = async function(options) {
4848
const skeletonImageBase64 = await saveScreenShot(page, options);
4949

5050
// Inject the skeleton into the desired page
51-
const result = insertSkeleton(skeletonImageBase64, options);
51+
// const result = insertSkeleton(skeletonImageBase64, options);
5252

5353
// Close the browser
5454
await browser.close();
5555

56-
return result;
56+
// return result;
5757
};
5858

5959
module.exports = getSkeleton;

src/insertSkeleton.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ const insertSkeleton = (skeletonImageBase64, options) => {
2020
<html>
2121
<head>
2222
<style>
23-
// @keyframes flush {
24-
// to {
25-
// opacity: 1;
26-
// }
27-
// from {
28-
// opacity: .5;
29-
// }
30-
// }
23+
@keyframes flush {
24+
to {
25+
opacity: 1;
26+
}
27+
from {
28+
opacity: .75;
29+
}
30+
}
3131
</style>
3232
</head>
3333
<body>

0 commit comments

Comments
 (0)