Longcat improvements

This fixes layout under Firefox and increases the frame rate for smoother animation.
This commit is contained in:
Brian Anderson 2013-09-12 13:12:49 -07:00
parent 4cf80cd49c
commit 0db96944e6
2 changed files with 6 additions and 2 deletions

View file

@ -1,5 +1,8 @@
<html> <html>
<head> <head>
<style type="text/css">
p { margin: 0px; fonts-size: 0px }
</style>
</head> </head>
<body> <body>
<p><img src="longcattop.png"/></p> <p><img src="longcattop.png"/></p>

View file

@ -14,10 +14,11 @@ function wait_for_img_load(f) {
wait_for_img_load(function() { wait_for_img_load(function() {
var count = 0; var count = 0;
function elongate() { function elongate() {
let height = Math.round((Math.sin(count) + 1) * 70 + 20); var height = Math.round((Math.cos(count + Math.PI) + 1) * 100 + 20);
count += 0.2; count += 0.2;
longcat_mid.height = height; longcat_mid.height = height;
window.setTimeout(function() { elongate() }, 100); longcat_mid.width = 600;
window.setTimeout(function() { elongate() }, 50);
} }
elongate(); elongate();
}); });