Skip to content

Commit 7c47cf7

Browse files
committed
Add contribute floating button with popup on all pages
- Red "+" fab appears above WeChat fab on every page except contribute.html - Popup shows icon, title, description, 3-step flow tags, and CTA link - Clicking contribute fab auto-closes WeChat popup and vice versa - Full responsive support for mobile/landscape breakpoints - Hidden in print media query
1 parent bd3d1eb commit 7c47cf7

11 files changed

Lines changed: 122 additions & 38 deletions

File tree

404.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
<link rel="icon" href="favicon.svg" type="image/svg+xml">
2121
<link rel="icon" href="favicon-32x32.png" sizes="32x32" type="image/png">
2222
<link rel="apple-touch-icon" href="apple-touch-icon.png">
23-
<link rel="manifest" href="manifest.json?v=20260323d">
23+
<link rel="manifest" href="manifest.json?v=20260323e">
2424
<link rel="preconnect" href="https://fonts.googleapis.com">
2525
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
2626
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400&family=Noto+Sans+SC:wght@400;500;700;900&family=Orbitron:wght@700;900&display=swap" rel="stylesheet">
27-
<link rel="stylesheet" href="css/style.css?v=20260323d">
27+
<link rel="stylesheet" href="css/style.css?v=20260323e">
2828
<style>
2929
.err-wrap{display:flex;flex-direction:column;align-items:center;justify-content:center;
3030
text-align:center;min-height:calc(100vh - 200px);padding:100px 20px 80px}
@@ -103,7 +103,7 @@ <h1 class="err-title" data-i18n="err404Title">页面未找到</h1>
103103
</section>
104104

105105
<div id="footer"></div>
106-
<script src="js/shared.js?v=20260323d"></script>
106+
<script src="js/shared.js?v=20260323e"></script>
107107
<script>
108108
document.getElementById('nav').innerHTML = navHTML('');
109109
document.getElementById('footer').innerHTML = footerHTML();
@@ -135,6 +135,6 @@ <h1 class="err-title" data-i18n="err404Title">页面未找到</h1>
135135
if (currentLang !== 'zh') setLang(currentLang);
136136
</script>
137137
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('sw.js')}</script>
138-
<script defer src="js/search.js?v=20260323d"></script>
138+
<script defer src="js/search.js?v=20260323e"></script>
139139
</body>
140140
</html>

compat.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
<link rel="icon" href="favicon.svg" type="image/svg+xml">
3030
<link rel="icon" href="favicon-32x32.png" sizes="32x32" type="image/png">
3131
<link rel="apple-touch-icon" href="apple-touch-icon.png">
32-
<link rel="manifest" href="manifest.json?v=20260323d">
32+
<link rel="manifest" href="manifest.json?v=20260323e">
3333
<link rel="preconnect" href="https://fonts.googleapis.com">
3434
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3535
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400&family=Noto+Sans+SC:wght@400;500;700;900&family=Orbitron:wght@700;900&display=swap" rel="stylesheet">
36-
<link rel="stylesheet" href="css/style.css?v=20260323d">
36+
<link rel="stylesheet" href="css/style.css?v=20260323e">
3737
<style>
3838
/* HERO */
3939
.cp-hero{padding:100px 0 24px;text-align:center}
@@ -270,7 +270,7 @@ <h1 class="anim-up grad-text" data-i18n="cpTitle">安装合集</h1>
270270
</div></section>
271271

272272
<div id="footer"></div>
273-
<script src="js/shared.js?v=20260323d"></script>
273+
<script src="js/shared.js?v=20260323e"></script>
274274
<script>
275275
document.getElementById('nav').innerHTML = navHTML('compat');
276276
document.getElementById('footer').innerHTML = footerHTML();
@@ -662,6 +662,6 @@ <h1 class="anim-up grad-text" data-i18n="cpTitle">安装合集</h1>
662662
});
663663
</script>
664664
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('sw.js')}</script>
665-
<script defer src="js/search.js?v=20260323d"></script>
665+
<script defer src="js/search.js?v=20260323e"></script>
666666
</body>
667667
</html>

contribute.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
<link rel="icon" href="favicon.svg" type="image/svg+xml">
3030
<link rel="icon" href="favicon-32x32.png" sizes="32x32" type="image/png">
3131
<link rel="apple-touch-icon" href="apple-touch-icon.png">
32-
<link rel="manifest" href="manifest.json?v=20260323d">
32+
<link rel="manifest" href="manifest.json?v=20260323e">
3333
<link rel="preconnect" href="https://fonts.googleapis.com">
3434
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3535
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400&family=Noto+Sans+SC:wght@400;500;700;900&family=Orbitron:wght@700;900&display=swap" rel="stylesheet">
36-
<link rel="stylesheet" href="css/style.css?v=20260323d">
36+
<link rel="stylesheet" href="css/style.css?v=20260323e">
3737
<style>
3838
.ct-hero{padding:100px 0 40px;text-align:center}
3939
.ct-hero-eye{display:inline-flex;align-items:center;gap:8px;font-size:.72rem;font-weight:600;color:var(--text-muted);
@@ -209,7 +209,7 @@ <h2 class="ct-section-title" data-i18n="ctTipsTitle">投稿小贴士</h2>
209209
</div>
210210
</section>
211211
<div id="footer"></div>
212-
<script src="js/shared.js?v=20260323d"></script>
212+
<script src="js/shared.js?v=20260323e"></script>
213213
<script>
214214
document.getElementById('nav').innerHTML = navHTML();
215215
document.getElementById('footer').innerHTML = footerHTML();
@@ -280,6 +280,6 @@ <h2 class="ct-section-title" data-i18n="ctTipsTitle">投稿小贴士</h2>
280280
gtag('config', 'G-GNDHG1PZLG');
281281
</script>
282282
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('sw.js')}</script>
283-
<script defer src="js/search.js?v=20260323d"></script>
283+
<script defer src="js/search.js?v=20260323e"></script>
284284
</body>
285285
</html>

css/style.css

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,36 @@ img{max-width:100%;display:block}
233233
.btt-progress circle{fill:none;stroke:var(--red);stroke-width:2;stroke-linecap:round;
234234
transition:stroke-dashoffset .15s}
235235

236+
/* === CONTRIBUTE FLOATING WIDGET === */
237+
.contribute-fab{position:fixed;bottom:140px;right:32px;width:42px;height:42px;border-radius:50%;
238+
background:var(--card);color:var(--red);border:1px solid var(--border);cursor:pointer;
239+
display:flex;align-items:center;justify-content:center;font-size:1.2rem;
240+
box-shadow:0 4px 20px rgba(0,0,0,.2);transition:all .3s;z-index:900;text-decoration:none}
241+
.contribute-fab:hover{border-color:var(--red);box-shadow:0 4px 24px rgba(199,70,52,.25);transform:translateY(-2px)}
242+
.contribute-fab.active{border-color:var(--red);background:var(--bg3)}
243+
.contribute-fab svg{width:22px;height:22px;fill:currentColor}
244+
245+
.contribute-popup{position:fixed;bottom:194px;right:32px;width:260px;background:var(--card);
246+
border:1px solid var(--border);border-radius:var(--r-lg);padding:20px;z-index:901;
247+
box-shadow:0 12px 48px rgba(0,0,0,.35);opacity:0;visibility:hidden;
248+
transform:translateY(12px) scale(.95);transition:all .3s ease}
249+
.contribute-popup.show{opacity:1;visibility:visible;transform:translateY(0) scale(1)}
250+
.contribute-popup::after{content:'';position:absolute;bottom:-7px;right:20px;width:14px;height:14px;
251+
background:var(--card);border-right:1px solid var(--border);border-bottom:1px solid var(--border);
252+
transform:rotate(45deg)}
253+
.contribute-popup-close{position:absolute;top:8px;right:10px;background:none;border:none;
254+
color:var(--text-muted);cursor:pointer;font-size:.9rem;padding:4px;line-height:1;transition:color .2s}
255+
.contribute-popup-close:hover{color:var(--text)}
256+
.contribute-popup-icon{text-align:center;font-size:1.6rem;margin-bottom:6px}
257+
.contribute-popup-title{text-align:center;font-size:.92rem;font-weight:700;color:var(--text);margin-bottom:8px}
258+
.contribute-popup-desc{text-align:center;font-size:.78rem;color:var(--text-dim);line-height:1.6;margin-bottom:12px}
259+
.contribute-popup-steps{display:flex;justify-content:center;gap:8px;margin-bottom:14px}
260+
.contribute-popup-steps span{font-size:.7rem;color:var(--text-muted);background:var(--bg2);
261+
padding:4px 8px;border-radius:var(--r);border:1px solid var(--border);white-space:nowrap}
262+
.contribute-popup-btn{display:block;text-align:center;padding:8px 16px;background:var(--red);
263+
color:#fff;border-radius:var(--r);font-size:.82rem;font-weight:600;text-decoration:none;transition:opacity .2s}
264+
.contribute-popup-btn:hover{opacity:.85}
265+
236266
/* === WECHAT CONSULT WIDGET === */
237267
.wechat-fab{position:fixed;bottom:86px;right:32px;width:42px;height:42px;border-radius:50%;
238268
background:var(--card);color:var(--green);border:1px solid var(--border);cursor:pointer;
@@ -337,6 +367,8 @@ img{max-width:100%;display:block}
337367
.back-to-top{bottom:80px;right:16px;width:44px;height:44px}
338368
.wechat-fab{bottom:136px;right:16px;width:44px;height:44px}
339369
.wechat-popup{bottom:186px;right:16px;width:240px;padding:14px}
370+
.contribute-fab{bottom:192px;right:16px;width:44px;height:44px}
371+
.contribute-popup{bottom:246px;right:16px;width:240px;padding:16px}
340372

341373
.footer-inner{grid-template-columns:1fr}
342374
.section{padding:56px 0}
@@ -390,6 +422,7 @@ img{max-width:100%;display:block}
390422
.trust-quote{padding:20px 16px}
391423
.trust-quote-text{font-size:.85rem}
392424
.wechat-popup{width:calc(100vw - 32px);right:16px}
425+
.contribute-popup{width:calc(100vw - 32px);right:16px}
393426
.search-footer{font-size:.7rem}
394427
.mode-card{padding:16px 14px}
395428
.cmd-btns{gap:6px}
@@ -407,6 +440,8 @@ img{max-width:100%;display:block}
407440
.back-to-top{bottom:64px}
408441
.wechat-fab{bottom:120px}
409442
.wechat-popup{bottom:170px}
443+
.contribute-fab{bottom:176px}
444+
.contribute-popup{bottom:230px}
410445
}
411446

412447
/* === macOS Terminal Code Blocks === */
@@ -450,7 +485,7 @@ img{max-width:100%;display:block}
450485

451486
/* === PERFORMANCE HINTS === */
452487
.card:hover{will-change:transform}
453-
.back-to-top:hover,.wechat-fab:hover,.wechat-popup.show{will-change:transform}
488+
.back-to-top:hover,.wechat-fab:hover,.wechat-popup.show,.contribute-fab:hover,.contribute-popup.show{will-change:transform}
454489

455490
/* === HERO FLOATING ORBS === */
456491
@keyframes floatOrb1{0%,100%{transform:translate(0,0) scale(1)}25%{transform:translate(30px,-20px) scale(1.1)}50%{transform:translate(-15px,-40px) scale(.95)}75%{transform:translate(-30px,-10px) scale(1.05)}}
@@ -640,7 +675,7 @@ img{max-width:100%;display:block}
640675

641676
/* === PRINT STYLES === */
642677
@media print{
643-
.nav,.mobile-tabbar,.back-to-top,.wechat-fab,.wechat-popup,.search-overlay,.nav-actions,.noise-overlay,.btt-progress,.hero-orb,.page-progress{display:none!important}
678+
.nav,.mobile-tabbar,.back-to-top,.wechat-fab,.wechat-popup,.contribute-fab,.contribute-popup,.search-overlay,.nav-actions,.noise-overlay,.btt-progress,.hero-orb,.page-progress{display:none!important}
644679
body{background:#fff;color:#000;font-size:12pt;line-height:1.5;padding-top:0}
645680
a{color:#000;text-decoration:underline}
646681
.footer{background:#f5f5f5;color:#333;border-top:1px solid #ccc}

docs.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
<link rel="icon" href="favicon.svg" type="image/svg+xml">
3030
<link rel="icon" href="favicon-32x32.png" sizes="32x32" type="image/png">
3131
<link rel="apple-touch-icon" href="apple-touch-icon.png">
32-
<link rel="manifest" href="manifest.json?v=20260323d">
32+
<link rel="manifest" href="manifest.json?v=20260323e">
3333
<link rel="preconnect" href="https://fonts.googleapis.com">
3434
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3535
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400&family=Noto+Sans+SC:wght@400;500;700;900&family=Orbitron:wght@700;900&display=swap" rel="stylesheet">
36-
<link rel="stylesheet" href="css/style.css?v=20260323d">
36+
<link rel="stylesheet" href="css/style.css?v=20260323e">
3737
<style>
3838
.doc-layout{display:grid;grid-template-columns:220px 1fr;gap:44px;padding:56px 0 80px;align-items:start}
3939
.doc-sidebar{position:sticky;top:calc(var(--nav-h) + 24px)}
@@ -1241,7 +1241,7 @@ <h3>v3.0.0 (2022-11-01)</h3>
12411241
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M18 15l-6-6-6 6"/></svg>
12421242
</button>
12431243
<div id="footer"></div>
1244-
<script src="js/shared.js?v=20260323d"></script>
1244+
<script src="js/shared.js?v=20260323e"></script>
12451245
<script>
12461246
document.getElementById('nav').innerHTML = navHTML('docs');
12471247
document.getElementById('footer').innerHTML = footerHTML();
@@ -1442,6 +1442,6 @@ <h3>v3.0.0 (2022-11-01)</h3>
14421442
});
14431443
</script>
14441444
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('sw.js')}</script>
1445-
<script defer src="js/search.js?v=20260323d"></script>
1445+
<script defer src="js/search.js?v=20260323e"></script>
14461446
</body>
14471447
</html>

download.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
<link rel="icon" href="favicon.svg" type="image/svg+xml">
3030
<link rel="icon" href="favicon-32x32.png" sizes="32x32" type="image/png">
3131
<link rel="apple-touch-icon" href="apple-touch-icon.png">
32-
<link rel="manifest" href="manifest.json?v=20260323d">
32+
<link rel="manifest" href="manifest.json?v=20260323e">
3333
<link rel="preconnect" href="https://fonts.googleapis.com">
3434
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3535
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400&family=Noto+Sans+SC:wght@400;500;700;900&family=Orbitron:wght@700;900&display=swap" rel="stylesheet">
36-
<link rel="stylesheet" href="css/style.css?v=20260323d">
36+
<link rel="stylesheet" href="css/style.css?v=20260323e">
3737
<style>
3838
/* HERO */
3939
.dl-hero{padding:100px 0 36px;text-align:center}
@@ -496,7 +496,7 @@ <h3 data-i18n="dlG6T">请尊重休息时间</h3>
496496

497497
</div><!-- /container -->
498498
<div id="footer"></div>
499-
<script src="js/shared.js?v=20260323d"></script>
499+
<script src="js/shared.js?v=20260323e"></script>
500500
<script>
501501
document.getElementById('nav').innerHTML = navHTML('download');
502502
document.getElementById('footer').innerHTML = footerHTML();
@@ -637,6 +637,6 @@ <h3 data-i18n="dlG6T">请尊重休息时间</h3>
637637
if (currentLang !== 'zh') setLang(currentLang);
638638
</script>
639639
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('sw.js')}</script>
640-
<script defer src="js/search.js?v=20260323d"></script>
640+
<script defer src="js/search.js?v=20260323e"></script>
641641
</body>
642642
</html>

generator.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
<link rel="icon" href="favicon.svg" type="image/svg+xml">
3030
<link rel="icon" href="favicon-32x32.png" sizes="32x32" type="image/png">
3131
<link rel="apple-touch-icon" href="apple-touch-icon.png">
32-
<link rel="manifest" href="manifest.json?v=20260323d">
32+
<link rel="manifest" href="manifest.json?v=20260323e">
3333
<link rel="preconnect" href="https://fonts.googleapis.com">
3434
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3535
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400&family=Noto+Sans+SC:wght@400;500;700;900&family=Orbitron:wght@700;900&display=swap" rel="stylesheet">
36-
<link rel="stylesheet" href="css/style.css?v=20260323d">
36+
<link rel="stylesheet" href="css/style.css?v=20260323e">
3737
<style>
3838
.presets-section{margin:0 0 28px}
3939
.presets-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
@@ -152,7 +152,7 @@ <h3 data-i18n="saveModalTitle">保存当前配置</h3>
152152
</section>
153153
</div>
154154
<div id="footer"></div>
155-
<script src="js/shared.js?v=20260323d"></script>
155+
<script src="js/shared.js?v=20260323e"></script>
156156
<script>
157157
document.getElementById('nav').innerHTML = navHTML('generator');
158158
document.getElementById('footer').innerHTML = footerHTML();
@@ -579,6 +579,6 @@ <h3 data-i18n="saveModalTitle">保存当前配置</h3>
579579
if (currentLang !== 'zh') setLang(currentLang);
580580
</script>
581581
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('sw.js')}</script>
582-
<script defer src="js/search.js?v=20260323d"></script>
582+
<script defer src="js/search.js?v=20260323e"></script>
583583
</body>
584584
</html>

index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
<link rel="icon" href="favicon.svg" type="image/svg+xml">
3030
<link rel="icon" href="favicon-32x32.png" sizes="32x32" type="image/png">
3131
<link rel="apple-touch-icon" href="apple-touch-icon.png">
32-
<link rel="manifest" href="manifest.json?v=20260323d">
32+
<link rel="manifest" href="manifest.json?v=20260323e">
3333
<link rel="preconnect" href="https://fonts.googleapis.com">
3434
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
35-
<link rel="preload" href="css/style.css?v=20260323d" as="style">
36-
<link rel="preload" href="js/shared.js?v=20260323d" as="script">
35+
<link rel="preload" href="css/style.css?v=20260323e" as="style">
36+
<link rel="preload" href="js/shared.js?v=20260323e" as="script">
3737
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400&family=Noto+Sans+SC:wght@400;500;700;900&family=Orbitron:wght@700;900&display=swap" rel="stylesheet">
38-
<link rel="stylesheet" href="css/style.css?v=20260323d">
38+
<link rel="stylesheet" href="css/style.css?v=20260323e">
3939
<style>
4040
.hero{position:relative;padding:120px 0 100px;overflow:hidden}
4141
.hero::before{content:'';position:absolute;top:-100px;left:50%;transform:translateX(-50%);
@@ -330,7 +330,7 @@ <h2 data-i18n="ctaTitle">告别手动安装,从现在开始</h2>
330330
<!-- FOOTER -->
331331
<div id="footer"></div>
332332

333-
<script src="js/shared.js?v=20260323d"></script>
333+
<script src="js/shared.js?v=20260323e"></script>
334334
<script>
335335
document.getElementById('nav').innerHTML = navHTML('home');
336336
document.getElementById('footer').innerHTML = footerHTML();
@@ -503,6 +503,6 @@ <h2 data-i18n="ctaTitle">告别手动安装,从现在开始</h2>
503503
})();
504504
</script>
505505
<script>if('serviceWorker' in navigator){navigator.serviceWorker.register('sw.js')}</script>
506-
<script defer src="js/search.js?v=20260323d"></script>
506+
<script defer src="js/search.js?v=20260323e"></script>
507507
</body>
508508
</html>

js/shared.js

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,8 +504,57 @@ document.addEventListener('DOMContentLoaded', () => {
504504
document.body.appendChild(bttRing);
505505
const ringCircle = bttRing.querySelector('circle');
506506

507-
// WeChat consult floating widget
507+
// Contribute floating button + popup
508508
const isGuide = location.pathname.includes('/guides/');
509+
const isContributePage = location.pathname.includes('contribute');
510+
if (!isContributePage) {
511+
const ctPath = isGuide ? '../contribute.html' : 'contribute.html';
512+
const ctFab = document.createElement('button');
513+
ctFab.className = 'contribute-fab';
514+
ctFab.title = t('contribute');
515+
ctFab.setAttribute('aria-label', t('contribute'));
516+
ctFab.innerHTML = '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"/></svg>';
517+
document.body.appendChild(ctFab);
518+
519+
const ctPopup = document.createElement('div');
520+
ctPopup.className = 'contribute-popup';
521+
const ctZh = currentLang === 'zh';
522+
ctPopup.innerHTML = `<button class="contribute-popup-close" aria-label="关闭">&times;</button>
523+
<div class="contribute-popup-icon">&#9997;</div>
524+
<div class="contribute-popup-title">${ctZh ? '分享您的安装体验' : 'Share Your Install Experience'}</div>
525+
<div class="contribute-popup-desc">${ctZh ? '安装完成后,脚本会自动生成报告模板。分享您的安装实录,帮助更多 DBA。' : 'The script auto-generates a report after installation. Share your experience to help more DBAs.'}</div>
526+
<div class="contribute-popup-steps">
527+
<span>1. ${ctZh ? '找到报告' : 'Find Report'}</span>
528+
<span>2. ${ctZh ? '补充内容' : 'Add Content'}</span>
529+
<span>3. ${ctZh ? '提交分享' : 'Submit'}</span>
530+
</div>
531+
<a href="${ctPath}" class="contribute-popup-btn">${ctZh ? '查看投稿指南 →' : 'View Contribute Guide →'}</a>`;
532+
document.body.appendChild(ctPopup);
533+
534+
ctFab.addEventListener('click', (e) => {
535+
e.stopPropagation();
536+
ctPopup.classList.toggle('show');
537+
ctFab.classList.toggle('active');
538+
// Close WeChat popup if open
539+
var wp = document.querySelector('.wechat-popup');
540+
if (wp) wp.classList.remove('show');
541+
var wf = document.querySelector('.wechat-fab');
542+
if (wf) wf.classList.remove('active');
543+
});
544+
const ctClose = ctPopup.querySelector('.contribute-popup-close');
545+
if (ctClose) ctClose.addEventListener('click', () => {
546+
ctPopup.classList.remove('show');
547+
ctFab.classList.remove('active');
548+
});
549+
document.addEventListener('click', (e) => {
550+
if (!ctPopup.contains(e.target) && !ctFab.contains(e.target)) {
551+
ctPopup.classList.remove('show');
552+
ctFab.classList.remove('active');
553+
}
554+
});
555+
}
556+
557+
// WeChat consult floating widget
509558
const qrPath = isGuide ? '../img/wechat-qr.webp' : 'img/wechat-qr.webp';
510559
const fab = document.createElement('button');
511560
fab.className = 'wechat-fab';

0 commit comments

Comments
 (0)