优化加载速度 & 精简文件

This commit is contained in:
底层用户 2022-06-20 21:20:45 +08:00
parent ca1b3dc00b
commit 80a41ec182
10 changed files with 56 additions and 200 deletions

View File

@ -1,178 +0,0 @@
@font-face {
font-family: "Pacifico-Regular";
src: url('../font/Pacifico-Regular.ttf') format('truetype');
}
@font-face {
font-family: "UnidreamLED";
src: url('../font/UnidreamLED.ttf') format('truetype');
}
@font-face {
font-family: "MiSans";
src: url('https://file.imsyy.top/font/MiSans-Regular.woff') format('woff');
font-display: sans-serif;
}
/*
@font-face {
font-family: "iconfont";
src: url('../font/iconfont.woff2') format('woff2'),
url('../font/iconfont.woff') format('woff'),
url('../font/iconfont.ttf') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-z_shangpinheji:before {
content: "\e683";
}
.icon-a-daohangzhiyindingwei-05:before {
content: "\e970";
}
.icon-volume-x:before {
content: "\e67a";
}
.icon-volume-1:before {
content: "\e67b";
}
.icon-volume:before {
content: "\e67c";
}
.icon-volume-2:before {
content: "\e67d";
}
.icon-music:before {
content: "\e986";
}
.icon-next-one:before {
content: "\e609";
}
.icon-next-one-copy:before {
content: "\ebd5";
}
.icon-pause:before {
content: "\e733";
}
.icon-play:before {
content: "\e65c";
}
.icon-undo:before {
content: "\e875";
}
.icon-wrench-fill:before {
content: "\e86e";
}
.icon-plus:before {
content: "\e653";
}
.icon-right:before {
content: "\e613";
}
.icon-right-copy:before {
content: "\ebd4";
}
.icon-times:before {
content: "\e857";
}
.icon-bars:before {
content: "\e61f";
}
.icon-link:before {
content: "\e603";
}
.icon-close:before {
content: "\e656";
}
.icon-photo:before {
content: "\ebd3";
}
.icon-navigation1:before {
content: "\e637";
}
.icon-cloud:before {
content: "\e624";
}
.icon-lab:before {
content: "\e88d";
}
.icon-blog-solid:before {
content: "\e631";
}
.icon-comment-alt-lines:before {
content: "\e679";
}
.icon-music-list:before {
content: "\e699";
}
.icon-youxiang:before {
content: "\e605";
}
.icon-github:before {
content: "\e691";
}
.icon-telegram1:before {
content: "\e731";
}
.icon-QQ:before {
content: "\e882";
}
.icon-twitter:before {
content: "\e883";
}
.icon-github1:before {
content: "\e799";
}
.icon-weixin:before {
content: "\e600";
}
.icon-telegram:before {
content: "\e8db";
}
.icon-yinhao-copy:before {
content: "\e608";
}
.icon-yinhao-copy-copy:before {
content: "\e62e";
} */

View File

@ -1,5 +1,22 @@
/*
作者: imsyy
主页https://www.imsyy.top/
GitHubhttps://github.com/imsyy/home
版权所有请勿删除
*/
@charset "utf-8";
@font-face {
font-family: "Pacifico-Regular";
src: url('../font/Pacifico-Regular.ttf') format('truetype');
}
@font-face {
font-family: "UnidreamLED";
src: url('../font/UnidreamLED.ttf') format('truetype');
}
/*全局样式*/
html,
body {

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -25,7 +25,6 @@
href="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-y/bootstrap/5.1.0/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="./css/style.css">
<link rel="stylesheet" type="text/css" href="./css/mobile.css">
<link rel="stylesheet" type="text/css" href="./css/font.css">
<link rel="stylesheet" type="text/css" href="./css/loading.css">
<link rel="stylesheet" type="text/css" href="./css/animation.css">
<link rel="stylesheet" type="text/css" href="./css/cursor.css">
@ -37,7 +36,7 @@
src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-y/izitoast/1.4.0/js/iziToast.min.js">
</script>
<!-- FontAwesome -->
<link rel="stylesheet" href="https://file.imsyy.top/font/fontawesome/css/pro.min.css">
<link rel="stylesheet" href="https://lib.baomitu.com/font-awesome/6.1.1/css/all.min.css">
<!-- Aplayer -->
<link rel="stylesheet" href="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-y/aplayer/1.10.1/APlayer.min.css"
crossorigin="anonymous" referrerpolicy="no-referrer" />
@ -50,7 +49,7 @@
"/upgrade-your-browser/index.html?referrer=" + encodeURIComponent(window.location.href);
</script>
<!-- 51.LA 统计 -->
<script src="https://file.imsyy.top/js/51LA/51LA.js"></script>
<script src="./js/51LA.js"></script>
</head>
<body>
@ -136,7 +135,7 @@
<div class="hitokoto cards" id="hitokoto">
<!--切换音乐-->
<div class="open-music fixed-top" id="open-music">
<i class="fa-solid fa-music-note"></i>
<i class="fa-solid fa-compact-disc"></i>
<span>&nbsp;打开音乐播放器</span>
</div>
<!--切换音乐结束-->
@ -167,7 +166,7 @@
</div>
<div class="music-volume" style="display: none;">
<div id="volume-ico">
<i class="fa-solid fa-volume"></i>
<i class="fa-solid fa-volume-low"></i>
</div>
<input type="range" min="0" max="1" step="0.01" id="volume">
</div>
@ -221,7 +220,7 @@
<div class="col">
<a href="https://music.imsyy.top/" target="_blank">
<div class="link-card cards">
<i class="fa-solid fa-list-music"></i>
<i class="fa-solid fa-music"></i>
<span class="link-name">音乐</span>
</div>
</a>

1
js/51LA.js Normal file
View File

@ -0,0 +1 @@
document.write("<script>!function(p){\"use strict\";!function(t){var s=window,e=document,i=p,c=\"\".concat(\"https:\"===e.location.protocol?\"https://\":\"http://\",\"sdk.51.la/js-sdk-pro.min.js\"),n=e.createElement(\"script\"),r=e.getElementsByTagName(\"script\")[0];n.type=\"text/javascript\",n.setAttribute(\"charset\",\"UTF-8\"),n.async=!0,n.src=c,n.id=\"LA_COLLECT\",i.d=n;var o=function(){s.LA.ids.push(i)};s.LA?s.LA.ids&&o():(s.LA=p,s.LA.ids=[],o()),r.parentNode.insertBefore(n,r)}()}({id:\"JfXLqaE7jjMvnMIm\",ck:\"JfXLqaE7jjMvnMIm\"});</script>")

View File

@ -1,3 +1,10 @@
/*
作者: imsyy
主页https://www.imsyy.top/
GitHubhttps://github.com/imsyy/home
版权所有请勿删除
*/
//弹窗样式
iziToast.settings({
timeout: 10000,
@ -34,24 +41,26 @@ window.addEventListener('load', function () {
message: '欢迎来到我的主页'
});
}, 800);
//延迟加载音乐播放器
var element = document.createElement("script");
element.src = "./js/music.js";
document.body.appendChild(element);
//中文字体缓加载
//由于中文字体过大,可转移至对象储存或 CDN 加载
const font = new FontFace(
"MiSans",
"url(" + "https://fastly.jsdelivr.net/gh/imsyy/file@1.0/font/MiSans-Regular.woff" + ")"
);
document.fonts.add(font);
}, false)
setTimeout(function () {
$('#loading-text').html("字体及文件加载可能需要一定时间")
}, 3000);
//延迟加载音乐播放器
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "./js/music.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
//新春灯笼 需要时取消注释
/*
new_element=document.createElement("link");
@ -333,6 +342,7 @@ for (var day of days) {
}
//控制台输出
console.clear();
var styleTitle1 = `
font-size: 20px;
font-weight: 600;

View File

@ -31,7 +31,7 @@ $.ajax({
/* 底栏歌词 */
setInterval(function () {
$("#lrc").html("<span class='lrc-show'><i class='fa-solid fa-music-note'></i> " + $(".aplayer-lrc-current").text() + " <i class='fa-solid fa-music-note'></i></span>");
$("#lrc").html("<span class='lrc-show'>" + $(".aplayer-lrc-current").text() + "</span>");
}, 500);
/* 音乐通知及控制 */
@ -39,7 +39,7 @@ $.ajax({
music = $(".aplayer-title").text() + $(".aplayer-author").text();
iziToast.info({
timeout: 4000,
icon: "fa-solid fa-music-note",
icon: "fa-solid fa-circle-play",
displayMode: 'replace',
message: music
});
@ -123,9 +123,9 @@ $.ajax({
if (x == 0) {
$("#volume-ico").html("<i class='fa-solid fa-volume-xmark'></i>");
} else if (x > 0 && x <= 0.3) {
$("#volume-ico").html("<i class='fa-solid fa-volume-low'></i>");
$("#volume-ico").html("<i class='fa-solid fa-volume-off'></i>");
} else if (x > 0.3 && x <= 0.6) {
$("#volume-ico").html("<i class='fa-solid fa-volume'></i>");
$("#volume-ico").html("<i class='fa-solid fa-volume-low'></i>");
} else {
$("#volume-ico").html("<i class='fa-solid fa-volume-high'></i>");
}

View File

@ -1,3 +1,10 @@
/*
作者: imsyy
主页https://www.imsyy.top/
GitHubhttps://github.com/imsyy/home
版权所有请勿删除
*/
// 背景图片 Cookies
function setBgImg(bg_img) {
if (bg_img) {