css布局实现山峰上月色夜景效果代码

代码语言:html

所属分类:布局界面

代码描述:css布局实现山峰上月色夜景效果代码

代码标签: css 夜色 山峰 月亮

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

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">



    <style>
        @property --annie {
          syntax: "*";
          inherits: false;
        }
        .overlays {
          position: fixed;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          width: 100vw;
          height: 100vh;
          z-index: -1;
          overflow: hidden;
          perspective: 900px;
          transform-style: preserve-3d;
          filter: hue-rotate(0deg);
          --annie_play-state: paused;
          --annie: --a 60s calc(-1s * var(--start)) infinite ease-in-out alternate var(--annie_play-state);
        }
        .overlays:active {
          --annie_play-state: running;
        }
        .overlays .overlay {
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
        }
        .overlays #overlay_sky {
          background-image: radial-gradient(circle at bottom, transparent 65%, #270245), linear-gradient(to bottom, #0000, #FF294166), linear-gradient(to bottom, #270245, #871A85);
          background-size: cover, cover, cover;
        }
        .overlays #overlay_stars {
          background-image: repeating-conic-gradient(#FFF2 0%, transparent 0.0002%, transparent 0.0045%, transparent 0.045%), repeating-conic-gradient(#FFF9 0%, transparent 0.0002%, transparent 0.009%, transparent 0.09%), repeating-conic-gradient(#FFF6 0%, transparent 0.0002%, transparent 0.0075%, transparent 0.075%);
          background-size: 100vmin 100vmin;
          filter: drop-shadow(0 0 0.2vmin #FFF) drop-shadow(0 0 0.2vmin #FFF) drop-shadow(0 0 0.2vmin #FFF);
        }
        .overlays .overlay_sun {
          display: flex;
          flex: 1;
          flex-direction: column;
          filter: drop-shadow(0 0 5vmin #FF2941) drop-shadow(0 0 7.5vmin #FE18D3);
        }
        .overlays .overlay_sun .overlay_sun-sun {
          background-image: radial-gradient(circle at top, #FFF 0%, transparent 50%), radial-gradient(circle, transparent, #FE18D3), repeating-linear-gradient(#FF2941 0%, transparent 0.5%, #FF2941 1%), radial-gradient(circle, #FEFF38 0% 45%, #FF2941 85%, #FE18D3 100%);
          box-shadow: inset 0vmin 0.5vmin 1vmin #FFF, inset 0vmin 1vmin 2vmin #FEFF38;
          border-radius: 50%;
          width: 30vmin;
          height: 30vmin;
          position: absolute;
          left: 0;
          right: 0;
          top: 0;
          bottom: 0;
          margin: 0 auto;
          margin-top: 10vmin;
          -webkit-mask: linear-gradient(to bottom, #000 10% 15%, transparent 15% 15.25%, #000 15.25% 21%, transparent 21% 21.5%, #000 21.5% 27%, transparent 27% 27.75%, #000 27.75% 33%, transparent 33% 34%, #000 34% 39%, transparent 39% 40.5%, #000 40.5% 44%, transparent 44% 46%, #000 46% 50%, transparent 50% 52%, #000 52% 56%, transparent 56% 58%, #000 58% 62%, transparent 62% 64%, #000 64% 67%, transparent 67% 70%, #000 70% 73%, transparent 73% 76%, #000 76% 79%, transparent 79% 82%, #000 82% 84%, transparent 84% 88%, #000 88% 90%, transparent 90% 94%, #000 94% 95%, transparent 95% 100%);
        }
        .overlays #overlay_sun2, .overlays #overlay_sun3 {
          filter: blur(5vmin);
          z-index: 1;
          transform: scale(1.5);
          transform-origin: top center;
        }
        .overlays #overlay_sun3 {
          transform: scale(1.5) translateY(35%) translateZ(-1500px) rotateX(75deg);
          filter: blur(15vmin);
          z-index: 2;
        }
        .overlays #overlay_sun3 .overlay_sun-sun {
          width: 90vmin;
          height: 90vmin;
        }
        .overlays #overlay_floor {
          width: 200%;
          transform: rotateX(70deg) translateX(-10%) translateY(50%);
          transform-style: preserve-3d;
          margin: 0 auto;
          z-index: 1;
        }
        .overlays #overlay_floor #overlay_floor-color, .overlays #overlay_floor #overlay_floor-grid, .overlays #overlay_floor #overlay_floor-horizon, .overlays #overlay_floor #overlay_floor-horizon2, .overlays #overlay_floor #overlay_mountain {
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
        }
        .overlays #overlay_floor #overlay_floor-color {
          background-image: linear-gradient(to bottom, #.........完整代码请登录后点击上方下载按钮下载查看

网友评论0