Exploring Units in Math.js

The math.js library's many features include comprehensive support for units, enabling us to carry out calculations and conversions of measurements including length, mass, volume and many more.

The library has its own comprehensive documentation so in this article I will just give a brief introduction the unit functionality before providing a few examples of more obscure or specialized usage.

Continue reading

SVG Animation with Anime.js

Anime.js is a very powerful and versatile library which lets you animate CSS properties, DOM attributes, SVG and even JavaScript objects. The library's own documentation is comprehensive and has plenty of interesting examples, but for this article I will write a simple library using anime.js to create SVG elements with zero size and a specified position, and then animate them to their desired size and location. The end result is an SVG image which appears to grow and assemble itself before your eyes. Let's get to it...

Continue reading

CSS Image Sprite Maker in Python

css sprites

If you have a number of small images on your website, for example those used for icons or buttons, it is more efficient to combine them into a single image which is usually smaller in size and requires only one HTTP request to download. You can then use CSS to specify an offset to the exact position of the individual image in the combined image.

Creating the combined image and corresponding CSS can be done by hand but this is time-consuming, boring and error-prone so I have written a simple Python module to do the job for you.

Continue reading

An Introduction to Web Hosting with GitHub Pages

In your travels around The Internet you may have encountered sites with URLs ending in .github.io. These use GitHub's own minimalist but very useful hosting service called GitHub Pages which is available free to anyone with a Github account.

In this article I'll show how easy it is to get up and running with the service, as well as exploring what you can and cannot do.

Continue reading