-
Notifications
You must be signed in to change notification settings - Fork 7
/
demo.html
82 lines (65 loc) · 3.31 KB
/
demo.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>animate-textshadow Demos</title>
<style>
html,body,div,p{margin:0;padding:0;}
body { margin: 2em; font-family: Arial,sans-serif; }
#glow, #slow, #blurry { font-size: 80px; }
#blurry, #glow { font-family: Arial Black, Arial, Helvetica, sans-serif; }
#subtle { font-family: Consolas, Courier, monospace; font-size: 40px; text-shadow: #ccc 3px 3px 3px; }
#glow { letter-spacing: 2px; text-shadow: #f00 0 0 0; color: #cc2c2c; }
#slow { font-family: Arial, Helvetica, sans-serif; letter-spacing: 2px; text-shadow: #259 5px 5px 5px; color: #49b; }
#blurry { font-size: 80px; letter-spacing: -3px; text-shadow: #aaa 0 0 10px; color: transparent; }
#button { position: relative; cursor: pointer; color: #3a3; font-family: Gill Sans Ultra Bold; font-size: 50px; text-shadow: #141 5px 5px 0; }
</style>
</head>
<body id="home">
<h1>animate-textshadow Demos</h1>
<div class="demos">
<p><span id="subtle">Subtle hover</span></p>
<pre><code>$("#subtle").hover(function() {
$(this).animate({textShadow: "#aaa 6px 6px 6px"});
}, function() {
$(this).animate({textShadow: "#ccc 3px 3px 3px"});
});</code></pre>
<p><span id="glow">Glow</span></p>
<pre><code>$("#glow").hover(function() {
$(this).animate({textShadow: "#f00 0 0 15px"});
}, function() {
$(this).animate({textShadow: "#f00 0 0 0"});
});</code></pre>
<p><span id="slow">Slow</span></p></div>
<pre><code>$("#slow").hover(function() {
$(this).animate({textShadow: "#000 -10px -10px 30px"}, 1000);
}, function() {
$(this).animate({textShadow: "#259 5px 5px 5px"}, 1000);
});</code></pre>
<p><span id="blurry">Blurry</span></p>
<p>Text's color set to <code>transparent</code></p>
<pre><code>$("#blurry").hover(function() {
$(this).animate({textShadow: "#aaa 0 0 0"});
}, function() {
$(this).animate({textShadow: "#aaa 0 0 10px"});
});</code></pre>
<p><span id="button">Text button</span></p>
<pre><code>$("#button").mousedown(function() {
$(this).animate({top: "3px", left: "3px", textShadow: "#141 2px 2px 0"}, 100);
}).mouseup(function() {
$(this).animate({top: 0, left: 0, textShadow: "#141 5px 5px 0"}, 100);
});</code></pre>
</div>
<script src="libs/jquery-1.6.1.min.js"></script>
<script src="jquery.animate-textshadow.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
$("#subtle").hover(function() { $(this).animate({textShadow: "#aaa 6px 6px 6px"}); }, function() { $(this).animate({textShadow: "#ccc 3px 3px 3px"}); });
$("#glow").hover(function() { $(this).animate({textShadow: "#f00 0 0 15px"}); }, function() { $(this).animate({textShadow: "#f00 0 0 0"}); });
$("#slow").hover(function() { $(this).animate({textShadow: "#000 -10px -10px 30px"}, 1000); }, function() { $(this).animate({textShadow: "#259 5px 5px 5px"}, 1000); });
$("#blurry").hover(function() { $(this).animate({textShadow: "#aaa 0 0 0"}); }, function() { $(this).animate({textShadow: "#aaa 0 0 10px"}); });
$("#button").mousedown(function() { $(this).animate({top: "3px", left: "3px", textShadow: "#141 2px 2px 0"}, 100); }).mouseup(function() { $(this).animate({top: 0, left: 0, textShadow: "#141 5px 5px 0"}, 100); });
});
</script>
</body>
</html>