2017 © Pedro Peláez
 

library minisprite

MiniSprite CSS sprites generator

image

rm/minisprite

MiniSprite CSS sprites generator

  • Tuesday, May 20, 2014
  • by romanmatyus
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

MiniSprite

Build Status Code Quality, (*1)

MiniSprite is library for automatized generating CSS Sprites from CSS definitions., (*2)

 Requirements

MiniSprite requires PHP 5.3.3 or later., (*3)

 How does this work?

  • Configure.
  • Parse CSS input.
  • Create Sprite image folding proposals.
  • Select winner proposal.
  • Generate Sprite images.
  • Regenerate content of CSS input and return it.

 Installation

The best way to install MiniSprite is use Composer package rm/minisprite or manual download the latest ZIP package from GitHub., (*4)

The downloaded package includes the following directories:, (*5)

  • src: this directory contains the source code of MiniSprite. This is the only directory that you will need in order to deploy your application., (*6)

  • tests: contains MiniSprite unit tests. Tests is too usable as examples od use case., (*7)

 Getting started

namespace MiniSprite;

require __DIR__ . '/MiniSprite/vendor/autoload.php';

$miniSprite = new MiniSprite;

// Configuration of Minisprite.
$miniSprite->setImageDirSource("http://www.umb.sk"); // Base path for searching images in CSS content.
$miniSprite->setImageDirOutput("./"); // Directory for saving sprite images.
$miniSprite->setImageDirOutputCss("./"); // Relative path for link of sprite images in regenerated CSS content.

// Registration of folding algorithms.
$miniSprite->addFolder(new HorizontalFolder);
$miniSprite->addFolder(new VerticalFolder);

// Registration of analyzer for winner selection.
$miniSprite->setAnalyzer(new MinimalAreaAnalyzer);

// Call compilation.
// In the variable $newCSS is content of regenerated CSS input.
$newCss = $miniSprite->compile(file_get_contents("http://www.umb.sk/umb/umbbb.nsf/styl.css"));

 Contributing

  • Use it!
  • Write bug reports of ideas into Issue tracker.
  • Fork repos and send pull requests with number of issue, source code and tests.

 Todo

  • Find and solve bugs.
  • Create new folding algorithms.
  • Create online API.
  • Propagate.

 Contact

Roman Mátyus romanmatyus@romiix.org, (*8)

The Versions

20/05 2014

dev-master

9999999-dev http://github.com/romanmatyus/MiniSprite

MiniSprite CSS sprites generator

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires