GithubHelp home page GithubHelp logo

cupools / lia Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 3.0 392 KB

Sprite tool that output sprite images and stylesheet files base on configured images, supports rem

License: MIT License

JavaScript 99.01% HTML 0.99%

lia's People

Contributors

cupools avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lia's Issues

Not support Windows.

Cause by incorrect usage of child_process.execFileSync, it will exactly throw new TypeError('invalid data') in Windows.

Easier and stronger template supports

Now it seems not friendly in using wrap and tmpl. Maybe with Handlebars a template looks like follows and wrap is not necessary anymore.

// sprites.tmpl
{
    path: '{{path}}',
    size: '{{size}}'
    items: [
    {{#list items}}
    {
        name: '{{name}}',
        selector: '{{selector}}',
        size: '{{size}}',
    },
    {{/list}}
    ]
}
// output
{
    path: 'build/foo.png',
    size: {
        width: 50,
        height: 100
    },
    items: [{
        name: 'one',
        selector: 'sp-one',
        size: {
            width: 50,
            height: 30
        }
    }, {
        name: 'two',
        selector: 'sp-two',
        size: {
            width: 50,
            height: 70
        }
    }]
}

New features with psd in v2.1.0

New features will come in v2.1.0 and the code is now in branch feature-psd

  • Supports output sprite images base on psd layer instead of file path. New option psd is necessary and src will be a pattern mapped to layer name
  • Build sprite images for keyframes animation base on psd group
  • Layer information from psd in template context
  • New CLI command to output each layer as .png images directly from psd.
  • Test coverage

生成图片时报错,缺少images/vendor

运行lia时报错

fs.js:114
    throw err;
    ^

Error: ENOENT: no such file or directory, scandir '/usr/local/lib/node_modules/lia/node_modules/images/vendor'
    at Object.readdirSync (fs.js:790:3)
    at Object.getInstalledBinaries (/usr/local/lib/node_modules/lia/node_modules/images/scripts/util/extensions.js:130:13)
    at foundBinariesList (/usr/local/lib/node_modules/lia/node_modules/images/scripts/util/errors.js:21:21)
    at foundBinaries (/usr/local/lib/node_modules/lia/node_modules/images/scripts/util/errors.js:16:5)
    at Object.module.exports.missingBinary (/usr/local/lib/node_modules/lia/node_modules/images/scripts/util/errors.js:46:5)
    at module.exports (/usr/local/lib/node_modules/lia/node_modules/images/scripts/util/binding.js:20:30)
    at Object.<anonymous> (/usr/local/lib/node_modules/lia/node_modules/images/index.js:32:51)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.