From cecc4838a28b07a2bbff0e9daed1b3da80cfaa04 Mon Sep 17 00:00:00 2001 From: Richard Worth Date: Mon, 9 Jun 2008 12:19:59 +0000 Subject: [PATCH] Added effects visual test pages --- tests/visual/effects.all.css | 49 ++++++++++ tests/visual/effects.all.html | 165 ++++++++++++++++++++++++++++++++++ tests/visual/effects.all.js | 65 ++++++++++++++ 3 files changed, 279 insertions(+) create mode 100644 tests/visual/effects.all.css create mode 100644 tests/visual/effects.all.html create mode 100644 tests/visual/effects.all.js diff --git a/tests/visual/effects.all.css b/tests/visual/effects.all.css new file mode 100644 index 000000000..587c64696 --- /dev/null +++ b/tests/visual/effects.all.css @@ -0,0 +1,49 @@ +body,html { + margin: 0; + padding: 0; + font-size: 12px; + font-family: Arial; + background: #000; +} + +ul.effects { + margin: 0; + padding: 0; +} + +ul.effects li { + margin: 0; + padding: 0; + width: 120px; + height: 100px; + float: left; + margin-top: 20px; + margin-left: 20px; +} + +div.effect { + width: 120px; + height: 100px; + background: #333; + border: 5px outset #aaa; + float: left; + cursor: pointer; + cursor: hand; +} + +div.current { + border: 5px outset #FF0000; + background: #660000; +} + +div.effect p { + color: #eee; + margin: 0px; + padding: 10px; +} + +.ui-effects-transfer { + border: 1px dotted #fff; + background: #666; + opacity: 0.5; +} \ No newline at end of file diff --git a/tests/visual/effects.all.html b/tests/visual/effects.all.html new file mode 100644 index 000000000..2664a3a61 --- /dev/null +++ b/tests/visual/effects.all.html @@ -0,0 +1,165 @@ + + + + + Effects Test Suite + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/visual/effects.all.js b/tests/visual/effects.all.js new file mode 100644 index 000000000..ebf0ad082 --- /dev/null +++ b/tests/visual/effects.all.js @@ -0,0 +1,65 @@ +$(document).ready(function() { + + $("div.effect") + .hover(function() { + $(this).addClass("hover"); + }, function() { + $(this).removeClass("hover"); + }) + ; + + + var effect = function(el, n, o) { + + $.extend(o, { + easing: "easeOutQuint" + }); + + $(el).bind("click", function() { + + $(this).addClass("current").hide(n, o, 1000, function() { + var self = this; + window.setTimeout(function() { + $(self).show(n, o, 1000, function() { $(this).removeClass("current"); }); + },500); + }); + }); + + }; + + + effect("#blindHorizontally", "blind", { direction: "horizontal" }); + effect("#blindVertically", "blind", { direction: "vertical" }); + + effect("#bounce3times", "bounce", { times: 3 }); + + effect("#clipHorizontally", "clip", { direction: "horizontal" }); + effect("#clipVertically", "clip", { direction: "vertical" }); + + effect("#dropDown", "drop", { direction: "down" }); + effect("#dropUp", "drop", { direction: "up" }); + effect("#dropLeft", "drop", { direction: "left" }); + effect("#dropRight", "drop", { direction: "right" }); + + effect("#explode9", "explode", { }); + effect("#explode36", "explode", { pieces: 36 }); + + effect("#fold", "fold", { size: 50 }); + + effect("#highlight", "highlight", { }); + + effect("#pulsate", "pulsate", { times: 2 }); + + effect("#puff", "puff", { times: 2 }); + effect("#scale", "scale", { }); + + $("#shake").bind("click", function() { $(this).addClass("current").effect("shake", {}, 100, function() { $(this).removeClass("current"); }); }); + + effect("#slideDown", "slide", { direction: "down" }); + effect("#slideUp", "slide", { direction: "up" }); + effect("#slideLeft", "slide", { direction: "left" }); + effect("#slideRight", "slide", { direction: "right" }); + + $("#transfer").bind("click", function() { $(this).addClass("current").effect("transfer", { to: "div:eq(0)" }, 1000, function() { $(this).removeClass("current"); }); }); + +}); \ No newline at end of file