Ajax Loader
×

CSS3 LIghtsaber

CSS3 lightsaber with JS trigger.

http://vuild.com/lightsaber/

HTML
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
1
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
2
<script type="text/javascript">
3
$(document).ready(function(){
4
 
5
        $(".slidingDiv").hide();
6
        $(".show_hide").show();
7
 
8
    $('.show_hide').click(function(){
9
    $(".slidingDiv").slideToggle();
10
    });
11
 
12
});
13
</script>
14
 
15
<div id="lightsaber" class="purple">
16
<div id="handle">
17
<div id="handle-top"></div>
18
<div id="handle-button"><a href="#" class="show_hide"></a></div>
19
<div id="handle-middle"></div>
20
<div id="handle-bottom"></div>
21
</div>
22
<div class="slidingDiv">
23
<div id="light">
24
<div id="lightcap"></div>
25
<div id="lightmain"></div>
26
</div>
27
</div>
28
</div>
 
CSS
/* CSS3 lightsaber with JS trigger, using different ways to animate. May the force be with you. More at http://vuild.com/lightsaber  */
1
/* CSS3 lightsaber with JS trigger, using different ways to animate. May the force be with you. More at http://vuild.com/lightsaber  */
2
 
3
body{
4
background:#111;  
5
}
6
 
7
.slidingDiv {
8
height:500px;
9
-webkit-border-radius:90px;
10
-moz-border-radius:90px;
11
border-radius:90px;
12
}
13
 
14
#lightsaber {
15
margin-top:50px;
16
margin-left:120px;
17
width:50px;
18
height:590px;
19
-moz-transform:rotate(200deg);
20
-webkit-transform:rotate(200deg);
21
-o-transform:rotate(200deg);
22
-ms-transform:rotate(200deg);
23
transform:rotate(200deg);
24
}
25
 
26
.purple #lightmain {
27
height:490px;
28
background: rgb(173,18,131);
29
background: -moz-linear-gradient(left, rgba(173,18,131,1) 0%, rgba(255,255,255,1) 54%, rgba(173,18,131,1) 100%);
30
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(173,18,131,1)), color-stop(54%,rgba(255,255,255,1)), color-stop(100%,rgba(173,18,131,1)));
31
background: -webkit-linear-gradient(left, rgba(173,18,131,1) 0%,rgba(255,255,255,1) 54%,rgba(173,18,131,1) 100%);
32
background: -o-linear-gradient(left, rgba(173,18,131,1) 0%,rgba(255,255,255,1) 54%,rgba(173,18,131,1) 100%); 
33
background: -ms-linear-gradient(left, rgba(173,18,131,1) 0%,rgba(255,255,255,1) 54%,rgba(173,18,131,1) 100%);
34
background: linear-gradient(to right, rgba(173,18,131,1) 0%,rgba(255,255,255,1) 54%,rgba(173,18,131,1) 100%);
35
-webkit-box-shadow: 0 1px 24px rgba(255, 0, 0, .9);
36
-moz-box-shadow: 0 1px 24px rgba(255, 0, 0, .9);
37
box-shadow: 0 1px 24px rgba(255, 0, 0, .9);
38
-webkit-border-radius: 20px;
39
-moz-border-radius: 20px;
40
border-radius: 20px;
41
-webkit-filter: blur(4px) saturate(1.5);
42
-webkit-animation: lighton 1s 1 ease-in-out;
43
animation: lighton 1s 1 ease-in-out; 
44
}
45
 
46
@-webkit-keyframes lighton
47
{
48
0%   {height:20px; opacity:0; }
49
100%   {height:490px; opacity:1;}
50
}
51
 
52
#light {
53
height:480px;
54
width:50px;
55
margin:auto;
56
position:relative;
57
-webkit-border-radius:40px;
58
-moz-border-radius:40px;
59
border-radius:40px; 
60
}
61
 
62
#lightmain {
63
width:15px;
64
margin:auto;
65
}
66
 
67
.purple #lightcap{
68
width:10px;
69
margin-left:auto;
70
margin-right:auto;
71
}
72
 
73
#handle {
74
height:120px;
75
width:18px;
76
padding-top:5px;
77
margin-left:auto;
78
margin-right:auto;
79
background: rgb(127,127,127);
80
background: -moz-linear-gradient(left, rgba(127,127,127,1) 0%, rgba(153,153,153,1) 9%, rgba(255,255,255,1) 24%, rgba(221,221,221,1) 37%, rgba(221,221,221,1) 50%, rgba(84,84,84,1) 52%, rgba(221,221,221,1) 56%, rgba(209,209,209,1) 84%, rgba(140,140,140,1) 100%);
81
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(127,127,127,1)), color-stop(9%,rgba(153,153,153,1)), color-stop(24%,rgba(255,255,255,1)), color-stop(37%,rgba(221,221,221,1)), color-stop(50%,rgba(221,221,221,1)), color-stop(52%,rgba(84,84,84,1)), color-stop(56%,rgba(221,221,221,1)), color-stop(84%,rgba(209,209,209,1)), color-stop(100%,rgba(140,140,140,1)));
82
background: -webkit-linear-gradient(left, rgba(127,127,127,1) 0%,rgba(153,153,153,1) 9%,rgba(255,255,255,1) 24%,rgba(221,221,221,1) 37%,rgba(221,221,221,1) 50%,rgba(84,84,84,1) 52%,rgba(221,221,221,1) 56%,rgba(209,209,209,1) 84%,rgba(140,140,140,1) 100%);
83
background: -o-linear-gradient(left, rgba(127,127,127,1) 0%,rgba(153,153,153,1) 9%,rgba(255,255,255,1) 24%,rgba(221,221,221,1) 37%,rgba(221,221,221,1) 50%,rgba(84,84,84,1) 52%,rgba(221,221,221,1) 56%,rgba(209,209,209,1) 84%,rgba(140,140,140,1) 100%);
84
background: -ms-linear-gradient(left, rgba(127,127,127,1) 0%,rgba(153,153,153,1) 9%,rgba(255,255,255,1) 24%,rgba(221,221,221,1) 37%,rgba(221,221,221,1) 50%,rgba(84,84,84,1) 52%,rgba(221,221,221,1) 56%,rgba(209,209,209,1) 84%,rgba(140,140,140,1) 100%);
85
background: linear-gradient(to right, rgba(127,127,127,1) 0%,rgba(153,153,153,1) 9%,rgba(255,255,255,1) 24%,rgba(221,221,221,1) 37%,rgba(221,221,221,1) 50%,rgba(84,84,84,1) 52%,rgba(221,221,221,1) 56%,rgba(209,209,209,1) 84%,rgba(140,140,140,1) 100%);
86
-webkit-border-radius:2px;
87
-moz-border-radius:2px;
88
border-radius:2px;
89
-moz-box-shadow: -1px 3px 14px #000;
90
-webkit-box-shadow: -1px 3px 14px #000;
91
box-shadow: -1px 3px 14px #000;
92
}
93
 
94
#handle-top {
95
height:20px;
96
background: rgb(69,72,77); /* Old browsers */
97
background: -moz-linear-gradient(left, rgba(69,72,77,1) 0%, rgba(0,0,0,1) 100%);
98
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(69,72,77,1)), color-stop(100%,rgba(0,0,0,1)));
99
background: -webkit-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
100
background: -o-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
101
background: -ms-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
102
background: linear-gradient(to right, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
103
}
104
 
105
#handle-middle {
106
height:12px;
107
margin-top:5px;
108
background: rgb(69,72,77);
109
background: -moz-linear-gradient(left, rgba(69,72,77,1) 0%, rgba(0,0,0,1) 100%);
110
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(69,72,77,1)), color-stop(100%,rgba(0,0,0,1)));
111
background: -webkit-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
112
background: -o-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
113
background: -ms-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
114
background: linear-gradient(to right, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
115
}
116
 
117
#handle-button  {
118
height:10px;
119
width:10px;
120
margin-left:auto;
121
margin-right:auto;
122
margin-top:35px;
123
}
124
 
125
#handle-button a {
126
display:block;
127
height:10px;
128
width:10px;
129
margin-left:auto;
130
margin-right:auto;
131
margin-top:35px;
132
background: rgb(69,72,77);
133
background: -moz-linear-gradient(left, rgba(69,72,77,1) 0%, rgba(0,0,0,1) 100%);
134
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(69,72,77,1)), color-stop(100%,rgba(0,0,0,1)));
135
background: -webkit-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
136
background: -o-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
137
background: -ms-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);/
138
background: linear-gradient(to right, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
139
-webkit-border-radius:10px;
140
-moz-border-radius:10px;
141
border-radius:10px;
142
-moz-box-shadow: 1px 0 1px #444;
143
-webkit-box-shadow: 1px 0 1px #444;
144
box-shadow: 1px 0 1px #444;
145
}
146
 
147
#handle-bottom {
148
height:15px;
149
width:10px;
150
margin-left:auto;
151
margin-right:auto;
152
margin-top:10px;
153
background: rgb(69,72,77); 
154
background: -moz-linear-gradient(left, rgba(69,72,77,1) 0%, rgba(0,0,0,1) 100%);
155
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(69,72,77,1)), color-stop(100%,rgba(0,0,0,1)));
156
background: -webkit-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
157
background: -o-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
158
background: -ms-linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
159
background: linear-gradient(to right, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
160
}
161
 
 

CSS3 LIghtsaber

CSSDeck G+