JSFiddle - React, Tailwind, and code Playground
by Riccal
HTML
<script src="http://ruler.hilliuse.com/ruler/jquery.ruler.js"></script>
<script src="http://modernizr.com/downloads/modernizr-latest.js"></script>
CSS
.ruler {
background: rgba(255,255,255,1);
color: #444;
font-family: source code pro, "Arial Narrow", "Helvetica Neue", Helvetica, Arial, Veranda, sans-serif;
font-size: 12px;
line-height: 14px;
overflow: hidden;
}
.ruler > div {
background: #444;
}
.hRule {
position: fixed;
width: 100%;
height: 18px;
left: 0px;
top: 0px;
border-bottom: 1px solid;
z-index: 9;
}
.vRule {
position: absolute;
min-height: 100%;
width: 18px;
left: 0px;
top: 0px;
border-right: 1px solid;
z-index: 9;
}
.corner {
position: fixed;
top: 0px;
left: 0px;
width: 18px;
height: 18px;
border-right: 1px solid;
border-bottom: 1px solid;
z-index: 10;
}
.hRule .tickLabel {
position: absolute;
top: 0px;
width: 1px;
height: 100%;
text-indent: 1px;
}
.hRule .tickMajor {
position: absolute;
bottom: 0px;
width: 1px;
height: 6px;
}
.hRule .tickMinor {
position: absolute;
bottom: 0px;
width: 1px;
height: 4px;
}
.vRule .tickLabel {
position: absolute;
right: 0px;
height: 1px;
width: 100%;
text-indent: 1px;
}
.vRule .tickLabel span {
display: block;
position: absolute;
top: 1px;
right: 0px;
margin-right: 18px;
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform: rotate(-90deg);
-webkit-transform-origin: top right;
-moz-transform-origin: top right;
-ms-transform-origin: top right;
-o-transform-origin: top right;
transform-origin: top right;
}
.vRule .tickMajor {
position: absolute;
right: 0px;
height: 1px;
width: 6px;
}
.vRule .tickMinor {
position: absolute;
right: 0px;
height: 1px;
width: 4px;
}
.vMouse {
display: block;
position: fixed;
width: 100%;
height: 0px;
left: 0;
background: rgba(0,0,0,0);
...
JavaScript
$(function() {
$('body').ruler();
});