Git Product home page Git Product logo

stitches's People

Contributors

draeton avatar egeriis avatar jondum avatar

Stargazers

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

Watchers

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

stitches's Issues

Support SVG

Is it possible to support SVG sprites? Fragment identifiers still don't have a lot of support.

Node cannot be inserted

Hi,

first thanks a lot for your plugin, so nice to use !

But i tried to use it on my own computer and didn't work.

So i downloaded th stitches-0.1.4 zip, unziped it, created an html page as you say.

JS and CSS are in the good folder, but when i try the page i get those 2 errors (in french) :

Erreur : mal formé
Fichier Source : file:///C:/Documents%20and%20Settings/Administrator/Desktop/stitches-0.1.4/js/stitches.html
Ligne : 10, Colonne : 75
Code Source :
< a href="javascript:void(0)" class="disabled dlsprite" target=_blank>Sprite »</ a>


Erreur : uncaught exception: [Exception... "Node cannot be inserted at the specified point in the hierarchy" code: "3" nsresult: "0x80530003 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR)" location: "file:///C:/Documents%20and%20Settings/Administrator/Desktop/stitches-0.1.4/js/jquery-1.7.1.min.js Line: 4"]

I use FF 4.0.1 (it is my working computer, cannot update FF for now)

Some Features

1-adding arrangement ability to items
2-style sheet and image download in zip or on click
3-test the style and sprite in same page to make sure the user is pretty satisfied with it.
thanks for your hard work bb

Where is the stitches.js

It says you need this to install.

<script data-main="js/stitches.js" src="js/stitches-1.3.5.min.js"></script>

I can't find stitches.js.

Help? Thanks!

Add JPG extension

Hi,

It would be interesting if there was a way to save the image-sprite in JPG and not PNG only.

Thanks!

SCSS support added

Hi, I just added SCSS support. Everything works fine except for the example. Unfortunately I cannot figure out where it fails. The problem is that the css classes are not injected to the browser. Where should I look for it? After that I can make a pull request to share :)

btw: Love this tool 💃

Support for importing settings from a local file

When using a data image it seems very difficult to copy everything properly and paste it into the text field under "import". I usually get some kind of syntax error. Ideally there would be an option to select a file from the computer to get the data from there.

I have an idea how to do this I just tested by hacking around in Chrome's DevTools so I'll submit a pull request in a bit.

alternative entry point

when using this you have 2 alternatives:

  1. use build/stitches/js/stitches-1.3.5.js, let it do its thing
  2. use src/require.js to load the src/js/module/stitches.js module, but use your own code instead of $(".stitches").each(function () { new Stitches(this) });, which is cumbersome and hard to discover.

i propose that this API is enhanced by the following:

if build/stitches/js/stitches-1.3.5.js finds some global like e.g. window.Stitches = { STUB: true }, then instead of attaching a stitches instace to every *.stitches, it replaces window.Stitches.

add render method and error template

The rendering code should be broken out from the getTemplates method. This will allow for either an error template or some other code to display to users with non-compliant browsers, or if something else goes awry.

write unit tests

The project needs some unit testing to maintain functionality between builds.

Stylus support

Hey man,

I'm sure you don't work on this much anymore, but would you accept a PR if I added in support for Stylus as well as LESS? I can make a stylus.tpl quickly and I see where to add it in utils/template.js and in js/stylesheet/ and in stitches.tpl. There appears to be enough room for a third tab/radio button.

I use Stylus almost exclusively nowadays and it takes a bit of manual editing to convert from the less stitches outputs to stylus, so it'd be awesome if it could do stylus from the get-go.

Sprite name conflicts cause unpredictable stylesheet issues

Sprites should not be allowed to have the same name. One solution is to have a flag on the sprite instances that notifies the user about a conflict.Another solution is to process incoming sprites and increment the number at the end of the name (I would probably use a /-\d+$/ convention)

Allow for custom arrangement of sprites

I want to solve this using groups (which will be assigned their own layout). If solved correctly, groups within groups shouldn't be a problem (other than processing time)...

Editing groups may be interesting... also, creating groups within groups... naturally, Adobe products will be somewhat of an inspiration here

Condense stylesheet size by using the average width and height of the sprites

Stitches successfully generated this sprite sheet:

Almost all flags are 16x11 in size, but two of them are 11x11, so the stylesheet looks like this:

.flags {
    background-image: url(spritesheet.png);
    background-repeat: no-repeat;
    display: block;
}

.flags-ad {
    width: 16px;
    height: 11px;
    background-position: 0 0;
}

/* ... */

.flags-ch {
    width: 11px;
    height: 11px;
    background-position: -192px 0;
}

The approach is simple: .flags would be 16x11 in size, and the width and height properties would be omitted in every sprite unless its size differs from the average, something like this:

.flags {
    width: 16px;
    height: 11px;
    background-image: url(spritesheet.png);
    background-repeat: no-repeat;
    display: block;
}

.flags-ad {
    background-position: 0 0;
}

/* ... */

.flags-ch {
    width: 11px;
    background-position: -192px 0;
}

Apart from that, Stitches is a great and useful tool, nice job!

fix dropfile and flashcanvas support

This tool should be supported in the major browsers, including IE and Safari. Dropfile and Flashcanvas are included, but they need to be linked up to the existing code.

Compact does not arrange images in correct order

Currently when importing more than five images while using the compact mode the images are placed in the incorrect order. Images should be arranged as

1 2 3
4 5 6
7 8

But are actually placed as

1 2 5
3 4 6
7 8

It would seem that the size of the spritesheet is not calculated beforehand but while adding each image. In the example case making the spritesheet 2x2 first until 5 images are added where it scales it to 3x3 and continues adding images in the available space.

Spritesheet blank on firefox

Spritesheet writes a blank png file when generated with firefox. Dimensions are correct but pixels are empty.

Gulp plugin

It would be nice to have stitches available as gulp plugin

Specify columns and rows

It would be awesome if you could add some options to override the amount of columns and rows you would like.

Add support for retina icons

MacBook Pros have retina screens and use double density icons. Basically a 100x100 icon would be displayed in a 50x50 space on the screen.

To support with Stitches:

  • Change default padding from 5px to 4px so it's always divisible by 2
  • Add an option to output a Retina-friendly spritesheet:
    • Include background-size: x y to resize the image, where x is half the width and y is half the height of the image (eg. background-size: 250px 100px for a 500px by 200px spritesheet)
    • Halve all the background-position values

More information: http://miekd.com/articles/using-css-sprites-to-optimize-your-website-for-retina-displays/

Change -0px to 0

The sprite editor sometimes outputs things like "background-position: -0px -0px". This could be changed to '0px' or just '0' for better, more readable CSS.

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.