Team:Acton-BoxboroughRHS/Simulations
From 2014hs.igem.org
(Difference between revisions)
Line 142: | Line 142: | ||
ctx.stroke(); | ctx.stroke(); | ||
*/ | */ | ||
+ | var t=0; | ||
+ | |||
+ | function clock(i){ | ||
+ | i%=2*Math.PI | ||
+ | return 4*Math.cos(i); | ||
+ | } | ||
+ | function render(){ | ||
ctx.fillStyle="rgb(245,245,245)"; | ctx.fillStyle="rgb(245,245,245)"; | ||
ctx.fillRect(0,0,500,500); | ctx.fillRect(0,0,500,500); | ||
+ | |||
+ | |||
+ | ctx.fillStyle="black"; | ||
ctx.font = "30px Arial"; | ctx.font = "30px Arial"; | ||
- | ctx. | + | ctx.fillText("Plasmid",10,50+clock(t+3)); |
ctx.font = "12px Arial"; | ctx.font = "12px Arial"; | ||
- | ctx. | + | ctx.fillText("Backbone",200,370); |
ctx.font = "10px Arial"; | ctx.font = "10px Arial"; | ||
- | ctx. | + | ctx.fillText("RBS",120,200); |
ctx.font = "10px Arial"; | ctx.font = "10px Arial"; | ||
- | ctx. | + | ctx.fillText("Promoter",190,130); |
ctx.font = "10px Arial"; | ctx.font = "10px Arial"; | ||
- | ctx. | + | ctx.fillText("ORF",280,130); |
ctx.font = "10px Arial"; | ctx.font = "10px Arial"; | ||
- | ctx. | + | ctx.fillText("Terminator",350,200); |
ctx.strokeStyle="green"; | ctx.strokeStyle="green"; | ||
Line 188: | Line 198: | ||
ctx.arc(250,250,100,1.75*Math.PI,0); | ctx.arc(250,250,100,1.75*Math.PI,0); | ||
ctx.stroke(); | ctx.stroke(); | ||
- | + | ||
+ | setTimeout(render,1000/60) | ||
+ | |||
+ | t+=Math.PI/36 | ||
+ | } | ||
+ | |||
+ | render(); | ||
+ | |||
</script> | </script> | ||
Revision as of 01:06, 4 June 2014
Note that this is test JavaScript:
Still Under Construction