<!DOCTYPE html> <html> <body> <form name="logoform"> <table border=0> <tr><td>Team Name (up to 7 characters) </td><td><input type="text" id="teamname" maxlength=7/> </td></tr> <tr><td>Font color</td><td><input type="color" id="teamfcolor"/></td></tr> <tr><td> Backcolor</td><td><input type="Color" id="teambcolor"/></td></tr> <tr><td colspan=2><input type="button" value="Preview Logo" onclick="PreviewLogo();"/>
</td></tr> </table>
<br/> <canvas id="myCanvas" width="200" height="100" style="border:1px solid #c3c3c3;"> Your browser does not support the canvas element. <canvas>
<script type="text/javascript"> function PreviewLogo() { var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.fillStyle = logoform.teambcolor.value; ctx.fillRect(0, 0, 200, 100); ctx.font = "40pt Arial"; ctx.fillStyle = logoform.teamfcolor.value; ctx.fillText(logoform.teamname.value, 25, 60);
var grd=ctx.createLinearGradient(0,0,25,100); grd.addColorStop(0,logoform.teamfcolor.value); grd.addColorStop(1,logoform.teambcolor.value); ctx.fillStyle=grd; ctx.fillRect(0,0,25,100); } </script> </form> </body> </html>
|