- Author:
- Martijn Laarman
- Twitter:
- @
- GitHub:
- Facebook:
- Google+:
- +
- Reddit:
- /r/
- Pouet:
- Website:
- mpdreamz.nl
- Compo:
- classic
- Demo link:
- https://js1k.com/2010-first/demo/136
- Shortlink:
- https://js1k.com/136
- Blog post:
- please update here!
- Bytes:
- 590
- Chars:
- 590
- Submission
var c=1,e=1,f=1;
setInterval(function(){var b=Math,a=document.getElementById("c").getContext("2d");c=++c%360;e=++e%1E3;f+=b.min(0.4,10/e);var d=125+b.sin(f)*75,g=b.max(0.3,0.4+b.sin(e/100)*0.4);a.save();a.clearRect(0,0,850,850);a.translate(d,75);a.scale(g,g);a.rotate(c*b.PI/180);a.strokeStyle="red";a.fillStyle="red";a.lineWidth=14;a.save();for(d=0;d<16;d++){a.beginPath();a.moveTo(100,10);a.lineTo(850,-30);a.lineTo(850,80);a.lineTo(100,20);a.fill();a.rotate(b.PI/8);a.stroke()}a.restore();a.beginPath();a.arc(0,0,108,
0,b.PI*2,true);a.fill();a.restore();a.strokeRect(0,0,300,150)},50);
- Description
- A simple animated naval ensign of Japan.
- Base64 encoded
dmFyIGM9MSxlPTEsZj0xOw0Kc2V0SW50ZXJ2YWwoZnVuY3Rpb24oKXt2YXIgYj1NYXRoLGE9ZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoImMiKS5nZXRDb250ZXh0KCIyZCIpO2M9KytjJTM2MDtlPSsrZSUxRTM7Zis9Yi5taW4oMC40LDEwL2UpO3ZhciBkPTEyNStiLnNpbihmKSo3NSxnPWIubWF4KDAuMywwLjQrYi5zaW4oZS8xMDApKjAuNCk7YS5zYXZlKCk7YS5jbGVhclJlY3QoMCwwLDg1MCw4NTApO2EudHJhbnNsYXRlKGQsNzUpO2Euc2NhbGUoZyxnKTthLnJvdGF0ZShjKmIuUEkvMTgwKTthLnN0cm9rZVN0eWxlPSJyZWQiO2EuZmlsbFN0eWxlPSJyZWQiO2EubGluZVdpZHRoPTE0O2Euc2F2ZSgpO2ZvcihkPTA7ZDwxNjtkKyspe2EuYmVnaW5QYXRoKCk7YS5tb3ZlVG8oMTAwLDEwKTthLmxpbmVUbyg4NTAsLTMwKTthLmxpbmVUbyg4NTAsODApO2EubGluZVRvKDEwMCwyMCk7YS5maWxsKCk7YS5yb3RhdGUoYi5QSS84KTthLnN0cm9rZSgpfWEucmVzdG9yZSgpO2EuYmVnaW5QYXRoKCk7YS5hcmMoMCwwLDEwOCwNCjAsYi5QSSoyLHRydWUpO2EuZmlsbCgpO2EucmVzdG9yZSgpO2Euc3Ryb2tlUmVjdCgwLDAsMzAwLDE1MCl9LDUwKTs=
- Original source
var r = 1, g= 1, l= 1, p= 100, h = 850
setInterval(function (){
var m = Math, c= document.getElementById('c').getContext('2d');
r= ++r % 360;
g= ++g % 1000;
l= l+ m.min(0.4,(10 / g));
var x = 125 + m.sin(l) * 75;
var s = m.max(0.3, 0.4 + (m.sin(g/p) * 0.4));
c.save()
c.clearRect(0,0,h,h);
c.translate(x,75);
c.scale(s,s);
c.rotate(r * m.PI/180);
c.strokeStyle = "red";
c.fillStyle = "red";
c.lineWidth = 14;
c.save();
for (var i=0;i<16;i++){
c.beginPath();
c.moveTo(p,10);
c.lineTo(h,-30);
c.lineTo(h,80);
c.lineTo(p,20);
c.fill();
c.rotate(m.PI/ 8);
c.stroke();
}
c.restore()
c.beginPath();
c.arc(0,0,p+8,0,m.PI*2,true);
c.fill()
c.restore();
c.strokeRect(0, 0, 300, 150);
},50)