Ajax Loader
HTML
 
1
 
2
  <section class="the-demo">
3
    <div class="example-item">
4
      <div class="lightsaber">
5
        <label for="yoda-example"></label>
6
        <input type="checkbox" id="yoda-example" checked="checked">
7
        <div class="switch"></div>
8
        <div class="plasma yoda"></div>
9
      </div>
10
      <h3>Yoda</h3>
11
    </div>
12
    <div class="example-item">
13
      <div class="lightsaber">
14
        <label for="darth-vader-example"></label>
15
        <input type="checkbox" id="darth-vader-example" checked="checked">
16
        <div class="switch"></div>
17
        <div class="plasma vader"></div>
18
      </div>
19
      <h3>Vader</h3>
20
    </div>
21
    <div class="example-item">
22
      <div class="lightsaber">
23
        <label for="windu-example"></label>
24
        <input type="checkbox" id="windu-example">
25
        <div class="switch"></div>
26
        <div class="plasma windu"></div>
27
      </div>
28
      <h3>Windu</h3>
29
    </div>
30
    <div class="example-item clearfix">
31
      <div class="lightsaber">
32
        <label for="obi-wan-example"></label>
33
        <input type="checkbox" id="obi-wan-example">
34
        <div class="switch"></div>
35
        <div class="plasma obi-wan"></div>
36
      </div>
37
      <h3>Obi</h3>
38
    </div>
39
 
40
  </section>
41
 
42
 
43
  <style>
44
    /* Only for Demo */
45
    body {
46
      background: #333;
47
      color: #fff;
48
      font-family: arial;
49
    }
50
 
51
    .the-demo {
52
      width: 960px;
53
      margin: 250px auto 0;
54
    }
55
 
56
    .example-item {
57
      float: left;
58
      width: 25%;
59
      padding-top: 325px;
60
    }
61
 
62
  </style>
 
CSS
.lightsaber { position: relative; }
1
.lightsaber { position: relative; }
2
 
3
.lightsaber label {
4
  cursor: pointer;
5
  position: absolute;
6
  bottom: 0;
7
  left: 0;
8
  z-index: 88;
9
  text-indent: -9999px;
10
  width: 15px;
11
  height: 50px;
12
  border-bottom: solid 4px grey;
13
  border-top: solid 5px grey;
14
  border-radius: 5px;
15
  -moz-border-radius: 5px;
16
  -webkit-border-radius: 5px;
17
  -o-border-radius: 5px;
18
  -ms-border-radius: 5px;
19
  background: rgb(226,226,226); /* Old browsers */
20
  background: linear-gradient(to right, rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%); /* W3C */
21
  background: -moz-linear-gradient(left, rgba(226,226,226,1) 0%, rgba(219,219,219,1) 50%, rgba(209,209,209,1) 51%, rgba(254,254,254,1) 100%); /* FF3.6+ */
22
  background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(226,226,226,1)), color-stop(50%,rgba(219,219,219,1)), color-stop(51%,rgba(209,209,209,1)), color-stop(100%,rgba(254,254,254,1))); /* Chrome,Safari4+ */
23
  background: -webkit-linear-gradient(left, rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%); /* Chrome10+,Safari5.1+ */
24
  background: -o-linear-gradient(left, rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%); /* Opera 11.10+ */
25
  background: -ms-linear-gradient(left, rgba(226,226,226,1) 0%,rgba(219,219,219,1) 50%,rgba(209,209,209,1) 51%,rgba(254,254,254,1) 100%); /* IE10+ */
26
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e2e2e2', endColorstr='#fefefe',GradientType=1 ); /* IE6-9 */
27
}
28
 
29
.lightsaber .switch {
30
  background: #B94A37;
31
  width: 5px;
32
  height: 10px;
33
  display: block;
34
  position: absolute;
35
  bottom: 25px;
36
  left: 13px;
37
  transition: left 200ms;
38
  -moz-transition: left 200ms;
39
  -webkit-transition: left 200ms;
40
  -o-transition: left 200ms;
41
  -ms-transition: left 200ms;
42
  border-radius: 10px;
43
  -moz-border-radius: 10px;
44
  -webkit-border-radius: 10px;
45
  -o-border-radius: 10px;
46
  -ms-border-radius: 10px;
47
}
48
 
49
.lightsaber input[type=checkbox] {
50
  position: absolute;
51
  bottom: 0;
52
  left: 0;
53
  opacity: 0;
54
  -moz-opacity: 0;
55
  -webkit-opacity: 0;
56
  -o-opacity: 0;
57
  -ms-opacity: 0;
58
  z-index: 77;
59
}
60
 
61
.lightsaber .plasma {
62
  transition: height 300ms,;
63
  -moz-transition: height 300ms;
64
  -webkit-transition: height 300ms;
65
  -o-transition: height 300ms;
66
  -ms-transition: height 300ms;
67
  border-radius: 12px 12px 0 0;
68
  position: absolute;
69
  bottom: 55px;
70
  left: 2px;
71
  width: 10px;
72
  display: block;
73
  filter: blur(1px);
74
  -moz-filter: blur(1px);
75
  -webkit-filter: blur(1px);
76
  -o-filter: blur(1px);
77
  -ms-filter: blur(1px);
78
  height: 0;
79
}
80
 
81
 
82
.lightsaber input[type=checkbox]:checked ~ div.plasma {
83
  height: 250px;
84
}
85
 
86
.lightsaber input[type=checkbox]:hover ~ div.switch {
87
  background: #c09853;
88
  left: 12px;
89
}
90
 
91
.lightsaber input[type=checkbox]:checked ~ div.switch {
92
  background: #468847;
93
}
94
 
95
.yoda {
96
  background: rgb(135,220,90); /* Old browsers */
97
  background: linear-gradient(to right, rgb(135,220,90) 0%,rgb(254,254,254) 30%,rgb(254,254,254) 50%,rgb(254,254,254) 70%,rgb(135,220,90) 100%); /* W3C */
98
  background: -moz-linear-gradient(left, rgb(135,220,90) 0%, rgb(254,254,254) 30%, rgb(254,254,254) 50%, rgb(254,254,254) 70%, rgb(135,220,90) 100%); /* FF3.6+ */
99
  background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgb(135,220,90)), color-stop(30%,rgb(254,254,254)), color-stop(50%,rgb(254,254,254)), color-stop(70%,rgb(254,254,254)), color-stop(100%,rgb(135,220,90))); /* Chrome,Safari4+ */
100
  background: -webkit-linear-gradient(left, rgb(135,220,90) 0%,rgb(254,254,254) 30%,rgb(254,254,254) 50%,rgb(254,254,254) 70%,rgb(135,220,90) 100%); /* Chrome10+,Safari5.1+ */
101
  background: -o-linear-gradient(left, rgb(135,220,90) 0%,rgb(254,254,254) 30%,rgb(254,254,254) 50%,rgb(254,254,254) 70%,rgb(135,220,90) 100%); /* Opera 11.10+ */
102
  background: -ms-linear-gradient(left, rgb(135,220,90) 0%,rgb(254,254,254) 30%,rgb(254,254,254) 50%,rgb(254,254,254) 70%,rgb(135,220,90) 100%); /* IE10+ */
103
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#87dc5a', endColorstr='#87dc5a',GradientType=1 ); /* IE6-9 */
104
  animation-name: yoda;
105
  -moz-animation-name: yoda;
106
  -webkit-animation-name: yoda;
107
  -o-animation-name: yoda;
108
  -ms-animation-name: yoda;
109
  animation-duration: 2s;
110
  -moz-animation-duration: 2s;
111
  -webkit-animation-duration: 2s;
112
  -o-animation-duration: 2s;
113
  -ms-animation-duration: 2s;
114
  animation-iteration-count: infinite;
115
  -moz-animation-iteration-count: infinite;
116
  -webkit-animation-iteration-count: infinite;
117
  -o-animation-iteration-count: infinite;
118
  -ms-animation-iteration-count: infinite;
119
}
120
 
121
.vader {
122
  background: rgb(229,17,21); /* Old browsers */
123
  background: linear-gradient(to right, rgba(229,17,21,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(229,17,21,1) 100%); /* W3C */
124
  background: -moz-linear-gradient(left, rgba(229,17,21,1) 0%, rgba(254,254,254,1) 30%, rgba(254,254,254,1) 47%, rgba(254,254,254,1) 71%, rgba(229,17,21,1) 100%); /* FF3.6+ */
125
  background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(229,17,21,1)), color-stop(30%,rgba(254,254,254,1)), color-stop(47%,rgba(254,254,254,1)), color-stop(71%,rgba(254,254,254,1)), color-stop(100%,rgba(229,17,21,1))); /* Chrome,Safari4+ */
126
  background: -webkit-linear-gradient(left, rgba(229,17,21,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(229,17,21,1) 100%); /* Chrome10+,Safari5.1+ */
127
  background: -o-linear-gradient(left, rgba(229,17,21,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(229,17,21,1) 100%); /* Opera 11.10+ */
128
  background: -ms-linear-gradient(left, rgba(229,17,21,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(229,17,21,1) 100%); /* IE10+ */
129
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e51115', endColorstr='#e51115',GradientType=1 ); /* IE6-9 */
130
  animation-name: vader;
131
  -moz-animation-name: vader;
132
  -webkit-animation-name: vader;
133
  -o-animation-name: vader;
134
  -ms-animation-name: vader;
135
  animation-duration: 2s;
136
  -moz-animation-duration: 2s;
137
  -webkit-animation-duration: 2s;
138
  -o-animation-duration: 2s;
139
  -ms-animation-duration: 2s;
140
  animation-iteration-count: infinite;
141
  -moz-animation-iteration-count: infinite;
142
  -webkit-animation-iteration-count: infinite;
143
  -o-animation-iteration-count: infinite;
144
  -ms-animation-iteration-count: infinite;
145
}
146
 
147
.windu {
148
  background: rgb(202,116,221); /* Old browsers */
149
  background: linear-gradient(to right, rgba(202,116,221,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(202,116,221,1) 100%); /* W3C */
150
  background: -moz-linear-gradient(left, rgba(202,116,221,1) 0%, rgba(254,254,254,1) 30%, rgba(254,254,254,1) 47%, rgba(254,254,254,1) 71%, rgba(202,116,221,1) 100%); /* FF3.6+ */
151
  background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(202,116,221,1)), color-stop(30%,rgba(254,254,254,1)), color-stop(47%,rgba(254,254,254,1)), color-stop(71%,rgba(254,254,254,1)), color-stop(100%,rgba(202,116,221,1))); /* Chrome,Safari4+ */
152
  background: -webkit-linear-gradient(left, rgba(202,116,221,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(202,116,221,1) 100%); /* Chrome10+,Safari5.1+ */
153
  background: -o-linear-gradient(left, rgba(202,116,221,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(202,116,221,1) 100%); /* Opera 11.10+ */
154
  background: -ms-linear-gradient(left, rgba(202,116,221,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(202,116,221,1) 100%); /* IE10+ */
155
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ca74dd', endColorstr='#ca74dd',GradientType=1 ); /* IE6-9 */
156
  animation-name: windu;
157
  -moz-animation-name: windu;
158
  -webkit-animation-name: windu;
159
  -o-animation-name: windu;
160
  -ms-animation-name: windu;
161
  animation-duration: 2s;
162
  -moz-animation-duration: 2s;
163
  -webkit-animation-duration: 2s;
164
  -o-animation-duration: 2s;
165
  -ms-animation-duration: 2s;
166
  animation-iteration-count: infinite;
167
  -moz-animation-iteration-count: infinite;
168
  -webkit-animation-iteration-count: infinite;
169
  -o-animation-iteration-count: infinite;
170
  -ms-animation-iteration-count: infinite;
171
}
172
 
173
.obi-wan {
174
  background: rgb(55,132,214); /* Old browsers */
175
  background: linear-gradient(to right, rgba(55,132,214,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(55,132,214,1) 100%); /* W3C */
176
  background: -moz-linear-gradient(left, rgba(55,132,214,1) 0%, rgba(254,254,254,1) 30%, rgba(254,254,254,1) 47%, rgba(254,254,254,1) 71%, rgba(55,132,214,1) 100%); /* FF3.6+ */
177
  background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(55,132,214,1)), color-stop(30%,rgba(254,254,254,1)), color-stop(47%,rgba(254,254,254,1)), color-stop(71%,rgba(254,254,254,1)), color-stop(100%,rgba(55,132,214,1))); /* Chrome,Safari4+ */
178
  background: -webkit-linear-gradient(left, rgba(55,132,214,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(55,132,214,1) 100%); /* Chrome10+,Safari5.1+ */
179
  background: -o-linear-gradient(left, rgba(55,132,214,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(55,132,214,1) 100%); /* Opera 11.10+ */
180
  background: -ms-linear-gradient(left, rgba(55,132,214,1) 0%,rgba(254,254,254,1) 30%,rgba(254,254,254,1) 47%,rgba(254,254,254,1) 71%,rgba(55,132,214,1) 100%); /* IE10+ */
181
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3784d6', endColorstr='#3784d6',GradientType=1 ); /* IE6-9 */
182
  animation-name: obi-wan;
183
  -moz-animation-name: obi-wan;
184
  -webkit-animation-name: obi-wan;
185
  -o-animation-name: obi-wan;
186
  -ms-animation-name: obi-wan;
187
  animation-duration: 2s;
188
  -moz-animation-duration: 2s;
189
  -webkit-animation-duration: 2s;
190
  -o-animation-duration: 2s;
191
  -ms-animation-duration: 2s;
192
  animation-iteration-count: infinite;
193
  -moz-animation-iteration-count: infinite;
194
  -webkit-animation-iteration-count: infinite;
195
  -o-animation-iteration-count: infinite;
196
  -ms-animation-iteration-count: infinite;
197
}
198
 
199
div {
200
  -webkit-transform : translateZ(0); 
201
  -o-transform : translateZ(0); 
202
  -moz-transform : translateZ(0); 
203
  transform : translateZ(0); 
204
}
205
 
206
/* Animations */
207
@keyframes yoda {
208
  from { box-shadow: 0 0 10px #7EC855; }
209
  50% { box-shadow: 0 0 16px #7EC855; }
210
  to { box-shadow: 0 0 10px #7EC855; }
211
}
212
@-moz-keyframes yoda {
213
  from { box-shadow: 0 0 10px #7EC855; }
214
  50% { box-shadow: 0 0 16px #7EC855; }
215
  to { box-shadow: 0 0 10px #7EC855; }
216
}
217
@-webkit-keyframes yoda {
218
  from { box-shadow: 0 0 10px #7EC855; }
219
  50% { box-shadow: 0 0 16px #7EC855; }
220
  to { box-shadow: 0 0 10px #7EC855; }
221
}
222
@-o-keyframes yoda {
223
  from { box-shadow: 0 0 10px #7EC855; }
224
  50% { box-shadow: 0 0 16px #7EC855; }
225
  to { box-shadow: 0 0 10px #7EC855; }
226
}
227
@-ms-keyframes yoda {
228
  from { box-shadow: 0 0 10px #7EC855; }
229
  50% { box-shadow: 0 0 16px #7EC855; }
230
  to { box-shadow: 0 0 10px #7EC855; }
231
}
232
 
233
@keyframes vader {
234
  from { box-shadow: 0 0 10px #e51115; }
235
  50% { box-shadow: 0 0 16px #e51115; }
236
  to { box-shadow: 0 0 10px #e51115; }
237
}
238
@-moz-keyframes vader {
239
  from { box-shadow: 0 0 10px #e51115; }
240
  50% { box-shadow: 0 0 16px #e51115; }
241
  to { box-shadow: 0 0 10px #e51115; }
242
}
243
@-webkit-keyframes vader {
244
  from { box-shadow: 0 0 10px #e51115; }
245
  50% { box-shadow: 0 0 16px #e51115; }
246
  to { box-shadow: 0 0 10px #e51115; }
247
}
248
@-o-keyframes vader {
249
  from { box-shadow: 0 0 10px #e51115; }
250
  50% { box-shadow: 0 0 16px #e51115; }
251
  to { box-shadow: 0 0 10px #e51115; }
252
}
253
@-ms-keyframes vader {
254
  from { box-shadow: 0 0 10px #e51115; }
255
  50% { box-shadow: 0 0 16px #e51115; }
256
  to { box-shadow: 0 0 10px #e51115; }
257
}
258
 
259
@keyframes windu {
260
  from { box-shadow: 0 0 10px #ca74dd; }
261
  50% { box-shadow: 0 0 16px #ca74dd; }
262
  to { box-shadow: 0 0 10px #ca74dd; }
263
}
264
@-moz-keyframes windu {
265
  from { box-shadow: 0 0 10px #ca74dd; }
266
  50% { box-shadow: 0 0 16px #ca74dd; }
267
  to { box-shadow: 0 0 10px #ca74dd; }
268
}
269
@-webkit-keyframes windu {
270
  from { box-shadow: 0 0 10px #ca74dd; }
271
  50% { box-shadow: 0 0 16px #ca74dd; }
272
  to { box-shadow: 0 0 10px #ca74dd; }
273
}
274
@-o-keyframes windu {
275
  from { box-shadow: 0 0 10px #ca74dd; }
276
  50% { box-shadow: 0 0 16px #ca74dd; }
277
  to { box-shadow: 0 0 10px #ca74dd; }
278
}
279
@-ms-keyframes windu {
280
  from { box-shadow: 0 0 10px #ca74dd; }
281
  50% { box-shadow: 0 0 16px #ca74dd; }
282
  to { box-shadow: 0 0 10px #ca74dd; }
283
}
284
 
285
@keyframes obi-wan {
286
  from { box-shadow: 0 0 10px #3784d6; }
287
  50% { box-shadow: 0 0 16px #3784d6; }
288
  to { box-shadow: 0 0 10px #3784d6; }
289
}
290
@-moz-keyframes obi-wan {
291
  from { box-shadow: 0 0 10px #3784d6; }
292
  50% { box-shadow: 0 0 16px #3784d6; }
293
  to { box-shadow: 0 0 10px #3784d6; }
294
}
295
@-webkit-keyframes obi-wan {
296
  from { box-shadow: 0 0 10px #3784d6; }
297
  50% { box-shadow: 0 0 16px #3784d6; }
298
  to { box-shadow: 0 0 10px #3784d6; }
299
}
300
@-o-keyframes obi-wan {
301
  from { box-shadow: 0 0 10px #3784d6; }
302
  50% { box-shadow: 0 0 16px #3784d6; }
303
  to { box-shadow: 0 0 10px #3784d6; }
304
}
305
@-ms-keyframes obi-wan {
306
  from { box-shadow: 0 0 10px #3784d6; }
307
  50% { box-shadow: 0 0 16px #3784d6; }
308
  to { box-shadow: 0 0 10px #3784d6; }
309
}
 
JavaScript
/* No JS! More info on this at my website. Enjoy! */
1
/* No JS! More info on this at my website. Enjoy! */
 

Pure CSS3 Star Wars Lightsaber Checkboxes

CSSDeck G+