js+css实现卡片鼠标交互视觉差异效果代码

代码语言:html

所属分类:视觉差异

代码描述:js+css实现卡片鼠标交互视觉差异效果代码

代码标签: js css 卡片 鼠标 交互 视觉差异

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

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

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


  
  
<style>
body {
  margin: 0;
  background: #f7f9fc;
  overflow: hidden;
}

.container {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  perspective: 100vw;
}

.card {
  --shadowX: 0;
  --shadowY: 0;
  --shadowBlur: 30px;
  width: 300px;
  height: 400px;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  z-index: 2;
  cursor: pointer;
  border: 1px outset #fff2;
  transition: height 600ms ease, width 600ms ease;
  
  &:hover {
    --shadowBlur: 10px;

    .ellipseContainer {
      opacity: 1;
    }
  }
  
  &:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: white;
    bo.........完整代码请登录后点击上方下载按钮下载查看

网友评论0