Archives de
Étiquette : HTML5

PUG HTML

PUG HTML

Introduction to Pug Pug is a template engine implemented in JavaScript that allows you to dynamically generate HTML, like Thymeleaf in Java and Twig in PHP. Its syntax is inspired by Haml. It is therefore minimalist and based on indentations. I have never used pug but my first impressions are rather mixed. Previously « Jade » Before, Pug was called Jade. Only Jade has become a registered trademark and as the domain of the trademark is very close (both refer to the…

Lire la suite Lire la suite

The <canvas> element

The <canvas> element

<canvas> is an HTML5 element that allows the creation and manipulation of graphical elements (paths, shapes, text, bitmap images) via a scripting language, most often JavaScript. All modern browsers support it natively, and can render it using hardware acceleration. To start, we add the following tag to the page, specifying the width and height attributes: Drawing lines Let’s draw a primitive C using two lines: Drawing a shape Now, let’s add a D using the context method arc. It accepts the following arguments: Drawing text Next up, we’ll write an A using…

Lire la suite Lire la suite