Random projects all by Chris West.
⇩ Continue ⇩

ES6 – Convert To Integer Jun 27, 2017
at 8:31AM

There are various ways to convert a string or a floating point number to an integer in JavaScript, but not all of them may suit your needs. In this post we will examine four different ways and then we will see which is the best in all cases. Solution #1: ~~x If we are dealing …

ES6 – Convert To IntegerRead More »

CSS – Local File System Paths On Windows Jun 16, 2017
at 2:21PM

When working with Windows you probably have noticed that local file paths use the backslash as the path separator. Although this is the case, even on Windows, in CSS you can use the forward-slash as a path separator to reference an image. If you want to use the forward-slash though, you must escape it with …

CSS – Local File System Paths On WindowsRead More »

JavaScript – Create Gradient Image Using Canvas Jun 13, 2017
at 1:31AM

The <canvas> can be quite useful, especially if you want to modify how images look on your site. For example, if you want to make an image appear as a gradient starting at the top with an alpha of 0 and then linearly fading to the image’s full alpha value you can use JavaScript along …

JavaScript – Create Gradient Image Using CanvasRead More »

JavaScript – Use Canvas To Watermark Images Jun 11, 2017
at 11:26AM

Did you know that you can add a watermark to all of your images that are on the same domain as your site just using JavaScript? Thanks to the <canvas> we can modify images and present in various ways as if they were originally available that way all via JavaScript. The following function is a …

JavaScript – Use Canvas To Watermark ImagesRead More »

JavaScript Snippet – Get Video Frame As An Image May 3, 2017
at 4:03PM

Lately I have dedicated a little more time to developing an electron app which saves a frame of every video it encounters as PNG images: Believe it or not the code to turn a frame of a video into an image element is not terribly complicated. Below is a simple function that can be used …

JavaScript Snippet – Get Video Frame As An ImageRead More »

JavaScript Snippet – toggleFullscreen() Apr 26, 2017
at 12:56AM

Making your web app toggle back and forth between full screen mode is a simple enough task as long as you do some feature testing. You can also use this handy function which will step through the 4 different feature tests: This code is based off of documentation found here on MDN. I personally am …

JavaScript Snippet – toggleFullscreen()Read More »

Canvas – Making A Simple Logo Feb 3, 2017
at 12:31PM

A few days ago while I was working on updating my resume I thought about ways to add my simple “CW” (short for Chris West of course) logo to it. At the time of writing this article I presented my logo on using CSS3: CW Leveraging the Canvas One great thing that Mozilla has …

Canvas – Making A Simple LogoRead More »

Canvas – Animating Pacman Head In JavaScript Feb 2, 2017
at 8:24PM

If your browser supports <canvas> (which if it doesn’t you need to switch to a better one 😆 ) you can see a simple JavaScript animation: Image (with link) Canvas Drawing Pacman Drawing Pacman is quite a small task as you would imagine. It simply involves drawing a partial circle with lines going back to …

Canvas – Animating Pacman Head In JavaScriptRead More »

My Interactive Resume – Part 1 Feb 1, 2017
at 10:22AM

Here is my first quick pass at an online resume: There are plenty of times when we want to add everything to our resume to let potential employers know our worth but it can be difficult to know how to really summarize everything. Project Search There are times when we want these potential employers …

My Interactive Resume – Part 1Read More »

Emoji Search Jan 30, 2017
at 9:00AM

Unicode now offers plenty of emojis that we can add to our code to show on our web pages or web applications. Below is quick-and-dirty emoji search I wrote based on this page from