Skip to content
Permalink
Browse files

#4251 - Added visual test pages

  • Loading branch information...
rdworth committed Mar 18, 2009
1 parent b025e67 commit 8120dfa0d02611a5c3dfc83192fa51115eab956b
@@ -0,0 +1,43 @@
<!doctype html>
<html lang="en">
<head>
<title>Animate Visual Test : Animate backgroundColor hex</title>
<link rel="stylesheet" href="../visual.css" type="text/css" />
<link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">
<script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
<script type="text/javascript" src="../../../ui/effects.core.js"></script>
<script type="text/javascript">
function hexFromRGB (r, g, b) {
var hex = [
r.toString(16),
g.toString(16),
b.toString(16)
];
$.each(hex, function (nr, val) {
if (val.length == 1) {
hex[nr] = '0' + val;
}
});
return hex.join('').toUpperCase();
}
function randomColorHex() {
return '#' + hexFromRGB(Math.floor(Math.random()*256), Math.floor(Math.random()*256), Math.floor(Math.random()*256));
}
$(function() {
$("#go").click(function() {
$("#animate-backgroundColor").stop().animate({ backgroundColor: randomColorHex() }, "fast");
});
})
</script>
<style type="text/css">
#animate-backgroundColor { width: 100px; height: 100px; background-color: gray; }
</style>
</head>
<body>

<div id="animate-backgroundColor"></div>

<button id="go">Go</button>

</body>
</html>
@@ -0,0 +1,34 @@
<!doctype html>
<html lang="en">
<head>
<title>Animate Visual Test : Animate backgroundColor rgb</title>
<link rel="stylesheet" href="../visual.css" type="text/css" />
<link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">
<script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
<script type="text/javascript" src="../../../ui/effects.core.js"></script>
<script type="text/javascript">
function randomColorRGB() {
return 'rgb('
+ Math.floor(Math.random()*256)
+ ', ' + Math.floor(Math.random()*256)
+ ', ' + Math.floor(Math.random()*256)
+ ')';
}
$(function() {
$("#go").click(function() {
$("#animate-backgroundColor").stop().animate({ backgroundColor: randomColorRGB() }, "fast");
});
})
</script>
<style type="text/css">
#animate-backgroundColor { width: 100px; height: 100px; background-color: gray; }
</style>
</head>
<body>

<div id="animate-backgroundColor"></div>

<button id="go">Go</button>

</body>
</html>
@@ -0,0 +1,43 @@
<!doctype html>
<html lang="en">
<head>
<title>Animate Visual Test : Animate color hex</title>
<link rel="stylesheet" href="../visual.css" type="text/css" />
<link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">
<script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
<script type="text/javascript" src="../../../ui/effects.core.js"></script>
<script type="text/javascript">
function hexFromRGB (r, g, b) {
var hex = [
r.toString(16),
g.toString(16),
b.toString(16)
];
$.each(hex, function (nr, val) {
if (val.length == 1) {
hex[nr] = '0' + val;
}
});
return hex.join('').toUpperCase();
}
function randomColorHex() {
return '#' + hexFromRGB(Math.floor(Math.random()*256), Math.floor(Math.random()*256), Math.floor(Math.random()*256));
}
$(function() {
$("#go").click(function() {
$("#animate-color").stop().animate({ color: randomColorHex() }, "fast");
});
})
</script>
<style type="text/css">
#animate-color { width: 250px; height: 100px; color: gray; }
</style>
</head>
<body>

<div id="animate-color">Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</div>

<button id="go">Go</button>

</body>
</html>
@@ -0,0 +1,34 @@
<!doctype html>
<html lang="en">
<head>
<title>Animate Visual Test : Animate color rgb</title>
<link rel="stylesheet" href="../visual.css" type="text/css" />
<link rel="stylesheet" href="../../../themes/base/ui.all.css" type="text/css">
<script type="text/javascript" src="../../../jquery-1.3.2.js"></script>
<script type="text/javascript" src="../../../ui/effects.core.js"></script>
<script type="text/javascript">
function randomColorRGB() {
return 'rgb('
+ Math.floor(Math.random()*256)
+ ', ' + Math.floor(Math.random()*256)
+ ', ' + Math.floor(Math.random()*256)
+ ')';
}
$(function() {
$("#go").click(function() {
$("#animate-color").stop().animate({ color: randomColorRGB() }, "fast");
});
})
</script>
<style type="text/css">
#animate-color { width: 250px; height: 100px; color: gray; }
</style>
</head>
<body>

<div id="animate-color">Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</div>

<button id="go">Go</button>

</body>
</html>

0 comments on commit 8120dfa

Please sign in to comment.
You can’t perform that action at this time.