Guest User

htl5jquer

a guest
Feb 24th, 2013
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.22 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <head>
  3.     <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  4.     <style>
  5.         #canvas-container {
  6.            width: 100%;
  7.            text-align:center;
  8.         }
  9.        
  10.         #button-container {
  11.            width: 100%;
  12.            text-align:center;
  13.         }
  14.  
  15.         canvas {
  16.            display: inline;
  17.         }
  18.        
  19.         address {
  20.             text-align: center;
  21.         }
  22.  
  23.         .css3button {
  24.             -moz-box-shadow:inset 0px 1px 0px 0px #ffffff;
  25.             -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff;
  26.             box-shadow:inset 0px 1px 0px 0px #ffffff;
  27.             background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ededed), color-stop(1, #dfdfdf) );
  28.             background:-moz-linear-gradient( center top, #ededed 5%, #dfdfdf 100% );
  29.             filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ededed', endColorstr='#dfdfdf');
  30.             background-color:#ededed;
  31.             -moz-border-radius:12px;
  32.             -webkit-border-radius:12px;
  33.             border-radius:12px;
  34.             border:3px solid #dcdcdc;
  35.             display:inline-block;
  36.             color:#777777;
  37.             font-family:arial;
  38.             font-size:20px;
  39.             font-weight:bold;
  40.             padding:6px 45px;
  41.             text-decoration:none;
  42.             text-shadow:1px 1px 0px #ffffff;
  43.         }.css3button:hover {
  44.             background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #dfdfdf), color-stop(1, #ededed) );
  45.             background:-moz-linear-gradient( center top, #dfdfdf 5%, #ededed 100% );
  46.             filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#dfdfdf', endColorstr='#ededed');
  47.             background-color:#dfdfdf;
  48.         }.css3button:active {
  49.             position:relative;
  50.             top:1px;
  51.         }
  52.     </style>
  53. </head>
  54. <body>
  55.     <div id="canvas-container">
  56.         <canvas id="myCanvas" width="1200" height="540" style="border: 1px gray solid;">
  57.             <p>Browser does not support canvas</p>
  58.         </canvas>
  59.     </div>
  60.     <script>
  61.         $(document).ready(function() {
  62.             var canvas = $("#myCanvas");
  63.             var context = canvas.get(0).getContext("2d");
  64.  
  65.             // The Face
  66.             context.font = '30pt Calibri';
  67.             context.textAlign = 'center';
  68.             context.fillStyle = 'blue';
  69.             context.fillText('Hello World!', 140, 100);
  70.      
  71.             context.strokeStyle = '#0000FF';
  72.             //context.fillStyle = '#FFFF00';
  73.             context.lineWidth = 4;
  74.             context.beginPath();
  75.             context.arc(620,270,250,0*Math.PI,2*Math.PI,true);
  76.             context.closePath();
  77.             context.stroke();
  78.             //context.fill();
  79.  
  80.  
  81.             // The Smile
  82.             context.strokeStyle = '#FF0000';
  83.             context.lineWidth = 2;
  84.             context.beginPath();
  85.             context.arc(620,240,200,0.2*Math.PI,0.8*Math.PI,false);
  86.             //context.closePath();
  87.             context.stroke();
  88.             //context.fill();
  89.  
  90.             // The Left eye
  91.             context.strokeStyle = '#000000';
  92.             context.fillStyle = '#000000';
  93.             context.beginPath();
  94.             context.arc(480,180,20,0*Math.PI,2*Math.PI,false);
  95.             context.closePath();
  96.             context.stroke();
  97.             context.fill();
  98.  
  99.             // The Right Eye
  100.             context.strokeStyle = '#000000';
  101.             context.fillStyle = '#000000';
  102.             context.beginPath();
  103.             context.arc(760,180,20,0*Math.PI,2*Math.PI,false);
  104.             context.closePath();
  105.             context.stroke();
  106.             context.fill();
  107.         });
  108.     </script>
  109.     <div id="button-container">
  110.         <button class="css3button">Click Me To Proceed</button>
  111.     <div id="button-container">
  112.     <address>The smile face and button were built using HTML5, jQuery 1.9.1, CSS3</address>
  113. </body>
  114. </html>
Advertisement
Add Comment
Please, Sign In to add comment