Skip to content

Instantly share code, notes, and snippets.

@gabrieldance
Last active December 17, 2015 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gabrieldance/5645496 to your computer and use it in GitHub Desktop.
Save gabrieldance/5645496 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>GIA Button Example</title>
<link rel="stylesheet" type="text/css" href="gia-tabbed-buttons.css">
</head>
<body>
<h1>GIA Button Example</h1>
<a class="gia-tabbed-button gia-tabbed-button-first" href="#1">One</a>
<a class="gia-tabbed-button gia-tabbed-button-selected" href="#2">Two</a>
<a class="gia-tabbed-button" href="#3">Three</a>
<a class="gia-tabbed-button gia-tabbed-button-last" href="#4">Four</a>
<br>
<br>
<br>
<div class="gia-tabbed-button gia-tabbed-button-first">Five</div>
<div class="gia-tabbed-button">Six</div>
<div class="gia-tabbed-button">Seven</div>
<div class="gia-tabbed-button gia-tabbed-button-last">Eight</div>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$('.gia-tabbed-button').on('click', function(e) {
console.log("clicked!")
// $('.gia-tabbed-button').on('mouseup', function(e) {
$('.gia-tabbed-button-selected').removeClass('gia-tabbed-button-selected')
$(this).addClass('gia-tabbed-button-selected')
})
$('#btn-income').trigger('click')
</script>
</body>
</html>
/*
NOTES:
Put a ".gia-tabbed-button-first" class on the first element,
and a ".gia-tabbed-button-last" class on the last one
to achieve slightly rounded corners
*/
/* all buttons in a series get this class */
.gia-tabbed-button {
display: inline-block;
padding: 8px 22px;
margin-right: -5px;
color: #505050;
font-size: 14px;
font-family: Helvetica, Arial, sans-serif;
font-weight: 200;
line-height: 1em;
cursor: pointer;
text-shadow:1px 1px 1px rgba(255,255,255,.2);
-webkit-background-clip: text;
-moz-background-clip: text;
background-clip: text;
border:1px solid #b4b4b4;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ffffff), color-stop(1, #dcdcdc) );
background:-moz-linear-gradient( center top, #ffffff 5%, #dcdcdc 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#dcdcdc');
background-color:#ffffff;
text-decoration: none;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.gia-tabbed-button:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f5f5f5), color-stop(1, #d2d2d2) );
background:-moz-linear-gradient( center top, #f5f5f5 5%, #d2d2d2 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#d2d2d2');
background-color:#d2d2d2;
}
/* put this class on the first element in the series */
.gia-tabbed-button-first {
-moz-border-top-left-radius:2px;
-webkit-border-top-left-radius:2px;
border-top-left-radius:2px;
-moz-border-bottom-left-radius:2px;
-webkit-border-bottom-left-radius:2px;
border-bottom-left-radius:2px;
}
/* put this class on the last element in the series */
.gia-tabbed-button-last {
-moz-border-top-right-radius:2px;
-webkit-border-top-right-radius:2px;
border-top-right-radius:2px;
-moz-border-bottom-right-radius:2px;
-webkit-border-bottom-right-radius:2px;
border-bottom-right-radius:2px;
}
.gia-tabbed-button:active {
-moz-box-shadow:inset 0px 1px 1px 0px #f0f0f0;
-webkit-box-shadow:inset 0px 1px 1px 0px #f0f0f0;
box-shadow:inset 0px 1px 1px 0px #f0f0f0;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #d2d2d2), color-stop(1, #f5f5f5) );
background:-moz-linear-gradient( center top, #d2d2d2 5%, #f5f5f5 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#d2d2d2', endColorstr='#f5f5f5');
background-color:#d2d2d2;
}
.gia-tabbed-button-selected,
.gia-tabbed-button-selected:hover {
color: #fff;
/* if text is 20px or larger */
text-shadow:-2px -2px 0px #074168, 1px 1px 1px rgba(255,255,255,.2);
/* if text is smaller than 20px */
text-shadow:-1px -1px 0px #074168;
-webkit-background-clip: text;
-moz-background-clip: text;
background-clip: text;
border:1px solid #074168;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #125185), color-stop(1, #2068a4) );
background:-moz-linear-gradient( center top, #125185 5%, #2068a4 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#125185', endColorstr='#2068a4');
background-color:#125185;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment