Skip to content

Commit 929e135

Browse files
committed
save
1 parent 7c442ef commit 929e135

File tree

4 files changed

+216
-1
lines changed

4 files changed

+216
-1
lines changed

docs/extra.css

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,4 +439,150 @@
439439
.md-header-nav__button.md-logo svg {
440440
width: 40px;
441441
height: 40px;
442+
}
443+
444+
@media screen and (max-width: 76.1875em) {
445+
.repo-stats {
446+
display: none !important;
447+
}
448+
}
449+
450+
/* Sponsor popup styling */
451+
.sponsor-popup {
452+
position: fixed;
453+
top: 0;
454+
left: 0;
455+
width: 100%;
456+
height: 100%;
457+
background-color: rgba(0, 0, 0, 0.5);
458+
display: flex;
459+
justify-content: center;
460+
align-items: center;
461+
z-index: 9999;
462+
opacity: 0;
463+
visibility: hidden;
464+
transition: opacity 0.3s, visibility 0.3s;
465+
}
466+
467+
.sponsor-popup.active {
468+
opacity: 1;
469+
visibility: visible;
470+
}
471+
472+
.sponsor-popup-content {
473+
background-color: #fff;
474+
border-radius: 8px;
475+
max-width: 500px;
476+
width: 90%;
477+
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
478+
overflow: hidden;
479+
}
480+
481+
[data-md-color-scheme="astral-dark"] .sponsor-popup-content {
482+
background-color: var(--galaxy);
483+
color: var(--white);
484+
}
485+
486+
.sponsor-popup-header {
487+
padding: 16px 20px;
488+
background-color: var(--rock);
489+
color: var(--black);
490+
display: flex;
491+
justify-content: space-between;
492+
align-items: center;
493+
}
494+
495+
.sponsor-popup-header h2 {
496+
margin: 0;
497+
font-size: 1.3rem;
498+
font-weight: 600;
499+
}
500+
501+
.sponsor-popup-close {
502+
background: none;
503+
border: none;
504+
font-size: 24px;
505+
cursor: pointer;
506+
color: var(--black);
507+
width: 30px;
508+
height: 30px;
509+
display: flex;
510+
justify-content: center;
511+
align-items: center;
512+
border-radius: 50%;
513+
transition: background-color 0.2s;
514+
}
515+
516+
.sponsor-popup-close:hover {
517+
background-color: rgba(0, 0, 0, 0.1);
518+
}
519+
520+
.sponsor-popup-body {
521+
padding: 20px;
522+
}
523+
524+
.sponsor-popup-buttons {
525+
display: flex;
526+
gap: 12px;
527+
margin: 20px 0;
528+
}
529+
530+
.sponsor-popup-button {
531+
display: flex;
532+
align-items: center;
533+
gap: 8px;
534+
padding: 10px 16px;
535+
border-radius: 4px;
536+
text-decoration: none;
537+
font-weight: 600;
538+
background-color: #f0f0f0;
539+
color: #333;
540+
transition: background-color 0.2s;
541+
}
542+
543+
.sponsor-popup-button.primary {
544+
background-color: var(--rock);
545+
color: var(--black);
546+
}
547+
548+
.sponsor-popup-button:hover {
549+
opacity: 0.9;
550+
}
551+
552+
.sponsor-popup-footer {
553+
margin-top: 16px;
554+
display: flex;
555+
justify-content: flex-end;
556+
font-size: 0.9rem;
557+
}
558+
559+
.sponsor-popup-footer label {
560+
display: flex;
561+
align-items: center;
562+
gap: 6px;
563+
cursor: pointer;
564+
}
565+
566+
/* Sponsor admonition styling */
567+
.md-typeset .admonition.sponsor,
568+
.md-typeset details.sponsor {
569+
border-left-color: var(--rock);
570+
}
571+
572+
.md-typeset .sponsor > .admonition-title,
573+
.md-typeset .sponsor > summary {
574+
background-color: rgba(255, 215, 0, 0.1);
575+
}
576+
577+
.md-typeset .sponsor > .admonition-title::before,
578+
.md-typeset .sponsor > summary::before {
579+
background-color: var(--rock);
580+
-webkit-mask-image: var(--md-admonition-icon--note);
581+
mask-image: var(--md-admonition-icon--note);
582+
}
583+
584+
/* Sponsor button styling */
585+
.md-typeset .md-button {
586+
margin-top: 0.5em;
587+
margin-right: 0.5em;
442588
}

docs/extra.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,71 @@ function cleanupClipboardText(targetSelector) {
4444
});
4545
}
4646

47+
// Show sponsor popup on first visit
48+
function showSponsorPopup() {
49+
// Check if user has seen the popup before
50+
if (!localStorage.getItem('mqpy_sponsor_popup_shown')) {
51+
// Create popup container
52+
const popup = document.createElement('div');
53+
popup.className = 'sponsor-popup';
54+
55+
// Create popup content
56+
popup.innerHTML = `
57+
<div class="sponsor-popup-content">
58+
<div class="sponsor-popup-header">
59+
<h2>Support MQPy Development</h2>
60+
<button class="sponsor-popup-close">&times;</button>
61+
</div>
62+
<div class="sponsor-popup-body">
63+
<p>Thank you for using MQPy! This project is free and open-source, developed in my free time.</p>
64+
<p>If you find MQPy useful, please consider supporting its development:</p>
65+
<div class="sponsor-popup-buttons">
66+
<a href="https://github.com/sponsors/Joaopeuko" class="sponsor-popup-button primary" target="_blank">
67+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path d="M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z" fill="currentColor"/></svg>
68+
Become a Sponsor
69+
</a>
70+
</div>
71+
<div class="sponsor-popup-footer">
72+
<label>
73+
<input type="checkbox" id="sponsor-popup-dont-show"> Don't show this message again
74+
</label>
75+
</div>
76+
</div>
77+
</div>
78+
`;
79+
80+
// Add popup to body
81+
document.body.appendChild(popup);
82+
83+
// Show popup with animation
84+
setTimeout(() => {
85+
popup.classList.add('active');
86+
}, 1000);
87+
88+
// Close button event
89+
const closeBtn = popup.querySelector('.sponsor-popup-close');
90+
closeBtn.addEventListener('click', () => {
91+
popup.classList.remove('active');
92+
93+
// Check if "don't show again" is checked
94+
const dontShowAgain = document.getElementById('sponsor-popup-dont-show').checked;
95+
if (dontShowAgain) {
96+
localStorage.setItem('mqpy_sponsor_popup_shown', 'true');
97+
}
98+
99+
// Remove popup after animation
100+
setTimeout(() => {
101+
popup.remove();
102+
}, 300);
103+
});
104+
}
105+
}
106+
47107
// Using the document$ observable is particularly important if you are using instant loading since
48108
// it will not result in a page refresh in the browser
49109
// See `How to integrate with third-party JavaScript libraries` guideline:
50110
// https://squidfunk.github.io/mkdocs-material/customization/?h=javascript#additional-javascript
51111
document$.subscribe(function () {
52112
setCopyText();
113+
showSponsorPopup();
53114
});

docs/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
<div style="display: flex; justify-content: center;">
2+
<img src="assets/logo.svg" alt="MQPy Logo" style="width: 200px; height: 200px;">
3+
</div>
4+
5+
!!! sponsor "Support MQPy Development"
6+
MQPy is a free and open-source project that needs your support to continue development!
7+
8+
[💛 Become a Sponsor](https://github.com/sponsors/Joaopeuko){ .md-button .md-button--primary }
9+
110
# MQPy
211

312
MQPy is a Python library designed to simplify the process of creating Expert Advisors for MetaTrader 5. While developing directly in MQL5 can be complex, MQPy provides a more streamlined experience using Python.

mkdocs.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ plugins:
144144
show_root_members_full_path: false
145145
show_module_member_docstring: true
146146
- mkdocs-jupyter
147-
148147
nav:
149148
- Home: index.md
150149
- API Reference: reference/

0 commit comments

Comments
 (0)