在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):danielhusar/gulp-local-screenshots开源软件地址(OpenSource Url):https://github.com/danielhusar/gulp-local-screenshots开源编程语言(OpenSource Language):JavaScript 87.0%开源软件介绍(OpenSource Introduction):gulp-local-screenshotsThis plugin will make the screenshots of your static html files using phantomjs. (make sure you have phantomjs installed on your machine) Install
Examplevar gulp = require('gulp');
var localScreenshots = require('gulp-local-screenshots');
gulp.task('screens', function () {
gulp.src('./public/*.html')
.pipe(localScreenshots({
width: ['1600', '1000', '480', '320']
}))
.pipe(gulp.dest('./public/'));
}); OptionspathType: Path from which the static files are served (Trailing slash at the end is required.) portType: Port for the static web server widthType: Array of page widths to make screenshots (for the responsive website) heightType: Height of the page, if the actual page heights is more than that it, iamge will have actual page height. (specifing height is good for testing) typeType: Output image extension folderType: Folder where to put images timeoutType: Timeout between files, in most cases you dont need to change that protocolType: Protocol that will be used in phantom.js hostType: Host that will be used in phantom.js serverType: If plugin should start local web server (otherwise you should start your web server by yourself, or specify host option for some remote server) zoomType: Zoom level to set the phantom.js browser viewport. Can be used to take 2x, 3x, etc. screen shots. Widths, heights and output file name remain as specified, but the resulting image will be * 'zoom' pixels. E.g. specify 320 width, zoom level 2: output file will be 320px of page content, but at twice the resolution (640px wide). suffixType: A custom suffix for output file name, you can use -thumb, -shot, etc. And the output file will named source-file-name + custom-suffix. If no suffix set, will use default suffix. DemoLicenseMIT © Daniel Husar |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论