CSS3 LIghtsaber
CSS3 lightsaber with JS trigger.
http://vuild.com/lightsaber/
CSS3 lightsaber with JS trigger.
http://vuild.com/lightsaber/
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".slidingDiv").hide();
$(".show_hide").show();
$('.show_hide').click(function(){
$(".slidingDiv").slideToggle();
});
});
</script>
<div id="lightsaber" class="purple">
<div id="handle">
<div id="handle-top"></div>
<div id="handle-button"><a href="#" class="show_hide"></a></div>
<div id="handle-middle"></div>
<div id="handle-bottom"></div>
</div>
<div class="slidingDiv">
<div id="light">
<div id="lightcap"></div>
<div id="lightmain"></div>
</div>
</div>
</div>
/* CSS3 lightsaber with JS trigger, using different ways to animate. May the force be with you. More at http://vuild.com/lightsaber */
/* CSS3 lightsaber with JS trigger, using different ways to animate. May the force be with you. More at http://vuild.com/lightsaber */
body{
background:#111;
}
.slidingDiv {
height:500px;
border-radius:90px;
border-radius:90px;
border-radius:90px;
}
#lightsaber {
margin-top:50px;
margin-left:120px;
width:50px;
height:590px;
transform:rotate(200deg);
transform:rotate(200deg);
transform:rotate(200deg);
transform:rotate(200deg);
transform:rotate(200deg);
}
.purple #lightmain {
height:490px;
background: rgb(173,18,131);
background: linear-gradient(left, rgba(173,18,131,1) 0%, rgba(255,255,255,1) 54%, rgba(173,18,131,1) 100%);
background: 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)));
background: linear-gradient(left, rgba(173,18,131,1) 0%,rgba(255,255,255,1) 54%,rgba(173,18,131,1) 100%);
background: linear-gradient(left, rgba(173,18,131,1) 0%,rgba(255,255,255,1) 54%,rgba(173,18,131,1) 100%);
background: linear-gradient(left, rgba(173,18,131,1) 0%,rgba(255,255,255,1) 54%,rgba(173,18,131,1) 100%);
background: linear-gradient(to right, rgba(173,18,131,1) 0%,rgba(255,255,255,1) 54%,rgba(173,18,131,1) 100%);
box-shadow: 0 1px 24px rgba(255, 0, 0, .9);
box-shadow: 0 1px 24px rgba(255, 0, 0, .9);
box-shadow: 0 1px 24px rgba(255, 0, 0, .9);
border-radius: 20px;
border-radius: 20px;
border-radius: 20px;
filter: blur(4px) saturate(1.5);
animation: lighton 1s 1 ease-in-out;
animation: lighton 1s 1 ease-in-out;
}
@-webkit-keyframes lighton
{
0% {height:20px; opacity:0; }
100% {height:490px; opacity:1;}
}
#light {
height:480px;
width:50px;
margin:auto;
position:relative;
border-radius:40px;
border-radius:40px;
border-radius:40px;
}
#lightmain {
width:15px;
margin:auto;
}
.purple #lightcap{
width:10px;
margin-left:auto;
margin-right:auto;
}
#handle {
height:120px;
width:18px;
padding-top:5px;
margin-left:auto;
margin-right:auto;
background: rgb(127,127,127);
background: 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%);
background: 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)));
background: 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%);
background: 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%);
background: 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%);
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%);
border-radius:2px;
border-radius:2px;
border-radius:2px;
box-shadow: -1px 3px 14px #000;
box-shadow: -1px 3px 14px #000;
box-shadow: -1px 3px 14px #000;
}
#handle-top {
height:20px;
background: rgb(69,72,77); /* Old browsers */
background: linear-gradient(left, rgba(69,72,77,1) 0%, rgba(0,0,0,1) 100%);
background: gradient(linear, left top, right top, color-stop(0%,rgba(69,72,77,1)), color-stop(100%,rgba(0,0,0,1)));
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
background: linear-gradient(to right, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
}
#handle-middle {
height:12px;
margin-top:5px;
background: rgb(69,72,77);
background: linear-gradient(left, rgba(69,72,77,1) 0%, rgba(0,0,0,1) 100%);
background: gradient(linear, left top, right top, color-stop(0%,rgba(69,72,77,1)), color-stop(100%,rgba(0,0,0,1)));
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
background: linear-gradient(to right, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
}
#handle-button {
height:10px;
width:10px;
margin-left:auto;
margin-right:auto;
margin-top:35px;
}
#handle-button a {
display:block;
height:10px;
width:10px;
margin-left:auto;
margin-right:auto;
margin-top:35px;
background: rgb(69,72,77);
background: linear-gradient(left, rgba(69,72,77,1) 0%, rgba(0,0,0,1) 100%);
background: gradient(linear, left top, right top, color-stop(0%,rgba(69,72,77,1)), color-stop(100%,rgba(0,0,0,1)));
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);/
background: linear-gradient(to right, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
border-radius:10px;
border-radius:10px;
border-radius:10px;
box-shadow: 1px 0 1px #444;
box-shadow: 1px 0 1px #444;
box-shadow: 1px 0 1px #444;
}
#handle-bottom {
height:15px;
width:10px;
margin-left:auto;
margin-right:auto;
margin-top:10px;
background: rgb(69,72,77);
background: linear-gradient(left, rgba(69,72,77,1) 0%, rgba(0,0,0,1) 100%);
background: gradient(linear, left top, right top, color-stop(0%,rgba(69,72,77,1)), color-stop(100%,rgba(0,0,0,1)));
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
background: linear-gradient(left, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
background: linear-gradient(to right, rgba(69,72,77,1) 0%,rgba(0,0,0,1) 100%);
}