Gloss & Stripes

About Programming, Mac, Design and Everything that's somehow Arty or Open Source.

LargeType JS [en]

Similar to the LargeType enhancement for OS X, this JavaScript tool enables a large type display of content-elements on your website. Simply add class="LargeType"> to a <span> or <p>.

Some Mac users will be familiar with the LargeType function integrated in Apple’s Addressbook. It enables you to right-click on a phone number and enlarge it so it’ll look similar to this:

LargeType in OS X Address BookImage from http://macmechanic.com/tips/?p=16

There is also a LargeType enhancement for OS X to activate LargeType in the OS X context menu system wide.

Inspired by this, I recently wrote a quick JavaScript based on prototype that simulates the OS X LargeType functionality by displaying text in a LargeType-like overlay for websites.

View the demo » (Quick’n dirty version)

How to use

  1. Download prototype and include with <script>
  2. Download LargeType.js and include with <script>
  3. Add class name .LargeType to arbitrary HTML-elements.
  4. Done. The script now wraps the element’s content in a link and attaches the display event for the LargeType container.

You can download all demo files here. I’m planning to dissect the JavaScript and CSS here soon, but the code has adequate commented sections so that you can get the picture of how it works (I’ll be here in case of questions).

Thoughts

While preparing the script for a public release, a first few ideas came up on how I could enhance the script:

  • Implement the same functionality without any JS but with CSS 2.1 selectors
    (adjacent E+F and :focus state)
  • Intelligent font-resizing during window resize to avoid line-breaking

If you have suggestions on how one could improve this little script, feel free to submit a comment. Have fun with the script! I hope you can use it.

RT @dertimbo LargeType JS

Posted in Developing, Tags:,

Possibly Related Entries

  • No related posts

Post a comment or review the article

+ -

Who is this?

freshlabs journal is the bi-lingual weblog and digital playground of Tim Isenheim, designer and webdeveloper from Hamburg, Germany. More →

  • Download Summersun, a sunny theme for WordPress
  • Download WP SIMILE Timeline, a lifestream plugin for WordPress

Topics

Archives

Tag Cosmos

3D ajax Apple blogging browser comedy comments contest copenhagen css Design dom firefox flash fuckedup gallery google html interface javascript music mythbusters offline opensource osx photo photoshop php plugin powerbook programming projects psp skype Software spam studyabroad switch video w3c wallpaper webdesign webstandards westciv Wordpress

Full Tag Cloud