three+vanilla-tilt实现炫酷三维鼠标交互倾斜价格卡片代码

代码语言:html

所属分类:其他

代码描述:three+vanilla-tilt实现炫酷三维鼠标交互倾斜价格卡片代码

代码标签: three vanilla-tilt 炫酷 三维 鼠标 交互 倾斜 价格 卡片 代码

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

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

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

<style>
    body {
        font-family: 'Inter', sans-serif;
        background-color: #111827;
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        margin: 0;
        overflow: hidden;
    }
    .card-container {
        position: relative;
        width: 360px;
        max-width: 90%;
        transform-style: preserve-3d;
        perspective: 1000px;
    }
    .card {
        background-color: rgba(100, 50, 20, 0.70);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-radius: 28px;
        padding: 24px;
        color: #E5E7EB;
        box-shadow: 0 12px 35px rgba(0,0,0,0.55), 0 0 0 1px rgba(255, 190, 120, 0.20) inset;
        position: relative;
        z-index: 1;
        overflow: hidden;
        transform-style: preserve-3d;
    }
    .card-title {
        font-size: 1.375rem;
        font-weight: 700;
        color: #F9FAFB;
        margin-bottom: 8px;
        transform: translateZ(20px);
    }
    .card-price {
        font-size: 3.25rem;
        font-weight: 800;
        color: #FFFFFF;
        margin-bottom: 6px;
        transform: translateZ(20px);
    }
    .card-price .currency {
        font-size: 1.875rem;
        font-weight: 500;
        vertical-align: super;
        margin-right: 4px;
        color: #FDBA74;
    }
    .card-price .period {
        font-size: 1.05rem;
        font-weight: 500;
        color: #D1D5DB;
    }
    .card-description {
        font-size: 0.925rem;
        color: #B0B6BF;
        margin-bottom: 20px;
        line-height: 1.6;
        transform: translateZ(20px);
    }
    .features-list {
        list-style: none;
        padding: 0;
        margin-bottom: 24px;
        transform: translateZ(20px);
    }
    .features-list li {
        display: flex;
        align-items: center;
        font-size: 0.9rem;
        margin-bottom: 12px;
        color: #D1D5DB;
    }

    .rotating-disc-svg {
        width: 20px;
        height: 20px;
        margin-right: 12px;
        animation: spin 3s linear infinite;
    }
    .rotating-disc-svg circle {
        stroke: #FDBA74;
        stroke-width: 2;
        stroke-dasharray: 10 5;
    }

    @keyframes spin {
        from {
            transform: rotate(0deg);
        }
        to {
            transform: rotate(360deg);
        }
    }

    .cta-button {
        background-color: rgba(255, 150, 80, 0.25);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        color: #FFFFFF;
        font-weight: 600;
        font-size: 1rem;
        padding: 14px 0;
        width: 100%;
        border: 1px solid rgba(255, 190, 120, 0.3);
        border-radius: 20px;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 5px 15px rgba(255, 100, 0, 0.25);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        transform: translateZ(20px);
    }
    .cta-button:hover {
        background-color: rgba(255, 160, 90, 0.40);
        border-color: rgba(255, 200, 140, 0.4);
        transform: translateY(-2px) scale(1.02) translateZ(20px);
        box-shadow: 0 7px 20px rgba(255, 100, 0, 0.35);
    }
    .cta-button:active {
        transform: translateY(-1px) scale(0.98) translateZ(20px);
        background-color: rgba(255, 140, 70, 0.45);
    }

    #energy-canvas {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 0;
        pointer-events: none;
    }
    @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
</style>

<script type="importmap">
{
    "imports":.........完整代码请登录后点击上方下载按钮下载查看

网友评论0