background preloader

Improving HTML5 Canvas Performance

Improving HTML5 Canvas Performance
Introduction HTML5 canvas, which started as an experiment from Apple, is the most widely supported standard for 2D immediate mode graphics on the web. Many developers now rely on it for a wide variety of multimedia projects, visualizations, and games. However, as the applications we build increase in complexity, developers inadvertently hit the performance wall. There’s a lot of disconnected wisdom about optimizing canvas performance. This article aims to consolidate some of this body into a more readily digestible resource for developers. Note that this article does not go into usage of HTML5 canvas. Performance testing To address the quickly changing world of HTML5 canvas, JSPerf (jsperf.com) tests verify that every proposed optimization still works. Visitors to a JSPerf performance test page can run the test on their browser, and let JSPerf store the normalized test results on Browserscope (browserscope.org). Pre-render to an off-screen canvas no pre-rendering: pre-rendering: Conclusion

requestAnimationFrame for smart animating If you’ve never written code to animate inside the browser, you can stop reading :) What is requestAnimationFrame? In your animation work, you’ve used a timer loop to make changes every few milliseconds. Good for us: browser vendors have decided, “hey, why don’t we just give you an API for that, because we can probably optimize some things for you.” So it’s basic API for use with animation, whether that be DOM-based styling changes, canvas or WebGL. Why should I use it? The browser can optimize concurrent animations together into a single reflow and repaint cycle, leading to higher fidelity animation. OMG I can brag about having a site with battery-friendly animations? Yeah bro. How should I use this? Note: I am using ‘requestAnimFrame` here because since the spec is still in flux, I don’t want to make a straight polyfill, yet. 2012.01.07: The spec has gotten some fixes and settled down. A robust polyfill I have this polyfill available as a gist as well. Let’s see that in action Is it ready?

Free UX Sketching And Wireframing Templates For Mobile Projects Today we are happy to release two printable UX sketching and wireframing templates, designed by Pixle81 for Smashing Magazine’s readers. This article presents Outline, a set of sketching and wireframing papers for mobile platforms and Tapsize, a set of templates for checking optimal tap areas without a mobile device. Outline Outline is a set of 28 printable sketching and wireframing papers (in PDF) for seven mobile platforms: Android, BlackBerry, iOS (iPad and iPhone), Meego, Symbian, webOS, Windows Phone 7. Note: Print the sheets at actual size (i.e. do not resize). As a bonus, Outline includes an Illustrator file displaying the mobile devices. Outline paper set Windows Phone 7 and 8 panorama template Android 4.x template Tapsize With Tapsize, you can determine the optimal tap area without having an actual device. Tapsize paper set Calculating the grid Checking the optimal tap area for the Google Nexus 7 tablet. Behind the Design Download The Set For Free Download the package7 (ZIP, 2 MB).

HTML5 Full-Screen Demonstration Oh look – a squirrel. Click to view full-screen… This demonstration illustrates how to use the HTML5 full-screen API which has been implemented in Firefox, Chrome and Safari. For further information, please refer to the article How to Use the HTML5 Full-Screen API… This example code was developed by Craig Buckler of OptimalWorks.net for SitePoint.com. Please view the source and use this code as you wish. 10 Rendering — HTML5 User agents are not required to present HTML documents in any particular way. However, this section provides a set of suggestions for rendering HTML documents that, if followed, are likely to lead to a user experience that closely resembles the experience intended by the documents' authors. So as to avoid confusion regarding the normativity of this section, RFC2119 terms have not been used. Instead, the term "expected" is used to indicate behavior that will lead to this experience. 10.1 Introduction In general, user agents are expected to support CSS, and many of the suggestions in this section are expressed in CSS terms. In the absence of style-layer rules to the contrary (e.g. author style sheets), user agents are expected to render an element so that it conveys to the user the meaning that the element represents, as described by this specification. An element is being rendered if it has any associated CSS layout boxes, SVG layout boxes, or some equivalent in other styling languages.

HTML5 Boilerplate - A rock-solid default for HTML5 awesome. Tipos de fuentes en css « Don Estándares Holas :) en css se plantea mucho sobre las fuentes, lo ideal… es usarle las propiedades del css para que se vea bonito al usuario, y para nosotros fácil de manejar. El css nos da la flexibilidad de poder darle color, tamaño, grueso y otras propiedades que trataremos de explicarlas, no todas :p por que son demasiadas pero si las mas importantes. Recuerda algo, por el momento no se pueden usar fuentes que el visitante no tenga instaladas, por ejemplo este tipo de letra, es muy bonita y hasta agradable, pero el problema es que si nosotros la instalamos en nuestra pc y trabajamos con css o en html con ese tipo de letra y la subimos a un servidor, esta en NUESTRA PC se va a ver muy bien, el problema es cuando nuestros usuarios abran nuestro sitio web, ellos no verán correctamente por que en la pc del usuario no esta instalada esta fuente. principalmente las fuentes default son: Arial, Helvetica, sans-serif Y que pasa si en el sistema operativo (Mi preferido :P Linux! .fuente_titulos{ } Me gusta:

Optimize browser rendering - Make the Web Faster Once resources have been downloaded to the client, the browser still needs to load, interpret, and render HTML, CSS, and JavaScript code. By simply formatting your code and pages in ways that exploit the characteristics of current browsers, you can enhance performance on the client side. Use efficient CSS selectors Overview Avoiding inefficient key selectors that match large numbers of elements can speed up page rendering. Details As the browser parses HTML, it constructs an internal document tree representing all the elements to be displayed. According to this system, the fewer rules the engine has to evaluate the better. The following categories of rules are considered to be inefficient: Rules with descendant selectors For example: Rules with the universal selector as the key body * {...}.hide-scrollbars * {...} Rules with a tag selector as the key ul li a {...} Rules with child or adjacent selectors body > * {...}.hide-scrollbars > * {...} ul > li > a {...} Rules with overly qualified selectors

C HTML5 Logo FAQ What does the logo represent? This logo represents HTML5, the cornerstone for modern Web applications. What do the smaller icons represent? The smaller technology class icons represent aspects of modern Web applications and Web sites — style, semantics, graphics, and so forth. Are all those technology features defined in the HTML5 specification? No, not all of them. Is W3C saying that CSS3 is part of the HTML5 specification? No. Can I use this logo on Web applications built on HTML5? Yes. Can I use this logo on Web sites that aren't built with HTML5? Yes, if you are talking about or showing your support for HTML5. Does this logo imply validity? No, this logo does not imply validity or conformance. How is this work licensed? The logo, icons, and website are licensed under Creative Commons Attribution 3.0 Unported The license says I need to attribute my usage or derivative work. This work is attributed to the W3C. Can I put this logo on stickers, t-shirts, etc? What are the original colors? Yes. Yes.

JavaScriptMVC Adding ScrollTo in the jQuery UI Accordion script Top 10 Best HTML5 Websites of 2012 Here are our editor's picks for the Top 10 Best HTML5 Websites of 2016 based on visual artistry, integrated sound, ease of use, and uniqueness. 1 | The Wilderness Downtown The Wilderness Downtown is an interactive music video for Arcade Fire's song ''We Used to Wait''. Visitors are asked to input the address of the home they grew up in and then the site uses Google Earth and HTML5 to create a personalized music video that takes the user on a journey back home. 2 | Heart of The Artic Heart of The Arctic takes users on an Arctic expedition/scavenger hunt through four distinct environments designed to show users the steps that would be needed to restore climate balance to the arctic region. 3 | Three Dreams of Black 3 Dreams of Black uses HTML5 to promote Danger Mouse and Daniele Luppi's album Rome. 4 | Enjoy Your Privacy The website was created to warn consumers about the dangers of not using password protection on their mobile devices.

Pancake Payments | Simple, Easy, Awesome!! JavaScript JavaScript (JS) is a lightweight interpreted (or just-in-time compiled) programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat. JavaScript is a prototype-based, garbage-collected, dynamic language, supporting multiple paradigms such as imperative, functional, and object-oriented. JavaScript's dynamic capabilities include runtime object construction, variable parameter lists, function variables, dynamic script creation (via eval), object introspection (via for...in and Object utilities), and source-code recovery (JavaScript functions store their source text and can be retrieved through toString()). This section is dedicated to the JavaScript language itself, and not the parts that are specific to Web pages or other host environments.

Related: