Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 56fa7b0

Browse files
committed
DOC: add donation buttons to main page
1 parent f915ac2 commit 56fa7b0

File tree

3 files changed

+156
-1
lines changed

3 files changed

+156
-1
lines changed

doc/_templates/donate_sidebar.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
<div style="background:#ccc; border-radius:0px 0px 0px 0px;font-weight:normal; font-family:Arial, Helvetica, sans-serif;border:none;box-shadow:none;left: 50%; margin-left:-72.5px;clear: both;display: block; width:145px;height:45px; line-height:2.8; position:relative; font-size:16px;text-align:center; cursor:pointer;color:#fff;text-decoration: none; z-index:1" onclick="open_window('MjI1OA==')">Support Matplotlib</div>
3+
4+
5+
6+
<div style="background:#ccc; border-radius:0px 0px 0px 0px;font-weight:normal; font-family:Arial, Helvetica, sans-serif;border:none;box-shadow:none;left: 50%; margin-left:-72.5px;clear: both;display: block; width:145px;height:45px; line-height:2.8; position:relative; font-size:16px;text-align:center; cursor:pointer;color:#fff;text-decoration: none; z-index:1" onclick="open_window('MjM2OA==')">Support NumFOCUS</div>

doc/_templates/layout.html

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,153 @@ <h3>We're updating the default styles for Matplotlib 2.0</h3>
265265

266266
</script>
267267
</body>
268+
<footer>
269+
<!--Flipcause Integration v3.0// Flipcause Integration Instructions:
270+
Install the following code block once in the website Header (after <head> tag) -->
271+
272+
<style>
273+
274+
.fc-black_overlay{
275+
display:none; position: fixed; z-index:1000001; top: 0%;left: 0%;width: 100%;height: 100%;
276+
background-color: black; filter: alpha(opacity=50); cursor:pointer; opacity:0.5;
277+
}
278+
279+
.fc-white_content {
280+
opacity:1; display:none; margin-top: -320px; margin-left: -485px; width:970px; height:640px;
281+
position:fixed; top:50%; left:50%; border: none;z-index:1000002;overflow: auto;
282+
}
283+
284+
.fc-main-box{
285+
opacity:1; display:none; margin:15px auto 0 auto; width:930px; position:relative; z-index:1000003;
286+
}
287+
288+
.fc-widget_close{
289+
opacity:1; content:url(http://i1338.photobucket.com/albums/o691/WeCause/X_zpse4a7e538.png);
290+
position:absolute; z-index=1000004; right:-16px; top:-16px; display:block; cursor:pointer;
291+
}
292+
293+
.floating_button{
294+
display: block; margin-top: 0px; margin-left: 0px; width:auto ; height: auto;
295+
position:fixed; z-index:999999; overflow: auto;
296+
}
297+
298+
@keyframes backfadesin {
299+
from { opacity:0; }
300+
to {opacity:.5;}
301+
}
302+
303+
@-moz-keyframes backfadesin {
304+
from { opacity:0; }
305+
to {opacity:.5;}
306+
}
307+
308+
@-webkit-keyframes backfadesin {
309+
from { opacity:0; }
310+
to {opacity:.5;}
311+
}
312+
313+
@-o-keyframes backfadesin {
314+
from { opacity:0; }
315+
to {opacity:.5;}
316+
}
317+
318+
319+
@-ms-keyframes backfadesin {
320+
from { opacity:0; }
321+
to {opacity:.5;}
322+
}
323+
324+
@keyframes fadesin {
325+
0%{ opacity:0; }
326+
50%{ opacity:0; }
327+
75% {opacity: 0; transform: translateY(20px);}
328+
100% {opacity: 1; transform: translateY(0);}
329+
}
330+
331+
@-moz-keyframes fadesin {
332+
0%{ opacity:0; }
333+
50%{ opacity:0; }
334+
75% {opacity: 0; -moz-transform: translateY(20px);}
335+
100% {opacity: 1; -moz-transform: translateY(0);}
336+
}
337+
338+
@-webkit-keyframes fadesin {
339+
0%{ opacity:0; }
340+
50%{ opacity:0; }
341+
75% {opacity: 0; -webkit-transform: translateY(20px);}
342+
100% {opacity: 1; -webkit-transform: translateY(0);}
343+
}
344+
345+
@-o-keyframes fadesin {
346+
0%{ opacity:0; }
347+
50%{ opacity:0; }
348+
75% {opacity: 0; -o-transform: translateY(20px);}
349+
100% {opacity: 1; -o-transform: translateY(0);}
350+
}
351+
352+
@-ms-keyframes fadesin {
353+
0%{ opacity:0; }
354+
50%{ opacity:0; }
355+
75% {opacity: 0; -ms-transform: translateY(20px);}
356+
100% {opacity: 1; -ms-transform: translateY(0);}
357+
}
358+
359+
</style>
360+
361+
<script>
362+
363+
function open_window(cause_id) {
364+
var protocol=String(document.location.protocol);
365+
var new_url;
366+
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)){
367+
new_url="https://www.flipcause.com/widget/"+cause_id
368+
window.open(new_url);
369+
}
370+
371+
else {
372+
document.getElementById("fc-fade").style.display = "block";
373+
document.getElementById("fc-fade").style.webkitAnimation = "backfadesin 1s";
374+
document.getElementById("fc-fade").style.animation = "backfadesin 1s";
375+
document.getElementById("fc-fade").style.mozAnimation = "backfadesin 1s";
376+
document.getElementById("fc-light").style.display = "block";
377+
document.getElementById("fc-light").style.webkitAnimation = "fadesin 1.5s";
378+
document.getElementById("fc-light").style.animation = "fadesin 1.5s";
379+
document.getElementById("fc-light").style.mozAnimation = "fadesin 1.5s";
380+
document.getElementById("fc-main").style.display = "block";
381+
document.getElementById("fc-main").style.webkitAnimation = "fadesin 1.5s";
382+
document.getElementById("fc-main").style.animation = "fadesin 1.5s";
383+
document.getElementById("fc-main").style.mozAnimation = "fadesin 1.5s";
384+
document.getElementById("fc-close").style.display = "block";
385+
document.getElementById("fc-close").style.webkitAnimation = "fadesin 1.5s";
386+
document.getElementById("fc-close").style.animation = "fadesin 1.5s";
387+
document.getElementById("fc-close").style.mozAnimation = "fadesin 1.5s";
388+
document.getElementById("fc-myFrame").style.display = "block";
389+
document.getElementById("fc-myFrame").style.webkitAnimation = "fadesin 1.5s";
390+
document.getElementById("fc-myFrame").style.animation = "fadesin 1.5s";
391+
document.getElementById("fc-myFrame").style.mozAnimation = "fadesin 1.5s";
392+
document.getElementById("fc-myFrame").src="https://www.flipcause.com/widget/"+cause_id;
393+
}
394+
}
395+
396+
397+
function close_window() {
398+
document.getElementById("fc-fade").style.display="none";
399+
document.getElementById("fc-light").style.display="none";
400+
document.getElementById("fc-main").style.display="none";
401+
document.getElementById("fc-close").style.display="none";
402+
document.getElementById("fc-myFrame").style.display="none";
403+
}
404+
405+
</script>
406+
407+
<div id="fc-fade" class="fc-black_overlay" onclick="close_window()"></div>
408+
<div id="fc-light" class="fc-white_content">
409+
<div id="fc-main" class="fc-main-box">
410+
<div id="fc-close" class="fc-widget_close" onclick="close_window()">
411+
</div><iframe id="fc-myFrame" iframe height="580" width="925" style="border: 0;
412+
border-radius:5px 5px 5px 5px; box-shadow:0 0 8px rgba(0, 0, 0, 0.5);" scrolling="no" src=""></iframe></div>
413+
</div>
414+
415+
<!--END Flipcause Main Integration Code-->
416+
</footer>
268417
</html>

doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186

187187
# Custom sidebar templates, maps page names to templates.
188188
html_sidebars = {
189-
'index': ['badgesidebar.html', 'indexsidebar.html'],
189+
'index': ['badgesidebar.html','donate_sidebar.html', 'indexsidebar.html'],
190190
'**': ['badgesidebar.html', 'localtoc.html',
191191
'relations.html', 'sourcelink.html', 'searchbox.html']
192192
}

0 commit comments

Comments
 (0)