diff --git a/public/css/public.css b/public/css/public.css index d041fbe..bf7edae 100644 --- a/public/css/public.css +++ b/public/css/public.css @@ -355,6 +355,27 @@ select { font-size: 12px; } +.site-footer__copyright-list { + display: flex; + flex-direction: column; + gap: 8px; +} + +.site-footer__copyright-row { + margin: 0; + color: rgba(255, 255, 255, .62); + font-size: 12px; + line-height: 1.8; +} + +.site-footer__copyright-row.index-style-02 { + color: rgba(255, 255, 255, .56); +} + +.site-footer__copyright-row.index-style-02:hover { + color: rgba(255, 255, 255, .86); +} + .site-footer__meta { display: flex; flex-wrap: wrap; @@ -1246,4 +1267,4 @@ select { height: auto; aspect-ratio: 1 / 1; } -} \ No newline at end of file +} diff --git a/utils/CommonUtil.js b/utils/CommonUtil.js index 7a1020e..4b54ca0 100644 --- a/utils/CommonUtil.js +++ b/utils/CommonUtil.js @@ -967,47 +967,48 @@ const CommonUtil = { .sort((a, b) => (Number(a.sort) || 0) - (Number(b.sort) || 0)); if (!list.length) return; - const copyrightItem = list.find((item) => /©|版权|copyright/i.test(String(item.content || ''))) || null; - const descItem = - list.find((item) => /本站|历史数据|数据分析|投注建议|不涉及|仅供/i.test(String(item.content || ''))) || - list.find((item) => item !== copyrightItem && !/ICP备|工信部|公网安备|公安/.test(String(item.content || ''))) || - null; + $('.site-footer__brand').each((_, brand) => { + const $brand = $(brand); + let $list = $brand.find('.site-footer__copyright-list').first(); - if (copyrightItem?.content) $('#copyright-info').text(copyrightItem.content.trim()); - if (descItem?.content) $('#additional-info').text(descItem.content.trim()); + if (!$list.length) { + $list = $('
', { class: 'site-footer__copyright-list' }).appendTo($brand); + } - const $meta = $('.site-footer__legal, .site-footer__meta').first(); - if (!$meta.length) return; + $brand + .find('.site-footer__legal, .site-footer__meta, #copyright-info, #additional-info') + .remove(); + $list.empty(); - $meta.empty(); - list - .forEach((item) => { + list.forEach((item) => { const content = String(item.content || '').trim(); if (!content) return; + const isIcp = /ICP备|工信部/.test(content); const isPolice = /公网安备|公安/.test(content); + const isCopyright = /©|版权|copyright/i.test(content); + const isDescription = /本站|历史数据|数据分析|投注建议|不涉及|仅供/i.test(content); + const attributes = { + class: 'site-footer__copyright-row', + text: content, + }; + if (isIcp) { $('', { + ...attributes, id: 'beian', href: 'https://beian.miit.gov.cn/', target: '_blank', - class: 'index-style-02', - text: content, - }).appendTo($meta); - } else if (isPolice) { - $('', { - id: 'police-record', - text: content, - }).appendTo($meta); + class: 'site-footer__copyright-row index-style-02', + }).appendTo($list); + } else { + if (isPolice) attributes.id = 'police-record'; + else if (isCopyright) attributes.id = 'copyright-info'; + else if (isDescription) attributes.id = 'additional-info'; + $('

', attributes).appendTo($list); } }); - - if (!$meta.children().length && descItem?.content) { - $('', { - id: 'additional-info', - text: descItem.content.trim(), - }).appendTo($meta); - } + }); }, setMeta(name, content) {