try to draw 1000*1000 svg grig

This commit is contained in:
Gnieark 2016-06-29 11:46:10 +02:00
parent dbe245db5b
commit e38534f89c
2 changed files with 4 additions and 6 deletions

View File

@ -9,14 +9,12 @@ function createElem(type,attributes){
function tron(bot1,bot2,xdcheck){ function tron(bot1,bot2,xdcheck){
//empty //empty
while (document.getElementById('fightResult').firstChild) {
document.getElementById('fightResult').removeChild(document.getElementById('fightResult').firstChild);
}
var mapImg = createElem('svg',{'alt' : 'map','width':'200','height':'200'}); var mapImg = createElem('svg',{'alt' : 'map','width':'200','height':'200'});
// "circle" may be any tag name // "circle" may be any tag name
mapImg.innerHTML = '<line x1="50" y1="50" x2="150" y2="150" stroke="black" stroke-width="2" /><line x1="100" y1="50" x2="200" y2="150" stroke="red" stroke-width="10" /><line x1="150" y1="50" x2="250" y2="150" stroke="blue" stroke-width="5" stroke-dasharray="5,3,2" />'; mapImg.innerHTML = '<line x1="50" y1="50" x2="150" y2="150" stroke="black" stroke-width="2" /><line x1="100" y1="50" x2="200" y2="150" stroke="red" stroke-width="10" /><line x1="150" y1="50" x2="250" y2="150" stroke="blue" stroke-width="5" stroke-dasharray="5,3,2" />';
document.getElementById('fightResult').appendChild(mapImg); document.getElementById('mainArticle').appendChild(mapImg);
} }

View File

@ -13,7 +13,7 @@
require_once(__DIR__."/functions.php"); require_once(__DIR__."/functions.php");
$bots=get_Bots_Array('tron'); $bots=get_Bots_Array('tron');
?> ?>
<article> <article id="mainArticle">
<h2><?php echo $lang['MAKE_DUEL'];?></h2> <h2><?php echo $lang['MAKE_DUEL'];?></h2>
<p> <p>
<select name="bot1" id="bot1"> <select name="bot1" id="bot1">
@ -34,5 +34,5 @@ $bots=get_Bots_Array('tron');
</p> </p>
<p><input type="checkbox" id="fullLogs"/><label for="fullLogs">view the full logs</label></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> <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>
<div id="fightResult"></div>
</article> </article>