css实现联系人卡片鼠标悬停翻转动画效果代码

代码语言:html

所属分类:悬停

代码描述:css实现联系人卡片鼠标悬停翻转动画效果代码

代码标签: css 联系人 卡片 鼠标 悬停 翻转 动画

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

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

<style>
    body {
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #f0f0f0;
  margin: 0;
}

.card {
  width: 320px;
  height: 384px;
  perspective: 1000px;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s;
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.card-front {
  background: linear-gradient(135deg, #9333ea, #ec4899, #ef4444);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
}

.card-back {
  background-color: white;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #333;
}

.profile-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  -webkit-animation: float 3s ease-in-out infinite;
          animation: float 3s ease-in-out infinite;
}

h2 {
  margin: 16px 0 8px;
  font-size: 1.5em;
}

p {
  margin: 4px 0;
  font-size: 1.125em;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  -webkit-animation: bubble 15s infinite;
          animation: bubble 15s infinite;
}

.bubble:nth-child(1) {
  width: 40px;
  height: 40px;
  left: 10%;
  -webkit-animation-duration: 8s;
          animation-d.........完整代码请登录后点击上方下载按钮下载查看

网友评论0