[scode type=”blue”]
前言:
只是做个笔记,不能保证符合所有人审美(效果如本站),有需要的往下看:
因改的太多使用作者原本的类直接到后台自定义CSS中修改达不到预期效果,会使其它部分使用相同类的布局错乱,所以需要修改少部分代码实现。[/scode]
以下代码插入后台自定义CSS中
/*全局字体*/
@font-face{font-family:HarmonyOS_Sans_SC_Medium;font-style:normal;font-display:swap; src:url(/usr/themes/handsome/assets/fonts/HarmonyOS/HarmonyOS-Sans.woff2) format('woff2')} *{font-family:HarmonyOS_Sans_SC_Medium} body {font- family: HarmonyOS!important;}
/*盒子布局*/
@media (min-width: 1200px) {
.app.container{
width:1100px
}
}
/* 网站背景添加模糊 */
#body {
margin: 0;
min-height: 100vh;
position: relative; /* 关键:为伪元素定位提供基准 */
}
/* 毛玻璃遮罩层 */
#body::before {
content: "";
position: fixed; /* 覆盖整个视口 */
top: 0;
left: 0;
width: 100%;
height: 100%;
/* 毛玻璃核心样式 */
backdrop-filter: blur(15px) saturate(180%);
-webkit-backdrop-filter: blur(15px) saturate(180%); /* Safari 兼容 */
/* 半透明基底+玻璃质感 */
background: rgba(255, 255, 255, 0.15);
box-shadow: inset 0 0 200px rgb(0 0 0 / 52%);
/* 玻璃纹理 (可选) */
background-image:
linear-gradient(
45deg,
rgba(255, 255, 255, 0.02) 25%,
transparent 25%,
transparent 75%,
rgba(255, 255, 255, 0.02) 75%
),
linear-gradient(
-45deg,
rgba(255, 255, 255, 0.02) 25%,
transparent 25%,
transparent 75%,
rgba(255, 255, 255, 0.02) 75%
);
background-size: 6px 6px;
z-index: -1; /* 确保遮罩在内容下方 */
}
/*播放器ui*/
#handsome_global_player .aplayer-pic{
border-radius:10px;
margin-top:8px;
}
/*修改后导航栏错位修复*/
.app-header .navbar-header{height:51px;}
.navbar-collapse.collapse{height:51px !important;}
以下友链美化均基于插件ErcerLink
下载链接:[button color=”success” icon=”” url=”https://github.com/OuOumm/ErcerLink” type=””]GitHub[/button]
[scode type=”red” size=””]这里注意插入三个类,前两个分别在插件js文件中,p1在44行i-checks后加入;
p2在46行btn后面加入。
p3在主题文件links.php中第四十五行ng-binding后加入。
注意:插件需要插入代码,具体看插件文档!!!
[/scode]
这里需要先到主题文件headnav.php插入以下内容:
<ul class="nav navbar-nav hidden-sm">
<li class="dropdown pos-stc friendlink-item">
<a id="friendLinkTrigger" data-status="false" href="#"
class="dropdown-toggle feathericons dropdown-toggle"
aria-expanded="false">
<i data-feather="link"></i>
<span class="caret"></span>
</a>
<div class="bg dropdown-menu wrapper w-full bg-white friendlink-menu" style="min-width: 400px">
<div class="row">
<div class="col-sm-12">
<!-- 申请表单 -->
<form class="form-horizontal panel-body friend-form-v2" role="form" id="F-link">
<!-- 标题部分 -->
<div class="form-title">
<span class="title-icon">👋</span>
<h3>申请友链</h3>
<div class="title-divider"></div>
</div>
<!-- 输入框组 -->
<div class="input-group compact">
<input type="text" name="host_name" placeholder="<?php _me('站点名称') ?>" required>
<input type="url" name="host_url" placeholder="<?php _me('站点链接') ?>" required>
</div>
<div class="input-group compact">
<input type="url" name="host_png" placeholder="<?php _me('站点图标') ?>" required>
<input type="text" name="host_msg" placeholder="<?php _me('站点描述(简洁有力)') ?>" required>
</div>
<!-- 修复后的复选框 -->
<div class="checkbox-notice">
<label class="custom-check">
<input type="checkbox" name="host_yes" required class="hidden-check">
<span class="checkmark"></span>
<span class="notice-text"><?php _me("已添加本站友链") ?></span>
</label>
<div class="notice-tip">(请先添加本站链接至贵站)</div>
<!-- 添加专用错误提示容器 -->
</div>
<button type="submit">提交申请</button>
</form>
</div>
</div>
</div>
</li>
</ul>
随后到后台自定义css中插入以下代码:
/*友链插件优化*/
.p1{margin-top:15px;padding-left:32px}/*插件44行i-checks后加入*/
/*插件js文件46行btn后面加入*/.p2 {
color: #000; /* 默认黑色文字 */
background-color:#dddddd;
width:150px;
font-family: 'Helvetica', sans-serif;
font-size: 16px;
font-weight: 500;
padding: 8px 0; /* 上下留空 */
display: inline-block;
position: relative;
cursor: pointer;
transition: color 0.3s;
}
/* 红色下划线(默认隐藏) */
.p2::after {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 0; /* 初始宽度为0 */
height: 2px;
background: #FF6F61;
transition: width 0.3s, opacity 0.3s;
}
/* 悬停时:红字 + 下划线展开 */
.p2:hover {
color: #FF6F61;
}
.p2:hover::after {
width: 100%; /* 下划线完全展开 */
}
/* 点击时:模拟按压效果 */
.p2:active {
transform: scale(0.95); /* 轻微缩小 */
transition: transform 0.1s; /* 快速响应 */
}
.p2:active::after {
background: #000; /* 点击时下划线变黑 */
}
.p3{padding:15px 15px 0px 15px !important}
.btn{border-radius:8px}
.stylish-text {
/* 默认状态:立体红黑设计 */
margin-bottom:20px;
border-radius:10px;
color: #FF6F61;
font-family: 'Arial Black', sans-serif;
font-size: 16px;
padding: 12px 60px;
display: inline-block;
position: relative;
background: #fff; /* 白色背景 */
border: 3px solid #000; /* 黑色边框 */
box-shadow: 8px 8px 0 #FF6F61; /* 红色投影模拟立体 */
transition: all 0.3s ease; /* 控制所有属性的过渡 */
cursor: pointer;
}
/* 悬停时:立体感加强 + 色彩反转 */
.stylish-text:hover {
color: #fff; /* 文字变白 */
background: #FF6F61; /* 背景变红色 */
box-shadow: 12px 12px 0 #000; /* 投影变黑色且更大 */
transform: translate(-4px, -4px); /* 向左上位移 */
}
/* 鼠标点击时的按压效果 */
.stylish-text:active {
box-shadow: 4px 4px 0 #000;
transform: translate(0, 0);
}
/* 友链复选框容器 */
.i-checks>i {
position: relative;
display: inline-block;
width: 20px; /* 稍增大尺寸 */
height: 20px;
margin: -2px 8px 0 -24px; /* 调整边距对齐 */
vertical-align: middle;
background-color: #fff;
border: 2px solid #2c3e50; /* 深色边框替代原灰色 */
border-radius: 4px; /* 添加圆角 */
cursor: pointer;
transition:
border-color 0.3s,
background-color 0.3s;
}
/* 悬停效果 */
.i-checks>i:hover {
border-color: #FF6F61; /* 主色调红边框 */
}
/* 选中状态标记 */
.i-checks>i:before {
position: absolute;
top: 50%;
left: 50%;
width: 12px; /* 调整为对勾形状 */
height: 6px;
border: 2px solid #FF6F61; /* 主色调红 */
border-top: none;
border-right: none;
transform: translate(-50%, -60%) rotate(-45deg) scale(0); /* 初始隐藏 */
opacity: 0;
transition:
transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55),
opacity 0.2s;
}
/* 选中时的动画 */
.i-checks input:checked + i:before {
transform: translate(-50%, -60%) rotate(-45deg) scale(1); /* 对勾展开 */
opacity: 1;
}
/* 选中时容器样式 */
.i-checks input:checked + i {
background-color: rgba(255, 111, 97, 0.1); /* 浅红色背景 */
border-color: #FF6F61;
}
/* 聚焦状态 */
.i-checks input:focus + i {
box-shadow: 0 0 0 3px rgba(255, 111, 97, 0.2); /* 聚焦光环效果 */
}
/*首页加入友链按钮*/
.bg.dropdown-menu.wrapper.w-full.bg-white.friendlink-menu.show{
box-shadow:none;
background-color:#ffffff00;
width:50%;
}
/* ===== 表单容器 ===== */
.friend-form-v2 {
max-width: 580px;
margin: 0 auto;
padding: 30px;
background: rgba(255,255,255,0.96);
border-radius: 16px;
box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
html.theme-dark .friend-form-v2 {
max-width: 580px;
margin: 0 auto;
padding: 30px;
background: rgb(97 97 97);
border-radius: 16px;
box-shadow: 0 8px 32px rgba(0,0,0,0.08);
}
/* ===== 标题美化 ===== */
.friend-form-v2 .form-title {
text-align: center;
margin-bottom: 30px;
position: relative;
}
.friend-form-v2 .form-title h3 {
font-size: 24px;
color: #2c3e50;
margin: 10px 0;
background: linear-gradient(135deg, #FF6F61, #FF8C7F);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.friend-form-v2 .title-icon {
font-size: 36px;
display: block;
}
.friend-form-v2 .title-divider {
width: 60px;
height: 3px;
background: #FF6F61;
margin: 15px auto;
border-radius: 2px;
}
/* ===== 输入框组 ===== */
.friend-form-v2 .input-group.compact {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
margin-bottom: 15px;
}
.friend-form-v2 input {
width: 100%;
padding: 12px 16px;
border: 2px solid #ecedef;
border-radius: 8px;
transition: all 0.3s;
background: rgba(255,255,255,0.9);
}
html.theme-dark .friend-form-v2 input {
width: 100%;
padding: 12px 16px;
border: 2px solid #000000;
border-radius: 8px;
transition: all 0.3s;
background: rgb(255 255 255 / 90%);
}
.friend-form-v2 input:focus {
border-color: #FF6F61;
box-shadow: 0 0 0 3px rgba(255,111,97,0.15);
transform: scale(1.02);
}
/* ===== 修复后的复选框 ===== */
.friend-form-v2 .checkbox-notice {
margin: 25px 0;
text-align: center;
}
.friend-form-v2 .custom-check {
display: inline-flex;
align-items: center;
cursor: pointer;
position: relative;
}
.friend-form-v2 .hidden-check {
opacity: 0;
position: absolute;
}
.friend-form-v2 .checkmark {
width: 18px;
height: 18px;
border: 2px solid #FF6F61;
border-radius: 4px;
margin-right: 8px;
position: relative;
transition: all 0.3s;
}
.friend-form-v2 .hidden-check:checked + .checkmark {
background: #FF6F61;
border-color: #FF6F61;
}
.friend-form-v2 .checkmark::after {
content: "";
position: absolute;
left: 4px;
top: 1px;
width: 5px;
height: 10px;
border: solid white;
border-width: 0 2px 2px 0;
transform: rotate(45deg);
opacity: 0;
}
.friend-form-v2 .hidden-check:checked + .checkmark::after {
opacity: 1;
}
.friend-form-v2 .notice-text {
color: #2c3e50;
font-weight: 500;
}
.friend-form-v2 .notice-tip {
color: #95a5a6;
font-size: 12px;
margin-top: 8px;
}
/* ===== 按钮样式 ===== */
.friend-form-v2 button {
width: 100%;
padding: 14px;
background: linear-gradient(135deg, #FF6F61, #FF8C7F);
border: none;
border-radius: 8px;
color: white;
font-weight: 600;
letter-spacing: 1px;
cursor: pointer;
transition: transform 0.2s;
}
.friend-form-v2 button:hover {
transform: translateY(-2px);
box-shadow: 0 4px 15px rgba(255,111,97,0.3);
}
/* ========== 动画核心样式 ========== */
.statistic-menu,
.friendlink-menu {
/* 初始状态 */
opacity: 0;
transform: translateY(-20px) scale(0.95);
transform-origin: top center;
pointer-events: none;
display: block !important; /* 保持渲染 */
visibility: hidden;
}
/* 显示状态 */
.statistic-menu.show,
.friendlink-menu.show {
opacity: 1;
transform: translateY(0) scale(1);
visibility: visible;
pointer-events: auto;
transition-delay: 0.1s;
}
/* 入场动画增强 */
@keyframes menuEntrance {
0% {
opacity: 0;
transform: translateY(-20px) scale(0.95);
}
50% {
transform: translateY(5px) scale(1.02);
}
100% {
opacity: 1;
transform: translateY(0) scale(1);
}
}
.statistic-menu.show,
.friendlink-menu.show {
animation: menuEntrance 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* 移动端适配优化 */
@media (max-width: 768px) {
.friendlink-menu {
left: 50% !important;
transform: translateX(-50%) translateY(-12px) !important;
}
.friendlink-menu.show {
transform: translateX(-50%) translateY(0) !important;
}
}
[font color=”#FF7F50″]友链需要后台自定义JS[/font]
/*加入js*/
// 首页导航友链和详情图标优化
document.addEventListener('click', function(e) {
// 检测点击目标
const isStatisticTrigger = e.target.closest('#statistic_pane');
const isFriendTrigger = e.target.closest('#friendLinkTrigger');
const isInsideMenu = e.target.closest('.statistic-menu, .friendlink-menu');
// 获取菜单元素
const statMenu = document.querySelector('.statistic-menu');
const friendMenu = document.querySelector('.friendlink-menu');
// 点击统计触发器
if (isStatisticTrigger) {
e.preventDefault();
const shouldShow = !statMenu.classList.contains('show');
statMenu.classList.toggle('show', shouldShow);
friendMenu.classList.remove('show');
return;
}
// 点击友链触发器
if (isFriendTrigger) {
e.preventDefault();
const shouldShow = !friendMenu.classList.contains('show');
friendMenu.classList.toggle('show', shouldShow);
statMenu.classList.remove('show');
return;
}
// 点击菜单外部区域
if (!isInsideMenu) {
statMenu.classList.remove('show');
friendMenu.classList.remove('show');
}
});
// 阻止菜单内容点击冒泡(关键修复)
document.querySelectorAll('.statistic-menu, .friendlink-menu').forEach(menu => {
menu.addEventListener('click', function(e) {
e.stopPropagation(); // 阻止所有菜单内部点击事件冒泡
// 特别处理表单元素的冒泡
if (e.target.closest('form')) {
e.stopImmediatePropagation();
}
});
});
// 保留原有表单验证逻辑
document.getElementById('F-link').addEventListener('submit', function(e) {
// 原有验证代码...
});
以下都是插入到后台自定义css中,别插入到js里面了
/*首页图片logo扫光*/
/*logo*/
/* 关键修复方案 */
/* 容器样式 */
#navbar-brand-day,
#navbar-brand-dark {
display: inline-block; /* 保持行内布局 */
position: relative; /* 闪光定位基准 */
overflow: hidden; /* 必须隐藏溢出 */
vertical-align: middle; /* 对齐修复 */
}
/* 图片基础样式 */
#navbar-brand-day img,
#navbar-brand-dark img {
display: block; /* 消除行内间隙 */
position: relative; /* 层级基准 */
z-index: 1; /* 确保图片在闪光层下方 */
}
/* 闪光效果 - 作用在容器上 */
#navbar-brand-day::after,
#navbar-brand-dark::after {
content: "";
position: absolute;
top: 0;
left: -100%;
width: 50%;
height: 100%;
background: linear-gradient(
to right,
transparent 0%,
rgba(255, 255, 255, 0.8) 50%,
transparent 100%
);
transform: skew(-20deg);
animation: shine 2s infinite;
z-index: 2; /* 确保闪光覆盖图片 */
}
/* 夜间模式闪光颜色调整 */
#navbar-brand-dark::after {
background: linear-gradient(
to right,
transparent 0%,
rgba(23, 23, 24, 0.3) 50%, /* 降低亮度 */
transparent 100%
);
}
@keyframes shine {
0% { left: -100%; }
100% { left: 200%; }
}
/* 布局保护 */
#navbar-brand-day,
#navbar-brand-dark {
line-height: 0; /* 消除行高影响 */
}
#navbar-brand-day img,
#navbar-brand-dark img {
width: auto !important; /* 防止尺寸被压缩 */
height: auto !important;
}
/*背景字体颜色*/
.bg-white{
color:#000000;
}
html.theme-dark .social_icon .btn-icon.btn-sm svg{
color:#fff
}
body, html{
color:#000000
}
html.theme-dark .bg-white{color:#aaa}
#post-panel{background:#f9f9f9}
.badge {
background-color: #000;
color: #fff;
padding: 4px 8px;
font-size: 0.8em;
display: inline-block;
transition: background-color 0.3s ease; /* 添加过渡效果 */
}
/* 悬停效果 */
.badge:hover {
background-color: rgb(255, 87, 51); /* 悬停颜色 */
cursor: pointer;
}
/* 左下方导航优化*/
div#left_footer{
background-color:#dddddd;
border-radius:10px !important
}
.b-normal{
border:1px solid #ffffff00
}
.left-bottom-icons svg{
height:16px;
width:16px
}
.social_icon .btn-icon.btn-sm svg{
vertical-align:-9px
}
a.aside-item.btn.btn-sm.btn-icon{margin-right:0}
/*鼠标悬停动画*/
.aside-item {
position: relative;
display: block;
margin: 6px 0;
border-radius: 4px;
overflow: hidden; /* 隐藏伪元素溢出 */
transition: color 0.5s ease;
}
/* 可选:添加扩散动画 */
.aside-item::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
background: rgba(255, 87, 51);
border-radius: 50%;
transform: translate(-50%, -50%);
transition: width 0.3s ease, height 0.3s ease;
z-index: -1;
}
.aside-item:hover::after {
width: 200%;
height: 200%;
}
/*夜间模式适配*/
html.theme-dark .aside-item {
position: relative;
display: block;
margin: 6px 0;
border-radius: 4px;
overflow: hidden; /* 隐藏伪元素溢出 */
transition: color 0.3s ease;
}
/* 可选:添加扩散动画 */
html.theme-dark .aside-item::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
color:#fff;
background: rgba(129,216,207);
border-radius: 50%;
transform: translate(-50%, -50%);
transition: width 0.3s ease, height 0.3s ease;
z-index: -1;
}
html.theme-dark .aside-item:hover::after {
width: 300%;
height: 300%;
}
/*搜索栏优化*/
.box-shadow-wrap-normal{
box-shadow:0 1px 3px rgb(87 86 86 / 53%)
}
.rounded{
border-radius:8px
}
.btn-sm{
padding:5px 10px 7px 10px
}
这里要改代码,需到主题文件aside.php第60行clear后面加入类name
/*左侧菜单*/
.wrapper{
padding:15px 15px 60px 15px
}
/*修改上面左侧菜单到头像的距离导致时光机错位修复*/
.wrapper.bg-white.time_tab_list{
padding:15px
}
/*时光机编辑栏加阴影*/
#comment{box-shadow:0 1px 3px rgb(129 129 129)}
/*左侧名称,需到主题文件aside.php第60行clear后面类name*/
span.clear.name{
padding-top:20px
}
/*头像圆角*/
.img-circle{
border-radius:15%
}
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容