Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <head>
- <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
- <style>
- #canvas-container {
- width: 100%;
- text-align:center;
- }
- #button-container {
- width: 100%;
- text-align:center;
- }
- canvas {
- display: inline;
- }
- address {
- text-align: center;
- }
- .css3button {
- -moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
- -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
- box-shadow:inset 0px 1px 0px 0px #ffffff;
- background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
- background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
- background-color:#ededed;
- -moz-border-radius:12px;
- -webkit-border-radius:12px;
- border-radius:12px;
- border:3px solid #dcdcdc;
- display:inline-block;
- color:#777777;
- font-family:arial;
- font-size:20px;
- font-weight:bold;
- padding:6px 45px;
- text-decoration:none;
- text-shadow:1px 1px 0px #ffffff;
- }.css3button:hover {
- background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed) );
- background:-moz-linear-gradient( center top, #dfdfdf 5%, #ededed 100% );
- filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
- background-color:#dfdfdf;
- }.css3button:active {
- position:relative;
- top:1px;
- }
- </style>
- </head>
- <body>
- <div id="canvas-container">
- <canvas id="myCanvas" width="1200" height="540" style="border: 1px gray solid;">
- <p>Browser does not support canvas</p>
- </canvas>
- </div>
- <script>
- $(document).ready(function() {
- var canvas = $("#myCanvas");
- var context = canvas.get(0).getContext("2d");
- // The Face
- context.font = '30pt Calibri';
- context.textAlign = 'center';
- context.fillStyle = 'blue';
- context.fillText('Hello World!', 140, 100);
- context.strokeStyle = '#0000FF';
- //context.fillStyle = '#FFFF00';
- context.lineWidth = 4;
- context.beginPath();
- context.arc(620,270,250,0*Math.PI,2*Math.PI,true);
- context.closePath();
- context.stroke();
- //context.fill();
- // The Smile
- context.strokeStyle = '#FF0000';
- context.lineWidth = 2;
- context.beginPath();
- context.arc(620,240,200,0.2*Math.PI,0.8*Math.PI,false);
- //context.closePath();
- context.stroke();
- //context.fill();
- // The Left eye
- context.strokeStyle = '#000000';
- context.fillStyle = '#000000';
- context.beginPath();
- context.arc(480,180,20,0*Math.PI,2*Math.PI,false);
- context.closePath();
- context.stroke();
- context.fill();
- // The Right Eye
- context.strokeStyle = '#000000';
- context.fillStyle = '#000000';
- context.beginPath();
- context.arc(760,180,20,0*Math.PI,2*Math.PI,false);
- context.closePath();
- context.stroke();
- context.fill();
- });
- </script>
- <div id="button-container">
- <button class="css3button">Click Me To Proceed</button>
- <div id="button-container">
- <address>The smile face and button were built using HTML5, jQuery 1.9.1, CSS3</address>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment