css实现光线滚动条效果代码
代码语言:html
所属分类:加载滚动
代码描述:css实现光线滚动条效果代码,像探照灯一样将滚动的文字区域照亮。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @property --scroll-y-position { syntax: "<percentage>"; initial-value: -10%; inherits: false; } @property --reflection-y-position { syntax: "<percentage>"; initial-value: -50%; inherits: false; } @property --scrollbar-color { syntax: "<color>"; inherits: false; initial-value: transparent; } @property --opacity-1 { syntax: "<number>"; inherits: false; initial-value: 0.1; } @property --opacity-2 { syntax: "<number>"; inherits: false; initial-value: 0.1; } @property --opacity-3 { syntax: "<number>"; inherits: false; initial-value: 0.1; } @property --opacity-4 { syntax: "<number>"; inherits: false; initial-value: 0.1; } @property --text-offset-1 { syntax: "<number>"; inherits: false; initial-value: 10; } @property --text-offset-2 { syntax: "<number>"; inherits: false; initial-value: 10; } @property --text-offset-3 { syntax: "<number>"; inherits: false; initial-value: 10; } @property --text-offset-4 { syntax: "<number>"; inherits: false; initial-value: 10; } html::-webkit-scrollbar { display: none; } body { margin: 0; background: black; height: 900px; font-family: sans-serif; } .scrollbar { width: 4px; height: 100%; background-color: var(--scrollbar-color); background-image: radial-gradient( circle at 0% var(--scroll-y-position), rgb(112, 153, 255) 0%, rgba(56, 106, 249, 0.79135) 10px, rgba(10, 76, 242, 0.53) 20px, rgba(255, 255, 255, 0) 40px, rgba(49, 49, 49, 0) 100% ); animation: on-scrolling both linear; animation-timeline: scroll(); animation-range: 10vh; } .container { width: 350px; height: 100%; background: linear-gradient( 132deg, rgba(255, 255, 255, 0.09) 0%, rgba(238, 238, 238, 0.03) 20%, rgba(202, 202, 202, 0.04) 70%, rgba(171, 171, 171, 0.02) 100% ); border: solid rgba(255, 255, 255, 0.06) 1px; margin-left: 15px; position: relative; } .container::before, .cont.........完整代码请登录后点击上方下载按钮下载查看
网友评论0