vue实现马蜂窝悬停动画效果

代码语言:html

所属分类:悬停

代码描述:vue实现马蜂窝悬停动画效果

代码标签: 悬停 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
.hexo-map {
  --color-base: #a4a4a6;
  --color-active: #f5cc23;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: -webkit-box;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
          flex-flow: row wrap;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
  font-size: 10vw;
  -webkit-transform: scale(1.1);
          transform: scale(1.1);
  mix-blend-mode: overlay;
  overflow: hidden;
}

.hexo {
  -webkit-box-flex: 0;
          flex: none;
  background-size: cover;
  width: 1em;
  height: 1em;
  display: -webkit-box;
  display: flex;
  position: relative;
  cursor: default;
  margin-bottom: -.15em;
}
.hexo:not(:nth-child(20n+11)):not(:nth-child(20n+12)):not(:nth-child(20n+13)):not(:nth-child(20n+14)):not(:nth-child(20n+15)):not(:nth-child(20n+16)):not(:nth-child(20n+17)):not(:nth-child(20n+18)):not(:nth-child(20n+19)):not(:nth-child(20n+20)) {
  -webkit-transform: translateX(50%);
          transform: translateX(50%);
}
.hexo:nth-child(20n-10) {
  -webkit-transform: scale(0) !important;
          transform: scale(0) !important;
}
.hexo::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-base);
  -webkit-clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
          clip-path: polygon(50% 0%, 95% 25%, 95% 75%, 50% 100%, 5% 75%, 5% 25%);
  opacity: .3;
  -webkit-transition: background 3s ease-out, opacity 3s ease-out, -webkit-transform 0.35s cubic-bezier(0.5, 0, 0.2, 1.6);
  transition: background 3s ease-out, opacity 3s ease-out, -webkit-transform 0.35s cubic-bezier(0.5, 0, 0.2, 1.6);
  transition: transform 0.35s cubic-bezier(0.5, 0, 0.2, 1.6), background 3s ease-out, opacity 3s ease-out;
  transition: transform 0.35s cubic-bezier(0.5, 0, 0.2, 1.6), background 3s ease-out, opacity 3s ease-out, -webkit-transform 0.35s cubic-bezier(0.5, 0, 0.2, 1.6);
}
.hexo:hover {
  z-index: 1;
}
.hexo:hover::after {
  -webkit-transform: scale(1.5);
          transform: scale(1.5);
  opacity: 1;
  background: var(--color-active);
  -webkit-transition: -webkit-transform 0.35s cubic-bezier(0.5, 0, 0.2, 1.6);
  transition: -webkit-transform 0.35s cubic-bezier(0.5, 0, 0.2, 1.6);
  transition: transform 0.35s cubic-bezier(0.5, 0, 0.2, 1.6);
  transition: transform 0.35s cubic-bezier(0.5, 0, 0.2, 1.6), -webkit-transform 0.35s cubic-bezier(0.5, 0, 0.2, 1.6);
}

:root {
  --mouse-x: -200;
  --mouse-y: -200;
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0