File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,13 +30,13 @@ <h1>Proxy Builder</h1>
3030 < p class ="subtitle "> Enhance proxy URLs (fragment & fingerprint) or chain two proxy configs into Xray &
3131 Sing-box configurations</ p >
3232 < div class ="protocol-badges ">
33- < span class ="badge badge-vless "> VLESS</ span >
34- < span class ="badge badge-vmess "> VMess</ span >
35- < span class ="badge badge-trojan "> Trojan</ span >
36- < span class ="badge badge-ss "> Shadowsocks</ span >
37- < span class ="badge badge-socks "> SOCKS</ span >
38- < span class ="badge badge-http "> HTTP</ span >
39- < span class ="badge badge-ssh "> SSH < sup class ="singbox-only-sup "> sing-box</ sup > </ span >
33+ < span class ="badge badge-vless " data-protocol =" vless " > VLESS</ span >
34+ < span class ="badge badge-vmess " data-protocol =" vmess " > VMess</ span >
35+ < span class ="badge badge-trojan " data-protocol =" trojan " > Trojan</ span >
36+ < span class ="badge badge-ss " data-protocol =" ss " > Shadowsocks</ span >
37+ < span class ="badge badge-socks " data-protocol =" socks " > SOCKS</ span >
38+ < span class ="badge badge-http " data-protocol =" http " > HTTP</ span >
39+ < span class ="badge badge-ssh " data-protocol =" ssh " > SSH < sup class ="singbox-only-sup "> sing-box</ sup > </ span >
4040 </ div >
4141 </ header >
4242
Original file line number Diff line number Diff line change 16271627 } ) ;
16281628 viewChain . style . display = viewName === 'chain' ? '' : 'none' ;
16291629 viewEnhancer . style . display = viewName === 'enhancer' ? '' : 'none' ;
1630+ document . querySelectorAll ( '.protocol-badges .badge' ) . forEach ( badge => {
1631+ const show = viewName === 'chain' || [ 'vless' , 'trojan' ] . includes ( badge . dataset . protocol ) ;
1632+ badge . style . display = show ? '' : 'none' ;
1633+ } ) ;
16301634 }
16311635
16321636 mainTabs . forEach ( tab => {
16331637 tab . addEventListener ( 'click' , ( ) => switchMainTab ( tab . dataset . view ) ) ;
16341638 } ) ;
16351639
1640+ // Apply badge visibility for the initial view (enhancer is active by default)
1641+ switchMainTab ( 'enhancer' ) ;
1642+
16361643 // ===== Tab switching =====
16371644 function switchTab ( tabName ) {
16381645 [ tabXray , tabSingbox ] . forEach ( t => t . classList . remove ( 'active' ) ) ;
You can’t perform that action at this time.
0 commit comments