css实现鼠标悬浮背景图片多层次缩放效果代码

代码语言:html

所属分类:悬停

代码描述:css实现鼠标悬浮背景图片多层次缩放效果代码

代码标签: css 悬浮 背景 图片 缩放

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


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
<style>
html {
  box-sizing: border-box;
  height: 100%;
}

body {
  display: grid;
  place-items: center;
  min-height: 100%;
  background-color: #191919;
}

[style*="--repeat-bg"] {
  width: 200px;
  height: 350px;
  background-image: var(--repeat-bg), var(--repeat-bg), var(--repeat-bg), var(--repeat-bg);
  background-size: 100% auto, 100% auto, 100% auto, 175% auto;
  background-repeat: no-repeat;
  background-position: center;
  transition: all 0.15s ease-out;
  animation: 0.875s linear 1 reverse forwards multi-scale-in;
  border-radius: 999px;
  box-shadow: inset 0 -10px 20px -10px #000;
  overflow: hidden;
}
[style*="--repeat-bg"]:hover {
  -webkit-animation-name: multi-scale-out;
          animation-name: multi-scale-out;
  -webkit-animation-direction: normal;
          animation-direction: normal;
  -webkit-animation-duration: 0.625s;
          animation-duration: 0.625s;
}

@-webkit-keyframes multi-scale-in {
  0% {
    background-size: 100% auto, 100% auto, 100% auto, 175% auto;
  }
  33.3333333333% {
    background-size: 66.6666666667% auto, 100% auto, 100% auto, 175% auto;
  }
  66.6666666667% {
    background-size: 33.3333333333% auto, 50% auto, 100% auto, 175% auto;
  }
  100% {
    background-size: 0% auto, 0% auto, 0% auto, 100% auto;.........完整代码请登录后点击上方下载按钮下载查看

网友评论0