The slabText plugin was inspired by the FitText plugin and written to produce newspaper like headlines that work with responsive page layouts.
Being responsive means it will always resize to fit the user's viewport in real-time, recalculating font sizes automatically without the user or the developer having to do anything.
Besides font size, the script also automatically determines the number of individual text rows per phrase, splitting long-winded titles across multiple lines, while slowly varying the font size with each line.
This is done by a math formula that takes into account the ideal number of characters for each row.
Taking this number, the title phrase is broken down on a per-row basis, dividing the available words while also taking into account the developer's desired font-size in pixels.
The underbellies of slabText are a mathematician's dream, but the end result is quite fantastic.
A demo is included with the download package.
Requirements:
- JavaScript enabled on client side
- jQuery
Comments not found