修复首页加载速度

This commit is contained in:
zqlit committed 2026-05-25 13:06:26 +08:00
1 parent eaca6ec191
commit a93f46a2de
8 files changed
+106 -110

No files matched your search

+4 -4
View File
@@ -45,7 +45,7 @@
{{ range .Site.Params.reward.items }}
<div class="reward-qr-item">
<div class="reward-qr-img-wrapper">
<img src="{{ .image }}" alt="{{ .name }}打赏">
<img src="{{ .image }}" alt="{{ .name }}打赏" loading="lazy">
</div>
<span>{{ .name }}</span>
</div>
@@ -54,7 +54,7 @@
{{ with .Site.Params.reward.wechat }}
<div class="reward-qr-item">
<div class="reward-qr-img-wrapper">
<img src="{{ . }}" alt="微信打赏">
<img src="{{ . }}" alt="微信打赏" loading="lazy">
</div>
<span>微信</span>
</div>
@@ -62,7 +62,7 @@
{{ with .Site.Params.reward.alipay }}
<div class="reward-qr-item">
<div class="reward-qr-img-wrapper">
<img src="{{ . }}" alt="支付宝打赏">
<img src="{{ . }}" alt="支付宝打赏" loading="lazy">
</div>
<span>支付宝</span>
</div>
@@ -70,7 +70,7 @@
{{ with .Site.Params.reward.qq }}
<div class="reward-qr-item">
<div class="reward-qr-img-wrapper">
<img src="{{ . }}" alt="QQ打赏">
<img src="{{ . }}" alt="QQ打赏" loading="lazy">
</div>
<span>QQ</span>
</div>
+94
View File
@@ -65,6 +65,100 @@
[data-theme="dark"] .url-name:hover::before {
opacity: 0.35;
}
@media only screen and (max-width: 768px) {
.items {
grid-template-columns: repeat(1, 1fr) !important;
grid-gap: 10px;
}
.link-des,.link-name{
right: 13px;
}
}
.items {
width: 100%;
height: 100%;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 10px;
justify-content: space-between;
}
.item-box {
background-color: white;
border-radius: 5px;
padding: 8px;
height: 300px;
box-shadow: rgba(14, 63, 126, 0.04) 0px 0px 0px 1px, rgba(42, 51, 69, 0.04) 0px 1px 1px -0.5px, rgba(42, 51, 70, 0.04) 0px 3px 3px -1.5px, rgba(42, 51, 70, 0.04) 0px 6px 6px -3px, rgba(14, 63, 126, 0.04) 0px 12px 12px -6px, rgba(14, 63, 126, 0.04) 0px 24px 24px -12px;
}
.website-img {
margin: 0 auto;
width: 90%;
}
.website-img img {
width: 100%;
height: 150px;
object-fit: contain;
}
.website-go-button {
margin: 0 auto;
width: 95%;
border-radius: 5px;
font-size: 14px;
padding: 5px;
text-align: center;
background-color: black;
color: white;
}
.link-info {
padding: 8px;
width: 100%;
height: 90px;
display: flex;
justify-content: center;
align-items: center;
}
.link-avatar {
width: 40%;
display: flex;
align-items: center;
}
.link-avatar img {
position: relative;
left: 5px;
width: 50px;
height: 50px;
}
.link-text-main {
width: 55%;
display: flex;
flex-direction: column;
}
.link-name {
position: relative;
right: 10px;
bottom: 5px;
width: 100%;
height: 50%;
font-weight: 600;
}
.link-des {
position: relative;
right: 10px;
top: 1px;
width: 100%;
height: 50%;
}
</style>
<div class="post-content" itemprop="articleBody">
<div class="links">
+4 -104
View File
@@ -39,6 +39,10 @@
<link rel="alternate" type="application/rss+xml" title="{{ site.Title }}" href="/rss.xml">
<!-- Favicon -->
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<!-- Resource Hints -->
<link rel="preconnect" href="https://cravatar.cn">
<link rel="preconnect" href="https://api.usj.cc">
<link rel="dns-prefetch" href="https://bsz.dusays.com:9001">
<!-- Analytics -->
<script async src="https://019e3dec-3312-7873-862a-3f56ac99ea83.spst2.com/ustat.js"></script>
<script>
@@ -147,113 +151,9 @@
</style>
{{- end -}}
<style>
@media only screen and (max-width: 768px) {
.items {
grid-template-columns: repeat(1, 1fr) !important;
grid-gap: 10px;
}
.link-des,.link-name{
right: 13px;
}
}
/* 新版友链样式 */
.items {
/* padding: 10px; */
width: 100%;
height: 100%;
/* background-color: #f5f5f6; */
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-gap: 10px;
/* 网格之间的间距 */
justify-content: space-between;
}
.item-box {
background-color: white;
border-radius: 5px;
padding: 8px;
/* width: 47%; */
height: 300px;
/* border: 1px solid #333; */
box-shadow: rgba(14, 63, 126, 0.04) 0px 0px 0px 1px, rgba(42, 51, 69, 0.04) 0px 1px 1px -0.5px, rgba(42, 51, 70, 0.04) 0px 3px 3px -1.5px, rgba(42, 51, 70, 0.04) 0px 6px 6px -3px, rgba(14, 63, 126, 0.04) 0px 12px 12px -6px, rgba(14, 63, 126, 0.04) 0px 24px 24px -12px;
}
.website-img {
margin: 0 auto;
width: 90%;
}
.website-img img {
width: 100%;
height: 150px;
object-fit: contain;
}
.website-go-button {
margin: 0 auto;
width: 95%;
border-radius: 5px;
font-size: 14px;
padding: 5px;
text-align: center;
background-color: black;
color: white;
}
.link-info {
padding: 8px;
width: 100%;
height: 90px;
display: flex;
justify-content: center;
align-items: center;
}
.link-avatar {
width: 40%;
/* 设置弹性布局 */
display: flex;
/* justify-content: center; */
align-items: center;
}
.link-avatar img {
position: relative;
left: 5px;
width: 50px;
height: 50px;
}
.link-text-main {
width: 55%;
display: flex;
flex-direction: column;
}
.link-name {
position: relative;
right: 10px;
bottom: 5px;
width: 100%;
height: 50%;
font-weight: 600;
}
.link-des {
position: relative;
right: 10px;
top: 1px;
width: 100%;
height: 50%;
}
</style>
<!-- <script src="/js/jquery.min.js"></script> -->
<script src="/js/instantpage.min.js" type="module" defer></script>
<script>console.log("\n %c Amigo Theme %c https://usj.cc \n", "color: #fadfa3; background: #030307; padding:3px; font-size:12px;", "color: #ffffff;background: #16171a; padding: 3px; font-size: 12px;");</script>
<meta name="template" content="Amigo" />
</head>