Skip to content

Commit eb01e49

Browse files
committed
Add a css3 loader in starting
1 parent 55278e3 commit eb01e49

File tree

2 files changed

+151
-4
lines changed

2 files changed

+151
-4
lines changed

css/pythonbooks.css

Lines changed: 142 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
/*
12-
NOTE FROM REVOLUNET :
12+
NOTE FROM REVOLUNET :
1313
Only Bootstrap styles needed for PythonBooks are here.
1414
*/
1515

@@ -118,6 +118,145 @@ body {
118118
color: #333333;
119119
background-color: #ffffff;
120120
}
121+
122+
/* css for loader */
123+
#loader-wrapper {
124+
position: relative;
125+
top:0;
126+
left:0;
127+
width:100%;
128+
height: 100%;
129+
}
130+
131+
#loader{
132+
display: block;
133+
position: absolute;
134+
left: 50%;
135+
top: 50%;
136+
width: 150px;
137+
height: 150px;
138+
margin: -75px 0 0 -75px;
139+
margin-top: 100px;
140+
border: 6px solid transparent;
141+
border-radius: 50%;
142+
border-top-color:#3498db;
143+
z-index: 10001;
144+
145+
-webkit-animation: spin 1.5s linear infinite;
146+
animation: spin 1.5s linear infinite;
147+
}
148+
149+
#loader::before {
150+
content:"";
151+
position: absolute;
152+
top:5px;
153+
left:5px;
154+
right:5px;
155+
bottom:5px;
156+
border:6px solid transparent;
157+
border-radius: 50%;
158+
border-top-color:#e74c3c;
159+
160+
-webkit-animation: spin 1.5s linear infinite;
161+
animation: spin 1.5s linear infinite;
162+
}
163+
164+
#loader::after {
165+
content:"";
166+
position: absolute;
167+
top:15px;
168+
left:15px;
169+
right:15px;
170+
bottom:15px;
171+
border:6px solid transparent;
172+
border-radius: 50%;
173+
border-top-color: #f9c922;
174+
175+
-webkit-animation: spin 1.5s linear infinite;
176+
animation: spin 1.5s linear infinite;
177+
}
178+
179+
@-webkit-keyframes spin{
180+
0% {
181+
-webkit-transform: rotate(0deg);
182+
-ms-transform: rotate(0deg);
183+
transform: rotate(0deg);
184+
}
185+
100% {
186+
-webkit-transform: rotate(360deg);
187+
-ms-transform: rotate(360deg);
188+
transform: rotate(360deg);
189+
}
190+
}
191+
192+
@keyframes spin {
193+
0% {
194+
-webkit-transform: rotate(0deg);
195+
-ms-transform: rotate(0deg);
196+
transform: rotate(0deg);
197+
}
198+
100% {
199+
-webkit-transform: rotate(360deg);
200+
-ms-transform: rotate(360deg);
201+
transform: rotate(360deg);
202+
}
203+
}
204+
205+
#loader-wrapper .loader-section {
206+
position: fixed;
207+
top: 0;
208+
width: 50%;
209+
height: 100%;
210+
background-color: #000;
211+
z-index: 10000;
212+
}
213+
214+
#loader-wrapper .loader-section.section-left {
215+
left: 0;
216+
}
217+
218+
#loader-wrapper .loader-section.section-right {
219+
right: 0;
220+
}
221+
222+
/* Loaded */
223+
.loaded #loader-wrapper .loader-section.section-left {
224+
-webkit-transform: translateX(-100%); /* Chrome, Opera 15+, Safari 3.1+ */
225+
-ms-transform: translateX(-100%); /* IE 9 */
226+
transform: translateX(-100%); /* Firefox 16+, IE 10+, Opera */
227+
228+
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
229+
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
230+
}
231+
232+
.loaded #loader-wrapper .loader-section.section-right {
233+
-webkit-transform: translateX(100%); /* Chrome, Opera 15+, Safari 3.1+ */
234+
-ms-transform: translateX(100%); /* IE 9 */
235+
transform: translateX(100%); /* Firefox 16+, IE 10+, Opera */
236+
237+
-webkit-transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
238+
transition: all 0.7s 0.3s cubic-bezier(0.645, 0.045, 0.355, 1.000);
239+
}
240+
241+
.loaded #loader {
242+
opacity: 0;
243+
-webkit-transition: all 0.3s ease-out;
244+
transition: all 0.3s ease-out;
245+
}
246+
247+
.loaded #loader-wrapper{
248+
visibility: hidden;
249+
}
250+
251+
.no-js #loader-wrapper {
252+
display: none;
253+
}
254+
.no-js h1 {
255+
color: #222222;
256+
}
257+
258+
/* end of css for loader */
259+
121260
a {
122261
color: #0088cc;
123262
text-decoration: none;
@@ -1292,7 +1431,7 @@ a.jsbookslinks {
12921431
width: 140px;
12931432
height: 184px;
12941433
background: rgba(54, 109, 156,.9) url('../img/view.png') no-repeat center;
1295-
z-index: 10;
1434+
z-index: 5;
12961435
-webkit-transition:opacity .2s linear;
12971436
-moz-transition:opacity .2s linear;
12981437
-o-transition:opacity .2s linear;
@@ -1668,7 +1807,7 @@ ul#social_buttons li a:hover {
16681807
width: 140px;
16691808
height: 184px;
16701809
}
1671-
1810+
16721811
}
16731812

16741813
@media (min-width: 768px) and (max-width: 979px) {

index.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ <h1>The best free Python resources</h1>
3939
</ul>
4040
</div>
4141

42+
<!-- adding loader -->
43+
<div id="loader-wrapper">
44+
<div id="loader"></div>
45+
<div class="loader-section section-left"></div>
46+
<div class="loader-section section-right"></div>
47+
</div>
48+
4249
<div class="container">
4350
<!-- ==========================
4451
JOBS
@@ -127,6 +134,7 @@ <h1>The best free Python resources</h1>
127134

128135

129136
$(document).ready(function() {
137+
$('body').addClass('loaded');
130138
$.getJSON('./issues.json?' + Math.random(), function(data) {
131139
var template = $('#booktpl').html();
132140
data.books.sort(randOrd);
@@ -146,7 +154,7 @@ <h1>The best free Python resources</h1>
146154
<div class="span4 booksection {{ level }}">
147155
<a target="_blank" href="{{url}}">
148156
<div class="view"></div>
149-
<div title="{{ title }}" id="cover" style="background:black url('{{cover}}') no-repeat center;-webkit-background-size:cover;-moz-background-size:cover;background-size:cover;">
157+
<div title="{{ title }}" id="cover" style="background:black url('{{cover}}') no-repeat center;-webkit-background-size:cover;-moz-background-size:cover;background-size:cover;z-index:50">
150158
</div>
151159
<h2 title="{{ title }}">{{title}}</h2>
152160
</a>

0 commit comments

Comments
 (0)