美化企业荣誉展示模块,优化少量证书的展示效果
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
HTML 改动: - 重新设计荣誉区域结构,独立成 honor-section - 添加标题"企业荣誉"和副标题"权威认证,值得信赖" - 使用 honor-list 容器承载荣誉卡片 CSS 改动: - 设计精致的卡片式布局,每个荣誉独立展示 - 280px 宽度卡片,适合 2-4 个证书的横向排列 - 添加圆形图标容器(120px),带渐变边框和发光效果 - 卡片悬停时:图标放大旋转、发光边框显现、光晕效果 - 响应式设计:平板、手机端自适应布局 - 保留旧样式作为兼容(.cert 设为 display: none) JavaScript 改动: - 更新 DOM 结构生成代码,使用新的 honor-item 样式 - 使用事件委托处理动态生成的卡片点击事件 - 点击卡片弹出 viewer 查看证书大图 视觉特点: - 深色科技风格,毛玻璃效果 - 渐变色装饰,光晕动效 - 适合少量(2-6个)证书的精致展示 - 居中对齐,突出重要性 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
16
js/index.js
16
js/index.js
@@ -88,10 +88,14 @@ $(function () {
|
||||
// 荣誉资质
|
||||
if (commentObj.honor && commentObj.honor.length > 0) {
|
||||
commentObj.honor.forEach((item) => {
|
||||
$("#certBox").append(`<div class="cert-item">
|
||||
<img src=${item.img} alt="">
|
||||
<p class="mt-20">${item.name}</p>
|
||||
</div>`);
|
||||
$("#certBox").append(`
|
||||
<div class="honor-item">
|
||||
<div class="honor-icon">
|
||||
<img src="${item.img}" alt="${item.name}">
|
||||
</div>
|
||||
<h4 class="honor-name">${item.name}</h4>
|
||||
</div>
|
||||
`);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -134,8 +138,8 @@ $(function () {
|
||||
loading: true,
|
||||
});
|
||||
|
||||
// 点击显示图片
|
||||
$(".cert-item,.practice-box,.brand-box").click(function () {
|
||||
// 点击显示图片(使用事件委托,因为元素是动态生成的)
|
||||
$(document).on("click", ".honor-item", function () {
|
||||
// 设置图片
|
||||
$("#viewer").attr("src", $(this).find("img").attr("src"));
|
||||
viewer.show();
|
||||
|
||||
Reference in New Issue
Block a user