1. 01. Incoming
  2. 02. Hifi
  3. 03. Lofi
  4. 04. The Lab
  5. 05. Tags

frequency decoder

slabText - a jQuery plugin for producing big, bold & responsive headlines

Posted Sunday January 08, 2012

frequency decoder

I’ve been wanting to attempt a port of Erik Loyers slabtype algorithm for quite some time now and seeing Paravels fittext jQuery plugin, in combination with a gloriously hassle-free lunch hour gave me the impetus to attempt it.

Head over to the demo and resize the browser viewport to see the effect in action.

So what does the script do again?

Put simply, the script splits headlines into rows before resizing each row to fill the available horizontal space. The ideal number of characters to set on each row is calculated by dividing the available width by the CSS font-size – the script then uses this ideal character count to split the headline into word combinations that are displayed as separate rows of text. More examples can be viewed on the demo page.

Grab the code

The code can be downloaded from github. Both minified and unminified versions are included within the bundle. The minified version currently clocks-in at just over 2k – this drops to 1k when gzipped.

Tags: javascript

Comments are currently closed but feel free to contact me on twitter with your questions or suggestions - I’d love to hear from you.

Popular Frequencies

  • Unobtrusive Table Sort Script (revi…
    Saturday September 16, 2006
  • Unobtrusive Date-Picker Widget Upda…
    Monday October 02, 2006
  • Unobtrusive Date-Picker Widget V4
    Tuesday February 03, 2009
  • Unobtrusive Table Sort Script
    Friday November 18, 2005
  • Unobtrusive Date-Picker Widget V5
    Wednesday September 09, 2009
All articles