css实现像素企鹅滑雪动画效果代码

代码语言:html

所属分类:动画

代码描述:css实现像素企鹅滑雪动画效果代码

代码标签: css 像素 企鹅 滑雪 动画

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

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

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

    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        * {
      box-sizing: border-box;
    }
    
    .wrapper {
      position: relative;
      width: 100vw;
      height: 100vh;
      background-color: #9df1fc;
      box-shadow: inset rgba(6, 177, 199, 0.8) 0 100px 200px -50px;
      overflow: hidden;
    }
    
    main {
      position: absolute;
      bottom: -20vh;
      left: -50vw;
      width: 200vw;
      height: 60vh;
      background-color: #ffffff;
      transform: rotate(10deg);
      -webkit-animation: horizonRotate 15s ease-in-out alternate infinite;
              animation: horizonRotate 15s ease-in-out alternate infinite;
      background: linear-gradient(to bottom, #ffffff 0%, #ffffff 20%, #fafafa 20%, #fafafa 40%, whitesmoke 40%, whitesmoke 60%, #f0f0f0 60%, #f0f0f0 80%, #ebebeb 80%, #ebebeb 100%);
    }
    
    .mountain {
      position: absolute;
      bottom: calc(100% + 8px*6);
      width: 8px;
      height: 8px;
      box-shadow: 48px 8px #fafafa, 40px 16px #ffffff, 48px 16px #ffffff, 56px 16px #fafafa, 32px 24px #ffffff, 40px 24px #ffffff, 48px 24px #ffffff, 56px 24px #ffffff, 64px 24px #fafafa, 24px 32px #ffffff, 32px 32px #ffffff, 40px 32px #ffffff, 48px 32px #ffffff, 56px 32px #ffffff, 64px 32px #ffffff, 72px 32px #fafafa, 16px 40px #ffffff, 24px 40px #ffffff, 32px 40px #ffffff, 40px 40px #ffffff, 48px 40px #ffffff, 56px 40px #ffffff, 64px 40px #ffffff, 72px 40px #ffffff, 80px 40px #fafafa, 8px 48px #ffffff, 16px 48px #ffffff, 24px 48px #ffffff, 32px 48px #ffffff, 40px 48px #ffffff, 48px 48px #ffffff, 56px 48px #ffffff, 64px 48px #ffffff, 72px 48px #ffffff, 80px 48px #ffffff, 88px 48px #fafafa;
    }
    .mountain:nth-child(1) {
      transform: translateX(160vw);
      -webkit-animation: horizonMovement 12s linear infinite;
              animation: horizonMovement 12s linear infinite;
    }
    .mountain:nth-child(2) {
      transform: translateX(172vw);
      -webkit-animation: horizonMovement 5s linear infinite;
              animation: horizonMovement 5s linear infinite;
    }
    .mountain:nth-child(3) {
      transform: translateX(219vw);
      -webkit-animation: horizonMovement 13s linear infinite;
              animation: horizonMovement 13s linear infinite;
    }
    .mountain:nth-child(4) {
      transform: translateX(213vw);
      -webkit-animation: horizonMovement 11s linear infinite;
              animation: horizonMovement 11s linear infinite;
    }
    .mountain:nth-child(5) {
      transform: translateX(247vw);
      -webkit-animation: horizonMovement 12s linear infinite;
              animation: horizonMovement 12s linear infinite;
    }
    .mountain:nth-child(6) {
      transform: translateX(260vw);
      -webkit-animation: horizonMovement 4s linear infinite;
              animation: horizonMovement 4s linear infinite;
    }
    .mountain:nth-child(7) {
      transform: translateX(247vw);
      -webkit-animation: horizonMovement 12s linear infinite;
              animation: horizonMovement 12s linear infinite;
    }
    .mountain:nth-child(8) {
      transform: translateX(225vw);
      -webkit-animation: horizonMovement 14s linear infinite;
              animation: horizonMovement 14s linear infinite;
    }
    .mountain:nth-child(9) {
      transform: translateX(213vw);
      -webkit-animation: horizonMovement 5s linear infinite;
              animation: horizonMovement 5s linear infinite;
    }
    .mountain:nth-child(10) {
      transform: translateX(265vw);
      -webkit-animation: horizonMovement 3s linear infinite;
              animation: horizonMovement 3s linear infinite;
    }
    .mountain:nth-child(11) {
      transform: translateX(211vw);
      -webkit-animation: horizonMovement 14s linear infinite;
              animation: horizonMovement 14s linear infinite;
    }
    .mountain:nth-child(12) {
      transform: translateX(222vw);
      -webkit-animation: horizonMovement 14s linear infinite;
              animation: horizonMovement 14s linear infinite;
    }
    
    .penguin {
      position: absolute;
      right: 160px;
      bottom: calc(100% + 8px*2);
      left: 0;
      margin: auto;
      width: 8px;
      height: 8px;
      -webkit-animation: sliding 1s linear infinite;
              animation: sliding 1s linear infinite;
      box-shadow: 24px 8px #252827, 32px 8px #252827, 40px 8px #252827, 48px 8px #252827, 56px 8px #252827, 64px 8px #252827, 72px 8px #252827, 80px 8px #252827, 88px 8px #252827, 120px 8px #252827, 128px 8px #252827, 136px 8px #252827, 144px 8px #252827, 16px 16px #252827, 24px 16px #252827, 32px 16px #252827, 40px 16px #252827, 48px 16px #252827, 56px 16px #252827, 64px 16px #252827, 72px 16px #252827, 80px 16px #252827, 88px 16px #252827, 96px 16px #252827, 112px 16px #252827, 120px 16px #252827, 128px 16px #252827, 136px 16px #252827, 144px 16px #252827, 152px 16px #252827, 8px 24px #252827, 16px 24px #252827, 24px 24px #252827, 32px 24px #252827, 40px 24px #252827, 48px 24px #252827, 56px 24px #252827, 64px 24px #3e4241, 72px 24px #3e4241, 80px 24px #3e4241, 88px 24px #252827, 96px 24px #252827, 104px 24px #252827, 112px 24px #252827, 120px 24px #252827, 128px 24px #252827, 136px 24px #252827, 144px 24px #ffffff, 152px 24px #252827, 160px 24px #252827, 0px 32px #252827, 8px 32px #252827, 16px 32px #252827, 24px 32px #252827, 32px 32px #252827, 40px 32px #3e4241, 48px 32px #3e4241, 56px 32px #3e4241, 64px 32px #3e4241, 72px 32p.........完整代码请登录后点击上方下载按钮下载查看

网友评论0