try to draw 1000*1000 svg grig

This commit is contained in:
Gnieark 2016-06-29 12:09:02 +02:00
parent 289e1eac2d
commit 4c628de03a
2 changed files with 9 additions and 7 deletions

View File

@ -8,9 +8,11 @@ function createElem(type,attributes){
function tron(bot1,bot2,xdcheck){
var mapImg = createElem('svg',{'version':'1.1','alt' : 'map','width':'200','height':'200','xmlns':'http://www.w3.org/2000/svg','viewBox':'0 0 20 20'});
// "circle" may be any tag name
mapImg.innerHTML = ' <rect id="rect1" x="10" y="10" width="50" height="80" style="stroke:#000000; fill:none;"/>';
document.getElementById('mainArticle').appendChild(mapImg);
var mapImg = document.getElementById("map");
var rect=createElem('rect',{'x':'10','y':'10','width':'50','height':'80','style':'stroke:#000000; fill:none;'});
mapImg.appendChild(rect);
}

View File

@ -34,7 +34,7 @@ $bots=get_Bots_Array('tron');
</p>
<p><input type="checkbox" id="fullLogs"/><label for="fullLogs">view the full logs</label></p>
<p><input id="fightButton" type="button" value="<?php echo $lang['FIGHT']; ?>" onclick="tron(document.getElementById('bot1').value,document.getElementById('bot2').value,'<?php echo xd_check_input(2); ?>',0);"></p>
<svg width="100" height="100">
<circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" />
<svg id="map" width="1000" height="1000">
</svg>
</article>