mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
Longcat improvements
This fixes layout under Firefox and increases the frame rate for smoother animation.
This commit is contained in:
parent
4cf80cd49c
commit
0db96944e6
2 changed files with 6 additions and 2 deletions
|
@ -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>
|
||||||
|
|
|
@ -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();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue