-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
33 lines (24 loc) · 2.79 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<!--[if lte IE 9 ]> <html class="ie" lang="en-GB"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en-GB"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Rule em all</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="assets/style.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>
<div class="wrap">
<h1>Rule <em>em</em> all</h1>
<p>Nobody likes media queries in pixels. This bookmarklets will help you setting and controlling breakpoints for your media queries. Just drag a button below to your bookmark bar.</p>
<div class="bookmarklets">
<!-- bookmarklets created with http://chriszarate.github.io/bookmarkleter/ -->
<p><a class="button" href='javascript:(function(e,t){"use strict";function i(){var e=t.innerWidth/o,i=t.innerHeight/o;e=Math.round(100*e)/100,i=Math.round(100*i)/100,a.innerHTML="W "+e+"em<br/>H "+i+"em"}if(e.getElementsByTagName("html")[0].className.match(/ie/))return!1;var n=e.body,r=5,d=e.createElement("div");d.id="emMeter",d.style.cssText="position:fixed;bottom:4rem;left:0;z-index:900",d.innerHTML=%27<div class="unit" style="width:%27+r+%27rem">0</div>%27,n.appendChild(d);var a=d.querySelector(".unit"),o=a.clientWidth/r;a.style.cssText="width:auto;padding:.4em;font-family:monospace;font-size:.9em;line-height:1.3;color:#fff;background:#000;background:rgba(0,0,0,.6)",i(),t.addEventListener("resize",i,!1)})(document,window);'>em meter</a></p>
<p><a class="button" href='javascript:(function(e,t){"use strict";function i(){var e=t.innerWidth,i=Math.floor(e/c),r="";d.className="js",d.style.width=e+"px";for(var s=1;i+1>s;s++)r+=%27<div class="unit"><span>%27+s*n+" </span></div>";d.innerHTML=r}if(e.getElementsByTagName("html")[0].className.match(/ie/))return!1;var n=5,r=e.head,s=e.body,a="#ruler .unit {float:left;width:"+n+"rem;text-align:right;overflow:hidden} ";a+="#ruler.js {position:absolute;overflow:hidden} ",a+="#ruler.js .unit {/*margin:0 -1px 0 0;/*border-right: 1px solid #ccc;*/box-shadow: -1px 0 0 #ccc inset; color: #aaa}",a+="#ruler.js span {font-family:monospace;font-size: 10px}";var l=e.createElement("style");l.type="text/css",l.styleSheet?l.styleSheet.cssText=a:l.appendChild(e.createTextNode(a)),r.appendChild(l);var d=e.createElement("div");d.id="ruler",d.style.cssText="position:fixed; top:0; left:0; z-index:900",d.innerHTML=%27<div class="unit">0</div>%27,s.appendChild(d);var o=d.querySelector(".unit"),c=o.clientWidth;i(),t.addEventListener("resize",i,!1)})(document,window);'>em ruler</a></p>
</div>
</div>
<script type="text/javascript" src="emeter.js"></script>
<script type="text/javascript" src="emruler.js"></script>
</body>
</html>