功能变化: 将网络字体改为本地字体

This commit is contained in:
猿小天
2023-12-26 11:33:37 +08:00
parent 217f3c8e14
commit 86e33e44e1
10 changed files with 2688 additions and 1 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -5,3 +5,4 @@
@import './media/media.scss'; @import './media/media.scss';
@import './waves.scss'; @import './waves.scss';
@import './dark.scss'; @import './dark.scss';
@import './fa/css/font-awesome.min.css';

View File

@@ -50,6 +50,17 @@ const getAwesomeIconfont = () => {
const styles: any = document.styleSheets; const styles: any = document.styleSheets;
let sheetsList = []; let sheetsList = [];
let sheetsIconList = []; let sheetsIconList = [];
// 判断fontFamily是否是本地加载
for (let i = 0; i < styles.length; i++) {
const rules = styles[i].cssRules || styles[i].rules;
if (rules) {
for (let j = 0; j < rules.length; j++) {
if (rules[j].style && rules[j].style.fontFamily === 'FontAwesome') {
sheetsList.push(styles[i])
}
}
}
}
for (let i = 0; i < styles.length; i++) { for (let i = 0; i < styles.length; i++) {
if (styles[i].href && styles[i].href.indexOf('netdna.bootstrapcdn.com') > -1) { if (styles[i].href && styles[i].href.indexOf('netdna.bootstrapcdn.com') > -1) {
sheetsList.push(styles[i]); sheetsList.push(styles[i]);

View File

@@ -2,7 +2,7 @@
const cssCdnUrlList: Array<string> = [ const cssCdnUrlList: Array<string> = [
'//at.alicdn.com/t/font_2298093_y6u00apwst.css', '//at.alicdn.com/t/font_2298093_y6u00apwst.css',
'//at.alicdn.com/t/c/font_3882322_9ah7y8m9175.css', //dvadmin3项目用icon '//at.alicdn.com/t/c/font_3882322_9ah7y8m9175.css', //dvadmin3项目用icon
'//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' //'//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'
]; ];
// 第三方 js url // 第三方 js url
const jsCdnUrlList: Array<string> = []; const jsCdnUrlList: Array<string> = [];