samedi 19 janvier 2019

many circles

<!DOCTYPE html>
<html>
<head>
<title>JSVG</title>
<style>
html,body{margin:0;padding:0;}
body{overflow:hidden;}
</style>
</head>
<body>
<svg width="0" height="0" id="svg"></svg>
<script>
var ww=window.innerWidth;
var wh=window.innerHeight;
var d=ww;
document.getElementById("svg").setAttribute("width",ww);
document.getElementById("svg").setAttribute("height",wh);
while (d>=1){
var svg=document.getElementsByTagName('svg')[0];
var newElement=document.createElementNS("http://www.w3.org/2000/svg","circle");
var c0='#'+Math.round(0xFFFFFF * Math.random()).toString(16);
newElement.setAttribute("cx",ww/2);
newElement.setAttribute("cy",wh/2);
newElement.setAttribute("r",d);
newElement.style.fill=c0;
svg.appendChild(newElement);
d=d-1;
}
</script>
</body>
</html>