css实现圣诞树彩带飘动节日快乐效果代码

代码语言:html

所属分类:动画

代码描述:css实现圣诞树彩带飘动节日快乐效果代码

代码标签: 彩带 飘动 节日 快乐 效果

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

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style>
    @charset "utf-8";
@font-face {
  font-family: 'Great Vibes';
  font-style: normal;
  font-weight: 400;
  src: url(https://fonts.gstatic.com/s/greatvibes/v8/RWmMoKWR9v4ksMfaWd_JN9XFiaE.ttf) format('truetype');
}
.main-wrapper {
  background: radial-gradient(ellipse at bottom, #a90e0e 5%, #4e0303 55%, #330000 78%);
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}
.tree-container {
  display: block;
  height: 370px;
  margin: 0;
  padding: 0;
}
.text-container {
  margin: 0;
  padding: 0;
  position: absolute;
  bottom: 14%;
  left: 15%;
  right: 15%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
}
.text-container h2 {
  color: rgba(252, 251, 233, 0.85);
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  margin: 0 0 0.8em 0;
}
.text-container h2.happy {
  font-size: 3.3em;
}
.text-container a.c2 {
  display: block;
  font-size: 13px;
  width: 40px;
  height: 40px;
  background-color: rgba(252, 251, 233, 0.8);
  border-radius: 50%;
  color: #8c1313;
  text-decoration: none;
  line-height: 40px;
}
.star {
  border-radius: 0;
  border-color: #f7b93f transparent transparent transparent;
  border-style: solid;
  border-top-width: 9.23076923px;
  border-right-width: 12px;
  border-left-width: 12px;
  height: 0;
  width: 0;
  margin-bottom: 5px;
  background: transparent;
  z-index: 100;
  animation: pulsate-star 1.4s ease-in-out infinite alternate-reverse;
}
.star:before,
.star:after {
  border-color: #f7b93f transparent transparent transparent;
  border-style: solid;
  border-top-width: 9.23076923px;
  border-right-width: 12px;
  border-left-width: 12px;
  border-bottom: 0;
  content: '';
  display: block;
  height: 0;
  left: -12px;
  position: absolute;
  top: -9.23076923px;
  width: 0;
}
.star:before {
  transform: translate(15.5555555%, -15.5555555%) rotate(72deg) translateY(50%);
}
.star:after {
  transform: translate(-15.5555555%, -15.5555555%) rotate(-72deg) translateY(50%);
}
.spiral-container {
  width: 100%;
  height: 100%;
  display: block;
}
.spiral {
  position: relative;
  margin: 0;
  padding: 0;
  transform-style: preserve-3d;
}
.spiral.one {
  -webkit-animation: rotate-tree 6s infinite linear both;
          animation: rotate-tree 6s infinite linear both;
  -webkit-animation-delay: -1.7s;
          animation-delay: -1.7s;
}
.spiral.one .light {
  background: #fcfbe9;
}
.spiral.two {
  -webkit-animation: rotate-tree 7s infinite linear both;
          animation: rotate-tree 7s infinite linear both;
  -webkit-animation-delay: -1s;
          animation-delay: -1s;
}
.spiral.two .light {
  background: #e8a41d;
}
.spiral.three {
  -webkit-animation: rotate-tree 8s infinite linear both;
          animation: rotate-tree 8s infinite linear both;
  -webkit-animation-delay: -0.1s;
          animation-delay: -0.1s;
}
.spiral.three .light {
  background: #f5e393;
}
.spiral > .light-wrapper {
  border-radius: 50%;
  position: absolute;
  display: block;
  width: 6px;
  height: 6px;
  left: 50%;
  top: 50%;
  margin: -3px 0 0 -3px;
}
.spiral .stabilise {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
}
.spiral .light {
  position: absolute;
  display: block;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  border-radius: 50%;
  opacity: 1;
  -webkit-animation-name: pulsate;
          animation-name: pulsate;
  -webkit-animation-timing-function: ease-in-out;
          animation-timing-function: ease-in-out;
  -webkit-animation-iteration-count: infinite;
          animation-iteration-count: infinite;
  animation-direction: alternate-reverse;
}
.spiral.one .light-wrapper.light-wrapper-1 {
  transform: translate3d(0px, 0.1px, 0.16666667px) rotateX(90deg) rotateZ(0deg) rotateY(0deg);
  width: 0.3255814px;
  height: 0.3255814px;
}
.spiral.one .light-wrapper.light-wrapper-1 .light {
  -webkit-animation-duration: 1.03777232s;
          animation-duration: 1.03777232s;
  -webkit-animation-delay: 0.86191852s;
          animation-delay: 0.86191852s;
}
.spiral.one .light-wrapper.light-wrapper-2 {
  transform: translate3d(0.0763236px, 0.39265087px, 0.66666667px) rotateX(90deg) rotateZ(0deg) rotateY(-11deg);
  width: 0.65116279px;
  height: 0.65116279px;
}
.spiral.one .light-wrapper.light-wrapper-2 .light {
  -webkit-animation-duration: 0.65416398s;
          animation-duration: 0.65416398s;
  -webkit-animation-delay: 0.72866345s;
          animation-delay: 0.72866345s;
}
.spiral.one .light-wrapper.light-wrapper-3 {
  transform: translate3d(0.33714593px, 0.83446547px, 1.5px) rotateX(90deg) rotateZ(0deg) rotateY(-22deg);
  width: 0.97674419px;
  height: 0.97674419px;
}
.spiral.one .light-wrapper.light-wrapper-3 .light {
  -webkit-animation-duration: 1.17724083s;
          animation-duration: 1.17724083s;
  -webkit-animation-delay: 0.62278099s;
          animation-delay: 0.62278099s;
}
.spiral.one .light-wrapper.light-wrapper-4 {
  transform: translate3d(0.87142246px, 1.34187291px, 2.66666667px) rotateX(90deg) rotateZ(0deg) rotateY(-33deg);
  width: 1.30232558px;
  height: 1.30232558px;
}
.spiral.one .light-wrapper.light-wrapper-4 .light {
  -webkit-animation-duration: 0.38030666s;
          animation-duration: 0.38030666s;
  -webkit-animation-delay: 0.31848241s;
          animation-delay: 0.31848241s;
}
.spiral.one .light-wrapper.light-wrapper-5 {
  transform: translate3d(1.73664593px, 1.7983495px, 4.16666667px) rotateX(90deg) rotateZ(0deg) rotateY(-44deg);
  width: 1.62790698px;
  height: 1.62790698px;
}
.spiral.one .light-wrapper.light-wrapper-5 .light {
  -webkit-animation-duration: 1.05474822s;
          animation-duration: 1.05474822s;
  -webkit-animation-delay: 0.49671126s;
          animation-delay: 0.49671126s;
}
.spiral.one .light-wrapper.light-wrapper-6 {
  transform: translate3d(2.94894736px, 2.06487517px, 6px) rotateX(90deg) rotateZ(0deg) rotateY(-55deg);
  width: 1.95348837px;
  height: 1.95348837px;
}
.spiral.one .light-wrapper.light-wrapper-6 .light {
  -webkit-animation-duration: 1.20298705s;
          animation-duration: 1.20298705s;
  -webkit-animation-delay: 1.11764278s;
          animation-delay: 1.11764278s;
}
.spiral.one .light-wrapper.light-wrapper-7 {
  transform: translate3d(4.47637274px, 1.99300955px, 8.16666667px) rotateX(90deg) rotateZ(0deg) rotateY(-66deg);
  width: 2.27906977px;
  height: 2.27906977px;
}
.spiral.one .light-wrapper.light-wrapper-7 .light {
  -webkit-animation-duration: 0.96597017s;
          animation-duration: 0.96597017s;
  -webkit-animation-delay: 0.66295814s;
          animation-delay: 0.66295814s;
}
.spiral.one .light-wrapper.light-wrapper-8 {
  transform: translate3d(6.23596841px, 1.43968675px, 10.66666667px) rotateX(90deg) rotateZ(0deg) rotateY(-77deg);
  width: 2.60465116px;
  height: 2.60465116px;
}
.spiral.one .light-wrapper.light-wrapper-8 .light {
  -webkit-animation-duration: 0.58374047s;
          animation-duration: 0.58374047s;
  -webkit-animation-delay: 0.88895999s;
          animation-delay: 0.88895999s;
}
.spiral.one .light-wrapper.light-wrapper-9 {
  transform: translate3d(8.0950657px, 0.28268592px, 13.5px) rotateX(90deg) rotateZ(0deg) rotateY(-88deg);
  width: 2.93023256px;
  height: 2.93023256px;
}
.spiral.one .light-wrapper.light-wrapper-9 .light {
  -webkit-animation-duration: 0.35593732s;
          animation-duration: 0.35593732s;
  -webkit-animation-delay: 0.3474119s;
          animation-delay: 0.3474119s;
}
.spiral.one .light-wrapper.light-wrapper-10 {
  transform: translate3d(9.87688341px, -1.56434465px, 16.66666667px) rotateX(90deg) rotateZ(0deg) rotateY(-99deg);
  width: 3.25581395px;
  height: 3.25581395px;
}
.spiral.one .light-wrapper.light-wrapper-10 .light {
  -webkit-animation-duration: 0.55988247s;
          animation-duration: 0.55988247s;
  -webkit-animation-delay: 0.9995478s;
          animation-delay: 0.9995478s;
}
.spiral.one .light-wrapper.light-wrapper-11 {
  transform: translate3d(11.37028071px, -4.13844373px, 20.16666667px) rotateX(90deg) rotateZ(0deg) rotateY(-110deg);
  width: 3.58139535px;
  height: 3.58139535px;
}
.spiral.one .light-wrapper.light-wrapper-11 .light {
  -webkit-animation-duration: 1.15653407s;
          animation-duration: 1.15653407s;
  -webkit-animation-delay: 1.29472094s;
          animation-delay: 1.29472094s;
}
.spiral.one .light-wrapper.light-wrapper-12 {
  transform: translate3d(12.34320913px, -7.41654828px, 24px) rotateX(90deg) rotateZ(0deg) rotateY(-121deg);
  width: 3.90697674px;
  height: 3.90697674px;
}
.spiral.one .light-wrapper.light-wrapper-12 .light {
  -webkit-animation-duration: 0.83058296s;
          animation-duration:.........完整代码请登录后点击上方下载按钮下载查看

网友评论0