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

[代码技巧] 子比主题 – 侧边百度一下卡片样式

[复制链接]
SunJu_FaceMall
社区贡献

314

主题

186

回帖

1万

积分

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

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

荣誉勋章

连签LV.1会员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发表于 昨天 15:41 | 查看全部 |阅读模式 浙江金华

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

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

×
一款子比主题侧边协助SEO优化的小工具,但UI设计实在太过陈旧,视觉体验不够出色。今天给大家带来一款全新设计的小卡片,清新美观,这一个小工具没打算写小工具,因为功能太少,直接用代码实现即可!来源:星雨博客

image.webp

代码部署


将下面的代码放到:WP后台–>>外观–>>小工具–>>自定义HTML即可!
  1. <style>
  2.     .input__container {
  3.         position: relative;
  4.         padding: 10px 15px;
  5.         display: flex;
  6.         justify-content: center;
  7.         align-items: center;
  8.         gap: 5px;
  9.         border-radius: 22px;
  10.         max-width: 300px;
  11.         transition: transform 400ms;
  12.         transform-style: preserve-3d;
  13.         perspective: 500px;
  14.     }

  15.     .shadow__input {
  16.         content: "";
  17.         position: absolute;
  18.         width: 100%;
  19.         height: 100%;
  20.         left: 0;
  21.         bottom: 0;
  22.         z-index: -1;
  23.         filter: blur(40px);
  24.         border-radius: 20px;
  25.         background: radial-gradient(circle at 25% 25%, #ff8fa0, transparent 40%),
  26.             radial-gradient(circle at 75% 25%, #8ed6ff, transparent 40%),
  27.             radial-gradient(circle at 25% 75%, #d08cff, transparent 40%),
  28.             radial-gradient(circle at 75% 75%, #93ffcf, transparent 40%);
  29.         background-size: 300% 300%;
  30.         animation: gradientMove 8s infinite ease-in-out;
  31.     }

  32.     @keyframes gradientMove {
  33.         0% {
  34.             background-position: 0% 0%;
  35.         }

  36.         25% {
  37.             background-position: 50% 25%;
  38.         }

  39.         50% {
  40.             background-position: 100% 50%;
  41.         }

  42.         75% {
  43.             background-position: 25% 75%;
  44.         }

  45.         100% {
  46.             background-position: 0% 100%;
  47.         }
  48.     }

  49.     .input__search {
  50.         flex-grow: 1;
  51.         border-radius: 20px;
  52.         outline: none;
  53.         border: none;
  54.         padding: 8px;
  55.         padding-left: 20px;
  56.         position: relative;
  57.     }

  58.     .input__button__shadow {
  59.         cursor: pointer;
  60.         border: none;
  61.         background: none;
  62.         transition: transform 400ms, background 400ms;
  63.         display: flex;
  64.         justify-content: center;
  65.         align-items: center;
  66.         border-radius: 12px;
  67.         padding: 5px;
  68.     }

  69.     .input__button__shadow:hover {
  70.         background: rgba(255, 255, 255, 0.2);
  71.     }

  72.     .wniui-seach {
  73.         position: relative;
  74.         display: flex;
  75.         justify-content: center;
  76.         align-items: center;
  77.         width: 100%;
  78.         height: 100px;
  79.         background-color: var(--main-bg-color);
  80.         border-radius: 10px;
  81.     }

  82.     .wniui-baidu {
  83.         position: absolute;
  84.         top: 0;
  85.         left: 0;
  86.     }

  87.     .wniui_prefix {
  88.         overflow: hidden;
  89.         display: inline-flex;
  90.         align-items: center;
  91.         padding: 5px 5px;
  92.         margin-right: 2px;
  93.         height: 19px;
  94.         vertical-align: middle;
  95.         font-size: 12px;
  96.         border-radius: .6em 2px;
  97.         line-height: 1.4rem
  98.     }

  99.     .wniui_prefix:after {
  100.         position: absolute;
  101.         content: " ";
  102.         display: block;
  103.         width: 15px;
  104.         height: 145%;
  105.         background-image: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0));
  106.         animation: sweepTitle 3s ease-in-out infinite;
  107.         transform: rotate(28deg)
  108.     }

  109.     @keyframes sweepTitle {
  110.         0% {
  111.             left: -100%
  112.         }

  113.         100% {
  114.             left: 100%
  115.         }
  116.     }
  117. </style>

  118. <div class="wniui-seach">
  119.     <span class="wniui_prefix wniui-baidu jb-pink">百度一下</span>
  120.     <div class="input__container">
  121.         <div class="shadow__input"></div>
  122.         <input type="text" name="text" class="input__search" placeholder="腾飞博客">
  123.         <button class="input__button__shadow">
  124.             <img src="https://www.wniui.com/wp-content/uploads/2024/12/c9a03fb2b220241229141747.svg" alt="搜索">
  125.         </button>
  126.     </div>
  127. </div>

  128. <script>
  129.     document.querySelector('.input__button__shadow').addEventListener('click', function () {
  130.         const query = document.querySelector('.input__search').value.trim() || '腾飞博客';
  131.         const searchUrl = `https://www.baidu.com/s?wd=${encodeURIComponent(query)}`;
  132.         window.open(searchUrl, '_blank');
  133.     });
  134. </script>
复制代码


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

本版积分规则

飞流广播+ 发布

系统消息:柒沐已经连续答对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
系统消息:飞流安卓客户端APP已上线,请在QQ群(123129)群文件内获取下载。
02-21 02:22
站内通告

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

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

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

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

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

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

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

fl@fllt.cn

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

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

GMT+8, 2025-10-11 06:10 , Processed in 0.079858 second(s), 60 queries, MemCached On , Gzip On.

Based on XJ-TX X3.5 Licensed

飞流论坛 HanAnalytics icp Astro vhAstro-Theme

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