Giter Site home page Giter Site logo

axis-psd's Introduction

axis-psd

export psd data positions.

install

from npm

npm install axis-psd

from github

git clone git://github.com/fnobi/axis-psd.git

usage

export with format

$ axis-psd sample.psd
[{"name":"baloon2-1.png","width":289,"height":313,"top":841,"left":439,"right":728,"bottom":1154},{"name":"baloon1-2.png","width":314,"height":337,"top":378,"left":418,"right":732,"bottom":715},{"name":"koma2.png","width":718,"height":428,"top":625,"left":4,"right":722,"bottom":1053},{"name":"koma1.png","width":693,"height":478,"top":119,"left":28,"right":721,"bottom":597}]
$ axis-psd --format css sample.psd
.layer[data-layer="koma1"] {
    left: 28px;
    top: 119px;
    width: 693px;
    height: 478px;
    background-image: url("koma1.png");
}
.layer[data-layer="koma2"] {
    left: 4px;
    top: 625px;
    width: 718px;
    height: 428px;
    background-image: url("koma2.png");
}
.layer[data-layer="baloon1-2"] {
    left: 418px;
    top: 378px;
    width: 314px;
    height: 337px;
    background-image: url("baloon1-2.png");
}
.layer[data-layer="baloon2-1"] {
    left: 439px;
    top: 841px;
    width: 289px;
    height: 313px;
    background-image: url("baloon2-1.png");
}
$ axis-psd --format pug sample.psd
.layer(data-layer="koma1")
.layer(data-layer="koma2")
.layer(data-layer="baloon1-2")
.layer(data-layer="baloon2-1")

customize for css

$ axis-psd --ratio 0.5 --format css --image-dir assets/ --sass-image-function image-url --base-selector '&'
&[data-layer="koma1"] {
    left: 14px;
    top: 59.5px;
    width: 346.5px;
    height: 239px;
    background-image: image-url("assets/koma1.png");
}
&[data-layer="koma2"] {
    left: 2px;
    top: 312.5px;
    width: 359px;
    height: 214px;
    background-image: image-url("assets/koma2.png");
}
&[data-layer="baloon1-2"] {
    left: 209px;
    top: 189px;
    width: 157px;
    height: 168.5px;
    background-image: image-url("assets/baloon1-2.png");
}
&[data-layer="baloon2-1"] {
    left: 219.5px;
    top: 420.5px;
    width: 144.5px;
    height: 156.5px;
    background-image: image-url("assets/baloon2-1.png");
}

axis-psd's People

Contributors

fnobi avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar  avatar

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.