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

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

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