Front-End Tools: My Favorite Finds of 2017

Avatar of Louis Lazaris
Louis Lazaris on

Another twelve months have passed and I’m sure all of you have come across some interesting new coding techniques, technologies, CSS tricks (of course!), and other stuff that will make you more productive in 2018.

As some of you might know, I curate a weekly newsletter called Web Tools Weekly, in which I feature dozens of links every week to new tools, mostly focusing on stuff that’s useful for front-end developers. So it’s an understatement to say that I’ve come across lots of new tools over the past 12 months.

As I’ve done in years past, I’ve put together a brief look at some of my favorite finds in front-end tools.

And please note that this is not a list of the “best” or “most popular” tools of 2017 – this has nothing to do with popularity or number of GitHub stars. These are tools I believe are unique, interesting, and practical – but not necessarily all that well-known. They are some of my personal favorite finds of the year, nothing more.

tlapse

When working on a new project, especially a large and lengthy one, it’s easy to forget the number of changes the project’s layout has gone through. tlapse is a command-line utility that allows you to set up automated screenshots of your work at specified intervals, essentially giving you a visual timeline of your development in the form of a series of screenshots.

tlapse

The project has 1,100+ stars on GitHub, so it seems developers are finding a valid use for this, even though it seems a little narcissistic at first glance. Besides the novelty of being able to look back at the progress of your project, I suppose tlapse could also be used to send visual progress reports to clients, project managers, or other development team members.

You install tlapse as a global npm package:

npm install -g tlapse

Then run it in the background and start your work:

tlapse -- localhost:3000

By default, tlapse will take screenshots at one minute intervals and the screenshots will be added to the tlapse folder in the current project (i.e. where you execute the command):

Running tlapse with the default settings

Usefully, tlapse will also take a screenshot only if it detects the layout has changed in some way. So if the next scheduled screenshot is the same as the previous, it will skip it:

tlapse skipping a duplicate screenshot

If you want to use a different directory or change the screenshot frequency, enter these as options along with the regular command:

tlapse --every 3m --directory ./screenshots -- localhost:3000

As the name suggests, tlapse allows you to make a time lapse video or animated GIF that demonstrates the progress of your work. Here’s one I created while mock-building a Bootstrap-based layout:

tlapse example

Overall, this is an easy to use tool, even for those not very comfortable with the command line, and there are certainly some use cases for wanting to take screenshots of work in progress.

KUTE.js

JavaScript animation libraries are not rare. But KUTE.js caught my eye due to its main selling point: Performance. It can’t be denied that if you’re going to even consider complex animations in web apps today, you have to be prepared to deal with potential performance problems as a result of users accessing your app on mobile devices or on slower connections.

KUTE.js

The moment you visit the KUTE.js home page, you’re greeted with a colorful, complex, super-smooth animation, testifying to the truth of this tool’s claims.

In addition to performance, two other things I like:

  • A really nice API
  • An excellent callback system

You start to build your animations by creating tween objects. For example:

var tween = KUTE.fromTo(
  '.box',
  {backgroundColor:'yellow'},
  {backgroundColor:'orange'},
  {complete: callback}
);

The above example creates a fromTo() tween with various options. Inside fromTo() I’ve specified the selector for the target element, the start and end values for the property being animated, and a callback function to execute when the animation is complete.

You can also create tweens using to(), allTo(), and allFromTo(), with the latter methods letting you apply animations to collections of objects.

The callback functionality is very fine-grained, allowing you to run code (which could include calling a new animation altogether) at specified points, including:

  • When an animation starts
  • For each frame of the animation
  • When an animation is paused
  • When an animation is resumed after having been paused
  • When an animation is stopped
  • When an animation is completed

I’ve only scratched the surface of the features available. The documentation on the site is good, so check that out for the full API. The CodePen below is based on one of the demos from the API docs, which uses the .chain() method to chain multiple transform animations.

See the Pen Chain Transform Animations with KUTE.js by Louis Lazaris (@impressivewebs) on CodePen.

ScrollDir

Scrolling libraries have been popular for some time now. ScrollDir, from the developers at Dollar Shave Club, is a really simple, tiny, and intuitive utility to help you do a couple of simple things with scroll detection.

ScrollDir

Once you drop in the library, in its simplest form the script just works. You don’t need to call the scrollDir() method or anything like that. If you open your browser’s developer tools and examine the live DOM while scrolling up and down on a page running ScrollDir, you can see what it does:

As shown in the above GIF, this utility adds a data-scrolldir attribute to the page’s <html> element, which changes to one of two values, depending on scroll direction:

<!-- when the user is scrolling down -->
<html data-scrolldir="down">

<!-- when the user is scrolling up -->
<html data-scrolldir="up">

It defaults to “down” when the page hasn’t yet been scrolled, although it seems like it could benefit from having a “neutral” class as a third optional state.

With this attribute in place, it’s super easy to make custom changes to a page’s layout with nothing but CSS, taking advantage of CSS’s attribute selectors:

[data-scrolldir="down"] .header-banner {
  top: -100px;
}

[data-scrolldir="up"] .footer-banner {
  bottom: -100px;
}

You can see the above code, combined with some simple CSS transitions, demonstrated in the CodePen below, which is similar to the example on the ScrollDir home page:

See the Pen ScrollDir basic demo by Louis Lazaris (@impressivewebs) on CodePen.

ScrollDir offers a few minor API options if you choose to use the non-auto version of the script. In either case it’s dead simple to use and I’m sure will come in handy if you’re building something that needs changes to occur on the page based on scroll direction.

CodeSandbox

Due to the popularity of web app development using libraries like React and Vue, a number of different IDEs and other code tools have come on the scene, aimed at helping developers who are working with a specific library or framework.

CodeSandbox

CodeSandbox is an online code editor for four of the current big players: React, Vue, Preact, and Svelte. This tool is somewhat in the same category as CodePen Projects, but is specifically designed for each of the four aforementioned libraries.

One of the nice features of CodeSandbox is the ability to add npm packages in the left side bar, under a pane called “Dependencies”. There’s a button called “Add Package” that allows you to search for packages in the npm registry:

Searching for npm packages on CodeSandbox

And if your app is missing a dependency, CodeSandbox will indicate this with an error message and an option to add the required package. In the following GIF, I’ve pieced together this React calculator app as an example project in CodeSandbox:

Installing missing dependencies on CodeSandbox

Notice the project still had a missing dependency, which I was able to install instantly. Here’s the CodeSandbox link to my version of that project.

Another feature that caught my eye is the ability to “peek” at the definition of a function in the code window:

CodeSandbox's Peek feature

Like many native IDEs, this allows you to be able to track down a function’s source, for quicker debugging and whatnot. There are also some clean inline code completion features, just like a native IDE.

There are tons more features I haven’t discussed here – including GitHub integration, deployment via ZEIT, and lots more – so be sure to poke around the different panels to get a feel for what you can do.

AmplitudeJS

AmplitudeJS is a dependency-free (we like that nowadays don’t we?) HTML5 audio player “for the modern web”. I think a lot of independent hobby-driven music makers with web development experience will appreciate this one for a number of reasons.

Amplitude allows you to build your own audio player with your own custom design and layout. To add a song list, you can add it via the main Amplitude.init() method in JSON format. Here’s an example with three songs:

Amplitude.init({
  songs: [
    {
      name: "Song Name One",
      artist: "Artist Name",
      album: "Album Name",
      url: "/path/to/song.mp3",
      cover_art_url: "/path/to/artwork.jpg"
    },
    {
      name: "Song Name Two",
      artist: "Artist Name Two",
      album: "Album Name Two",
      url: "/path/to/song.mp3",
      cover_art_url: "/path/to/artwork.jpg"
    },
    {
       name: "Song Name Three",
      artist: "Artist Name Three",
      album: "Album Name Three",
      url: "/path/to/song.mp3",
      cover_art_url: "/path/to/artwork.jpg"
    }
  ]
});

The code behind this player generates the audio using the Web Audio API, which is kind of like adding HTML5’s audio element, but with nothing but JavaScript. So you could technically generate a functioning version of the AmplitudeJS player with zero HTML. See this CodePen as an example, which auto-plays the only song in the playlist and has no HTML. Even if you examine the generated DOM, there’s nothing there; it’s just JavaScript. In that instance, I’m using the "autoplay": true option in the init() method (the default is false, of course).

If you want to see the flexible and varied audio players that can be built with AmplitudeJS, be sure to check out the examples page. The Flat Black Player is probably my favorite for its similarity to an old-school MP3 player. I’ve put it into a CodePen demo below:

See the Pen LeEgyj by Louis Lazaris (@impressivewebs) on CodePen.

In terms of configuring AmplitudeJS, here are some of the highlights.

All the info you provide in the JSON can be added dynamically to the player wherever you want. For example the following HTML would display the song name, artist, album, and file URL for the currently playing track:

<p amplitude-song-info="name" amplitude-main-song-info="true">
<p amplitude-song-info="artist" amplitude-main-song-info="true">
<p amplitude-song-info="album" amplitude-main-song-info="true">
<p amplitude-song-info="url" amplitude-main-song-info="true">

Notice the amplitude-song-info attribute, which defines which bit of data you want to inject into that element. You wouldn’t necessarily use paragraphs, but that’s one way to do it. You can see this in action in this CodePen demo.

With the metadata features, adding a running time or time remaining indicator for the current song is easy:

<p class="amplitude-time-remaining" amplitude-main-time-remaining="true">
<p class="amplitude-current-time" amplitude-main-current-time="true">

Another great feature is the ability to work with callbacks (which is pretty much a must for any good API). Here’s two of the callback options used in a simple example:

Amplitude.init({
  songs: [
    // songs list would be here...
  ],
  callbacks: {
    before_play: function() {
      document.querySelector('.msg').innerHTML = 'Song will now begin...';
    },
    after_stop: function() {
      document.querySelector('.msg').innerHTML = 'Song has ended!';
    }
  }
});

You can see this in action in this CodePen. I’ve incorporated a rudimentary play/pause button to help with the callbacks. To see the final callback, you have to wait for the song to complete (pausing doesn’t trigger the after_stop callback). The button is built using nothing but a few HTML attributes, no extra scripting needed.

This is a really small sampling of what’s possible with this player and how flexible it is. The docs are solid and should get you up and running with this tool in no time.

Honorable Mentions

That’s a detailed look at five of my favorites from the past year. But there are lots of others worth examining that are similarly lesser-known. I’ve listed some of these below:

  • BunnyJS –An ES6-based front-end framework that advertises as “Simple like jQuery, better then jQuery UI, powerful like React”.
  • keyframes-tool –A command line tool to convert CSS animations to a keyframes object suitable for use with the Web Animations API.
  • Konsul – A React renderer that renders to the browser’s developer tools console.
  • across-tabs – Easy communication between cross-origin browser tabs.
  • svgi – A CLI tool to inspect the content of SVG files, providing information on the SVG (number of nodes, paths, containers, shapes, tree hierarchy, etc).
  • CSS in JS Playground – Play around with the code for just about any of the CSS-in-JavaScript solutions (JSS, styled-components, glamorous, etc).

What’s Your Favorite Find of the Year?

So that’s it. As I said at the start, this was not meant to be an awards ceremony for best tools of the year, but more of a look at some not-so-mainstream alternatives that are interesting and practical. I hope you find some of them useful. If you’re interested in continuing to keep up with the influx of new tools in front-end development, be sure to subscribe to my newsletter.

Have you stumbled upon (or built) something cool over the past year that would be of interest to front-end developers? Let me know in the comments, I’d love to take a look.