1// ç»ä¸åå§åfooter - å®å ¨ç±èæ¬ç®¡çï¼é¡µé¢åªéè¦æä¾ç©ºå®¹å¨ï¼æå®å ¨ç±èæ¬åå»ºï¼ 2function initFooter() { 3 // æ¥æ¾æå建footerå®¹å¨ 4 let footer = document.getElementById('site-footer'); 5 6 if (!footer) { 7 // 妿ä¸åå¨ï¼å建footer 8 footer = document.createElement('footer'); 9 footer.id = 'site-footer'; 10 document.body.appendChild(footer); 11 } 12 13 // ç»ä¸è®¾ç½®æ ·å¼åclassï¼å®å ¨ç±èæ¬æ§å¶ï¼è¦çä»»ä½é¡µé¢è®¾ç½®ï¼ 14 // 使ç¨é¦é¡µçé¡µèæ ·å¼ï¼ç»ä¸æ ¼å¼ï¼ 15 footer.className = 'footer'; 16 // ä½¿ç¨ !important ç¡®ä¿è¦ç styles.css ä¸çæ§æ ·å¼ 17 footer.style.cssText = 'text-align: center !important; padding: 2rem !important; color: #6b7280 !important; font-size: 0.9rem !important; border-top: 1px solid #1f2937 !important; margin-top: 4rem !important; background-color: transparent !important;'; 18 19 // ç¡®ä¿footer龿¥æ ·å¼ç»ä¸ï¼é¦é¡µæ ¼å¼ï¼- ä½¿ç¨æ´å¼ºçä¼å 级è¦ç styles.css 20 if (!document.getElementById('footer-style-injected')) { 21 const style = document.createElement('style'); 22 style.id = 'footer-style-injected'; 23 style.textContent = ` 24 /* è¦ç styles.css ä¸çæ§é¡µèæ ·å¼ï¼ä½¿ç¨é¦é¡µæ ¼å¼ */ 25 #site-footer.footer { 26 text-align: center !important; 27 padding: 2rem !important; 28 color: #6b7280 !important; 29 font-size: 0.9rem !important; 30 border-top: 1px solid #1f2937 !important; 31 margin-top: 4rem !important; 32 background-color: transparent !important; 33 } 34 35 /* è¦ç #site-footer a çæ ·å¼ */ 36 #site-footer.footer a { 37 color: #60a5fa !important; 38 text-decoration: none !important; 39 margin: 0 0.5rem !important; 40 } 41 42 #site-footer.footer a:hover { 43 text-decoration: underline !important; 44 background-color: transparent !important; 45 } 46 47 /* è¦ç #footer-links ç flex å¸å±ï¼ä½¿ç¨é¦é¡µçç®åæ ¼å¼ */ 48 #site-footer.footer #footer-links { 49 display: block !important; 50 text-align: center !important; 51 } 52 53 #site-footer.footer #footer-links p { 54 margin: 0; 55 line-height: 1.6; 56 } 57 `; 58 document.head.appendChild(style); 59 } 60 61 // æ¸ ç©ºå¹¶å建footerå 容容å¨ï¼å®å ¨ç±èæ¬æ§å¶ï¼ 62 footer.innerHTML = ` 63 <div id="footer-links"> 64 <!-- 龿¥å°éè¿ footer.js å¨æçæ --> 65 </div> 66 `; 67} 68 69// 页èICP夿¡ä¿¡æ¯å è½½èæ¬ 70async function loadICPInfo() { 71 try { 72 const response = await fetch('/api/v1/site-config'); 73 const config = await response.json(); 74 const icpElement = document.getElementById('icp-license-text'); 75 if (icpElement && config.icp_license) { 76 icpElement.textContent = config.icp_license; 77 } 78 } catch (error) { 79 console.error('å è½½ICP夿¡ä¿¡æ¯å¤±è´¥:', error); 80 // 妿API失败ï¼ä½¿ç¨é»è®¤å¼ï¼ç°å¨ç±renderFooterLinksç»ä¸å¤çï¼ 81 // ICPä¿¡æ¯å·²å å«å¨footerä¸ï¼ä¸åéè¦åç¬å è½½ 82 } 83} 84 85// 渲æé¡µè龿¥ï¼ä½¿ç¨é¦é¡µçæ ¼å¼ï¼ 86function renderFooterLinks() { 87 const footerLinksContainer = document.getElementById('footer-links'); 88 if (!footerLinksContainer) { 89 return; 90 } 91 92 const links = [ 93 { href: '/about.html', text: 'å ³äºæä»¬' }, 94 { href: '/help.html', text: 'ä½¿ç¨æå' }, 95 { href: '/tools-intro.html', text: 'å·¥å ·ä»ç»' }, 96 { href: '/contact.html', text: 'èç³»æä»¬' }, 97 { href: '/privacy.html', text: 'éç§æ¿ç' }, 98 { href: '/terms.html', text: 'æå¡æ¡æ¬¾' } 99 ]; 100 101 // 使ç¨é¦é¡µçæ ¼å¼ï¼é¾æ¥ä¹é´ç¨ç«çº¿åé 102 footerLinksContainer.innerHTML = ` 103 <p> 104 ${links.map((link, index) => { 105 const separator = index < links.length - 1 ? ' | ' : ''; 106 return `<a href="${link.href}">${link.text}</a>${separator}`; 107 }).join('')} 108 </p> 109 <p style="margin-top: 1rem;"> 110 poe2lens © 2024 | ä¸ä¸ºæµæ¾ä¹è·¯2ç©å®¶æé çå·¥å ·ç« 111 </p> 112 <p style="margin-top: 0.5rem;"> 113 <a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer" style="color: #6b7280; text-decoration: none;"> 114 沪ICPå¤2025152952å·-1 115 </a> 116 </p> 117 `; 118} 119 120// 页é¢å è½½å®æååå§åfooterå¹¶å è½½ICPä¿¡æ¯å页è龿¥ 121if (document.readyState === 'loading') { 122 document.addEventListener('DOMContentLoaded', () => { 123 initFooter(); 124 loadICPInfo(); 125 renderFooterLinks(); 126 }); 127} else { 128 initFooter(); 129 loadICPInfo(); 130 renderFooterLinks(); 131} 132
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.