六边形窝峰悬浮鼠标跟随动画效果
代码语言:html
所属分类:悬停
代码描述:六边形窝峰悬浮鼠标跟随动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { background: #171516; overflow: hidden; } .container { top: 51%; position: absolute; transform: translateY(-50%); } .row { display: block; width: 100vw; height: 121px; overflow: hidden; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: -35px; margin-left: -33px; } .row .hexagon { position: relative; width: 100px; height: 54.74px; background-color: #3d3d3d; margin: 32.87px 2px; display: block; transition: all 0.2s linear; } .row .hexagon::after { content: ""; position: absolute; width: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; top: 100%; width: 0; border-top: 28.87px solid #3d3d3d; transition: all 0.2s linear; } .row .hexagon::before { content: ""; position: absolute; width: 0; border-left: 50px solid transparent; border-right: 50px solid transparent; bottom: 100%; border-bottom: 28.87px solid #3d3d3d; transition: all 0.2s linear; } .row.row-moved { margin-left: 19px; } .light { background: #3fff3c !important; animation: colorgen 1s infinite; } .light::after { border-top: 28.87px solid #3fff3c !important; } .light::before { border-bottom: 28.87px solid #3fff3c !important; } @keyframes colorgen { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(270deg); } } </style> </head> <body translate="no" > <!-- Thank you for checking my pen --> <section class="container"> <div class="row "> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> </div> <div class="row row-moved"> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> </div> <div class="row "> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> </div> <div class="row row-moved"> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div> <div class="hexagon"></div>.........完整代码请登录后点击上方下载按钮下载查看
网友评论0