更换 CDN

This commit is contained in:
底层用户 2022-06-21 15:30:02 +08:00
parent 9d7f369f61
commit 9805f64da6
2 changed files with 10 additions and 7 deletions

View File

@ -9,18 +9,21 @@ GitHubhttps://github.com/imsyy/home
@font-face {
font-family: "MiSans";
src: url('../font/MiSans-Regular.subset.woff2') format('woff2');
src: url('../font/MiSans-Regular.subset.ttf') format('truetype');
font-style: normal;
font-weight: 400;
font-display: swap;
src: url('https://s-bj-2127-file.oss.dogecdn.com/font/MiSans-Regular.subset.woff2') format('woff2');
/* src: url('https://s-bj-2127-file.oss.dogecdn.com/font/MiSans-Regular.subset.ttf') format('truetype'); */
}
@font-face {
font-family: "Pacifico-Regular";
src: url('../font/Pacifico-Regular.ttf') format('truetype');
src: url('https://s-bj-2127-file.oss.dogecdn.com/font/Pacifico-Regular.ttf') format('truetype');
}
@font-face {
font-family: "UnidreamLED";
src: url('../font/UnidreamLED.ttf') format('truetype');
src: url('https://s-bj-2127-file.oss.dogecdn.com/font/UnidreamLED.ttf') format('truetype');
}
/*全局样式*/

View File

@ -47,12 +47,12 @@ window.addEventListener('load', function () {
element.src = "./js/music.js";
document.body.appendChild(element);
//中文字体缓加载
//中文字体缓加载-此处写入字体源文件
//先行加载简体中文子集,后续补全字集
//由于压缩过后的中文字体仍旧过大,可转移至对象存或 CDN 加载
//由于压缩过后的中文字体仍旧过大,可转移至对象或 CDN 加载
const font = new FontFace(
"MiSans",
"url(" + "../font/MiSans-Regular.woff2" + ")"
"url(" + "./font/MiSans-Regular.woff2" + ")"
);
document.fonts.add(font);