SlideShare a Scribd company logo
1 of 16
Download to read offline
New Features
       ✓ Snow ThemeRoller
       ✓ Speed Improvements
            ★ Server Image Generation: 40 – 50x faster
            ★ Removed ImageMagick Dependency
            ★ Client Image & CSS Generation:
              Almost Instant Feedback
       ✓ JSON Structure: Nested, Overridable
       ✓ Updated Bookmarklet
            ★ More Browser Support
            ★ Offline Support

Pixel Graphic Design Studio
Server Side Image Generation
       ✓ Removed ImageMagick dependency
            ★ PHP GD
            ★ Optipng
       ✓ Icons: Precompiled




Pixel Graphic Design Studio
Client Side CSS Generation
       ✓ Use Strategies
            ★ Inline Style Changes
                  $(".ui-icon").css({ ... })

            ★ Rule Editing
            ★ Style Tags
                  $("head").append("<style ...></style>")




Pixel Graphic Design Studio
Client Side CSS Generation
       ✓ Templating/Replacement
            ★ Simple Tokens
                  #aaaaaa/*{header.b}*/
                  normal/*{font.w}*/

            ★ Same as server replacement




Pixel Graphic Design Studio
Client Side CSS Generation

       var file               =   $.Themeroller.CSS[version],
          tokens              =   base.to_tokens(),
          regex               =   /s+S+/*{([^}*/]+)}*//gi,
          css                 =   file.replace(regex, function(m,k,v){
                                      return ' ' + tokens[k];
                                  });




Pixel Graphic Design Studio
Client Side CSS Generation

     var tokens = [
          "header.bg.c" = "#fff",
          "header.bg.i" = "#a00",
          "header.bg.b" = "#00a",
          "header.bg.tx.repeat" = "repeat-x"
          ...
       ];




Pixel Graphic Design Studio
Client Side CSS Generation

     $("head #themeroller-stylesheet")
         .replaceWith(
             "<style type='text/css'
                     media='screen'
                        id='themeroller-stylesheet'>"
             + css +
             "</style>");




Pixel Graphic Design Studio
Client Side Image Generation
       ✓ New Images
            ★ Stamping: Take an icon template, and change the colors
            ★ Layering: Merge a texture with a solid color
       ✓ Application to CSS
            ★ Needed the image in a URL format




Pixel Graphic Design Studio
Client Side Image Generation
       ✓ HTML5 Canvas
            ★ Supported Composite Modes
            ★ toDataURL
            ★ Built in PNG support




Pixel Graphic Design Studio
HTML5 Canvas Workflow
       1. Load the template image
       2. Create a canvas
       3. Size the canvas (Clears existing content)
       4. Set the composite mode and opacity
       5. Draw the template image
       6. Return the dataURL
       7. Add the dataURL to the CSS




Pixel Graphic Design Studio
Creating the Icons
     var canvas = document.createElement('canvas'),
         context = canvas.getContext('2d');

     function makeImage( color ){
       canvas.width = 100;
       canvas.height = 100;

         canvas.fillStyle = color;
         canvas.fillRect(0, 0, 100, 100);

         context.globalCompositeOperation = "destination-out";
         context.drawImage(img, 0, 0);

         return canvas.toDataURL('image/png')
     }




Pixel Graphic Design Studio
http://github.com/dcneiner/html5-demo
Fallback Support
       ✓ Build the support on the server first
       ✓ Work out a clean URL strategy
       ✓ Use feature detection to test for Canvas support
       ✓ Since DataURL is a URL, you can use a real path and the
         base64 data interchangeably.




Pixel Graphic Design Studio
Send as Little Data as Needed
       ✓ Send JSON, not HTML, wherever possible
       ✓ Provide overrides instead of full data wherever possible
            ★ You can override any default theme
            ★ Merge on the server




Pixel Graphic Design Studio
TWITTER   @dougneiner

  EMAIL   doug@pixelgraphics.us

TUMBLR    http://dougneiner.com

   WEB    http://pixelgraphics.us

More Related Content

What's hot

アイドルだって WordPressが好き! ~アイドル公式サイトに見るテーマ実装例~
アイドルだって WordPressが好き! ~アイドル公式サイトに見るテーマ実装例~アイドルだって WordPressが好き! ~アイドル公式サイトに見るテーマ実装例~
アイドルだって WordPressが好き! ~アイドル公式サイトに見るテーマ実装例~tecking
 
Responsive images, an html 5.1 standard
Responsive images, an html 5.1 standardResponsive images, an html 5.1 standard
Responsive images, an html 5.1 standardAndrea Verlicchi
 
Power your website with Windows Azure
Power your website with Windows AzurePower your website with Windows Azure
Power your website with Windows AzureJoão Pedro Martins
 
2022.04 - CSS Day IT - Images Optimisation 4.0
2022.04 - CSS Day IT - Images Optimisation 4.02022.04 - CSS Day IT - Images Optimisation 4.0
2022.04 - CSS Day IT - Images Optimisation 4.0Andrea Verlicchi
 
Images meet Web
Images meet WebImages meet Web
Images meet Web傑倫 鍾
 
The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210Mahmoud Samir Fayed
 
The status of living HTML (highlights)
The status of living HTML (highlights)The status of living HTML (highlights)
The status of living HTML (highlights)ourmaninjapan
 
Steph's Html5 and css presentation
Steph's Html5 and css presentationSteph's Html5 and css presentation
Steph's Html5 and css presentationstephy123123
 
LinkedIn image and video specifications
LinkedIn image and video specifications LinkedIn image and video specifications
LinkedIn image and video specifications Vanilla Skills
 
JS Fest 2018. Илья Иванов. Введение в React-Native
JS Fest 2018. Илья Иванов. Введение в React-NativeJS Fest 2018. Илья Иванов. Введение в React-Native
JS Fest 2018. Илья Иванов. Введение в React-NativeJSFestUA
 
GWT.create 2013: Introduction to GXT
GWT.create 2013: Introduction to GXTGWT.create 2013: Introduction to GXT
GWT.create 2013: Introduction to GXTniloc132
 

What's hot (14)

アイドルだって WordPressが好き! ~アイドル公式サイトに見るテーマ実装例~
アイドルだって WordPressが好き! ~アイドル公式サイトに見るテーマ実装例~アイドルだって WordPressが好き! ~アイドル公式サイトに見るテーマ実装例~
アイドルだって WordPressが好き! ~アイドル公式サイトに見るテーマ実装例~
 
Responsive images, an html 5.1 standard
Responsive images, an html 5.1 standardResponsive images, an html 5.1 standard
Responsive images, an html 5.1 standard
 
Power your website with Windows Azure
Power your website with Windows AzurePower your website with Windows Azure
Power your website with Windows Azure
 
2022.04 - CSS Day IT - Images Optimisation 4.0
2022.04 - CSS Day IT - Images Optimisation 4.02022.04 - CSS Day IT - Images Optimisation 4.0
2022.04 - CSS Day IT - Images Optimisation 4.0
 
Images meet Web
Images meet WebImages meet Web
Images meet Web
 
Html5 n css3
Html5 n css3Html5 n css3
Html5 n css3
 
Html5
Html5Html5
Html5
 
The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210The Ring programming language version 1.9 book - Part 49 of 210
The Ring programming language version 1.9 book - Part 49 of 210
 
The status of living HTML (highlights)
The status of living HTML (highlights)The status of living HTML (highlights)
The status of living HTML (highlights)
 
Html 5
Html 5Html 5
Html 5
 
Steph's Html5 and css presentation
Steph's Html5 and css presentationSteph's Html5 and css presentation
Steph's Html5 and css presentation
 
LinkedIn image and video specifications
LinkedIn image and video specifications LinkedIn image and video specifications
LinkedIn image and video specifications
 
JS Fest 2018. Илья Иванов. Введение в React-Native
JS Fest 2018. Илья Иванов. Введение в React-NativeJS Fest 2018. Илья Иванов. Введение в React-Native
JS Fest 2018. Илья Иванов. Введение в React-Native
 
GWT.create 2013: Introduction to GXT
GWT.create 2013: Introduction to GXTGWT.create 2013: Introduction to GXT
GWT.create 2013: Introduction to GXT
 

Similar to Themeroller 2.0: Refactoring for Speed

Canvas in html5 - TungVD
Canvas in html5 - TungVDCanvas in html5 - TungVD
Canvas in html5 - TungVDFramgia Vietnam
 
SharePoint Patterns & Practices - PnP Core and PnP PowerShell SIG - 7th of Oc...
SharePoint Patterns & Practices - PnP Core and PnP PowerShell SIG - 7th of Oc...SharePoint Patterns & Practices - PnP Core and PnP PowerShell SIG - 7th of Oc...
SharePoint Patterns & Practices - PnP Core and PnP PowerShell SIG - 7th of Oc...SharePoint Patterns and Practices
 
New Elements & Features in CSS3
New Elements & Features in CSS3New Elements & Features in CSS3
New Elements & Features in CSS3Jamshid Hashimi
 
Next Steps in Responsive Design
Next Steps in Responsive DesignNext Steps in Responsive Design
Next Steps in Responsive DesignJustin Avery
 
HTML5 for ASP.NET Developers
HTML5 for ASP.NET DevelopersHTML5 for ASP.NET Developers
HTML5 for ASP.NET DevelopersJustin Lee
 
PnP Webcast - Introduction to SharePoint Site Designs and Site Scripts
PnP Webcast - Introduction to SharePoint Site Designs and Site ScriptsPnP Webcast - Introduction to SharePoint Site Designs and Site Scripts
PnP Webcast - Introduction to SharePoint Site Designs and Site ScriptsSharePoint Patterns and Practices
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Erin M. Kidwell
 
Responsive WordPress workflow
Responsive WordPress workflowResponsive WordPress workflow
Responsive WordPress workflowJames Bundey
 
Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"Lviv Startup Club
 
Back to the 90s' - Revenge of the static website
Back to the 90s' - Revenge of the static websiteBack to the 90s' - Revenge of the static website
Back to the 90s' - Revenge of the static websiteYves Goeleven
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondAndy Stratton
 
Artdm 170 week15 publishing
Artdm 170 week15 publishingArtdm 170 week15 publishing
Artdm 170 week15 publishingGilbert Guerrero
 
We All Live in a Yellow (Serverless) Submarine
We All Live in a Yellow (Serverless) SubmarineWe All Live in a Yellow (Serverless) Submarine
We All Live in a Yellow (Serverless) SubmarineFITC
 
Brand Your Community Using Less and Gulp
Brand Your Community Using Less and GulpBrand Your Community Using Less and Gulp
Brand Your Community Using Less and Gulpshujiui
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksNathan Smith
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAmir Barylko
 
NZYP Project Casestudy using SilverStripe CMS
NZYP Project Casestudy using SilverStripe CMSNZYP Project Casestudy using SilverStripe CMS
NZYP Project Casestudy using SilverStripe CMSCam Findlay
 
Core Web Vitals Optimization for any website, especially WordPress
Core Web Vitals Optimization for any website, especially WordPressCore Web Vitals Optimization for any website, especially WordPress
Core Web Vitals Optimization for any website, especially WordPressClementYo
 

Similar to Themeroller 2.0: Refactoring for Speed (20)

Canvas in html5 - TungVD
Canvas in html5 - TungVDCanvas in html5 - TungVD
Canvas in html5 - TungVD
 
SharePoint Patterns & Practices - PnP Core and PnP PowerShell SIG - 7th of Oc...
SharePoint Patterns & Practices - PnP Core and PnP PowerShell SIG - 7th of Oc...SharePoint Patterns & Practices - PnP Core and PnP PowerShell SIG - 7th of Oc...
SharePoint Patterns & Practices - PnP Core and PnP PowerShell SIG - 7th of Oc...
 
New Elements & Features in CSS3
New Elements & Features in CSS3New Elements & Features in CSS3
New Elements & Features in CSS3
 
Next Steps in Responsive Design
Next Steps in Responsive DesignNext Steps in Responsive Design
Next Steps in Responsive Design
 
HTML5 for ASP.NET Developers
HTML5 for ASP.NET DevelopersHTML5 for ASP.NET Developers
HTML5 for ASP.NET Developers
 
PnP Webcast - Introduction to SharePoint Site Designs and Site Scripts
PnP Webcast - Introduction to SharePoint Site Designs and Site ScriptsPnP Webcast - Introduction to SharePoint Site Designs and Site Scripts
PnP Webcast - Introduction to SharePoint Site Designs and Site Scripts
 
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
Girl Develop It Cincinnati: Intro to HTML/CSS Class 4
 
Responsive WordPress workflow
Responsive WordPress workflowResponsive WordPress workflow
Responsive WordPress workflow
 
Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"
 
Back to the 90s' - Revenge of the static website
Back to the 90s' - Revenge of the static websiteBack to the 90s' - Revenge of the static website
Back to the 90s' - Revenge of the static website
 
Trendsetting: Web Design and Beyond
Trendsetting: Web Design and BeyondTrendsetting: Web Design and Beyond
Trendsetting: Web Design and Beyond
 
Artdm 170 week15 publishing
Artdm 170 week15 publishingArtdm 170 week15 publishing
Artdm 170 week15 publishing
 
We All Live in a Yellow (Serverless) Submarine
We All Live in a Yellow (Serverless) SubmarineWe All Live in a Yellow (Serverless) Submarine
We All Live in a Yellow (Serverless) Submarine
 
Brand Your Community Using Less and Gulp
Brand Your Community Using Less and GulpBrand Your Community Using Less and Gulp
Brand Your Community Using Less and Gulp
 
Adobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + FireworksAdobe MAX 2008: HTML/CSS + Fireworks
Adobe MAX 2008: HTML/CSS + Fireworks
 
Awesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescriptAwesome html with ujs, jQuery and coffeescript
Awesome html with ujs, jQuery and coffeescript
 
Drawing images
Drawing imagesDrawing images
Drawing images
 
NZYP Project Casestudy using SilverStripe CMS
NZYP Project Casestudy using SilverStripe CMSNZYP Project Casestudy using SilverStripe CMS
NZYP Project Casestudy using SilverStripe CMS
 
Core Web Vitals Optimization for any website, especially WordPress
Core Web Vitals Optimization for any website, especially WordPressCore Web Vitals Optimization for any website, especially WordPress
Core Web Vitals Optimization for any website, especially WordPress
 
Presentation Tier optimizations
Presentation Tier optimizationsPresentation Tier optimizations
Presentation Tier optimizations
 

Recently uploaded

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
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, Adobeapidays
 
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...apidays
 
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 businesspanagenda
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
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 educationjfdjdjcjdnsjd
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
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 Pakistandanishmna97
 
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 FMESafe Software
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
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 WoodJuan lago vázquez
 

Recently uploaded (20)

Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
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
 
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...
 
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
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
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
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
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
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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
 

Themeroller 2.0: Refactoring for Speed

  • 1.
  • 2. New Features ✓ Snow ThemeRoller ✓ Speed Improvements ★ Server Image Generation: 40 – 50x faster ★ Removed ImageMagick Dependency ★ Client Image & CSS Generation: Almost Instant Feedback ✓ JSON Structure: Nested, Overridable ✓ Updated Bookmarklet ★ More Browser Support ★ Offline Support Pixel Graphic Design Studio
  • 3. Server Side Image Generation ✓ Removed ImageMagick dependency ★ PHP GD ★ Optipng ✓ Icons: Precompiled Pixel Graphic Design Studio
  • 4. Client Side CSS Generation ✓ Use Strategies ★ Inline Style Changes $(".ui-icon").css({ ... }) ★ Rule Editing ★ Style Tags $("head").append("<style ...></style>") Pixel Graphic Design Studio
  • 5. Client Side CSS Generation ✓ Templating/Replacement ★ Simple Tokens #aaaaaa/*{header.b}*/ normal/*{font.w}*/ ★ Same as server replacement Pixel Graphic Design Studio
  • 6. Client Side CSS Generation var file = $.Themeroller.CSS[version], tokens = base.to_tokens(), regex = /s+S+/*{([^}*/]+)}*//gi, css = file.replace(regex, function(m,k,v){ return ' ' + tokens[k]; }); Pixel Graphic Design Studio
  • 7. Client Side CSS Generation var tokens = [ "header.bg.c" = "#fff", "header.bg.i" = "#a00", "header.bg.b" = "#00a", "header.bg.tx.repeat" = "repeat-x" ... ]; Pixel Graphic Design Studio
  • 8. Client Side CSS Generation $("head #themeroller-stylesheet") .replaceWith( "<style type='text/css' media='screen' id='themeroller-stylesheet'>" + css + "</style>"); Pixel Graphic Design Studio
  • 9. Client Side Image Generation ✓ New Images ★ Stamping: Take an icon template, and change the colors ★ Layering: Merge a texture with a solid color ✓ Application to CSS ★ Needed the image in a URL format Pixel Graphic Design Studio
  • 10. Client Side Image Generation ✓ HTML5 Canvas ★ Supported Composite Modes ★ toDataURL ★ Built in PNG support Pixel Graphic Design Studio
  • 11. HTML5 Canvas Workflow 1. Load the template image 2. Create a canvas 3. Size the canvas (Clears existing content) 4. Set the composite mode and opacity 5. Draw the template image 6. Return the dataURL 7. Add the dataURL to the CSS Pixel Graphic Design Studio
  • 12. Creating the Icons var canvas = document.createElement('canvas'), context = canvas.getContext('2d'); function makeImage( color ){ canvas.width = 100; canvas.height = 100; canvas.fillStyle = color; canvas.fillRect(0, 0, 100, 100); context.globalCompositeOperation = "destination-out"; context.drawImage(img, 0, 0); return canvas.toDataURL('image/png') } Pixel Graphic Design Studio
  • 14. Fallback Support ✓ Build the support on the server first ✓ Work out a clean URL strategy ✓ Use feature detection to test for Canvas support ✓ Since DataURL is a URL, you can use a real path and the base64 data interchangeably. Pixel Graphic Design Studio
  • 15. Send as Little Data as Needed ✓ Send JSON, not HTML, wherever possible ✓ Provide overrides instead of full data wherever possible ★ You can override any default theme ★ Merge on the server Pixel Graphic Design Studio
  • 16. TWITTER @dougneiner EMAIL doug@pixelgraphics.us TUMBLR http://dougneiner.com WEB http://pixelgraphics.us

Editor's Notes

  1. Rule editing: browser differences
  2. Rule editing: browser differences
  3. Rule editing: browser differences
  4. Rule editing: browser differences
  5. Rule editing: browser differences
  6. Rule editing: browser differences
  7. Rule editing: browser differences