• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

danielhusar/gulp-local-screenshots: Do the screenshots of your static html files

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

danielhusar/gulp-local-screenshots

开源软件地址(OpenSource Url):

https://github.com/danielhusar/gulp-local-screenshots

开源编程语言(OpenSource Language):

JavaScript 87.0%

开源软件介绍(OpenSource Introduction):

gulp-local-screenshots Build Status

This plugin will make the screenshots of your static html files using phantomjs. (make sure you have phantomjs installed on your machine)

Install

npm install --save-dev gulp-local-screenshots

Example

var 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/'));
});

Options

path

Type: String
Default: 'public/'

Path from which the static files are served (Trailing slash at the end is required.)

port

Type: Number
Default: '8080'

Port for the static web server

width

Type: Array
Default: ['1024']

Array of page widths to make screenshots (for the responsive website)

height

Type: String
Default: '10'

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)

type

Type: String
Default: 'jpg'

Output image extension

folder

Type: String
Default: 'screens'

Folder where to put images

timeout

Type: Number
Default: '200'

Timeout between files, in most cases you dont need to change that

protocol

Type: String
Default: 'http'

Protocol that will be used in phantom.js

host

Type: String
Default: 'localhost'

Host that will be used in phantom.js

server

Type: Boolean
Default: 'true'

If plugin should start local web server (otherwise you should start your web server by yourself, or specify host option for some remote server)

zoom

Type: Number
Default: '1'

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).

suffix

Type: String
Default: 'false'

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.

Demo

Demo

License

MIT © Daniel Husar




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
terrierscript/gulp-unzip发布时间:2022-06-21
下一篇:
willianjusten/Fast: A simple boilerplate to create projects with Jade, Stylus, G ...发布时间:2022-06-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap