Recommendation
More Effects...
JS
1
 
 
CSS
1
@import url(http://weloveiconfonts.com/api/?family=entypo);
2
*, *:before, *:after {
3
  margin:0;
4
  padding:0;
5
  -webkit-box-sizing:border-box;
6
  -moz-box-sizing:border-box;
7
  box-sizing:border-box;
8
}
9
#lamp {
10
  position:relative;
11
  width:100vw;
12
  height:100vh;
13
  overflow:hidden;
14
}
15
input[name="switch"], input[name="switch"] + label {
16
  position:absolute;
17
  bottom:3rem;
18
  width:4rem;
19
  height:4rem;
20
}
21
input[name="switch"] + label {right:3rem;}
22
input[name="switch"] {
23
  opacity:0;
24
  z-index:9;
25
  cursor:pointer;
26
}
27
input[value="on"] {
28
  right:3rem;
29
}
30
input[value="off"] {
31
  right:-4rem;
32
}
33
input[name="switch"] + label {
34
  text-align:center;
35
}
36
[class*="entypo-"]:before {
37
  line-height:4rem;
38
  font-size:2.5rem;
39
  color:rgba(255,255,255,0.4);
40
  font-family:'entypo', sans-serif;
41
}
42
input[value="on"]:checked {
43
  right:-4rem;
44
}
45
input[value="on"]:checked + input[value="off"] {
46
  right:3rem;
47
}
48
.lamp {
49
  position:relative;
50
  margin:0 auto;
51
  width:.7rem;
52
  height:10rem;
53
  background-image:linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)),
54
                   linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)),
55
                   linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7));
56
  background-repeat:no-repeat;
57
  background-size:.15rem 8rem, .4rem .8rem, .7rem 2rem;
58
  background-position:50% 0, .23rem 8rem, 0 8.8rem;
59
}
60
.lamp:before, .lamp:after {
61
  content:'';
62
  position:absolute;
63
}
64
.lamp:before {
65
  left:-1.65rem;
66
  bottom:-4rem;
67
  width:4rem;
68
  height:4rem;
69
  border-radius:50%;
70
  background:rgba(255,255,255,0.03);
71
  box-shadow:inset 2px -2px 10px rgba(255,255,255,0.07);
72
  transition:all .15s;
73
}
74
.gonna-give-light, 
75
.gonna-give-light:before{
76
  position:absolute;
77
}
78
.gonna-give-light {
79
  top:10.05rem;
80
  left:.25rem;
81
  width:0;
82
  height:1.5rem;
83
  border-right:.2rem solid rgba(255,255,255,0.05);
84
}
85
.gonna-give-light:before {
86
  content:'';
87
  top:1.5rem;
88
  left:-.35rem;
89
  width:.9rem;
90
  height:.9rem;
91
  border-radius:50%;
92
  border:.2rem solid rgba(255,255,255,0.05);
93
  box-shadow:0px 0px 50px rgba(255,255,255,0);
94
}
95
input[value="on"]:checked ~ .lamp:before {
96
  background:rgba(255,255,255,1);
97
  box-shadow:0px 2px 10px rgba(255,255,255,0.8),
98
             0px 5px 50px rgba(255,255,255,0.8),
99
             0px 8px 80px rgba(255,255,255,0.6),
100
             0px 8px 120px rgba(255,255,255,0.6);
101
}
102
body {background:#2f323c;}
103
html, body {
104
  width:100%;
105
  height:100%;
106
}
 
HTML
1
<div id="lamp">
2
  <input type="radio" name="switch" value="on" />
3
  <input type="radio" name="switch" value="off" checked="checked"/>
4
  <label for="switch" class="entypo-lamp"></label>
5
  <div class="lamp">
6
    <div class="gonna-give-light"></div>
7
  </div>
8
</div>
 

Join Effecthub.com

Working with Global Gaming Artists and Developers!


Or Sign Up with Your Email Address:
This field must contain a valid email
Password should be at least 1 character