UFO on the desk

0

作品を見る
http://etext-music.com/works/svg/D3_1_2.html

・全画面モード(F11)がおすすめ。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>UFO on the desk</title>
<script src="my.js"></script>
<script src="d3.js"></script>
</head>
<body style="background-image:url('bgimg.jpg')">
<body>
<div id="canvas"></div>
<script>
d3.select("#canvas").append("svg").attr("width",500).attr("height",500)
.append("circle").attr("cx",250).attr("cy",250).attr("r",200)
.attr("fill","gold").attr("opacity",0.8)
.transition().each("end",repeat);
function repeat(){
c = d3.select(this);
(function repeat(){
c=c
.transition().duration(2000)
.attr("r",0)
.transition().duration(2000)
.attr("r",200)
.attr("fill",function(){return "rgb("+Random(255)+","+Random(255)+","+Random(255)+")"})
.each("end",repeat);
})()
};
</script>
</body>
</html>

Default