Skip to content

Instantly share code, notes, and snippets.

@No9
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save No9/71d832cb43b70f8c2daa to your computer and use it in GitHub Desktop.
Save No9/71d832cb43b70f8c2daa to your computer and use it in GitHub Desktop.
A tongue in cheek implementation of hyperscript to illustrating a 'pure ui' approach
// Based on http://rauchg.com/2015/pure-ui/
var h = require('hyperscript')
function dashboard(opts){
// with proper access to the layout data
// data CSS media queries can be redundant
if (opts.width > 375) {
return h('div', 'Twitter followers ' + opts.num)
} else {
return h('div', 'Twitter followers ' + (opts.num / 1000) + 'K')
}
}
console.log(dashboard({ width: 375, num: 400000 }).outerHTML)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment