SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
CSS::SpriteMaker
in Action!
London.pm Technical Meeting
London, Thursday, 19 September 2013
Savio Dimatteo
Perl Developer
Nestoria Property Search
What is a CSS Image Sprite?
image containing smaller images
+
CSS rules to render each smaller image
Example of Image Sprite
chess.png
Example of associated CSS rule set
.white-king-ico,.chess-ico,.white-knight-ico,.white-queen-ico,.chess-board-ico,.white-pawn-ico,.
black-queen-2d-ico,.white-bishop-ico,.black-king-2d-ico,.white-castle-ico { background-image: url
('chess.png'); background-repeat: no-repeat; }
.white-king-ico { background-position: 0px 0px; width: 256px; height: 256px; }
.chess-ico { background-position: -256px 0px; width: 256px; height: 256px; }
.white-knight-ico { background-position: 0px -256px; width: 256px; height: 256px; }
.white-queen-ico { background-position: -256px -256px; width: 256px; height: 256px; }
.chess-board-ico { background-position: -512px 0px; width: 256px; height: 256px; }
.white-pawn-ico { background-position: -512px -256px; width: 256px; height: 256px; }
.black-queen-2d-ico { background-position: 0px -512px; width: 256px; height: 256px; }
.white-bishop-ico { background-position: -256px -512px; width: 256px; height: 256px; }
.black-king-2d-ico { background-position: -512px -512px; width: 256px; height: 256px; }
.white-castle-ico { background-position: -768px 0px; width: 256px; height: 256px; }
style.css
<html>
<head>
<title>CSS::SpriteMaker Technique</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div class="white-knight-ico" />
</body>
</html>
Example of technique
<html>
<head>
<title>CSS::SpriteMaker Technique</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<img src="spacer.png" class="white-knight-ico" />
</body>
</html>
Example of technique
Making a Sprite
● Online batch generators
● WYSIWYG online tools
● Command-line tools written in
Java/Ruby/Python… and only recently in
Perl!
○ CSS::SpriteBuilder
CSS::SpriteMaker in Action
CSS::SpriteMaker in Action
CSS::SpriteMaker in Action
CSS::SpriteMaker in Action
CSS::SpriteMaker in Action
CSS::SpriteMaker in Action
CSS::SpriteMaker in Action
CSS::SpriteMaker in Action
CSS::SpriteMaker in Action
CSS::SpriteMaker in Action
Remove Padding
Remove Padding
Group icons: same kind same row
Group icons: same kind same row
Group icons: Nestoria map markers
Group icons: two icons per row
Group icons: two icons per row
Advanced Layouts
+
=
?
Advanced Layouts
Advanced Layouts
Advanced Layouts
Advanced Layouts
Advanced Layouts
Advanced Layouts
Advanced Layouts - Packed
Advanced Layouts - FixedDimension
Advanced Layouts - DirectoryBased
CSS Class Generation
● based on file name of input image
○ no characters collide with CSS syntax
● collisions
○ input image file name: “alice.png”
○ input image file name: “alice.gif”
○ result: .alice .alice-1
CSS Class Names Generation
CSS Sprite Viewer
…
…
CSS Sprite Viewer
Perl Modules Used
● File::Find
○ discover input images
● Module::Pluggable
○ for pluggable layouts
● Image::Magick
○ read/write/identify images
Questions?
● twitter.com/darksmo
● www.savio.dimatteo.it/talks
● github.com/darksmo
● github.com/lokku
London.pm Technical Meeting
London, Thursday, 19 September 2013
CSS::SpriteMaker
in Action!
W
e’re
hiring!
www.lokku.com
/jobs

Contenu connexe

Similaire à CSS::SpriteMaker in action!

Css sprite_maker-1
Css  sprite_maker-1Css  sprite_maker-1
Css sprite_maker-1
lokku
 
3 ways-to-create-sprites-in-rails
3 ways-to-create-sprites-in-rails3 ways-to-create-sprites-in-rails
3 ways-to-create-sprites-in-rails
Nico Hagenburger
 
Sass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IVSass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IV
Dirk Ginader
 
建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版
Joseph Chiang
 
Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)
Ontico
 
Type-safe front-end development with Scala
Type-safe front-end development with ScalaType-safe front-end development with Scala
Type-safe front-end development with Scala
takezoe
 

Similaire à CSS::SpriteMaker in action! (20)

Css sprite_maker-1
Css  sprite_maker-1Css  sprite_maker-1
Css sprite_maker-1
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + Fireworks
 
3 ways-to-create-sprites-in-rails
3 ways-to-create-sprites-in-rails3 ways-to-create-sprites-in-rails
3 ways-to-create-sprites-in-rails
 
HTML5 after the hype - JFokus2015
HTML5 after the hype - JFokus2015HTML5 after the hype - JFokus2015
HTML5 after the hype - JFokus2015
 
Images meet Web
Images meet WebImages meet Web
Images meet Web
 
Intro to CSS3
Intro to CSS3Intro to CSS3
Intro to CSS3
 
Sass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IVSass, Compass and the new tools - Open Web Camp IV
Sass, Compass and the new tools - Open Web Camp IV
 
Minimalism in Web Development
Minimalism in Web DevelopmentMinimalism in Web Development
Minimalism in Web Development
 
Refresh Tallahassee: The RE/MAX Front End Story
Refresh Tallahassee: The RE/MAX Front End StoryRefresh Tallahassee: The RE/MAX Front End Story
Refresh Tallahassee: The RE/MAX Front End Story
 
Eye Candy Without Images: Fun With CSS3
Eye Candy Without Images: Fun With CSS3Eye Candy Without Images: Fun With CSS3
Eye Candy Without Images: Fun With CSS3
 
CSS3: Ripe and Ready
CSS3: Ripe and ReadyCSS3: Ripe and Ready
CSS3: Ripe and Ready
 
Simply Responsive CSS3
Simply Responsive CSS3Simply Responsive CSS3
Simply Responsive CSS3
 
建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版建立前端開發團隊 - 2011 中華電信訓練所版
建立前端開發團隊 - 2011 中華電信訓練所版
 
CSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to RespondCSS3: Ripe and Ready to Respond
CSS3: Ripe and Ready to Respond
 
Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)Илья Пухальский (EPAM Systems)
Илья Пухальский (EPAM Systems)
 
Type-safe front-end development with Scala
Type-safe front-end development with ScalaType-safe front-end development with Scala
Type-safe front-end development with Scala
 
About Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JSAbout Best friends - HTML, CSS and JS
About Best friends - HTML, CSS and JS
 
Drawing a Circle Three Ways: Generating Graphics for the Web
Drawing a Circle Three Ways: Generating Graphics for the WebDrawing a Circle Three Ways: Generating Graphics for the Web
Drawing a Circle Three Ways: Generating Graphics for the Web
 
Keeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and WebpackKeeping the frontend under control with Symfony and Webpack
Keeping the frontend under control with Symfony and Webpack
 
パフォーマンスから考えるSass/Compassの導入・運用
パフォーマンスから考えるSass/Compassの導入・運用パフォーマンスから考えるSass/Compassの導入・運用
パフォーマンスから考えるSass/Compassの導入・運用
 

Plus de lokku

The Nestoria GeoChallenge
The Nestoria GeoChallengeThe Nestoria GeoChallenge
The Nestoria GeoChallenge
lokku
 

Plus de lokku (20)

Geocoding Overview
Geocoding OverviewGeocoding Overview
Geocoding Overview
 
OpenCage Data and sustainable business models for open data
OpenCage Data and sustainable business models for open data OpenCage Data and sustainable business models for open data
OpenCage Data and sustainable business models for open data
 
Presenting the OpenCage Geocoder at #londonapi 17 Sept 2014
Presenting the OpenCage Geocoder at #londonapi 17 Sept 2014Presenting the OpenCage Geocoder at #londonapi 17 Sept 2014
Presenting the OpenCage Geocoder at #londonapi 17 Sept 2014
 
A living hell - lessons learned in eight years of parsing real estate data
A living hell - lessons learned in eight years of parsing real estate data  A living hell - lessons learned in eight years of parsing real estate data
A living hell - lessons learned in eight years of parsing real estate data
 
Geo-search-location-based-results-for-site-search
Geo-search-location-based-results-for-site-searchGeo-search-location-based-results-for-site-search
Geo-search-location-based-results-for-site-search
 
Geocoding India - talk delivered on 31 Jan 2014 at the Bangalore goeBLR event
Geocoding India - talk delivered on 31 Jan 2014 at the Bangalore goeBLR eventGeocoding India - talk delivered on 31 Jan 2014 at the Bangalore goeBLR event
Geocoding India - talk delivered on 31 Jan 2014 at the Bangalore goeBLR event
 
Nestoria new design
Nestoria new designNestoria new design
Nestoria new design
 
Reducing the technical hurdle - why we started OpenCage Data
Reducing the technical hurdle - why we started OpenCage DataReducing the technical hurdle - why we started OpenCage Data
Reducing the technical hurdle - why we started OpenCage Data
 
Nestoria case study - The effective use of geo-data for search marketing
Nestoria case study - The effective use of geo-data for search marketingNestoria case study - The effective use of geo-data for search marketing
Nestoria case study - The effective use of geo-data for search marketing
 
The Nestoria GeoChallenge
The Nestoria GeoChallengeThe Nestoria GeoChallenge
The Nestoria GeoChallenge
 
Making using OSM data simpler - OpenCage Data
Making using OSM data simpler - OpenCage Data Making using OSM data simpler - OpenCage Data
Making using OSM data simpler - OpenCage Data
 
What’s next in mapping for portals? ppw2012
What’s next in mapping for portals? ppw2012What’s next in mapping for portals? ppw2012
What’s next in mapping for portals? ppw2012
 
How Nestoria switched to OpenStreetMap maps
How Nestoria switched to OpenStreetMap mapsHow Nestoria switched to OpenStreetMap maps
How Nestoria switched to OpenStreetMap maps
 
Remote Geocoding
Remote GeocodingRemote Geocoding
Remote Geocoding
 
Lessons learned in doing lots with few people
Lessons learned in  doing lots with few peopleLessons learned in  doing lots with few people
Lessons learned in doing lots with few people
 
Mapstraction
MapstractionMapstraction
Mapstraction
 
How People Search For Locations
How People Search For LocationsHow People Search For Locations
How People Search For Locations
 
Arbyte - A modular, flexible, scalable job queing and execution system
Arbyte - A modular, flexible, scalable job queing and execution systemArbyte - A modular, flexible, scalable job queing and execution system
Arbyte - A modular, flexible, scalable job queing and execution system
 
Planning for Debugging
Planning for DebuggingPlanning for Debugging
Planning for Debugging
 
YAPC::Europe 2008 - Mike Astle - Profiling
YAPC::Europe 2008 - Mike Astle - ProfilingYAPC::Europe 2008 - Mike Astle - Profiling
YAPC::Europe 2008 - Mike Astle - Profiling
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 

CSS::SpriteMaker in action!