Progressive enhancement with handlers and enhancers

var handlers = { 'overlay' : function(e) { // This function is executed on click of any element with // 'overlay' in its data-handler attribute. // The click event is in 'e', $(this).attr('data-foo') holds the // value of data-foo of the element the user clicked on }, 'another-function-name' : function(e) {} …

Textures.js – SVG patterns for Data Visualization

Textures are useful for the selective perception of different categories var svg = d3.select(“#example”) .append(“svg”); var t = textures.lines() .thicker(); svg.call(t); svg.append(“circle”) .style(“fill”, t.url()); A multitude of predefined styles is available. It’s also possible to define your own styles. Textures.js →

Space.js – HTML-driven narrative 3D-scrolling

For our messages to communicate across efficiently, we need to create a powerful connection between the user and our medium. Today we are going to explore a new way of presenting stories on the web. And for this I’ve created an open-source and free to use JavaScript library i call space.js. It’s basically parallax technologies …

Mapbox Landsat-live

Today we’re releasing the first edition of Landsat-live, a map that is constantly refreshed with the latest satellite imagery from NASA’s Landsat 8 satellite. With every pixel captured within the past 32 days, Landsat-live features the freshest imagery possible around the entire planet. Uses the Landsat 8 data directly now that it’s stored on AWS. …

Geofencing for the Web

navigator.serviceWorker.register(‘serviceworker.js’).then( function(serviceWorkerRegistration) { serviceWorkerRegistration.geofencing.add( new CircularGeofenceRegion({ name: “myfence”, latitude: 37.421999, longitude: -122.084015, radius: 1000 }), {includePosition: true}).then( function(geofence) { console.log(geofence.id); // If more than just a name needs to be stored with a geofence, now // would be the time to store this in some storage. }, function(error) { // During development it often helps …

Push Notifications for the Web

self.addEventListener(‘push’, function(event) { // Since there is no payload data with the first version // of push messages, we’ll grab some data from // an API and use it to populate a notification event.waitUntil( fetch(SOME_API_ENDPOINT).then(function(response) { if (response.status !== 200) { // Either show a message to the user explaining the error // or enter …

Quantity Queries for CSS

Styling elements based on the “more than one” and “fewer than two” thresholds is a neat trick, but a flexible “quantity query” interface would accept any quantity. That is, I should be able to style “more than or equal to n” for any value of n. Then I can style “more than or equal to …

The Web’s Grain

Great piece by Frank Chimero. Starts with that nostalgic nineties feel and finds it way to photography, responsive design, and the fact that some websites try to blow you away with their design/technological advancements. “Listen bub,” I say, “it is very impressive that you can teach a bear to ride a bicycle, and it is …