挂件头衔✨️靓标库🧚‍♂️名人堂🦄宝可梦🍎水果机🥊猜拳🏧黑市🏧银行💹抽奖
   🎁
返回列表 发布新帖
查看: 220|回复: 0

[代码技巧] 子比主题 – 侧边百度一下简约样式_带打字效果

[复制链接]
社区贡献

330

主题

204

回帖

2万

积分

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

积分成就
   钻石 : 293 颗
   贡献 : 40810 点
   金币 : 24 枚
Icon在线时间 : 1669 小时
Icon注册时间 : 2024-11-22
Icon最后登录 : 2026-6-10

荣誉勋章

连续签到LV.1累计签到LV.3任务·年会员幸运抽奖·皇幸运抽奖·尊幸运抽奖·豪起源之星摩羯座推广LV.2钻石LV.1注册一周年

总共送礼:1 个    总共收礼:0 个

实力·绝代收藏家

飞流名人堂成员 1 FLLTCN 实名认证 特邀大神 诚信商家 信誉担保 精华作者+ 官方团队 vip vip-year 发表于 2025-10-10 17:52:28 | 查看全部 |阅读模式 浙江金华

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

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

×
在这篇文章之前腾飞博客分享过两篇,不过今天这次分享的不一样,之前的是固定的,而今天的百度一下的样式是获取当前页面的标题,而且是打字自动输入的一款样式效果,喜欢的自行部署吧!

image.webp

代码部署


定位:WP后台–>>外观–>>小工具–>>自定义HTML,直接将下面的代码丢到里面,然后放到侧边即可!
  1. <style>
  2. .searchs {
  3.     background-color: var(--main-bg-color);
  4.     padding: 15px;
  5.     overflow: hidden;
  6.     transition: all 0.3s;
  7.     border-radius: 4px;
  8.     position: relative;
  9.     margin: 20px 0 25px 0;
  10.     box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  11.     transform: translateY(-4px);
  12.     border-top: 2px solid rgba(51, 133, 255, 0.2);
  13. }
  14. mip-form form {
  15.     position: relative;
  16.     display: flex;
  17.     align-items: center;
  18. }
  19. .searchs input[type="text"] {
  20.     border: 2px solid #3385FF;
  21.     border-right: none;
  22.     border-radius: 4px 0 0 4px;
  23.     width: 100%;
  24.     padding: 8px 12px;
  25.     font-size: 14px;
  26.     transition: all 0.3s;
  27.     box-sizing: border-box;
  28.     height: 38px;
  29.     line-height: 18px;
  30.     margin: 0;
  31.     background-color: var(--footer-bg);
  32. }
  33. .searchs input[type="submit"] {
  34.     background: linear-gradient(to bottom, #3385FF, #2a7ae9);
  35.     color: #fff;
  36.     font-size: 14px;
  37.     height: 38px;
  38.     padding: 0 15px;
  39.     border: 2px solid #3385FF;
  40.     border-left: none;
  41.     border-radius: 0 4px 4px 0;
  42.     cursor: pointer;
  43.     transition: all 0.3s;
  44.     margin: 0;
  45.     line-height: 18px;
  46.     box-shadow: 1px 0 2px rgba(0,0,0,0.1);
  47. }
  48. .tit {
  49.     background: linear-gradient(to right, #3385FF, #2a7ae9);
  50.     position: relative;
  51.     top: -15px;
  52.     display: inline-block;
  53.     color: #fff;
  54.     padding: 6px 15px;
  55.     font-size: 14px;
  56.     border-radius: 4px 4px 0 0;
  57.     box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
  58.     text-shadow: 0 1px 1px rgba(0,0,0,0.2);
  59. }
  60. </style>
  61.   <div class="searchs">
  62.     <div class="tit"><strong>百度一下</strong></div>
  63.     <mip-form method="get" url="https://www.baidu.com/s" class="mip-element mip-layout-container">
  64.         <form action="https://www.baidu.com/s" method="GET" target="_blank">
  65.             <input type="text" name="wd" placeholder="正在加载..." id="searchInput">
  66.             <input type="submit" value="搜索">
  67.         </form>
  68.     </mip-form>
  69. </div>
  70. <script>
  71. const pageTitle = document.title.replace(/_百度搜索$/, '').trim() || "习听风雨";
  72. document.addEventListener('DOMContentLoaded', function() {
  73.     const searchInput = document.getElementById('searchInput');
  74.     let i = 0;
  75.     function typeWriter() {
  76.         if (i < pageTitle.length) {
  77.             searchInput.value += pageTitle.charAt(i);
  78.             i++;
  79.             setTimeout(typeWriter, 100);
  80.         }
  81.     }
  82.     setTimeout(typeWriter, 500);
  83.     searchInput.addEventListener('focus', function() {
  84.         this.select();
  85.     });
  86. });
  87. </script>
复制代码



本帖被以下淘专辑推荐:

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

本版积分规则

飞流广播+ 发布

系统消息:飞流安卓客户端APP已上线,请在QQ群(123129)群文件内获取下载。
02-21 02:22
01-24 12:40
站内通告

📢 六月份后均不在线,请悉知

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

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

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

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

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

官方Q群:1003810038钉推群:BAYR2383 站长QQ:3388700000

飞流论坛(FLLT.CN),一个专注于资源信息发布、虚拟网络交易、技术学习与娱乐社交的交流平台。
  • 钉钉新帖推送群
  • 官方交流QQ群
  • 站长唯一微信号

💥客户端|🧿小黑屋|📴手机页|飞流网 |网站地图

GMT+8, 2026-6-10 08:08 , Processed in 0.076443 second(s), 84 queries, MemCached On , Gzip On.

飞流论坛 HanAnalytics icp

Copyright © 2024-2026 飞流网 版权所有 All Rights Reserved. X3.5

快速回复 返回顶部 返回列表