div+css布局可爱太阳升起落下loading动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:div+css布局可爱太阳升起落下loading动画效果代码

代码标签: div css 布局 可爱 太阳 升起 落下 loading 动画

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

<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<style>
    @font-face {
    font-family: HarmonyOS;
    src: url("../font/HarmonyOS_Sans_SC_Medium.ttf")
}

:root {
    --light-color: #f4c042;
    --dark-color: #7a5600
}

*,*::before,*::after {
    padding: 0;
    margin: 0;
    box-sizing: border-box
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: HarmonyOS;
    background-color: var(--light-color)
}

.container {
    position: relative;
    width: 300px;
    height: 300px
}

.container .sun {
    position: absolute;
    top: 135px;
    left: calc(50% - 136px / 2);
    width: 136px;
    height: 136px;
    animation: sun 2.7s linear infinite
}

.container .sun .sun-body {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 6px solid var(--dark-color);
    animation: sun-body 2.7s linear infinite
}

.container .sun .sun-body .line {
    position: absolute;
    top: -24px;
    left: calc(50% - 3px);
    width: 6px;
    height: 12px;
    border-radius: 6px;
    background-color: var(--dark-color);
    transform: rotate(calc(var(--i) * 45deg));
    transform-origin: center 68px
}

.container .sun .eye {
    position: absolute;
    top: 60px;
    left: 40px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--dark-color);
    box-shadow: 16px 0 var(--dark-color);
    animation: eye 2.7s linear infinite
}

.container .horizon {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 115px;
    background-color: var(--light-color)
}

.container .horizon::before {
    content: "";
    position: absolute;
    left: 5%;
   .........完整代码请登录后点击上方下载按钮下载查看

网友评论0