返回列表 发布新帖
查看: 54|回复: 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-8 21:36:30 | 查看全部 |阅读模式 浙江金华

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

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

×
这是一款子比主题两款顶部加载进度条,我觉得第一款还是比较美观的,给自己的子比加上顶部进度条更佳美化,话不多说直接开始!

第一款


image.webp

第二款


image.webp

代码部署


引入头部
将下面的代码放到:子比主题–>>自定义头部HTML代码
  1. <script data-pjax src="//npm.elemecdn.com/pace-js@1.2.4/pace.min.js"></script>
复制代码


CSS两款样式
将下面的代码放到:子比主题–>>自定义CSS样式即可,效果可以看上方的图片即可!
第一款
  1. /* 顶部小进度条start */
  2. .pace {
  3.   -webkit-pointer-events: none;
  4.   pointer-events: none;
  5.   -webkit-user-select: none;
  6.   -moz-user-select: none;
  7.   user-select: none;
  8.   z-index: 2000;
  9.   position: fixed;
  10.   margin: auto;
  11.   top: 10px;
  12.   left: 0;
  13.   right: 0;
  14.   height: 8px;
  15.   border-radius: 8px;
  16.   width: 8rem;
  17.   background: #eaecf2;
  18.   border: 1px #e3e8f7;
  19.   overflow: hidden;
  20. }
  21. .pace-inactive .pace-progress {
  22.   opacity: 0;
  23.   transition: 0.3s ease-in;
  24. }
  25. .pace .pace-progress {
  26.   -webkit-box-sizing: border-box;
  27.   -moz-box-sizing: border-box;
  28.   -ms-box-sizing: border-box;
  29.   -o-box-sizing: border-box;
  30.   box-sizing: border-box;
  31.   -webkit-transform: translate3d(0, 0, 0);
  32.   -moz-transform: translate3d(0, 0, 0);
  33.   -ms-transform: translate3d(0, 0, 0);
  34.   -o-transform: translate3d(0, 0, 0);
  35.   transform: translate3d(0, 0, 0);
  36.   max-width: 200px;
  37.   position: absolute;
  38.   z-index: 2000;
  39.   display: block;
  40.   top: 0;
  41.   right: 100%;
  42.   height: 100%;
  43.   width: 100%;
  44.   background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  45.   animation: gradient 1.5s ease infinite;
  46.   background-size: 200%;
  47. }
  48. .pace.pace-inactive {
  49.   opacity: 0;
  50.   transition: 0.3s;
  51.   top: -8px;
  52. }
  53. @keyframes gradient {
  54.   0% {
  55.     background-position: 0% 50%;
  56.   }
  57.   50% {
  58.     background-position: 100% 50%;
  59.   }
  60.   100% {
  61.     background-position: 0% 50%;
  62.   }
  63. }
  64. /* 顶部小进度条end */
复制代码
第二款
  1. .pace {
  2.   -webkit-pointer-events: none;
  3.   pointer-events: none;
  4.   -webkit-user-select: none;
  5.   -moz-user-select: none;
  6.   user-select: none;
  7. }

  8. .pace-inactive {
  9.   display: none;
  10. }

  11. .pace .pace-progress {
  12.   background: #e90f92;
  13.   position: fixed;
  14.   z-index: 2000;
  15.   top: 0;
  16.   right: 100%;
  17.   width: 100%;
  18.   height: 2px;
  19. }

  20. .pace .pace-progress-inner {
  21.   display: block;
  22.   position: absolute;
  23.   right: 0px;
  24.   width: 100px;
  25.   height: 100%;
  26.   box-shadow: 0 0 10px #e90f92, 0 0 5px #e90f92;
  27.   opacity: 1.0;
  28.   -webkit-transform: rotate(3deg) translate(0px, -4px);
  29.   -moz-transform: rotate(3deg) translate(0px, -4px);
  30.   -ms-transform: rotate(3deg) translate(0px, -4px);
  31.   -o-transform: rotate(3deg) translate(0px, -4px);
  32.   transform: rotate(3deg) translate(0px, -4px);
  33. }

  34. .pace .pace-activity {
  35.   display: block;
  36.   position: fixed;
  37.   z-index: 2000;
  38.   top: 15px;
  39.   right: 15px;
  40.   width: 14px;
  41.   height: 14px;
  42.   border: solid 2px transparent;
  43.   border-top-color: #e90f92;
  44.   border-left-color: #e90f92;
  45.   border-radius: 10px;
  46.   -webkit-animation: pace-spinner 400ms linear infinite;
  47.   -moz-animation: pace-spinner 400ms linear infinite;
  48.   -ms-animation: pace-spinner 400ms linear infinite;
  49.   -o-animation: pace-spinner 400ms linear infinite;
  50.   animation: pace-spinner 400ms linear infinite;
  51. }

  52. @-webkit-keyframes pace-spinner {
  53.   0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
  54.   100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
  55. }
  56. @-moz-keyframes pace-spinner {
  57.   0% { -moz-transform: rotate(0deg); transform: rotate(0deg); }
  58.   100% { -moz-transform: rotate(360deg); transform: rotate(360deg); }
  59. }
  60. @-o-keyframes pace-spinner {
  61.   0% { -o-transform: rotate(0deg); transform: rotate(0deg); }
  62.   100% { -o-transform: rotate(360deg); transform: rotate(360deg); }
  63. }
  64. @-ms-keyframes pace-spinner {
  65.   0% { -ms-transform: rotate(0deg); transform: rotate(0deg); }
  66.   100% { -ms-transform: rotate(360deg); transform: rotate(360deg); }
  67. }
  68. @keyframes pace-spinner {
  69.   0% { transform: rotate(0deg); transform: rotate(0deg); }
  70.   100% { transform: rotate(360deg); transform: rotate(360deg); }
  71. }
  72. /* 在下面修改进度条外观 */
  73. .pace .pace-progress {
  74.   background: #1ef4fbec; /*进度条颜色*/
  75.   height: 3px;/* 进度条厚度 */
  76. }
  77. .pace .pace-progress-inner {
  78.   box-shadow: 0 0 10px #1ef4fbce, 0 0 5px #1ecffbd0; /*阴影颜色*/
  79. }
  80. .pace .pace-activity {
  81.   border-top-color: #1edafbe5;  /*上边框颜色*/
  82.   border-left-color: #1ef4fbec;  /*左边框颜色*/
  83. }
复制代码


本帖被以下淘专辑推荐:

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

本版积分规则

飞流广播+ 发布

系统消息:柒沐已经连续答对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 15:19 , Processed in 0.085461 second(s), 61 queries, MemCached On , Gzip On.

Based on XJ-TX X3.5 Licensed

飞流论坛 HanAnalytics icp Astro vhAstro-Theme

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