css绘制鸡蛋效果

代码语言:html

所属分类:布局界面

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

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

    <style>
        html {
            height: 100%;
        }
        body {
            background: radial-gradient(#CCC, #222);
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100%;
            overflow: hidden;
        }
        .title {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 50%;
            margin-bottom: 14vw;
            text-align: center;
            font-weight: 100;
            font-size: 3vw;
            color: #FFF;
            opacity: 0.25;
        }
        .egg-wrapper + .title::before {
            content: "css egg";
        }
        .egg-wrapper + .egg-wrapper + .title::before {
            content: "css eggs";
        }
        input {
            position: fixed;
            z-index: 1;
            bottom: 50%;
            width: 15vw;
            height: 20vw;
            cursor: pointer;
            opacity: 0;
            margin-bottom: -10vw;
        }
        .stage {
            position: absolute;
            z-index: -2;
            width: 100vw;
            height: 150vw;
            perspective: 50vw;
            transition: filter 2s;
        }
        .stage .light {
            width: 100%;
            height: 100%;
            background: #FFF;
            border-radius: 50%;
            transform: rotateX(80deg);
        }
        .egg-wrapper {
            position: relative;
            width: 15vw;
            height: 20vw;
            margin: 0 0.3vw;
            border-radius: 50% 50% 50% 50%/60% 60% 40% 40%;
        }
        .egg-wrapper:not(.rotate) {
            animation-name: move;
            animation-duration: 3s;
            animation-tim.........完整代码请登录后点击上方下载按钮下载查看

网友评论0