enhanced network animation (smooth loading, reload not all 4 animation phases at once)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6943 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 103c848af8
commit d5d48b8dc7

@ -11,26 +11,30 @@
<script type="text/javascript"> <script type="text/javascript">
imagestub = "NetworkPicture.png?width=768&height=576&bgcolor=FFFFFF&coronaangle="; imagestub = "NetworkPicture.png?width=768&height=576&bgcolor=FFFFFF&coronaangle=";
imageindex = 0; imageanimindex = 0;
imageloadindex = 0;
imagecycles = 0; imagecycles = 0;
imagearray = new Array(4); imagearray = new Array(4);
setTimeout("initanimation()", 100); setTimeout("initanimation()", 100);
setTimeout("doanimation()", 1000); setTimeout("doanimation()", 1000);
function initanimation() { function initanimation() {
for (j = 0; j < 4; j++) { handle = new Date().getTime();
imagearray[j] = new Image(768, 576); for (j = 0; j < 4; j++) initanimationphase(j, handle);
angle = j * 90; }
time = new Date().getTime(); function initanimationphase(phase, handle) {
imagearray[j].src = imagestub + angle + "&time=" + time; imagearray[phase] = new Image(768, 576);
} angle = phase * 90;
imagearray[phase].src = imagestub + angle + "&handle=" + handle;
} }
function doanimation() { function doanimation() {
document.getElementById("NetworkPicture").src = imagearray[imageindex].src; document.getElementById("NetworkPicture").src = imagearray[imageanimindex].src;
imageindex++; imageanimindex++;
if (imageindex == 4) { imageindex = 0; } if (imageanimindex == 4) { imageanimindex = 0; }
imagecycles++; imagecycles++;
if (imagecycles == 100) { if (imagecycles == 25) {
initanimation(); initanimationphase(imageloadindex, new Date().getTime());
imageloadindex++;
if (imageloadindex == 4) { imageloadindex = 0; }
imagecycles = 0; imagecycles = 0;
} }
setTimeout("doanimation()", 100); setTimeout("doanimation()", 100);

Loading…
Cancel
Save