vanilla-tilt实现玻璃态Glassmorphism卡片三维倾斜交互效果代码

代码语言:html

所属分类:悬停

代码描述:vanilla-tilt实现玻璃态Glassmorphism卡片三维倾斜交互效果代码

代码标签: vanilla-tilt 玻璃态 Glassmorphism 卡片 三维 倾斜 交互

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">



    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800;900&family=Sigmar+One&family=Syne+Mono&display=swap" rel="stylesheet">



    <style>
        *{
          margin: 0;
          padding: 0;
          box-sizing: border-box;
          font-family: 'Poppins', sans-serif;
        }
        
        body{
          display: flex;
          justify-content: center;
          align-items: center;
          min-height: 100vh;
          background-color: #081945;
        }
        
        body::before{
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background: #8319F5;
          clip-path: circle(50% at right 70%);
        }
        
        body::after{
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background: #FF25C2;
          clip-path: circle(40% at 10% 10%);
        }
        
        .container{
          position: relative;
          display: flex;
          justify-content: center;
          align-items: center;
          max-width: 1200px;
          flex-wrap: wrap;
          z-index: 1;
        }
        
        .container .card{
          position: relative;
          width: 280px;
          height: 400px;
          margin: 30px;
          box-shadow: 20px 20px 50px rgba(0, 0, 0, 0.5);
          border-radius: 15px;
          background: rgba(255,255,255,0.1);
          overflow: hidden;
          display: flex;
          justify-content: center;
          align-items: center;
          border-top: 1px solid rgba(255,255,255,0.5);
          border-left: 1px solid rgba(255,255,255,0.5);
          backdrop-filter: blur(5px);
        }
        
        .container .card.........完整代码请登录后点击上方下载按钮下载查看

网友评论0