Skip to content

Instantly share code, notes, and snippets.

@jdrew1303
Forked from pixbit/index.html
Created November 15, 2012 17:18
Show Gist options
  • Save jdrew1303/4079886 to your computer and use it in GitHub Desktop.
Save jdrew1303/4079886 to your computer and use it in GitHub Desktop.
CSS brushed metal
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CSS brushed metal by Simurai &middot; CodePen</title>
<!--
Copyright (c) 2012 Hugo Giraudel, http://codepen.io/HugoGiraudel
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<link rel="stylesheet" href="http://codepen.io/stylesheets/css/reset.css">
<style>
@import "http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold";
html {
background-color: #D8D8D8;
font: 62.5%/1 "Droid Sans", "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
}
body {
margin: 100px;
}
button {
border: medium none;
display: block;
}
a {
display: block;
text-decoration: none;
}
.metal {
background-color: #E5E5E5;
color: #333333;
font: bold 6em/2em "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
margin: 40px auto;
position: relative;
text-align: center;
text-shadow: 0 -1px 0 rgba(102, 102, 102, 0.5), 0 2px 1px rgba(255, 255, 255, 0.6);
}
.radial.metal {
border-radius: 80px 80px 80px 80px;
height: 160px;
line-height: 160px;
width: 160px;
}
.metal.radial:before, .metal.radial:after {
border-radius: inherit;
content: "";
height: inherit;
left: 0;
position: absolute;
top: 0;
width: inherit;
}
.metal.linear {
border-radius: 0.5em 0.5em 0.5em 0.5em;
font-size: 4em;
height: 80px;
width: 100px;
}
.metal.linear.oval {
font-feature-settings: normal;
font-language-override: normal;
border-radius: 50% 50% 50% 50%;
font-family: Georgia,"Times New Roman",Times,serif;
font-size: 3em;
font-size-adjust: none;
font-stretch: normal;
font-style: italic;
font-variant: normal;
font-weight: bold;
height: 60px;
line-height: 60px !important;
margin-top: 100px;
width: 70px;
}
.metal:active {
color: #0066CC;
text-shadow: 0 -1px 0 rgba(0, 51, 102, 0.3), 0 2px 1px #b2d8ff, 0 0 5px #99ddff, 0 0 20px rgba(0, 127, 255, 0.6);
}
html {
background-image: repeating-linear-gradient(45deg, transparent 0px, rgba(0, 0, 0, 0.016) 5px), repeating-linear-gradient(-45deg, transparent 0px, rgba(0, 0, 0, 0.016) 5px);
}
.metal {
transition: color 0.2s ease 0s;
box-shadow: 0 0 0 4px #262626 inset, 0 -1px 5px 4px rgba(38, 38, 38, 0.8) inset, 0 -1px 0 7px rgba(0, 0, 0, 0.25) inset, 0 2px 1px 7px rgba(255, 255, 255, 0.7) inset, 0 -5px 6px 4px rgba(0, 0, 0, 0.15), 0 5px 6px 4px rgba(255, 255, 255, 0.5);
}
.metal.radial:before {
transform: rotate(65deg);
}
.metal.radial:after {
transform: rotate(-65deg);
}
.metal.linear {
background-image: repeating-linear-gradient(left center, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 6%, rgba(255, 255, 255, 0.1) 7.5%), repeating-linear-gradient(left center, transparent 0%, transparent 4%, rgba(0, 0, 0, 0.03) 4.5%), repeating-linear-gradient(left center, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 1.2%, rgba(255, 255, 255, 0.15) 2.2%), linear-gradient(-90deg, #c6c6c6 0%, #e5e5e5 47%, #c6c6c6 53%, #b2b2b2 100%);
}
.metal:active {
box-shadow: 0 0 0 4px #004c99 inset, 0 -1px 5px 4px rgba(0, 38, 76, 0.4) inset, 0 -1px 0 7px rgba(0, 51, 102, 0.25) inset, 0 2px 1px 7px rgba(255, 255, 255, 0.7) inset, 0 0 3px 2px rgba(127, 191, 255, 0.8), 0 -5px 6px 4px rgba(50, 102, 153, 0.25), 0 5px 6px 4px #e8f2fc;
}
h1 {
position: absolute;
top: 0;
left: 0;
padding: 10px;
font-size: 30px;
text-shadow: 0 1px 0 white;
}
</style>
<style>
#codepen-footer, #codepen-footer * {
-webkit-box-sizing: border-box !important;
-moz-box-sizing: border-box !important;
box-sizing: border-box !important;
}
#codepen-footer {
display: block !important;
position: fixed !important;
bottom: 0 !important;
left: 0 !important;
width: 100% !important;
padding: 0 10px !important;
margin: 0 !important;
height: 30px !important;
line-height: 30px !important;
font-size: 12px !important;
color: #eeeeee !important;
background-color: #505050 !important;
text-align: left !important;
background: -webkit-linear-gradient(top, #505050, #383838) !important;
background: -moz-linear-gradient(top, #505050, #383838) !important;
background: -ms-linear-gradient(top, #505050, #383838) !important;
background: -o-linear-gradient(top, #505050, #383838) !important;
border-top: 1px solid black !important;
border-bottom: 1px solid black !important;
border-radius: 0 !important;
border-image: none !important;
box-shadow: inset 0 1px 0 #6e6e6e, 0 2px 2px rgba(0, 0, 0, 0.4) !important;
z-index: 300 !important;
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, sans-serif !important;
letter-spacing: 0 !important;
word-spacing: normal !important;
word-spacing: 0 !important;
-webkit-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
-o-transform: none !important;
transform: none !important;
}
#codepen-footer a {
color: #a7a7a7 !important;
text-decoration: none !important;
text-shadow: none !important;
border: 0 !important;
}
#codepen-footer a:hover {
color: white !important;
}
</style>
<script>
// Kill alerts, confirmations and prompts
// window.alert = function(){}; we're going to allow alerts for now
window.confirm = function(){};
window.prompt = function(){};
window.open = function(){};
window.print = function(){};
</script>
<script src="http://codepen.io/javascripts/libs/prefixfree.min.js"></script>
</head>
<body>
<button class="metal radial">✈</button>
<button class="metal linear">2</button>
<button class="metal linear">1</button>
<button class="metal linear">0</button>
<a class="metal linear oval" href="http://simurai.com/post/9214147117/css3-brushed-metal">i</a>
<h1>Brushed Metal by <a href="http://simurai.com/post/9214147117/css3-brushed-metal" title="Brushed Metal by Simurai">Simurai</a></h1>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://codepen.io/javascripts/libs/modernizr.js"></script>
<script>
(function() {
/* From Simurai on : http://simurai.com/post/9214147117/css3-brushed-metal */
})();
</script>
<div id="codepen-footer">
<a style="color: #f73535 !important;" href="https://codepen.wufoo.com/forms/m7x3r3/def/field14=" onclick="window.open(this.href, null, 'height=517, width=680, toolbar=0, location=0, status=1, scrollbars=1, resizable=1'); return false">Report Abuse</a>
&nbsp;
<a href="/HugoGiraudel/pen/lewfd" target="_blank">Edit this Pen</a>
</div>
</body>
</html>
/* From Simurai on : http://simurai.com/post/9214147117/css3-brushed-metal */
<button class="metal radial">✈</button>
<button class="metal linear">2</button>
<button class="metal linear">1</button>
<button class="metal linear">0</button>
<a class="metal linear oval" href="http://simurai.com/post/9214147117/css3-brushed-metal">i</a>
<h1>Brushed Metal by <a href="http://simurai.com/post/9214147117/css3-brushed-metal" title="Brushed Metal by Simurai">Simurai</a></h1>
@import "compass";
@import "http://fonts.googleapis.com/css?family=Droid+Sans:regular,bold";
html {
background-color: #D8D8D8;
font: 62.5%/1 "Droid Sans","Lucida Sans Unicode","Lucida Grande",Verdana,Arial,Helvetica,sans-serif;
}
body {
margin: 100px;
}
button {
border: medium none;
display: block;
}
a {
display: block;
text-decoration: none;
}
.metal {
background-color: #E5E5E5;
color: #333333;
font: bold 6em/2em "Helvetica Neue",Arial,Helvetica,Geneva,sans-serif;
margin: 40px auto;
position: relative;
text-align: center;
text-shadow: 0 -1px 0 rgba(102, 102, 102, 0.5), 0 2px 1px rgba(255, 255, 255, 0.6);
}
.radial.metal {
border-radius: 80px 80px 80px 80px;
height: 160px;
line-height: 160px;
width: 160px;
}
.metal.radial:before, .metal.radial:after {
border-radius: inherit;
content: "";
height: inherit;
left: 0;
position: absolute;
top: 0;
width: inherit;
}
.metal.linear {
border-radius: 0.5em 0.5em 0.5em 0.5em;
font-size: 4em;
height: 80px;
width: 100px;
}
.metal.linear.oval {
font-feature-settings: normal;
font-language-override: normal;
border-radius: 50% 50% 50% 50%;
font-family: Georgia,"Times New Roman",Times,serif;
font-size: 3em;
font-size-adjust: none;
font-stretch: normal;
font-style: italic;
font-variant: normal;
font-weight: bold;
height: 60px;
line-height: 60px !important;
margin-top: 100px;
width: 70px;
}
.metal:active {
color: #0066CC;
text-shadow: 0 -1px 0 rgba(0, 51, 102, 0.3), 0 2px 1px #B2D8FF, 0 0 5px #99DDFF, 0 0 20px rgba(0, 127, 255, 0.6);
}
html {
background-image: repeating-linear-gradient(45deg, transparent 0px, rgba(0, 0, 0, 0.016) 5px), repeating-linear-gradient(-45deg, transparent 0px, rgba(0, 0, 0, 0.016) 5px);
}
.metal {
transition: color 0.2s ease 0s;
box-shadow:
0 0 0 4px #262626 inset,
0 -1px 5px 4px rgba(38, 38, 38, 0.8) inset,
0 -1px 0 7px rgba(0, 0, 0, 0.25) inset,
0 2px 1px 7px rgba(255, 255, 255, 0.7) inset,
0 -5px 6px 4px rgba(0, 0, 0, 0.15),
0 5px 6px 4px rgba(255, 255, 255, 0.5);
}
.metal.radial:before {
transform: rotate(65deg);
}
.metal.radial:after {
transform: rotate(-65deg);
}
.metal.linear {
background-image:
repeating-linear-gradient(left center , rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 6%, rgba(255, 255, 255, 0.1) 7.5%),
repeating-linear-gradient(left center , transparent 0%, transparent 4%, rgba(0, 0, 0, 0.03) 4.5%),
repeating-linear-gradient(left center , rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0) 1.2%, rgba(255, 255, 255, 0.15) 2.2%),
linear-gradient(-90deg, #C6C6C6 0%, #E5E5E5 47%, #C6C6C6 53%, #B2B2B2 100%);
}
.metal:active {
box-shadow:
0 0 0 4px #004C99 inset,
0 -1px 5px 4px rgba(0, 38, 76, 0.4) inset,
0 -1px 0 7px rgba(0, 51, 102, 0.25) inset,
0 2px 1px 7px rgba(255, 255, 255, 0.7) inset,
0 0 3px 2px rgba(127, 191, 255, 0.8),
0 -5px 6px 4px rgba(50, 102, 153, 0.25),
0 5px 6px 4px #E8F2FC;
}
h1 {
position:absolute;
top:0;
left:0;
padding:10px;
font-size:30px;
text-shadow:0 1px 0 white;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment