Added effects visual test pages

This commit is contained in:
Richard Worth 2008-06-09 12:19:59 +00:00
parent 6e4092f986
commit cecc4838a2
3 changed files with 279 additions and 0 deletions

View File

@ -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;
}

View File

@ -0,0 +1,165 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Effects Test Suite</title>
<link rel="stylesheet" href="effects.all.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<script type="text/javascript" src="../../jquery-1.2.6.js"></script>
<script type="text/javascript" src="../../ui/effects.core.js"></script>
<script type="text/javascript" src="../../ui/effects.blind.js"></script>
<script type="text/javascript" src="../../ui/effects.bounce.js"></script>
<script type="text/javascript" src="../../ui/effects.clip.js"></script>
<script type="text/javascript" src="../../ui/effects.drop.js"></script>
<script type="text/javascript" src="../../ui/effects.explode.js"></script>
<script type="text/javascript" src="../../ui/effects.fold.js"></script>
<script type="text/javascript" src="../../ui/effects.highlight.js"></script>
<script type="text/javascript" src="../../ui/effects.pulsate.js"></script>
<script type="text/javascript" src="../../ui/effects.scale.js"></script>
<script type="text/javascript" src="../../ui/effects.shake.js"></script>
<script type="text/javascript" src="../../ui/effects.slide.js"></script>
<script type="text/javascript" src="../../ui/effects.transfer.js"></script>
<script type="text/javascript" src="effects.all.js"></script>
</head>
<body>
<ul class="effects">
<li>
<div class="effect" id="blindHorizontally">
<p>Blind horizontally</p>
</div>
</li>
<li>
<div class="effect" id="blindVertically">
<p>Blind vertically</p>
</div>
</li>
<li>
<div class="effect" id="bounce3times">
<p>Bounce 3 times</p>
</div>
</li>
<li>
<div class="effect" id="clipHorizontally">
<p>Clip horizontally</p>
</div>
</li>
<li>
<div class="effect" id="clipVertically">
<p>Clip vertically</p>
</div>
</li>
<li>
<div class="effect" id="dropDown">
<p>Drop down</p>
</div>
</li>
<li>
<div class="effect" id="dropUp">
<p>Drop up</p>
</div>
</li>
<li>
<div class="effect" id="dropLeft">
<p>Drop left</p>
</div>
</li>
<li>
<div class="effect" id="dropRight">
<p>Drop right</p>
</div>
</li>
<li>
<div class="effect" id="explode9">
<p>Explode in 9 pieces</p>
</div>
</li>
<li>
<div class="effect" id="explode36">
<p>Explode in 36 pieces</p>
</div>
</li>
<li>
<div class="effect" id="fold">
<p>Fold</p>
</div>
</li>
<li>
<div class="effect" id="highlight">
<p>Highlight</p>
</div>
</li>
<li>
<div class="effect" id="pulsate">
<p>Pulsate 2 times</p>
</div>
</li>
<li>
<div class="effect" id="puff">
<p>Puff</p>
</div>
</li>
<li>
<div class="effect" id="scale">
<p>Scale</p>
</div>
</li>
<li>
<div class="effect" id="shake">
<p>Shake</p>
</div>
</li>
<li>
<div class="effect" id="slideDown">
<p>Slide down</p>
</div>
</li>
<li>
<div class="effect" id="slideUp">
<p>Slide up</p>
</div>
</li>
<li>
<div class="effect" id="slideLeft">
<p>Slide left</p>
</div>
</li>
<li>
<div class="effect" id="slideRight">
<p>Slide right</p>
</div>
</li>
<li>
<div class="effect" id="transfer">
<p>Transfer to first element</p>
</div>
</li>
</ul>
</body>
</html>

View File

@ -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"); }); });
});