jQuery Scroll Path

February 9th, 2012 :: Web Development :: No Comments

A computer mouse

I released a jQuery plugin a couple of days ago and I haven’t had time to write about it here until now. The plugin is based on a slightly crazy idea, but it has been getting some good response on Forrst and Twitter (my follower count has tripled quadrupled since the release).

Most people seem to think that it’s a pretty cool plugin, but struggle in coming up with good practical uses of it. It might not be of much use on any “serious” website, but I think it can create quite a nice effect on personal portfolios and presentation pages, if used creatively.

Read More

Tutorial — Creating a Custom Tweet Button with a Counter

January 19th, 2012 :: Web Development :: No Comments

custom tweet buttons

Tweet buttons are a great way to spread your content to the public. Twitter provides an easy way to include their button on your site, but this comes at the cost of not having a very customizable style.

The button is served inside an iframe, which restricts CSS and Javascript access. This can make it hard to get the button to fit in with the rest of the design. What’s even worse is that while the button wrapper is set at a fixed width, the counter inside isn’t. Once the page starts getting more tweets and the counter increases, the width of the button expands, but since the parent iframe has a fixed width, it’s impossible for us to know the actual width of the button.

Something that can also be seen as an issue is the size (46.5 kB) of the widget.js script that Twitter injects with the default button. In most cases though, this script file should already be in the visitor’s cache.

Read More

accentColor Script

December 17th, 2011 :: Web Development :: No Comments

Out of curiosity, I started coding on a script to get the accent colors of external websites, kind of like Chrome does it in the most visited sites thumbnails. The script can be used to automatically give your outgoing links appropriate colors and make them look more interesting.

a jigsaw piece

The script works by calculating the dominant color of the site’s favicon, which usually works pretty well to determine the web page’s signature color. I’m using a canvas object to analyze the pixel data, which restricts the browser suppport to more modern browsers. It would be possible to widen the browser support by parsing the image file data directly, but considering that favicons come in many different formats, this would require too much work and code for such a small visual effect.

CORS is used to connect to getFavicon, a service by Jason Cartwright that retrieves the favicon of any given URL. There is also a PHP proxy file that you can use on your own server as fallback for browsers without CORS support.

I’ve created a pretty demo page for the script, check it out below.

Demo

Code Snippet — Accessing Clipboard Images with Javascript

December 3rd, 2011 :: Web Development :: No Comments

a clipboard
The system clipboard is a feature that most of us heavy computer users probably couldn’t survive a day without. While it’s mostly used for copying and pasting text, images can also be stored in the clipboard, by for example using the print screen key. Today I want to share with you how you can access these images with a bit of Javascript code. This works in modern versions of Chrome and Firefox, but the technique differs a bit between them.
Read More

CSS Mask Tutorial — Rotating Image Gallery

November 24th, 2011 :: Web Development :: 4 Comments

Gallery Wheel

I’ve been trying out different things that you can do with the CSS mask property lately. With a CSS mask, you can mask or clip any element to a desired shape. The mask is either a PNG image, or an SVG image.

I coupled this with the CSS transform and transition properties, and came up with a pretty cool concept for an image gallery.

I’ve put together a demo for Chrome and Webkit nightly builds. Firefox also supports the CSS mask property, but doesn’t seem to play well with rotated masked images, so I’ve only used -webkit prefixes for this demo.

I’ll run through all the different steps in making this gallery wheel below, starting with the markup.

Read More

A Brief Introduction

November 23rd, 2011 :: General :: No Comments

I’m going to let my first post serve as an introduction to future readers for what this blog most likely is going to be about. But first, let me briefly introduce myself.

My name is Joel Besada, I’m a computer science student at the Royal Institute of Technology in Stockholm, Sweden. Roughly one year ago, I took my first steps into web development/design. Since then, I’ve undertaken several personal projects creating websites, plugins and themes. My most notable project thus far is JSManipulate — an open-source Javascript image manipulation library.

I’m starting this blog because I want to write about what I’m working on, share my thoughts about the web, and show some useful web development tricks. Hopefully, I’ll some day have an audience here that finds what I write helpful and/or interesting. Until then, this blog will serve as an archive for myself in which I solidify all the things that go through my head while I’m programming and designing.

As an added bonus, I figured it would be a fun idea to dust off my old Wacom tablet and do some drawings for each blog post. Beware though, I’m not doing this because I’m particularly good at drawing, I’m doing this because I’m not. As the say, practice makes perfect, so here’s a drawing of a whale!
Introduction Whale
That’s enough of an introduction! Now I’ll start writing on some actual content to kick off this blog with.