Skip to content

Instantly share code, notes, and snippets.

@betabong
Last active August 29, 2015 14:27
Show Gist options
  • Save betabong/b056490d17c1f08974b5 to your computer and use it in GitHub Desktop.
Save betabong/b056490d17c1f08974b5 to your computer and use it in GitHub Desktop.
Screenreader Heading (visible only)
<a href='javascript:(function () %7B !function a(b,c,d)%7Bfunction e(g,h)%7Bif(!c%5Bg%5D)%7Bif(!b%5Bg%5D)%7Bvar i%3D"function"%3D%3Dtypeof require%26%26require%3Bif(!h%26%26i)return i(g,!0)%3Bif(f)return f(g,!0)%3Bvar j%3Dnew Error("Cannot find module %27"%2Bg%2B"%27")%3Bthrow j.code%3D"MODULE_NOT_FOUND",j%7Dvar k%3Dc%5Bg%5D%3D%7Bexports:%7B%7D%7D%3Bb%5Bg%5D%5B0%5D.call(k.exports,function(a)%7Bvar c%3Db%5Bg%5D%5B1%5D%5Ba%5D%3Breturn e(c%3Fc:a)%7D,k,k.exports,a,b,c,d)%7Dreturn c%5Bg%5D.exports%7Dfor(var f%3D"function"%3D%3Dtypeof require%26%26require,g%3D0%3Bg<d.length%3Bg%2B%2B)e(d%5Bg%5D)%3Breturn e%7D(%7B1:%5Bfunction(a,b,c)%7Bb.exports%3D"body %7B%5Cn%09padding: 0%3B%5Cn margin: 0%3B%5Cn font: caption%3B%5Cn line-height: 1.6%3B%5Cn color: %23284900%3B%5Cn%7D%5Cn%5Cnul %7B%5Cn margin: 0%3B%5Cn margin-top: 3em%3B%5Cn padding: 0%3B%5Cn%7D%5Cn%5Cna %7B%5Cn%09color: %23284900%3B%5Cn text-decoration: none%3B%5Cn%7D%5Cna > .level %7B%5Cn display: inline-block%3B%5Cn background-color: %23284900%3B%5Cn color: white%3B%5Cn font-size: 85%25%3B%5Cn font-weight: bold%3B%5Cn width: 2.7ex%3B%5Cn height: 2.7ex%3B%5Cn text-align: center%3B%5Cn /* border-radius: 2ex%3B */%5Cn box-sizing: border-box%3B%5Cn top: -1px%3B%5Cn position: relative%3B%5Cn margin-right: 0.5ex%3B%5Cn%7D%5Cn%5Cna:hover %7B%5Cn background-color: %23284900%3B%5Cn color: white%3B%5Cn%7D%5Cna:hover > .level %7B%5Cn background-color: transparent%3B%5Cn%7D%5Cn%5Cn%5Cn.h5o-close %7B%5Cn%09position: absolute%3B%5Cn%09top: 15px%3B%5Cn%09right: 15px%3B%5Cn%09padding: 5px 10px%3B%5Cn border-radius: 5px%3B%5Cn%09border: 1px %23284900 solid%3B%5Cn%09color: inherit%3B%5Cn%09background-color: white%3B%5Cn%09cursor: pointer%3B%5Cn%7D%5Cn.h5o-close:hover %7B%5Cn%09color: white%3B%5Cn%09background-color: %23284900%3B%5Cn%7D%5Cn%5Cn.h5o-container %7B%5Cn%09white-space: nowrap%3B%5Cn%09overflow-x: hidden%3B%5Cn%09text-overflow: ellipsis%3B%5Cn%09padding: 15px 60px 15px 15px%3B%5Cn%7D%5Cn%5Cn.h5o-container ol %7B%5Cn%09margin: 0%3B%5Cn%09padding: 0%3B%5Cn%7D%5Cn%5Cn.h5o-container li %7B%5Cn%09list-style: none%3B%5Cn%09margin-left: 20px%3B%5Cn%7D%5Cn"%7D,%7B%7D%5D,2:%5Bfunction(a,b,c)%7Bfunction d()%7Be(jQuery.noConflict(!0))%7Dfunction e(a)%7Bvar b%3Da(%27<div style%3D"outline: 3px solid rgba(30,60,0,0.5)%3B background: rgba(30,60,0,0.05)%3B border: 2px solid white%3B box-shadow: inset 0px 0px 6px 3px rgba(30, 60, 0, 0.5)%3B transition: all 200ms ease-out%3B pointer-events: none%3B"></div>%27),c%3D2,d%3D"position:fixed%3Btop:10px%3Bright:10px%3Bborder:"%2Bc%2B"px solid %23000%3Bbackground:rgba(255,255,255,.9)%3Bz-index:999999%3Bwidth:90%25%3Bmax-width:90%25%3Bmax-width:calc(100%25 - 20px)%3Bmin-height:50px%3B",e%3Df(a(document.body),a).asHTML(!0),k%3Ddocument.createElement("div")%3Bj(%5Bk%5D,"class","h5o-container"),k.innerHTML%3De,j(k.getElementsByTagName("a"),"target","_top")%3Bvar l%3Dk.insertBefore(document.createElement("button"),k.firstChild)%3Bj(%5Bl%5D,"class","h5o-close"),l.innerHTML%3D"Close",i(function(e,f)%7Breturn e%3Fvoid console.error(e):(g(h,f.document),j(%5Bf.iframe%5D,"style",d),f.document.body.appendChild(k),k.style.position%3D"absolute",f.iframe.style.width%3Dk.scrollWidth%2Bc%2B"px",f.iframe.style.height%3Dk.scrollHeight%2Bc%2B"px",k.style.position%3D"static",l.addEventListener("click",function()%7Bdocument.body.removeChild(f.iframe),k%3Dl%3Dnull,%24heading%26%26%24heading.remove()%7D),void a(k).on("click","a",function(c)%7Bvar d%3Da(a(c.currentTarget).attr("href"))%3Ba(document.body).append(b)%3Bvar e%3Dd.offset()%3Bb.css(%7Bposition:"absolute",zIndex:1e7,top:e.top-3,left:e.left-3,width:d.outerWidth()%2B6,height:d.outerHeight()%2B6%7D)%7D))%7D)%7Dvar f%3Da("../h5o-js/dist/outliner.min.js"),g%3Da("cssify"),h%3Da("./bookmarklet.css"),i%3Da("iframeish"),j%3Dfunction(a,b,c)%7Bfor(var d%3D0%3Bd<a.length%3Bd%2B%2B)a%5Bd%5D.setAttribute(b,c)%7D%3Bif(window.jQuery)e(jQuery)%3Belse%7Bvar k%3Ddocument.createElement("script")%3Bk.addEventListener%3Fk.addEventListener("load",d,!1):k.readyState%26%26(k.onreadystatechange%3Dd),k.src%3D"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js",document.body.appendChild(k)%7D%7D,%7B"../h5o-js/dist/outliner.min.js":5,"./bookmarklet.css":1,cssify:3,iframeish:4%7D%5D,3:%5Bfunction(a,b,c)%7Bb.exports%3Dfunction(a,b)%7Bvar c%3Db%7C%7Cdocument%3Bif(c.createStyleSheet)%7Bvar d%3Dc.createStyleSheet()%3Breturn d.cssText%3Da,d.ownerNode%7Dvar e%3Dc.getElementsByTagName("head")%5B0%5D,f%3Dc.createElement("style")%3Breturn f.type%3D"text/css",f.styleSheet%3Ff.styleSheet.cssText%3Da:f.appendChild(c.createTextNode(a)),e.appendChild(f),f%7D,b.exports.byUrl%3Dfunction(a)%7Bif(document.createStyleSheet)return document.createStyleSheet(a).ownerNode%3Bvar b%3Ddocument.getElementsByTagName("head")%5B0%5D,c%3Ddocument.createElement("link")%3Breturn c.rel%3D"stylesheet",c.href%3Da,b.appendChild(c),c%7D%7D,%7B%7D%5D,4:%5Bfunction(a,b,c)%7Bfunction d(a,b)%7B"undefined"%3D%3Dtypeof b%26%26"function"%3D%3Dtypeof a%26%26(b%3Da,a%3D%7B%7D)%3Bvar c%3Da.renderTo%7C%7Cdocument.body,d%3Ddocument.createElement("iframe")%3Bd.style.border%3D"none"%3Bvar e%3D!1,f%3Dfunction()%7Bif(!e)%7Bvar a%3Dd.contentDocument%3Btry%7Ba.open()%7Dcatch(c)%7Breturn void setTimeout(f,10)%7De%3D!0,a.write("<!doctype html>"),a.close(),b(null,%7Biframe:d,document:a%7D)%7D%7D%3Bd.addEventListener("load",f),c.appendChild(d)%7Db.exports%3Dd%7D,%7B%7D%5D,5:%5Bfunction(a,b,c)%7B(function(d)%7B!function(a)%7Bif("object"%3D%3Dtypeof c%26%26"undefined"!%3Dtypeof b)b.exports%3Da()%3Belse if("function"%3D%3Dtypeof define%26%26define.amd)define(%5B%5D,a)%3Belse%7Bvar e%3Be%3D"undefined"!%3Dtypeof window%3Fwindow:"undefined"!%3Dtypeof d%3Fd:"undefined"!%3Dtypeof self%3Fself:this,e.HTML5Outline%3Da()%7D%7D(function()%7Breturn function b(c,d,e)%7Bfunction f(h,i)%7Bif(!d%5Bh%5D)%7Bif(!c%5Bh%5D)%7Bvar j%3D"function"%3D%3Dtypeof a%26%26a%3Bif(!i%26%26j)return j(h,!0)%3Bif(g)return g(h,!0)%3Bvar k%3Dnew Error("Cannot find module %27"%2Bh%2B"%27")%3Bthrow k.code%3D"MODULE_NOT_FOUND",k%7Dvar l%3Dd%5Bh%5D%3D%7Bexports:%7B%7D%7D%3Bc%5Bh%5D%5B0%5D.call(l.exports,function(a)%7Bvar b%3Dc%5Bh%5D%5B1%5D%5Ba%5D%3Breturn f(b%3Fb:a)%7D,l,l.exports,b,c,d,e)%7Dreturn d%5Bh%5D.exports%7Dfor(var g%3D"function"%3D%3Dtypeof a%26%26a,h%3D0%3Bh<e.length%3Bh%2B%2B)f(e%5Bh%5D)%3Breturn f%7D(%7B1:%5Bfunction(a,b)%7Bb.exports%3Da("./src/createOutline")%7D,%7B"./src/createOutline":2%7D%5D,2:%5Bfunction(a,b)%7Bfunction c(a,b)%7Bvar c%3D0,d%3Da.find("h1,h2,h3,h4,h5,h6,h7").filter(":visible").toArray().map(function(a)%7Bvar d%3DparseInt(a.nodeName.substr(1)),e%3Da.id%7C%7C"h5o-heading-"%2B %2B%2Bc%3Ba.id%3De%3Bvar f%3D%27<span class%3D"level">%27%2Bd%2B"</span> "%2Bb.trim(a.textContent).replace(/%5Cs%2B/g," ")%3Breturn%27<li style%3D"margin-left: %27%2Bd%2B%27em%3B"><a href%3D"%23%27%2Be%2B%27">%27%2Bf%2B"</a></li>"%7D).join("%5Cn")%3Breturn%7BasHTML:function()%7Breturn"<ul>"%2Bd%2B"</ul>"%7D%7D%7Db.exports%3Dc%7D,%7B%7D%5D%7D,%7B%7D,%5B1%5D)(1)%7D)%7D).call(this,"undefined"!%3Dtypeof global%3Fglobal:"undefined"!%3Dtypeof self%3Fself:"undefined"!%3Dtypeof window%3Fwindow:%7B%7D)%7D,%7B%7D%5D%7D,%7B%7D,%5B2%5D)%3B %7D)()'>Drag me to Bookmarks</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment