• css3圣诞雪景球


    本来想多做几个了 无奈最近太忙 于是模仿做了一个在codepen看到的圣诞雪景球   算是送给自己的圣诞礼物

    演示地址:http://www.qdfuns.com/notes/26668/d5e1776243f8272941de3e65dd094db2.html

    想看原文的地址在这里http://codepen.io/chilliconcode/pen/rWpvOe

      1 <html lang="en">
      2 <head>
      3     <meta charset="UTF-8">
      4     <title>CSS动画圣诞雪景球</title>
      5     <embed src="age/sd.mp3" autostart="true" loop="-1" controls="ControlPanel" width="0" height="0">
      6 <style type="text/css">
      7 @charset "UTF-8";
      8 body{
      9     background:#4bb093;
     10 }
     11 ul,ol,li{
     12     list-style-type:none;
     13 }
     14 body,div,ul,li,p{ margin:0; padding:0;}
     15 img{border:0;}
     16 .snow_globe{
     17     width: 400px;
     18     height: 400px;
     19     margin:100px auto;
     20     position: relative;
     21 }
     22 .circular_white{
     23     width: 400px;
     24     height: 400px;
     25     border-radius:100%;
     26     position: absolute;
     27     background:rgba(255, 255, 255, 0.5);
     28 }
     29 .cir_cen{
     30     width: 380px;
     31     height: 380px;
     32     z-index: 3;
     33     margin-top: 10px;
     34     margin-left: 10px;
     35     display: inline-block;
     36     border-radius:100%;
     37     position: absolute;
     38     background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 68%, #f5f5f5 68%, #ebeff5 79%, #c7d7e0 100%);
     39 }
     40 .step{
     41     width: 356px;
     42     height: 40px;
     43     background: #fff;
     44     position: relative;
     45     top: 236px;
     46     border-radius: 100%;
     47     margin: auto;
     48 }
     49 .son_btm{
     50     width: 110px;
     51     height: 110px;
     52     margin:150px 0 0 135px;
     53     border-radius: 100%;
     54     position: absolute;
     55     background:#fff;
     56     box-shadow: -5px 10px 20px -10px #cccccc;
     57     z-index: 99;
     58 }
     59 .son_top{
     60     width: 80px;
     61     height: 80px;
     62     margin:90px 0 0 150px;
     63     border-radius: 100%;
     64     position: absolute;
     65     background:#fff;
     66     z-index: 99;
     67 }
     68 .eye{
     69     width: 6px;
     70     height: 6px;
     71     z-index:99;
     72     background:#613900;
     73     border-radius:100%;
     74     margin-top: 110px;
     75     margin-left: 170px;
     76     position: absolute;
     77 }
     78 .eye_2{
     79     width: 8px;
     80     height: 8px;
     81     z-index: 99;
     82     background: #613900;
     83     border-radius: 100%;
     84     margin-top: 108px;
     85     margin-left: 190px;
     86     position: absolute;
     87 }
     88 .nose{
     89     background-color: transparent;
     90     display: inline-block;
     91     position: absolute;
     92     top: 120px;
     93     left: 140px;
     94     border-top: 8px solid transparent;
     95     border-bottom: 8px solid transparent;
     96     border-right: 40px solid #f97d00;
     97     border-radius: 30px;
     98     z-index: 99;
     99 }
    100 .scarf{
    101     width: 70px;
    102     height: 10px;
    103     background-color: #ec4800;
    104     position: absolute;
    105     top: 150px;
    106     left: 155px;
    107     z-index: 99;
    108     transform: rotate(3deg);
    109     border-radius: 30%;
    110 }
    111 .scarf_2{
    112     width: 10px;
    113     height: 30px;
    114     background-color: #d34100;
    115     display: inline-block;
    116     position: absolute;
    117     top: 145px;
    118     left: 200px;
    119     z-index: 99;
    120     transform: rotate(-25deg);
    121     border-radius: 30%;
    122 }
    123 .hat{
    124 width: 100px;
    125     height: 15px;
    126     border-radius: 50%;
    127     background-color: #613900;
    128     position: absolute;
    129     z-index: 99;
    130     top: 90px;
    131     left: 145px;
    132     transform: rotate(10deg);
    133 }
    134 .hat_2{
    135     width: 80px;
    136     height: 40px;
    137     background-color: #613900;
    138     display: inline-block;
    139     position: relative;
    140     top: -35px;
    141     left: 10px;
    142 }
    143 .ribbon {
    144     height: 10px;
    145     width: 80px;
    146     background-color: #ec4800;
    147     position: relative;
    148     top: -65px;
    149     left: 10px;
    150     z-index: 6;
    151 }
    152 .hat_3{
    153     z-index: 5;
    154     display: inline-block;
    155     position: relative;
    156     top: -100px;
    157     left: 10px;
    158     width: 80px;
    159     height: 5px;
    160     border-radius: 50%;
    161     background-color: #3b2200;
    162 }
    163 .shape{
    164     width: 5px;
    165     height: 5px;
    166     margin-top: 140px;
    167     margin-left: 50px;
    168     z-index: 99;
    169     border-radius: 100%;
    170     position: absolute;
    171     border-radius:100%;
    172     box-shadow: 119px 0px 0px 0px #ed5614, 125px 2px 0px 0px #ed5614, 132px 2px 0px 0px #ed5614, 138px -2px 0px 0px #ed5614;
    173 }
    174 .shape_1{
    175     width: 10px;
    176     height: 10px;
    177     margin-top: 160px;
    178     margin-left: 50px;
    179     z-index: 99;
    180     position: absolute;
    181     border-radius: 100%;
    182     box-shadow: 130px 15px 0px -2px #613900, 130px 28px 0px -1px #613900, 130px 41px 0px 0px #613900, 130px 55px 0px 0px #613900;
    183 }
    184 
    185 
    186 .snowflake{
    187   overflow: hidden;
    188 }
    189 
    190 .snow {
    191   width: 380px;
    192   height: 350px;
    193   border-radius: 100%;
    194   position: absolute;
    195   top: 10px;
    196   left: 10px;
    197   overflow: hidden;
    198   opacity: 0.8;
    199 }
    200 /* 雪花是胡乱写的... 这个方法模仿自http://codepen.io/chilliconcode/pen/rWpvOe */
    201 .snow_1 {
    202     color: #fff;
    203     opacity: 0.5;
    204     animation: sfanim linear 30s;
    205     -webkit-animation: sfanim linear 30s;
    206     animation-iteration-count: infinite;
    207     -webkit-animation-iteration-count: infinite;
    208     text-shadow:0px 20px, -6px 20px, -13px 20px, -20px 18px, -19px 20px, 380px 171px, 550px 80px, 269px 50px, 20px 151px, 221px 344px, 229px 136px, 237px 280px, 303px 30px, 211px 314px, 378px 285px, 388px 117px, 70px 295px, 149px 318px, 96px 66px, 129px 217px, 138px 218px, 241px 310px, 231px 368px, 18px 327px, 173px 213px, 118px 10px, 246px 208px, 159px 244px, 268px 376px, 167px 262px, 85px 238px, 277px 47px, 386px 192px, 259px 364px, 325px 327px, 279px 201px, 303px 517px, 32px 489px, 323px 519px, 98px 583px, 126px 635px, 0px 571px, 380px 461px, 269px 417px, 0px 551px, 121px 744px, 229px 536px, 237px 680px, 303px 430px, 211px 714px, 378px 685px, 10px 687px, 93px 745px, 292px 724px, 223px 692px, 156px 560px, 253px 458px, 205px 595px, 145px 506px, 79px 712px, 182px 759px, 279px 499px, 349px 524px, 5px 433px, 216px 547px,120px 666px, 50px 666px, 214px 421px, 364px 404px, 202px 652px, 354px 632px, 312px 500px;
    209 }
    210 
    211 .snow_2 {
    212     color: #fff;
    213     animation: sfanim linear 15s;
    214     -webkit-animation: sfanim linear 15s;
    215     animation-iteration-count: infinite;
    216     -webkit-animation-iteration-count: infinite;
    217     text-shadow: 600px 500px, 50px 625px, 351px 741px, 20px 632px, 250px 652px, 388px 698px, 235px 762px, 50px 714px, 385px 742px, 185px 635px, 156px 560px, 364px 485px, 340px 620px, 394px 428px, 187px 748px, 217px 624px, 356px 630px, 33px 758px, 238px 762px, 357px 586px, 253px 798px, 68px 786px, 164px 662px, 119px 598px, 221px 557px, 126px 537px, 282px 503px, 11px 455px, 219px 632px, 60px 597px, 41px 529px, 247px 451px, 217px 644px, 304px 400px, 214px 421px, 287px 757px, 76px 404px, 376px 735px, 169px 572px, 245px 790px, 66px 717px, 375px 85px, 11px 289px, 254px 384px, 5px 286px, 266px 305px, 388px 298px, 180px 307px, 36px 13px, 74px 295px, 238px 290px, 384px 235px, 1px 294px, 45px 138px, 131px 350px, 258px 120px, 157px 305px, 96px 349px, 325px 319px, 132px 288px, 167px 111px,  41px 129px, 247px 51px, 217px 244px, 304px 0px, 214px 21px, 287px 357px, 76px 4px, 376px 335px, 169px 172px, 245px 390px, 66px 317px;
    218 }
    219 
    220 @keyframes sfanim {
    221   0% {
    222     -webkit-transform: translate(0px, -500px);
    223             transform: translate(0px, -500px);
    224   }
    225   100% {
    226     -webkit-transform: translate(0px, 100px);
    227             transform: translate(0px, 100px);
    228   }
    229 }
    230 
    231 @-webkit-keyframes sfanim {
    232   0% {
    233     -webkit-transform: translate(0px, -500px);
    234             transform: translate(0px, -500px);
    235   }
    236   100% {
    237     -webkit-transform: translate(0px, 100px);
    238             transform: translate(0px, 100px);
    239   }
    240 }
    241 .toum {
    242     width: 400px;
    243     height: 400px;
    244     border-radius: 100%;
    245     position: absolute;
    246     background:linear-gradient(315deg, rgba(255, 255, 255,0.9) 0%, rgba(253, 251, 251, 0.2) 47%, rgb(191, 253, 239) 100%);
    247     background:-webkit-linear-gradient(315deg, rgba(255, 255, 255,0.9) 0%, rgba(253, 251, 251, 0.2) 47%, rgb(191, 253, 239) 100%); 
    248 }
    249 
    250 .arch {
    251     width: 560px;
    252     height: 133.33333px;
    253     position: absolute;
    254     bottom: -342px;
    255     margin-left: -80px;
    256     position: relative;
    257     -webkit-clip-path: polygon(30% 10%, 70% 10%, 80% 100%, 20% 100%);
    258     z-index: 99999;
    259     overflow: hidden;
    260 }
    261 .arch_1 {
    262     height: 180px;
    263     width: 400px;
    264     border-radius: 100%;
    265     border: 20px solid #ffcb12;
    266     position: absolute;
    267     bottom: 74px;
    268     left: 60px;
    269 }
    270 .arch_2 {
    271     height: 180px;
    272     width: 400px;
    273     border-radius: 100%;
    274     border: 40px solid #ebbb11;
    275     position: absolute;
    276     bottom: 35px;
    277     left: 46px;
    278 }
    279 .shadow{
    280     width: 400px;
    281     height: 40px;
    282     background: #449e85;
    283     position: relative;
    284     top: 280px;
    285     border-radius: 100%;
    286     margin: auto;
    287 }
    288 </style>
    289 </head>
    290 <body>
    291 <div class="snow_globe">
    292     <div class="circular_white"></div>
    293     <div class="cir_cen">
    294         <div class="step"></div>
    295     </div>
    296     <div class="snowman">
    297         <div class="son_btm"></div>
    298         <div class="son_top"></div>
    299         <div class="shape"></div>
    300         <div class="shape_1"></div>
    301         <div class="hat">
    302             <div class="hat_2"></div>
    303             <div class="ribbon"></div>
    304             <div class="hat_3"></div>
    305         </div>
    306         <div class="eye"></div>
    307         <div class="eye_2"></div>
    308         <div class="nose"></div>
    309         <div class="scarf"></div>
    310         <div class="scarf_2"></div>
    311     </div>
    312     <div class="snowflake">
    313         <div class="snow">
    314           <div class="snow_1">
    315             <p>*</p>
    316           </div>
    317           <div class="snow_2">
    318             <p>*</p>
    319           </div>
    320         </div>
    321    </div>
    322    <div class="toum"></div>
    323     <div class="arch">
    324         <div class="arch_1"></div>
    325         <div class="arch_2"></div>
    326     </div>
    327     <div class="shadow"></div>
    328 </div>
    329 
    330 </body>
    331 </html>
    View Code

      

  • 相关阅读:
    Seafile和Nextcloud相比较哪个好用
    opencv3.1+cmake+mingw5.3+QT5编译
    算法导论第三版--动态规划与贪心算法
    Linux 网卡特性配置ethtool详解
    算法导论第三版--红黑树
    算法导论第三版--二叉搜索树
    realloc在aarch64_be-gcc的奇怪表现
    算法导论第三版--桶排序
    算法导论第三版--计数,基数排序
    算法导论第三版--插入排序和归并排序
  • 原文地址:https://www.cnblogs.com/wlyj/p/6216710.html
Copyright © 2020-2023  润新知