File size: 5,016 Bytes
c3d5f0d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html>
<html>
<head>
  <style>body {
  background-color:#e5e5e5;
  overflow: hidden;
    display: flex;
  align-items: center;
  justify-content: center;    
}

body,
html {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

svg{
  width:100%;
  height:100%;
  visibility:hidden;
 
}

#rockClone{
  mix-blend-mode: overlay;
}
</style>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.0/TweenMax.min.js"></script>
</head>
<body>
   <svg class="mainSVG" version="1.1"
	 xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
	 x="0px" y="0px" width="600px" height="600px" viewBox="0 0 600 600" >
<defs>
    <filter id="edgeClean" color-interpolation-filters="sRGB">
    <feComponentTransfer>
      <feFuncA type="table" tableValues="0 .5 1 1" />
    </feComponentTransfer>
  </filter>   
<filter  id="goo" color-interpolation-filters="sRGB">
      <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" />
      <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 21 -9" result="cm" />
    
        <feComposite in="SourceGraphic" in2="cm" />
  	</filter> 
  <filter id="rockFilter">
<!--<feColorMatrix  in="SourceGraphic" type="hueRotate" values="30" />-->
    <feColorMatrix in="SourceGraphic" type="matrix" values="1 0 0 0
0 0 1 0 
0 0 1 0
0 0 0 0
0 0 1 0"/>
  </filter>
  <filter id="reflection">
      <feTurbulence id="turbulence" baseFrequency="0.01 0.8" type="fractalNoise" stitchTiles="stitch" numOctaves="1" seed="0"/>
      <feDisplacementMap in="SourceGraphic" scale="50" />
      <feGaussianblur stdDeviation="0.7" >
      </feGaussianblur>
    </filter>
  <clipPath id="rippleMask">
       <rect width="600" height="200" y="300" />

  </clipPath>
</defs>
   <g id="rippleGroup" filter="url(#goo)" fill="none" stroke="#6BCCD5" stroke-width="2" stroke-miterlimit="10"  >
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>
<ellipse  cx="300" cy="310" rx="36" ry="12"/>

     
   </g>
<g id="rockGroup" filter="url(#edgeClean)">
	<path fill="#333333" d="M404.6,310.7l-65-76.6l35-5.8C374.6,228.3,396.3,285.7,404.6,310.7z"/>
	<path fill="#383838" d="M339.5,234.1l64.9,76.6c-18.1,9.2-47.4,13-79.4,13.6v-0.1L339.5,234.1z"/>
	<path fill="#3D3D3D" d="M374.6,228.3l-35,5.8l-75.8-35.8L374.6,228.3z"/>
	<path fill="#3F3F3F" d="M339.5,234.1L325,324.2v0.1c-8,0.2-16.4,0.1-24.6-0.1l-68.6-49.6L339.5,234.1z"/>
	<path fill="#474747" d="M339.6,234.1l-107.7,40.5l31.9-76.3L339.6,234.1z"/>
	<path fill="#474747" d="M231.9,274.6l68.6,49.6c-45.9-1.3-89.3-8.1-98.3-13.5l-5.8-14.2L231.9,274.6z"/>
	<path fill="#505050" d="M263.9,198.3l-31.9,76.3l-35.5,21.9L263.9,198.3z"/>
</g>
</svg>

  <script>var xmlns = "http://www.w3.org/2000/svg",
  select = function(s) {
    return document.querySelector(s);
  },
  selectAll = function(s) {
    return document.querySelectorAll(s);
  },
  mainSVG = select('.mainSVG'),
    rockGroup = select('#rockGroup'),
  rippleGroup = select('#rippleGroup'),
    rockClone = rockGroup.cloneNode(true);

 
mainSVG.appendChild(rockClone);
mainSVG.appendChild(rockGroup)
TweenMax.set(rockClone, {
  transformOrigin:'50% 90%',
  scaleY:-0.5,
  alpha:0.4,
  filter:'url(#reflection)'
})
rockClone.id="rockClone"


TweenMax.set('svg', {
  visibility:'visible',
  scale:1.1
})
TweenMax.set('#rockClone path', {
  filter:'url(#rockFilter)'
})

var tl = new TimelineMax({repeat:0});
tl.staggerFromTo('#rippleGroup ellipse', 32, {
  cycle:{
  attr:function(i){
    var destRX = randomBetween(15, 60);
    TweenMax.set(this, {
      strokeWidth:randomBetween(0, 4),
      stroke:"hsl(+=" +randomBetween(13, 25)+ ", +=0%, +=0%)"
  })
    return {rx:destRX, ry:0};
  }  }
},{
  cycle:{
  attr:function(i){
   var destRX = randomBetween(200, 300);
    return {rx:destRX, ry:destRX/6};   
  }  },
  ease:Sine.easeOut,
  stroke:'#e5e5e5',
  repeat:-1
}, 6)
.to('#rippleGroup ellipse', tl.duration(),{
  alpha:0
},'-='+ tl.duration())

tl.time(2000);

TweenMax.to(turbulence, 10, {
  attr:{
    seed:80
  },
  repeat:-1,
  yoyo:true,
  ease:Linear.easeNone
})

function randomBetween(min,max)
{
    return Math.floor(Math.random()*(max-min+1)+min);
}</script>
</body>
</html>