Blog
How to download an HTML5 canvas as an image using JavaScript
After drawing to the canvas, you may want to download and save the canvas drawing as an image. To do this, you can use the `toDataURL()` method of the canvas object. Let's say you have a "Download" button in your HTML: html
Learn HTML5 canvas by building an image watermarking tool
HTML5 canvas allows us to create and manipulate pixels, just like a painter working on a canvas. We can draw text and graphics onto the canvas using JavaScript. To demonstrate its power, let's build an image watermarking tool that allows a user to upload an i...
9 UX writing tips for designers and developers
UX writing is the practice of crafting text for digital interfaces that help users interact with products more conveniently. While it is not expected for designers and developers to be professional writers, knowing how to write UX copy is valuable when creati...
JavaScript regular expressions crash course
Regular expressions are a method to describe patterns in string data. Regular expressions form a tiny, separate language part of many languages, including JavaScript. Admittedly, regular expressions have a cryptic syntax and are often difficult to write. Kn...
Predictive modeling of weight changes using differential equations
Inspired by my own challenges with weight fluctuations, I wanted to explore how people's weight might change based on calorie consumption. This article details how I went about modelling weight change with differential equations, and building a web applicatio...
How to calculate the distance between two locations using JavaScript
The most popular way of calculating the distance between two points on a sphere is using the Haversine equation. If you have the coordinates (longitude and latitude) of the starting and destination locations, you can use this equation to calculate the dist...
How to get a user's location using the Geolocation API
Knowing a user's location can be a very important feature of a web app. You can use the location information to personalise the user experience, give users directions, suggest friends or events in a person's locality, or to power a particular feature. When...
Advantages and disadvantages of SVG
Created in 1999, SVG has grown to become the most popular vector image format for the web. This article will cover the advantages and disadvantages of SVG (Scalable Vector Graphics) as a format for displaying images on the web. By knowing the pros and cons of...
