惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
P
Palo Alto Networks Blog
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
有赞技术团队
有赞技术团队
The GitHub Blog
The GitHub Blog
C
Cisco Blogs
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
Simon Willison's Weblog
Simon Willison's Weblog
T
Tenable Blog
Know Your Adversary
Know Your Adversary
Spread Privacy
Spread Privacy
WordPress大学
WordPress大学
月光博客
月光博客
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threat Research - Cisco Blogs
Cisco Talos Blog
Cisco Talos Blog
I
InfoQ
D
Darknet – Hacking Tools, Hacker News & Cyber Security
W
WeLiveSecurity
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
U
Unit 42
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
Google DeepMind News
Google DeepMind News
Apple Machine Learning Research
Apple Machine Learning Research
Attack and Defense Labs
Attack and Defense Labs
罗磊的独立博客
T
The Exploit Database - CXSecurity.com
I
Intezer
GbyAI
GbyAI
Jina AI
Jina AI
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Google Online Security Blog
Google Online Security Blog
Engineering at Meta
Engineering at Meta
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
小众软件
小众软件
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
Project Zero
Project Zero

Hyde Blog

Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog 关于我 关于我 Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog Hyde Blog
Hyde Blog
Hyde · 2025-10-05 · via Hyde Blog

首页卡片动画 原创

新建文件 ​

提示

--vp-c-brand-1 是变量来的,我在var.scss文件中定义的,没有的话自己改成颜色代码就行,例如:#5da8ff

  • docs\.vitepress\theme\style\文件夹中,新建text-card-hover.scss文件,并添加以下代码:

scss

/*文章标题动态小横线t*/
$underline-height: 2px; // 下划线高度
$transition-duration: 0.3s; // 下划线动画时长

a {
  position: relative; // 相对定位,以便于设置伪元素的位置
  display: inline-block; // 内联块元素,以便于设置宽度和高度

  &::after {
    content: " "; // 伪元素内容为空
    position: absolute; // 绝对定位,以便于设置位置
    left: 50%; // 水平居中
    bottom: -$underline-height; // 距离底部的距离
    width: 0; // 初始宽度为0
    height: $underline-height; // 高度为下划线高度
    background: var(--vp-c-brand-1); // 下划线颜色
    transform: translateX(-50%); // 水平居中
    transition: {
      property: width, left; // 过渡属性为宽度和left
      duration: $transition-duration; // 过渡时长
      timing-function: ease-out; // 过渡函数为ease-out
    }
  }

  &:hover {
    &::after {
      left: 50; // 线条从中间开始
      width: 100%; // 线条宽度为100%
      transition-timing-function: cubic-bezier(
        0.25,
        0.46,
        0.45,
        0.94
      ); // 过渡函数为cubic-bezier
    }
  }
}

// 文章列表卡片hover阴影圆角效果
.tk-post-item {
  transition: transform 0.3s ease, box-shadow 0.3s ease; // 过渡属性为transform和box-shadow

  &:hover {
    box-shadow: 0 10px 16px -4px var(--vp-c-brand-1); // 首页卡片阴影效果
    transform: translateY(-3px); // 首页卡片向上移动3px
    border-radius: 8px; // 首页卡片圆角效果
  }
}

引入样式 ​

  • docs\.vitepress\theme\style\index.scss文件中,引入text-card-hover.scss文件:

scss

@use "./text-card-hover.scss" as *; // 文字在悬停时会出现下划线动画
  • docs\.vitepress\theme\index.ts文件中,引入index.scss文件:

ts

import "./style/index.scss"; // 引入.vitepress\theme\style\index.scss全局样式