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.83058296s;
-webkit-animation-delay: 0.34976387s;
animation-delay: 0.34976387s;
}
.spiral.one .light-wrapper.light-wrapper-13 {
transform: translate3d(12.55914755px, -11.30830725px, 28.16666667px) rotateX(90deg) rotateZ(0deg) rotateY(-132deg);
width: 4.23255814px;
height: 4.23255814px;
}
.spiral.one .light-wrapper.light-wrapper-13 .light {
-webkit-animation-duration: 1.13944545s;
animation-duration: 1.13944545s;
-webkit-animation-delay: 0.62885279s;
animation-delay: 0.62885279s;
}
.spiral.one .light-wrapper.light-wrapper-14 {
transform: translate3d(11.79557445px, -15.653256px, 32.66666667px) rotateX(90deg) rotateZ(0deg) rotateY(-143deg);
width: 4.55813953px;
height: 4.55813953px;
}
.spiral.one .light-wrapper.light-wrapper-14 .light {
-webkit-animation-duration: 0.92869412s;
animation-duration: 0.92869412s;
-webkit-animation-delay: 0.82962568s;
animation-delay: 0.82962568s;
}
.spiral.one .light-wrapper.light-wrapper-15 {
transform: translate3d(9.8633508px, -20.22286604px, 37.5px) rotateX(90deg) rotateZ(0deg) rotateY(-154deg);
width: 4.88372093px;
height: 4.88372093px;
}
.spiral.one .light-wrapper.light-wrapper-15 .light {
-webkit-animation-duration: 1.20085615s;
animation-duration: 1.20085615s;
-webkit-animation-delay: 0.66328483s;
animation-delay: 0.66328483s;
}
.spiral.one .light-wrapper.light-wrapper-16 {
transform: translate3d(6.62576755px, -24.72770115px, 42.66666667px) rotateX(90deg) rotateZ(0deg) rotateY(-165deg);
width: 5.20930233px;
height: 5.20930233px;
}
.spiral.one .light-wrapper.light-wrapper-16 .light {
-webkit-animation-duration: 0.77290538s;
animation-duration: 0.77290538s;
-webkit-animation-delay: 0.89990483s;
animation-delay: 0.89990483s;
}
.spiral.one .light-wrapper.light-wrapper-17 {
transform: translate3d(2.01596209px, -28.82960105px, 48.16666667px) rotateX(90deg) rotateZ(0deg) rotateY(-176deg);
width: 5.53488372px;
height: 5.53488372px;
}
.spiral.one .light-wrapper.light-wrapper-17 .light {
-webkit-animation-duration: 0.66121439s;
animation-duration: 0.66121439s;
-webkit-animation-delay: 0.50371079s;
animation-delay: 0.50371079s;
}
.spiral.one .light-wrapper.light-wrapper-18 {
transform: translate3d(-3.94856673px, -32.15849531px, 54px) rotateX(90deg) rotateZ(0deg) rotateY(-187deg);
width: 5.86046512px;
height: 5.86046512px;
}
.spiral.one .light-wrapper.light-wrapper-18 .light {
-webkit-animation-duration: 0.39620084s;
animation-duration: 0.39620084s;
-webkit-animation-delay: 1.27220592s;
animation-delay: 1.27220592s;
}
.spiral.one .light-wrapper.light-wrapper-19 {
transform: translate3d(-11.1555135px, -34.33314024px, 60.16666667px) rotateX(90deg) rotateZ(0deg) rotateY(-198deg);
width: 6.18604651px;
height: 6.18604651px;
}
.spiral.one .light-wrapper.light-wrapper-19 .light {
-webkit-animation-duration: 0.99881464s;
animation-duration: 0.99881464s;
-webkit-animation-delay: 1.28718052s;
animation-delay: 1.28718052s;
}
.spiral.one .light-wrapper.light-wrapper-20 {
transform: translate3d(-19.39238481px, -34.98478829px, 66.66666667px) rotateX(90deg) rotateZ(0deg) rotateY(-209deg);
width: 6.51162791px;
height: 6.51162791px;
}
.spiral.one .light-wrapper.light-wrapper-20 .light {
-webkit-animation-duration: 1.25361238s;
animation-duration: 1.25361238s;
-webkit-animation-delay: 0.94828828s;
animation-delay: 0.94828828s;
}
.spiral.one .light-wrapper.light-wrapper-21 {
transform: translate3d(-28.34693359px, -33.78255994px, 73.5px) rotateX(90deg) rotateZ(0deg) rotateY(-220deg);
width: 6.8372093px;
height: 6.8372093px;
}
.spiral.one .light-wrapper.light-wrapper-21 .light {
-webkit-animation-duration: 1.08686529s;
animation-duration: 1.08686529s;
-webkit-animation-delay: 0.99155211s;
animation-delay: 0.99155211s;
}
.spiral.one .light-wrapper.light-wrapper-22 {
transform: translate3d(-37.61386453px, -30.45910693px, 80.66666667px) rotateX(90deg) rotateZ(0deg) rotateY(-231deg);
width: 7.1627907px;
height: 7.1627907px;
}
.spiral.one .light-wrapper.light-wrapper-22 .light {
-webkit-animation-duration: 0.55154018s;
animation-duration: 0.55154018s;
-webkit-animation-delay: 0.35083849s;
animation-delay: 0.35083849s;
}
.spiral.one .light-wrapper.light-wrapper-23 {
transform: translate3d(-46.70792766px, -24.83504567px, 88.16666667px) rotateX(90deg) rotateZ(0deg) rotateY(-242deg);
width: 7.48837209px;
height: 7.48837209px;
}
.spiral.one .light-wrapper.light-wrapper-23 .light {
-webkit-animation-duration: 0.8415227s;
animation-duration: 0.8415227s;
-webkit-animation-delay: 0.60508142s;
animation-delay: 0.60508142s;
}
.spiral.one .light-wrapper.light-wrapper-24 {
transform: translate3d(-55.08315394px, -16.84061019px, 96px) rotateX(90deg) rotateZ(0deg) rotateY(-253deg);
width: 7.81395349px;
height: 7.81395349px;
}
.spiral.one .light-wrapper.light-wrapper-24 .light {
-webkit-animation-duration: 0.30945689s;
animation-duration: 0.30945689s;
-webkit-animation-delay: 1.08130135s;
animation-delay: 1.08130135s;
}
.spiral.one .light-wrapper.light-wrapper-25 {
transform: translate3d(-62.15761846px, -6.53302895px, 104.16666667px) rotateX(90deg) rotateZ(0deg) rotateY(-264deg);
width: 8.13953488px;
height: 8.13953488px;
}
.spiral.one .light-wrapper.light-wrapper-25 .light {
-webkit-animation-duration: 0.91367963s;
animation-duration: 0.91367963s;
-webkit-animation-delay: 0.9459824s;
animation-delay: 0.9459824s;
}
.spiral.one .light-wrapper.light-wrapper-26 {
transform: translate3d(-67.34276159px, 5.89172821px, 112.66666667px) rotateX(90deg) rotateZ(0deg) rotateY(-275deg);
width: 8.46511628px;
height: 8.46511628px;
}
.spiral.one .light-wrapper.light-wrapper-26 .light {
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0