PHP Classes
elePHPant
Icontem

CSS sprite class: Generate sprite images and CSS to use image styles

Recommend this page to a friend!
  Info   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2011-04-25 (8 years ago) RSS 2.0 feedStarStarStarStar 65%Total: 1,467 This week: 1All time: 2,630 This week: 366Up
Version License PHP version Categories
css-sprite-class 1.0.0GNU General Publi...5.0HTML, PHP 5, Graphics
Description Author

This class can be used to generate sprite images and CSS to use image styles to use the sprites in Web pages.

It can take a list of images and generates a single sprite image with all the images inside.

The class can also generate CSS style definitions to use in Web pages that need to use the images from the generated sprite image.

Innovation Award
PHP Programming Innovation award nominee
October 2010
Number 2


Prize: One book of choice by Packt
Web pages with many images force the browser to make too many requests to the Web server.

An alternative solution to reduce the number of requests consists in assembling several images into a single sprite image. Then use CSS styles that define how to clip each image from the sprite and use the image in the Web pages.

This class implements a PHP solution to assemble sprite from a list of images and the necessary CSS styles to use the images in the pages.

Manuel Lemos
  Performance   Level  
Name: Arturs Sosins <contact>
Classes: 22 packages by
Country: Latvia Latvia
Age: 31
All time rank: 581 in Latvia Latvia
Week rank: 41 Up1 in Latvia Latvia Equal
Innovation award
Innovation award
Nominee: 13x

Winner: 2x

  Files folder image Files  
File Role Description
Files folder imageexamples (3 files)
Files folder imagetest_images (3 files)
Plain text file css_sprite.class.php Class Main class file

  Files folder image Files  /  examples  
File Role Description
  Accessible without login Plain text file css_code_example.php Example CSS code generation example
  Accessible without login Plain text file download_sprite_example.php Example CSS sprite forcing download example
  Accessible without login Plain text file image_output_example.php Example CSS sprite output example

  Files folder image Files  /  test_images  
File Role Description
  Accessible without login Image file elephpant.png Icon Test png file
  Accessible without login Image file php.gif Icon Test gif file
  Accessible without login Image file php.jpg Icon Test jpg file

 Version Control Unique User Downloads Download Rankings  
 0%
Total:1,467
This week:1
All time:2,630
This week:366Up
User Ratings User Comments (1)
 All time
Utility:93%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:-
Examples:93%StarStarStarStarStar
Tests:-
Videos:-
Overall:65%StarStarStarStar
Rank:813
 
Very nicely done.
8 years ago (Tom Carnevale)
70%StarStarStarStar