Skip to content

Instantly share code, notes, and snippets.

@lightyrs
Created July 30, 2011 05:50
Show Gist options
  • Save lightyrs/1115245 to your computer and use it in GitHub Desktop.
Save lightyrs/1115245 to your computer and use it in GitHub Desktop.
OS X HUD Panel in Pure CSS3
<!-- http://bobjr.ru/hud/simulator.html -->
<div id="window">
<div id="title">
<div id="close"></div>
Applied Styles
</div>
<div id="content">
<div class="row odd"></div>
<div class="row even"></div>
<div id="footer">
<div id="button">Button</div>
</div>
</div>
</div>
div#window {
border: 1px solid rgba(86, 86, 86, 0.87);
-webkit-border-radius: 6px;
-moz-box-shadow: 0 2px 7px rgba(0, 0, 0, 0.81);
-webkit-box-shadow: 0 2px 7px rgba(0, 0, 0, 0.81);
box-shadow: 0 2px 7px rgba(0, 0, 0, 0.81);
border-bottom: 1px solid rgba(66, 66, 66, 0.87);
border-top: none;
width: 500px;
margin-left: auto;
margin-right: auto;
margin-top: 130px;
}
#title {
font: 11px/15px "Lucida Grande";
border-top: 1px solid rgba(151, 151, 151, 0.92);
height: 18px;
-webkit-border-radius: 6px;
-webkit-border-bottom-left-radius: 0px;
-webkit-border-bottom-right-radius: 0px;
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(108, 108, 108, 0.9)), color-stop(0.5, rgba(87, 87, 87, 0.88)), color-stop(0.5, rgba(75, 75, 75, 0.86)), to(rgba(75, 75, 75, 0.86)));
margin-top: 0;
margin-left: 0;
margin-right: 0;
color: rgba(255, 255, 255, 0.9);
text-align: center;
border-bottom-left-radius: 0px 0px;
border-bottom-right-radius: 0px 0px;
}
#close {
width: 13px;
height: 13px;
background-image: url(close.png);
display: block;
position: absolute;
opacity: 0.9;
margin-left: 4px;
margin-top: 2px;
-webkit-transition-duration: 0.1s;
-webkit-transition-property: opacity;
cursor: pointer;
}
#close:hover {
opacity: 1;
}
div#content {
margin-left: -1px;
margin-right: -1px;
}
.row {
font: normal 11px/18px "Lucida Grande";
color: rgba(255, 255, 255, 0.85);
display: block;
background-color: rgba(79, 79, 79, 0.87);
padding: 7px 16px;
border-left: 1px solid rgba(255, 255, 255, 0.12);
border-right: 1px solid rgba(255, 255, 255, 0.12);
-webkit-transition-duration: 0.07s;
-webkit-transition-property: background;
cursor: pointer;
}
.row:nth-child(odd) {
background-color: rgba(43, 43, 43, 0.85);
}
.text {
font: normal 11px/18px "Lucida Grande";
color: rgba(255, 255, 255, 0.85);
cursor: pointer;
}
div#footer {
background-color: gray;
margin-left: auto;
margin-right: auto;
text-align: center;
background-color: rgba(43, 43, 43, 0.85);
-webkit-border-bottom-left-radius: 6px;
-webkit-border-bottom-right-radius: 6px;
border-top: 1px solid rgba(0, 0, 0, 0.19);
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
border-left: 1px solid rgba(255, 255, 255, 0.08);
border-right: 1px solid rgba(255, 255, 255, 0.08);
border-bottom-left-radius: 6px 6px;
border-bottom-right-radius: 6px 6px;
}
#button {
font: normal 11px/13px "Lucida Grande";
color: white;
-webkit-border-radius: 5px;
display: inline-block;
padding: 1px 8px 3px;
-webkit-box-shadow: 0 1px 1px rgba(255, 255, 255, 0.04), 0 1px 0px rgba(255, 255, 255, 0.07), 0 -1px 1px rgba(0, 0, 0, 0.15), inset 0 0px 1px rgba(255, 255, 255, 0.48), inset 0 1px 0px rgba(255, 255, 255, 0.12);
background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0.2)), color-stop(0.5, rgba(255, 255, 255, 0.07)), color-stop(0.5, rgba(255, 255, 255, 0)), to(rgba(255, 255, 255, 0))) rgba(255, 255, 255, 0.0);
border-top: 1px solid rgba(0, 0, 0, 0.35);
border-right: 1px solid rgba(0, 0, 0, 0.5);
border-bottom: 1px solid rgba(0, 0, 0, 0.6);
border-left: 1px solid rgba(0, 0, 0, 0.5);
margin: 20px auto;
cursor: pointer;
}
#button:active {
background-image:
-webkit-gradient(linear, left bottom, left top, from(rgba(255, 255, 255, 0.1)),
to(rgba(255, 255, 255, 0.6)));
-webkit-box-shadow:
0 1px 1px rgba(0, 0, 0, 0.2),
0 -1px 1px rgba(0, 0, 0, 0.15),
inset 0 0px 1px rgba(255, 255, 255, 0.48),
inset 0 1px 0px rgba(255, 255, 255, 0.12);
}
#button:after {
content: "";
width: 7px;
height: 6px;
display: inline-block;
background-image: url(arrow.png);
margin-left: 18px;
position: relative;
top: -1px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment