返回列表 发帖
查看: 414|回复: 2

一款漂亮的 滚动条

10

主题

54

回帖

73

积分

渐入佳境

贡献
0 点
金币
5 个
发表于 2024-2-23 10:42:13 | 显示全部楼层 |阅读模式
QQ截图20240223101315.png

1 路径 找到 /template/你的模板/common/header.html   

  1. 在找到这段代码 :
  2. <font color="#708090"><body id="nv_{$_G[basescript]}" class="pg_{CURMODULE}{if $_G['basescript'] === 'portal' && CURMODULE === 'list' && !empty($cat)} {$cat['bodycss']}{/if}" onkeydown="if(event.keyCode==27) return false;">
  3.         <div id="append_parent"></div><div id="ajaxwaitid"></div></font>
复制代码
把下面代码 添加到上<body> 之间 </body>
  1. <div id="progressbar"></div>
  2. <div id="scrollpath"></div>
复制代码
2  路径  找到 /template/你的模板/common/footer.html  

添加到里面 footer.html  里面

  1. <script type="text/javascript">
  2.         let progress=document.getElementById('progressbar');
  3.         let totalheight=document.body.scrollHeight - window.innerHeight;
  4.         window.onscroll=function(){
  5.                 let progressHeight=(window.pageYOffset / totalheight) *100;
  6.                 progress.style.height=progressHeight + "%";
  7.         }
  8. </script>
复制代码
3 路径 找到 /template/你的模板/common/common.css  

   添加到  common.css  最下面

  1. *{
  2.         -margin: 0;
  3.         -padding: 0;
  4.         -box-sizing: border-box;
  5.     font-family: "Droid Serif","Times New Roman","PingFang SC","Hiragino Sans GB","Source Han Sans CN","WenQuanYi Micro Hei","Microsoft Yahei",serif;
  6. }
  7. section{
  8.     -padding: 50px;
  9.     -background: #000;
  10.     -min-height: 100vh;
  11. }
  12. section h2{
  13.     font-size: 2.5em;
  14.     color: #fff;
  15. }
  16. section p{
  17.     font-size: 1.2em;
  18.     color: #fff;
  19. }
  20. ::-webkit-scrollbar{
  21.     width: 0;
  22. }
  23. #scrollpath{
  24.     position: fixed;
  25.     top: 0;
  26.     right: 0;
  27.     width: 10px;
  28.     height: 100%;
  29.     background: rgba(255,255,255,0.05);
  30. }
  31. #progressbar{
  32.     position: fixed;
  33.     top: 0;
  34.     right: 0;
  35.     width: 10px;
  36.     background: linear-gradient(to top,#008aff,#00ffe7);
  37.     animation: animate 5s linear infinite;
  38. }
  39. @keyframes animate{
  40.     0%,100%{
  41.         filter:hue-rotate(0deg);
  42.     }
  43.     50%{
  44.         filter:hue-rotate(360deg);
  45.     }
  46. }
  47. #progressbar:before{
  48.     content: '';
  49.     position: absolute;
  50.     top: 0;
  51.     left: 0;
  52.     width: 100%;
  53.     height: 100%;
  54.     background: linear-gradient(to top,#008aff,#00ffe7);
  55.     filter: blur(10px);
  56. }

  57. #progressbar:after{
  58.     content: '';
  59.     position: absolute;
  60.     top: 0;
  61.     left: 0;
  62.     width: 100%;
  63.     height: 100%;
  64.     background: linear-gradient(to top,#008aff,#00ffe7);
  65.     filter: blur(30px);
  66. }
复制代码


演示地址: https://mp3.wf






回复

使用道具 举报

5

主题

70

回帖

129

积分

渐入佳境

贡献
8 点
金币
6 个
发表于 2024-2-23 10:46:54 | 显示全部楼层
效果很炫酷,谢谢分享,不过不适合应用于我的网站
回复 支持 反对

使用道具 举报

31

主题

238

回帖

288

积分

炉火纯青

贡献
1 点
金币
1 个
发表于 2024-2-23 13:52:14 | 显示全部楼层
很炫,很给力
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 关注公众号
  • 有偿服务微信
  • 有偿服务QQ

手机版|小黑屋|Discuz! 官方交流社区 ( 皖ICP备16010102号 |皖公网安备34010302002376号 )|网站地图|star

GMT+8, 2024-5-3 13:55 , Processed in 0.043332 second(s), 8 queries , Redis On.

Powered by Discuz! W1.0 Licensed

Cpoyright © 2001-2024 Discuz! Team.

关灯 在本版发帖
有偿服务QQ
有偿服务微信
返回顶部
快速回复 返回顶部 返回列表