css+div布局绘制光芒四射的可爱太阳代码

代码语言:html

所属分类:布局界面

代码描述:css+div布局绘制光芒四射的可爱太阳代码

代码标签: css div 布局 绘制 光芒 四射 可爱 太阳 代码

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

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

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

  
  
  
<style>
@property --modif {
  syntax: '<number>';
  inherits: false;
  initial-value: 1;
}

@property --transY {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

figure {
  font-size: 1vmin;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50em;
  aspect-ratio: 1;
  overflow: hidden;
  
  figcaption {
    transform: translate(0, -2em);
  }
  
  .center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 25em;
    transform: translate(-50%, -50%);
    aspect-ratio: 1;
    background: #fc0;
    border-radius: 50% 48% 47% 52%;
    animation: 
      rotate 5s infinite,
      shake 4.7s infinite;
    
    .cheek {
      --pos: 30%;
      width: 11%;
      aspect-ratio: 1.5;
      border-radius: 50%;
      background: #f003;
      position: absolute;
      transform: translate(-50%, -50%);
      top: 67%;
      left: var(--pos);
      
      & + & {
        left: calc(100% - var(--pos));
      }
    }
    
    .eye {
      --pos: 35%;
      width: 11%;
      aspect-ratio: 1;
      border-radius: 50%;
      background: #000;
      position: absolute;
      transform: translate(-50%, -50%);
      top: 60%;
      left: var(--pos);
      
      &::before {
        content: "";
        position: absolute;
        top: 30%;
        left: 35%;
        width: 30%;
        aspect-ratio: 1;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        background: #fff;
        animation: growShrink 3s linear infinite;
      }
      
      &::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 15%;
        width: 20%;
        aspect-ratio: 1;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        background: #fff;
        animation: growShrink 3s -1.5s linear infinite;
      }
      
      & + & {
        left: calc(100% - var(--pos));
      }
    }
    
    .mouth {
      --size: 0.7em;
      width: 7%;
      aspect-ratio: 1;
      border: var(--size) solid #0000;
      border-left-color: #000;
      border-bottom-color: #000;
      border-radius: 50%;
      top: 63%;
      left: 50%;
      position: absolute;
      transform: translate(-50%, -50%) rotate(-45deg);
    }
  }
  
  .ray {
    --angle: 0deg;
    --modif: 1;
    --transY: -13.5em;
    --anim: ;
    --extraanim: ;
    width: 3%;
    height: 10%;
    background: #fb2;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform-origin: 50% 100%;
    transform: translate(-50%, -100%) rotate(var(.........完整代码请登录后点击上方下载按钮下载查看

网友评论0