Skip to content

pmaxs/css-sprite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSS sprite generator.

Installation

composer require pmaxs/css-sprite

Usage

<?php
require '../vendor/autoload.php';

$CssSprite = new \Pmaxs\CssSprite\Sprite();
$CssSprite->addFiles([
    __DIR__ . '/data1',
    __DIR__ . '/data2',
    __DIR__ . '/anonymous.png',
    __FILE__
]);
$CssSprite->process();

echo "<img src='data:image/png;base64," . base64_encode($CssSprite->getSprite()) . "' />";
echo "<p></p>";
echo $CssSprite->getStyle();