返回列表 发布新帖
查看: 55|回复: 0

[代码技巧] 子比主题 – 文章封面缩略图悬停样式(四款)

[复制链接]
SunJu_FaceMall
社区贡献

315

主题

190

回帖

1万

积分

等级头衔
Icon组别 : 管理员
Icon等级 :

积分成就
   钻石 : 524 颗
   贡献 : 1779 点
   金币 : 12 枚
Icon在线时间 : 1295 小时
Icon注册时间 : 2024-11-22
Icon最后登录 : 2025-11-14

荣誉勋章

会员LV.1会员LV.2会员LV.3会员LV.4会员LV.5会员LV.6会员LV.7会员LV.8会员LV.9会员LV.10

风云·优秀版主

飞流名人堂成员

1

实名认证 手机认证 vip vip-year FLLTCN发表于 2025-10-9 00:34:01 | 查看全部 |阅读模式 浙江金华

资源无需等待,交易就趁现在,全面资源整合网络大咖云集,让你轻松玩转互联网!

您需要 登录 才可以下载或查看,没有账号?立即注册

×
给子比主题加点美化吧,本篇文章是子比主题文章封面缩略图悬停样式,我这边提供了四款,我觉得还是不错的四款悬停样式,喜欢哪个就部署哪个吧!

第一款


image.webp

第二款


image.webp

第三款


image.webp

第四款


image.webp

代码部署


根据上面的演示图喜欢哪个将下面的代码放到:子比主题–>>自定义CSS样式即可,别忘了换图标!
第一款CSS
  1. .item-thumbnail {
  2.   position: relative;
  3.   overflow: hidden;
  4.   transition: transform 0.4s ease;
  5. }

  6. .item-thumbnail:hover {
  7.   transform: translateY(-5px);
  8. }

  9. .item-thumbnail:before {
  10.   content: '';
  11.   position: absolute;
  12.   top: 0;
  13.   left: 0;
  14.   right: 0;
  15.   bottom: 0;
  16.   background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
  17.   transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  18.   border-radius: 8px;
  19.   z-index: 2;
  20.   max-width: 765px;
  21.   margin: 0 auto;
  22.   pointer-events: none;
  23.   padding-left: 10px;
  24.   box-shadow: 0 5px 15px rgba(0,0,0,0);
  25. }

  26. .item-thumbnail:after {
  27.   content: '';
  28.   position: absolute;
  29.   top: 50%;
  30.   left: 50%;
  31.   width: 50px;
  32.   height: 50px;
  33.   margin: -25px 0 0 -25px;
  34.   background: url(https://www.tfbkw.com/favicon.ico);
  35.   background-repeat: no-repeat;
  36.   background-size: 100% 100%;
  37.   z-index: 3;
  38.   transform: scale(0.8) rotate(-10deg);
  39.   transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  40.   opacity: 0;
  41.   pointer-events: none;
  42.   filter: drop-shadow(0 0 8px rgba(255,255,255,0.6));
  43. }

  44. .item-thumbnail:hover:before {
  45.   background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 100%);
  46.   box-shadow: 0 8px 25px rgba(0,0,0,0.3);
  47. }

  48. .item-thumbnail:hover:after {
  49.   transform: scale(1) rotate(0deg);
  50.   opacity: 1;
  51.   animation: pulse 1.5s infinite alternate ease-in-out;
  52. }

  53. @keyframes pulse {
  54.   0% {
  55.     filter: drop-shadow(0 0 5px rgba(255,255,255,0.6));
  56.   }
  57.   100% {
  58.     filter: drop-shadow(0 0 15px rgba(255,255,255,0.8));
  59.   }
  60. }
复制代码

第二款
  1. .item-thumbnail:before {
  2.   content: '';
  3.   position: absolute;
  4.   top: 0;
  5.   left: 0;
  6.   right: 0;
  7.   bottom: 0;
  8.   background: rgba(0,0,0,0);
  9.   transition: background .35s;
  10.   border-radius: 8px;
  11.   z-index: 2;
  12.   max-width: 765px;
  13.   margin: 0 auto;
  14.   pointer-events: none;
  15.   padding-left: 10px
  16. }

  17. .item-thumbnail:after {
  18.   content: '';
  19.   position: absolute;
  20.   top: 50%;
  21.   left: 50%;
  22.   width: 40px;
  23.   height: 40px;
  24.   margin: -20px 0 0 -20px;
  25.   background: url(https://www.tfbkw.com/favicon.ico);background-repeat: no-repeat;
  26.   background-size: 100% 100%;
  27.   z-index: 3;
  28.   -webkit-transform: scale(2);
  29.   transform: scale(2);
  30.   transition: opacity .35s,-webkit-transform .35s;
  31.   transition: transform .35s,opacity .35s;
  32.   transition: transform .35s,opacity .35s,-webkit-transform .35s;
  33.   opacity: 0;
  34.   pointer-events: none;
  35. }

  36. .item-thumbnail:hover:before {
  37.   background: rgba(0,0,0,.5)
  38. }

  39. .item-thumbnail:hover:after {
  40.   -webkit-transform: scale(1);
  41.   transform: scale(1);
  42.   opacity: 1
  43. }
复制代码

第三款
  1. .item-thumbnail {
  2.   position: relative;
  3.   overflow: hidden;
  4.   transform: translateZ(0);
  5. }
  6. .item-thumbnail:before {
  7.   content: '';
  8.   position: absolute;
  9.   top: 0;
  10.   left: 0;
  11.   right: 0;
  12.   bottom: 0;
  13.   background: rgba(0,0,0,0);
  14.   transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
  15.   border-radius: 12px;
  16.   z-index: 2;
  17.   max-width: 765px;
  18.   margin: 0 auto;
  19.   pointer-events: none;
  20.   box-shadow: 0 0 0 rgba(0,0,0,0);
  21. }
  22. .item-thumbnail:after {
  23.   content: '';
  24.   position: absolute;
  25.   top: 50%;
  26.   left: 50%;
  27.   width: 56px;
  28.   height: 56px;
  29.   margin: -28px 0 0 -28px;
  30.   background: url(https://www.tfbkw.com/favicon.ico) center/contain no-repeat;
  31.   z-index: 3;
  32.   transform: scale(1.8) rotate(15deg);
  33.   transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  34.   opacity: 0;
  35.   filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2));
  36. }
  37. .item-thumbnail:hover:before {
  38.   background: rgba(0,0,0,0.6);
  39.   box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  40.   border-radius: 16px;
  41. }
  42. .item-thumbnail:hover:after {
  43.   transform: scale(1) rotate(0deg);
  44.   opacity: 1;
  45.   filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
  46. }
复制代码

第四款
  1. .item-thumbnail {
  2.   position: relative;
  3.   overflow: hidden;
  4.   transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  5.   border-radius: 8px;
  6. }

  7. .item-thumbnail:hover {
  8.   transform: translateY(-8px) scale(1.02);
  9.   box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  10. }

  11. .item-thumbnail:before {
  12.   content: '';
  13.   position: absolute;
  14.   top: 0;
  15.   left: 0;
  16.   right: 0;
  17.   bottom: 0;
  18.   background: linear-gradient(45deg, rgba(66, 0, 255, 0.2) 0%, rgba(255, 0, 140, 0.2) 100%);
  19.   transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
  20.   border-radius: 8px;
  21.   z-index: 2;
  22.   max-width: 765px;
  23.   margin: 0 auto;
  24.   pointer-events: none;
  25.   padding-left: 10px;
  26.   backdrop-filter: blur(0px);
  27. }

  28. .item-thumbnail:after {
  29.   content: '';
  30.   position: absolute;
  31.   top: 50%;
  32.   left: 50%;
  33.   width: 60px;
  34.   height: 60px;
  35.   margin: -30px 0 0 -30px;
  36.   background: url(https://www.tfbkw.com/favicon.ico);
  37.   background-repeat: no-repeat;
  38.   background-size: 100% 100%;
  39.   z-index: 3;
  40.   transform: scale(0) translateY(20px);
  41.   transition: all 0.7s cubic-bezier(0.19, 1, 0.22, 1);
  42.   opacity: 0;
  43.   pointer-events: none;
  44.   filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
  45. }

  46. .item-thumbnail:hover:before {
  47.   background: linear-gradient(135deg, rgba(66, 0, 255, 0.6) 0%, rgba(255, 0, 140, 0.4) 100%);
  48.   backdrop-filter: blur(3px);
  49.   box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.2);
  50. }

  51. .item-thumbnail:hover:after {
  52.   transform: scale(1) translateY(0);
  53.   opacity: 1;
  54.   animation: float 3s infinite ease-in-out, glow 2s infinite alternate;
  55. }

  56. @keyframes float {
  57.   0% {
  58.     transform: translateY(0) rotate(0deg) scale(1);
  59.   }
  60.   50% {
  61.     transform: translateY(-10px) rotate(5deg) scale(1.05);
  62.   }
  63.   100% {
  64.     transform: translateY(0) rotate(0deg) scale(1);
  65.   }
  66. }

  67. @keyframes glow {
  68.   0% {
  69.     filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8));
  70.   }
  71.   100% {
  72.     filter: drop-shadow(0 0 20px rgba(255, 255, 255, 1)) drop-shadow(0 0 30px rgba(66, 0, 255, 0.6));
  73.   }
  74. }

  75. .item-thumbnail::before {
  76.   content: '';
  77.   position: absolute;
  78.   inset: -3px;
  79.   background: linear-gradient(45deg, #ff00cc, #3300ff, #00ccff, #ff00cc);
  80.   background-size: 400% 400%;
  81.   z-index: -1;
  82.   border-radius: 10px;
  83.   opacity: 0;
  84.   transition: opacity 0.5s ease;
  85.   animation: gradientBG 6s ease infinite;
  86. }

  87. .item-thumbnail:hover::before {
  88.   opacity: 1;
  89. }

  90. @keyframes gradientBG {
  91.   0% {
  92.     background-position: 0% 50%;
  93.   }
  94.   50% {
  95.     background-position: 100% 50%;
  96.   }
  97.   100% {
  98.     background-position: 0% 50%;
  99.   }
  100. }
复制代码

本帖被以下淘专辑推荐:

路虽远,行则将至;事虽难,做则必成。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

飞流广播+ 发布

系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
10-30 17:02
系统消息:柒沐已经连续答对10道难题,逆天学霸谁与争锋?!#每日答题#
10-09 09:07
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
09-24 09:00
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
09-11 11:40
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
09-02 09:17
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
08-27 08:56
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
08-20 15:12
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
08-03 10:22
系统消息:柒沐已经连续答对10道难题,逆天学霸谁与争锋?!#每日答题#
06-30 08:57
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
06-18 09:14
系统消息:清风网络已经连续答对10道难题,逆天学霸谁与争锋?!#每日答题#
04-11 09:40
系统消息:清风网络已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
04-10 09:31
系统消息:IXM77777已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
04-09 13:44
系统消息:清风网络已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
04-09 09:22
系统消息:柒沐已经连续答对10道难题,逆天学霸谁与争锋?!#每日答题#
04-09 08:52
系统消息:清风网络已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
04-08 09:24
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
04-07 09:02
系统消息:柒沐已经连续答对10道难题,逆天学霸谁与争锋?!#每日答题#
02-27 09:35
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
02-26 09:06
系统消息:柒沐已经连续答对3道难题,逆天学霸谁与争锋?!#每日答题#
02-25 08:49
站内通告

提供资源交易、信息共享、靓号交流、技术变现、学习问答、兴趣娱乐等全面服务。

1.丰富功能系统,扩展社区特色玩法,打造最好的互联网聚集圈子。

2.准确信息真实交易,安全快捷又方便,让虚拟交易面对面。

3. 天上不会掉馅饼,话术骗术迷人心,切勿脱离平台线下交易,被骗与平台无关!

4. 欺诈骗钱,违规违法将视情受到警告&禁言&封号甚至检举至👮🏻‍♀️处理!

官方Q群:123129钉推群:BAYR2383 站长QQ:3220000000

投诉/建议/商务合作联系

fl@fllt.cn

严禁私下交易,被骗与本站无关。
违反交易细则,取证立查严惩。
  • 钉钉新帖推送群
  • 官方交流QQ群
  • 站长唯一微信号

👮曝光Ta|🧿小黑屋|📴手机页|飞流网 ( 渝ICP备2025054677号-1|电信增值许可 渝B2-20250789 )|网站地图

GMT+8, 2025-11-16 13:21 , Processed in 0.088786 second(s), 61 queries, MemCached On , Gzip On.

Based on XJ-TX X3.5 Licensed

飞流论坛 HanAnalytics icp Astro vhAstro-Theme

关灯 在本版发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表