JSDM

HTML

x
 
1
<div class="circle"></div>
2
<div class="circle"></div>
3
<div class="circle"></div>
4
<div class="circle"></div>
5
<div class="circle"></div>
6
<div class="circle"></div>
7
<div class="circle"></div>
8
<div class="circle"></div>
9
<div class="circle"></div>
10
<div class="circle"></div>
11
<div class="circle"></div>
12
<div class="circle"></div>
13
14
<svg id="moon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 28 28">
15
  <path d="M20.51,18.49c1.23,0,2.42-0.26,3.57-0.79c0.42-0.19,0.8-0.12,1.12,0.2c0.149,0.149,0.24,0.319,0.27,0.529
16
      c0.04,0.21,0.021,0.41-0.069,0.601c-0.98,2.109-2.45,3.8-4.431,5.069C19,25.36,16.85,25.99,14.51,25.99
17
      c-1.62,0-3.18-0.311-4.65-0.95c-1.48-0.64-2.76-1.49-3.83-2.56C4.95,21.4,4.1,20.13,3.47,18.65c-0.64-1.48-0.96-3.03-0.96-4.66
18
      c0-1.59,0.3-3.12,0.9-4.57c0.6-1.45,1.41-2.71,2.44-3.77C6.87,4.59,8.1,3.73,9.53,3.08c1.42-0.65,2.93-1.01,4.53-1.07
19
      c0.459-0.02,0.77,0.18,0.95,0.61c0.19,0.42,0.11,0.8-0.229,1.12c-0.9,0.82-1.58,1.76-2.06,2.84c-0.47,1.08-0.71,2.21-0.71,3.41
20
      c0,1.54,0.38,2.97,1.14,4.27c0.76,1.3,1.791,2.33,3.1,3.09C17.55,18.11,18.97,18.49,20.51,18.49z"/>
21
</svg>
!

CSS

xxxxxxxxxx
107
 
1
$colors: #F4C3D1, #E4A1BD, #D17FA8, #BA6090, #954B76, #743562, #5A2C56, #54214F, #461B46, #320F3B, #2C0A37, #250831;
2
$r-start: 30px;
3
$r-fade: 250px;
4
5
/* --------------------------------- 
6
  Mixins 
7
--------------------------------- */
8
%center-align {
9
  -webkit-transform: translate(-50%, -50%);
10
  -ms-transform: translate(-50%, -50%);
11
  transform: translate(-50%, -50%);
12
}
13
14
@mixin animation($name, $time) {
15
  -webkit-animation: $name $time infinite;
16
     -moz-animation: $name $time infinite;
17
       -o-animation: $name $time infinite;
18
          animation: $name $time infinite;
19
}
20
21
@mixin keyframes($name) {
22
  @-webkit-keyframes #{$name} {
23
    @content; 
24
  }
25
  @-moz-keyframes #{$name} {
26
    @content;
27
  }
28
  @-ms-keyframes #{$name} {
29
    @content;
30
  }
31
  @keyframes #{$name} {
32
    @content;
33
  } 
34
}
35
36
#moon {
37
  position: absolute;
38
  fill: #FCF8F4;
39
  fill-rule: evenodd;
40
  width: 20px;
41
  height: 20px;
42
  left: 50%;
43
  top: 50%;
44
  @extend %center-align;
45
}
46
47
/* --------------------------------- 
48
  Circles 
49
--------------------------------- */
50
.circle {
51
  width: $r-start;
52
  height: $r-start;
53
  border-radius: 50%;
54
  background-color: nth($colors, 1);
55
  position: absolute;
56
  opacity: 0;
57
  left: 50%;
58
  top: 50%;
59
  @extend %center-align;
60
  box-shadow: 0 0 2px rgba(0,0,0,0.1);
61
}
62
63
@for $i from 0 through 11 {
64
  .circle:nth-child(#{11}n+#{$i}) {
65
    @include animation(undulate, 5s);
66
    -webkit-animation-delay: $i * 500ms;
67
            animation-delay: $i * 500ms;
68
  }
69
}
70
71
72
/* --------------------------------- 
73
  Animation 
74
--------------------------------- */
75
@include keyframes(undulate) {
76
  0% {
77
    width: $r-start;
78
    height: $r-start;
79
    opacity: 1;
80
  }
81
  
82
  @for $i from 1 through length($colors) {
83
    $percent: 7% + 7 * $i;
84
    
85
    #{$percent} { background-color: nth($colors, $i); }
86
  }
87
88
  100% {
89
    background-color: #150525;
90
    width: $r-fade;
91
    height: $r-fade;
92
    opacity: 0;
93
  }
94
}
95
96
/* --------------------------------- 
97
  Global 
98
--------------------------------- */
99
html,
100
body {
101
  padding: 0;
102
  margin: 0;
103
  width: 100%;
104
  height: 100%;
105
  overflow: hidden;
106
  background-color: #150525;
107
}
!
? ?
? ?
必须是有效的URL
+ 添加另一个资源

JS

xxxxxxxxxx
13
 
1
var circles = document.getElementsByClassName('circle');
2
3
var addListener = function(circle, i) {
4
 circle.addEventListener('animationend', 
5
  function() {
6
    console.log('done ');
7
    //circles[i].style.zIndex = '1';
8
  }, false);
9
}
10
11
for(i = 0; i < circles.length - 1; i++) {
12
 addListener(circles[i], i);
13
}
!
必须是有效的URL
+ 添加另一个资源
Close

文件管理 点击文件查看URL

图片

  1. 暂无文件

CSS

  1. 暂无文件

JavaScript

  1. 暂无文件

其他

  1. 暂无文件
拖动文件到上面的区域或者:
加载中 ..................