div+css布局实现卡通女孩打坐修行练瑜伽效果代码

代码语言:html

所属分类:布局界面

代码描述:div+css布局实现卡通女孩打坐修行练瑜伽效果代码

代码标签: div css 卡通 女孩 打坐 修行 瑜伽

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


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

<head>

  <meta charset="UTF-8">

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

:root {
  --p-c: #a9d1e1;
  --p-c-700: #86bfd0;
  --s-c: #e9fafd;
  --sk-c: #f4a17f;
  --h-c: #1d3443;
  --sk-c-600: #bd694d;
  --t-c: #fdd3bc;
  --pt-c: #d15a5b;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: var(--p-c);
  min-width: fit-content;
  min-height: 600px;
  position: relative;
}

img {
  width: 100%;
  position: absolute;
  z-index: -9999;
}

main {
  width: 500px;
  aspect-ratio: 1;
  position: relative;
  animation: move 10s linear infinite;
  flex-shrink: 0;
}

/* -----------------Dots------------------- */

ul {
  list-style: none;
  animation: balls 10s linear infinite;
}

ul > li {
  position: absolute;
  width: 20px;
  aspect-ratio: 1;
  background-color: var(--s-c);
  border-radius: 50%;
}

ul > li:nth-child(3n) {
  width: 10px;
  height: 10px;
}

ul > li:first-child {
  top: 20px;
  left: 50%;
}

ul > li:nth-child(2) {
  left: 115px;
  top: 190px;
}
ul > li:nth-child(3) {
  left: 100px;
  top: 280px;
}
ul > li:nth-child(4) {
  left: 50px;
  top: 330px;
}
ul > li:nth-child(5) {
  right: 40px;
  top: 260px;
  width: 15px;
}
ul > li:nth-child(6) {
  right: 170px;
  top: 340px;
}
ul > li:nth-child(7) {
  right: 85px;
  top: 160px;
  width: 15px;
}
ul > li:nth-child(8) {
  right: 180px;
  bottom: 35px;
  width: 15px;
}
ul > li:nth-child(9) {
  right: 150px;
  top: 185px;
}
ul > li:nth-child(10) {
  left: 130px;
  top: 90px;
  width: 10px;
}
ul > li:nth-child(11) {
  left: 40px;
  top: 130px;
  width: 8px;
}

/* --------------------shadow--------------------------- */

.shadow {
  position: absolute;
  bottom: 15px;
  height: 10px;
  width: 70%;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 100%;
  background-color: var(--p-c-700);
}

/* -------------------------circle paths------------------------- */

.circles div {
  position: absolute;
  width: 290px;
  height: 250px;
  border: 3px solid var(--s-c);
  border-right-color: transparent;
  border-bottom-color: transparent;
  transform: rotate(-45deg);
  border-radius: 50%;
  top: 110px;
  left: 65px;
}

.circles div:nth-child(2) {
  left: 115px;
  width: 270px;
  top: 100px;
  transform: rotate(-40deg);
}
.circles div:nth-child(3) {
  left: 155px;
  width: 250px;
  top: 130px;
  transform: rotate(-220deg);
}
.circles div:nth-child(4) {
  left: 205px;
  width: 200px;
  border: 3px solid var(--s-c);
  top: 100px;
  transform: rotate(-120deg);
}

/* ------------------------character--------------------- */

.face {
  width: 80px;
  height: 80px;
  position: absolute;
  left: 51%;
  top: 90px;
  /* opacity: 0; */
  border-radius: 20px;
  transform: translateX(-50%) rotate(45deg);
  background-color: var(--h-c);
  overflow: hidden;
}

.face::before,
.face::after {
  position: absolute;
  content: "";
  width: 120px;
  height: 200px;
  background-color: var(--sk-c);
  left: 10px;
  bottom: 0px;
  border-radius: 35px;
  transform: rotate(-5deg);
}

.face::after {
  bottom: 65px;
  left: -59px;
  width: 200px;
  border-radius: 200px;
  background-color: inherit;
}

.ear {
  width: 15px;
  height: 25px;
  border-radius: 50%;
  background: var(--sk-c);
  position: absolute;
  top: 125px;
  left: 287px;
  transform: rotate(13deg);
  z-index: 5;
}

/* ---------------------eye------------------ */

.eyebrow {
  position: absolute;
  width: 23px;
  top: 39px;
  left: 23px;
  transform: rotate(19deg);
  height: 25px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-left-color: var(--h-c);
}

.eyebrow::after {
  position: absolute;
  content: "";
  width: 23px;
  height: 25px;
  border: inherit;
  top: -15px;
  left: 22px;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: inherit;
}

.eye {
  position: absolute;
  width: 16px;
  height: 12px;
  top: 45px;
  left: 25px;
  transform: rotate(305deg);
  border-radius: 50%;
  border-bottom: 2px solid var(--h-c);
}

.eye::after {
  position: absolute;
  content: "";
  width: 100%;
  height: 100%;
  left: 30px;
  top: 8px;
  transform: rotate(13deg);
  border: inherit;
  border-radius: inherit;
}

.nose {
  width: 10px;
  position: absolute;
  height: 8px;
  border-radius: 100%;
  left: 50px;
  top: 50px;
  transform: rotate(316deg);
  border-bottom: 3px solid var(--sk-c-600);
}

.mouth {
  width: 18px;
  position: absolute;
  height: 9px;
  border-radius: 100%;
  left: 53px;
  top: 57px;
  transform: rotate(316deg);
  border: 3px solid transparent;
  border-bottom-color: var(--sk-c-600);
}

.facehair {
  width: 42px;
  position: absolute;
  height: 23px;
  border-radius: 100%;
  left: 1px;
  top: -5px;
  transform: rotate(47deg);
  border-bottom: 3px solid var(--h-c);
}
.facehair:nth-child(6) {
  width: 62px;
  height: 45px;
  left: -4px;
  top: -28px;
  transform: rotate(39deg);
}

/* -----------------------hair------------------- */

.hair {
  position: absolute;
  width: 111px;
  height: 116px;
  border-radius: 50%;
  background: linear-gradient(127deg, transparent 0 50%, var(--h-c) 50%);
  left: 196px;
  top: 70px;
}

.hair > div {
  width: 74px;
  height: 100px;
  position: absolute;
  left: 34px;
  top: 2px;
  background-color: var(--h-c);
  border-radius: 100%;
}

.hair > div:nth-child(2) {
  left: 6px;
  top: 0px;
  border-radius: 23px;
  width: 60px;
  transform: rotate(27deg);
  background: linear-gradient(337deg, transparent 0 50%, var(--h-c) 50%);
}
.hair > div:nth-child(3) {
  left: -3px;
  top: 22px;
  border-radius: 73px;
  width: 101px;
  transform: rotate(27deg);
  background-color: var(--h-c);
}
.hair > div:nth-child(4) {
  left: -4px;
  top: 100px;
  border-radius: 113px;
  width: 48px;
  height: 38px;
  transform: rotate(307deg);
  background-color: var(--h-c);
  z-index: 1;
}

.neck {
  position: absolute;
  border-top: 50px solid transparent;
  border-bottom: 55px solid transparent;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  left: 232px;
  top: 91px;
  border-bottom-color: var(--sk-c);
}

.body {
  width: 82px;
  height: 50px;
  overflow: hidden;
  position: absolute;
  left: 216px;
  top: 290px;
  border-radius: 0 0 100% 100%;
}

.body > div {
  border-top: 188px solid var(--sk-c);
  border-bottom: 100px solid transparent;
  border-left: 40px solid transparent;
  border-right: 42px solid tra.........完整代码请登录后点击上方下载按钮下载查看

网友评论0