Hello, sass-spritemaker!

master v1.0.0
Tomek Wójcik 2019-01-10 08:07:53 +01:00
当前提交 fc60ab110d
共有 151 个文件被更改,包括 2530 次插入0 次删除

52
.eslintrc.json Normal file
查看文件

@ -0,0 +1,52 @@
{
"env": {
"node": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"impliedStrict": true
}
},
"rules": {
"no-undef": "error",
"quotes": [
2, "single", {"avoidEscape": true, "allowTemplateLiterals": true}
],
"no-unused-vars": [0],
"no-console": [2],
"no-empty": ["error", {"allowEmptyCatch": true}],
"array-bracket-spacing": ["error", "never"],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", {"allowSingleLine": true}],
"camelcase": ["error", {"properties": "never"}],
"comma-dangle": ["error", "never"],
"comma-spacing": ["error", {"before": false, "after": true}],
"comma-style": ["error", "last"],
"computed-property-spacing": ["error", "never"],
"key-spacing": [
"error", {"beforeColon": false, "afterColon": true, "mode": "strict"}
],
"keyword-spacing": ["error", { "before": true, "after": true }],
"linebreak-style": ["error", "unix"],
"max-len": ["error", 120],
"no-multiple-empty-lines": ["error"],
"no-spaced-func": ["error"],
"no-trailing-spaces": ["error"],
"no-unreachable": [1],
"no-whitespace-before-property": ["error"],
"object-curly-spacing": ["error", "never"],
"one-var-declaration-per-line": ["error", "always"],
"one-var": ["error", "never"],
"semi-spacing": ["error", {"before": false, "after": true}],
"semi": ["error", "always"],
"space-before-function-paren": ["error", "always"],
"space-before-blocks": ["error", "always"],
"space-in-parens": ["error", "never"],
"space-infix-ops": ["error"],
"unicode-bom": ["error", "never"]
}
}

5
.gitignore vendored Normal file
查看文件

@ -0,0 +1,5 @@
example/.sass-cache/
example/output/sprite*
node_modules/
tmp_spritemaker*/
bthlabs-sass-spritemaker-*.tgz

5
.npmignore Normal file
查看文件

@ -0,0 +1,5 @@
example/**/*
test/**/*
yarn.lock
.eslintrc.json
bthlabs-sass-spritemaker-*.tgz

19
LICENSE Normal file
查看文件

@ -0,0 +1,19 @@
Copyright (c) 2019-present Tomek Wójcik <contact@bthlabs.pl>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

29
NOTICE.txt Normal file
查看文件

@ -0,0 +1,29 @@
sass-spritemaker
Copyright (c) 2019-present Tomek Wójcik <contact@bthlabs.pl>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
---
sass-spritemaker includes the following third party software and resources
Linea Iconset
Copyright (c) Dario Ferrando
Licensed under terms of CCBY license
http://creativecommons.org/licenses/by/4.0/

67
README.md Normal file
查看文件

@ -0,0 +1,67 @@
# sass-spritemaker
Convert a bunch of PNGs to a Sass spritemap.
## Installation
sass-spritemaker requires **Node 6.9.0 or later**.
```
npm install --save-dev @bthlabs/sass-spritemaker
```
This assumes that you’re using [npm](http://npmjs.com/) package manager.
sass-spritemaker supports [yarn](https://yarnpkg.com/), too.
## Usage example
The following JavaScript code demonstrates the most common usage of the
library:
```javascript
const {spritemaker} = require('../lib/spritemaker.js');
spritemaker({
files: ['./icons/*.png'],
output: './output/'
});
```
## API
### `spritemaker(options)`
This is the main entrypoint of the library. The *options* argument is an object
that specifies the function's behaviour.
**Options object fields**:
* `fields` - array of globs that will be resolved to construct input files
list. Defaults to `[]`.
* `output` - path to output directory. Defaults to `sprite/`.
* `urlPrefix` - URL prefix for background image URLs. Defaults to `/`.
## Development
To bootstrap the development environment, clone the repo and run `npm install`
from the root directory.
The `package.json` file provides the following scripts:
* `lint` - performs an eslint run over the source code,
* `test` - performs a single test run.
## Contributing
If you think you found a bug or want to send a patch, feel free to contact
me through e-mail.
If you're sending a patch, make sure it passes eslint checks and is tested.
## Author
sass-spritemaker is developed by [Tomek Wójcik](https://www.bthlabs.pl/).
## License
sass-spritemaker is licensed under the MIT License.

28
example/example.js Normal file
查看文件

@ -0,0 +1,28 @@
/**
* Copyright (c) 2019-present Tomek Wójcik <contact@bthlabs.pl>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
const {spritemaker} = require('../lib/spritemaker.js');
spritemaker({
files: ['./icons/*.png'],
output: './output/'
});

二进制
example/icons/basic_accelerator.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.2 KiB

二进制
example/icons/basic_alarm.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.1 KiB

二进制
example/icons/basic_anchor.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 824 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 964 B

二进制
example/icons/basic_archive.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 741 B

二进制
example/icons/basic_archive_full.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 782 B

二进制
example/icons/basic_ban.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 952 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 464 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 368 B

二进制
example/icons/basic_battery_full.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 287 B

二进制
example/icons/basic_battery_half.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 367 B

二进制
example/icons/basic_bolt.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 962 B

二进制
example/icons/basic_book.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 274 B

二进制
example/icons/basic_book_pen.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 406 B

二进制
example/icons/basic_book_pencil.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 389 B

二进制
example/icons/basic_bookmark.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 400 B

二进制
example/icons/basic_calculator.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 462 B

二进制
example/icons/basic_calendar.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 339 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.1 KiB

二进制
example/icons/basic_cards_hearts.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.1 KiB

二进制
example/icons/basic_case.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 413 B

二进制
example/icons/basic_chronometer.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 923 B

二进制
example/icons/basic_clessidre.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 543 B

二进制
example/icons/basic_clock.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 943 B

二进制
example/icons/basic_clockwise.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 963 B

二进制
example/icons/basic_cloud.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 770 B

二进制
example/icons/basic_clubs.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.1 KiB

二进制
example/icons/basic_compass.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.1 KiB

二进制
example/icons/basic_cup.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 625 B

二进制
example/icons/basic_diamonds.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 597 B

二进制
example/icons/basic_display.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 262 B

二进制
example/icons/basic_download.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 410 B

二进制
example/icons/basic_exclamation.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 821 B

二进制
example/icons/basic_eye.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 643 B

二进制
example/icons/basic_eye_closed.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 892 B

二进制
example/icons/basic_female.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 885 B

二进制
example/icons/basic_flag1.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 368 B

二进制
example/icons/basic_flag2.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 446 B

二进制
example/icons/basic_floppydisk.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 425 B

二进制
example/icons/basic_folder.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 320 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 385 B

二进制
example/icons/basic_gear.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 732 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.0 KiB

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 935 B

二进制
example/icons/basic_globe.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 895 B

二进制
example/icons/basic_gunsight.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 753 B

二进制
example/icons/basic_hammer.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 650 B

二进制
example/icons/basic_headset.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 836 B

二进制
example/icons/basic_heart.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 961 B

二进制
example/icons/basic_heart_broken.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.1 KiB

二进制
example/icons/basic_helm.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1.2 KiB

二进制
example/icons/basic_home.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 438 B

二进制
example/icons/basic_info.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 824 B

二进制
example/icons/basic_ipod.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 552 B

二进制
example/icons/basic_joypad.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 731 B

二进制
example/icons/basic_key.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 553 B

二进制
example/icons/basic_keyboard.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 304 B

二进制
example/icons/basic_laptop.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 275 B

二进制
example/icons/basic_life_buoy.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 921 B

二进制
example/icons/basic_lightbulb.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 993 B

二进制
example/icons/basic_link.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 843 B

二进制
example/icons/basic_lock.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 621 B

二进制
example/icons/basic_lock_open.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 627 B

二进制
example/icons/basic_magic_mouse.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 579 B

二进制
example/icons/basic_magnifier.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 816 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 828 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 845 B

二进制
example/icons/basic_mail.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 514 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 530 B

二进制
example/icons/basic_mail_open.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 643 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 664 B

二进制
example/icons/basic_male.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 850 B

二进制
example/icons/basic_map.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 577 B

二进制
example/icons/basic_message.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 439 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 440 B

二进制
example/icons/basic_message_txt.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 456 B

二进制
example/icons/basic_mixer2.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 492 B

二进制
example/icons/basic_mouse.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 655 B

二进制
example/icons/basic_notebook.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 286 B

二进制
example/icons/basic_notebook_pen.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 442 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 414 B

二进制
example/icons/basic_paperplane.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1014 B

二进制
example/icons/basic_pencil_ruler.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 627 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 548 B

二进制
example/icons/basic_photo.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 570 B

二进制
example/icons/basic_picture.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 711 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 717 B

二进制
example/icons/basic_pin1.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 656 B

二进制
example/icons/basic_pin2.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 590 B

二进制
example/icons/basic_postcard.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 301 B

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 331 B

二进制
example/icons/basic_printer.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 325 B

二进制
example/icons/basic_question.png Normal file

二进制文件未显示。

之后

宽度:  |  高度:  |  大小: 1010 B

某些文件未显示,因为此 diff 中更改的文件太多 显示更多