三维盒子弹出卡片特效动画

代码语言:html

所属分类:三维

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

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

    <style>
        html {
            box-sizing: border-box;
        }

        *,
        *:before,
        *:after {
            box-sizing: inherit;
        }

        body {
            background: radial-gradient(#ffffff 50%, #d5d3d5 100%);
            overflow: hidden;
        }

        body,
        html {
            height: 100%;
            width: 100%;
            margin: 0;
            padding: 0;
        }

        .scene {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            -webkit-perspective: 900px;
            perspective: 900px;
            visibility: hidden;
        }

        .box {
            -webkit-transform-style: preserve-3d;
            transform-style: preserve-3d;
            position: relative;
            z-index: 2;
            width: 180px;
            height: 249.66px;
            transform-style: preserve-3d;
        }

        .box__front, .box__back {
            position: absolute;
            width: 100%;
            height: 100%;
        }

        .box__left, .box__right {
            position: absolute;
            top: 0;
            left: calc(50% - 49.239px/2);
            height: 100%;
            width: 49.239px;
            background: #ececec;
        }

        .box__flap {
            position: absolute;
            left: calc(50% - 49.239px/2);
            top: calc(50% - 49.239px/2);
            width: 49.239px;
            height: 0;
            -webkit-transform-origin: 50% 100%;
            transform-origin: 50% 100%;
            border-bottom: 49.239px solid #dedede;
            border-left: calc(49.239px/10) solid transparent;
            border-right: calc(49.239px/10) solid transparent;
        }

        .box__lid {
            position: absolute;
            z-index: 0;
            top: calc(50% - 49.239px/2);
            width: 180px;
            height: 49.239px;
            -webkit-transform-origin: 50% 100%;
            transform-origin: 50% 100%;
            -webk.........完整代码请登录后点击上方下载按钮下载查看

网友评论0