css+svg实现鼠标悬浮扩散变成卡片效果代码

代码语言:html

所属分类:悬停

代码描述:css+svg实现鼠标悬浮扩散变成卡片效果代码

代码标签: css svg 鼠标 悬浮 扩散 卡片

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

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

<head>
    <meta charset="UTF-8">


<style>
    html {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
   -webkit-box-pack: center;
       -ms-flex-pack: center;
           justify-content: center;
   -webkit-box-align: center;
       -ms-flex-align: center;
           align-items: center;
 }
 
 body {
   display: -webkit-box;
   display: -ms-flexbox;
   display: flex;
   -webkit-box-pack: justify;
       -ms-flex-pack: justify;
           justify-content: space-between;
   -webkit-box-align: center;
       -ms-flex-align: center;
           align-items: center;
   min-height: 100vh;
   background-color: #F7F9FC;
   font-family: system, -apple-system, BlinkMacSystemFont, sans-serif;
   font-size: 20px;
   color: #5d6494;
   -webkit-font-smoothing: antialiased;
   -moz-osx-font-smoothing: grayscale;
 }
 
 .container {
   width: 220px;
   height: 220px;
   display: -webkit-box;
   display: -ms-flexbox;
   display: flex;
   -webkit-box-pack: center;
       -ms-flex-pack: center;
           justify-content: center;
   -webkit-box-align: center;
       -ms-flex-align: center;
           align-items: center;
 }
 
 .box {
   position: absolute;
   width: 220px;
   height: 220px;
   display: -webkit-box;
   display: -ms-flexbox;
   display: flex;
   -webkit-box-pack: center;
       -ms-flex-pack: center;
           justify-content: center;
   -webkit-box-align: center;
       -ms-flex-align: center;
           align-items: center;
   -webkit-box-orient: vertical;
   -webkit-box-direction: normal;
       -ms-flex-direction: column;
           flex-direction: column;
   border-radius: 3px;
   overflow: hidden;
   -webkit-transition: -webkit-box-shadow ease 1s;
   transition: -webkit-box-shadow ease 1s;
   transition: box-shadow ease 1s;
   transition: box-shadow ease 1s, -webkit-box-shadow ease 1s;
 }
 
 .icon {
   position: relative;
   margin-top: 8px;
   -webkit-transition: all 0.6s ease;
   transition: all 0.6s ease;
   -webkit-transition-delay: 0.32s;
           transition-delay: 0.32s;
   will-change: transform;
 }
 
 .icon_bg {
   width: 80px;
   height: 80px;
   border-radius: 100%;
   border: 1px solid rgba(225, 227, 232, 0.18);
   -webkit-box-shadow: 0 3px 4px 0 rgba(44, 71, 146, 0.25);
           box-shadow: 0 3px 4px 0 rgba(44, 71, 146, 0.25);
   background-color: #fff;
   display: -webkit-box;
   display: -ms-flexbox;
   display: flex;
   -webkit-box-pack: center;
       -ms-flex-pack: center;
           justify-content: center;
   -webkit-box-align: center;
       -ms-flex-align: center;
           align-items: center;
   -webkit-transition: all 0.6s ease;
   transition: all 0.6s ease;
   -webkit-transition-delay: 0.32s;
           transition-delay: 0.32s;
   will-change: transform;
 }
 
 .title {
   position: relative;
 }
 
 .super-box:hover .box {
 /*   border: 1px solid rgba(225, 227, 232, 0.18); */
   -webkit-box-shadow: 0 3px 4px 0 rgba(44, 71, 146, 0.25);
           box-shadow: 0 3px 4px 0 rgba(44, 71, 146, 0.25);
   -webkit-transition-delay: 0.32s;
           transition-delay: 0.32s;
 }
 
 .super-box:hover .icon_bg {
   -webkit-transform: translateY(-32px) scale(6);
           transform: translateY(-32px) scale(6);
 }
 
 .super-box:hover .icon {
   -webkit-transform: translateY(-48px) scale(1.4);
           transform: translateY(-48px) scale(1.4);
 }
 
 .super-box {
     width: 220px;
   height: 220px;
   display: -webkit-box;
   display: -ms-flexbox;
   display: flex;
   -webkit-box-pack: center;
       -ms-flex-pack: center;
           justify-content: center;
   -webkit-box-align: center;
       -ms-flex-align: center;
           align-items: center;
   -webkit-box-orient: vertical;
   -webkit-box-direction: normal;
       -ms-flex-direction: column;
           flex-direction: column;
 }
 
 .text {
   position: relative;
   top: -32px;
   width: 200px;
   text-align: center;
   -webkit-transition: all 0.4s ease;
   transition: all 0.4s ease;
   -webkit-transition-delay: 0.32s;
           transition-delay: 0.32s;
 }
 
 .super-box:hover .text {
   opacity: 0;
   -webkit-transform: translateY(-4px) scale(.8);
           transform: translateY(-4px) scale(.8);
   
 }
 
 .box::after {
   content: "Discover the attacker's tactics and purposes and find out the identity of the attacker";
   position: absolute;
   width: 170px;
   top: 111px;
   opacity: 0;
   font-size: 13px;
   color: #5d6494;
   line-height: 20px;
   -webkit-transition: all 0.3s ease;
   transition: all 0.3s ease;
   -webkit-transition-delay: 0.32s;
           transition-delay: 0.32s;
 }
 
 .super-box:hover .box::after {
   opacity: 1;
 }

.dr {
position: absolute;
  bottom: 16px; 
  right: 16px;
  width:100px;
}
</style>

</head>

<body>
    <!-- partial:index.partial.html -->
    <div class="super-box">
        <div class="container">
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0