Created
May 17, 2011 09:23
-
-
Save Victa/976195 to your computer and use it in GitHub Desktop.
Apple-esque toolbar (navbar) CSS3 & canvas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<title>Tabbar canvas</title> | |
<canvas id="toolbar"></canvas> | |
<script> | |
var canvas = document.getElementById("toolbar"); | |
var context = canvas.getContext("2d"); | |
var gradient = context.createLinearGradient(0, 0, 0, 44); | |
gradient.addColorStop(0,'#2F2F2F'); | |
gradient.addColorStop(0.5,'#151515'); | |
gradient.addColorStop(0.51,'#000000'); | |
gradient.addColorStop(1,'#000000'); | |
context.fillStyle = gradient; | |
context.fillRect(0, 0, 300, 44); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<title>Tabbar CSS3</title> | |
<style> | |
#toolbar { | |
width: 100%; | |
height: 44px; | |
background-color: #000000; | |
border-top: 1px solid #4B4B4B; | |
background-image: -moz-linear-gradient(top, #2F2F2F, #151515 50%, #000000 51%, #000000); | |
background-image: -o-linear-gradient(top, #2F2F2F, #151515 50%, #000000 51%, #000000); | |
background-image: -WebKit-gradient(linear, 0% 0%, 0% 100%, from(#2F2F2F), color-stop(50%, #151515), color-stop(51%, #000000), to(#000000)); | |
background-image: linear-gradient(top, #2F2F2F, #151515 50%, #000000 51%, #000000); | |
} | |
</style> | |
<div id="toolbar"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment