Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Intention.js: Rewrites your HTML based on the user's context. (intentionjs.com)
12 points by mildweed on April 22, 2013 | hide | past | favorite | 4 comments


Allows you to do two things:

  *  change around attributes on tags, usually src, href or class
  *  move HTML elements around the page
Based on whatever you want (Context.js):

  *  Window width
  *  touch capabilities
  *  pixel ratio
  *  [code your own here]


Is this more appropriate than doing the same thing in CSS/@media?


What's "appropriate" depends entirely on what you are doing. Intention.js gives you really fine tuned control over how an element responds to different contexts, be it a width threshold, interaction mode, display resolution, could even use scroll depth or number of user's visits to the site.


It goes way beyond what css and media queries can do. Imagine writing a media query for a slow-connection, large, high-resolution device in portrait mode, for a repeat, paid visitor, that moved the physical location of DOM elements as a result of the query.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: