-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
58 lines (58 loc) · 2 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Noisy Shapes</title>
<style type="text/css">
body {
background-color: hsl(25, 35%, 93%);
margin: 0;
padding: 0 5dvw;
}
main {
display: flex;
justify-content: center;
align-items: center;
height: 100dvh;
}
svg.shape {
max-width: 80dvh;
width: 100%; /* Needed for Safari */
}
</style>
</head>
<body>
<svg width="0" height="0" style="display: block;">
<defs>
<filter id="noise">
<feTurbulence
type="fractalNoise"
baseFrequency="19.5"
numOctaves="10"
result="turbulence"
/>
<feComposite operator="in" in="turbulence" in2="SourceAlpha" result="composite"/>
<feColorMatrix in="composite" type="luminanceToAlpha" />
<feBlend in="SourceGraphic" in2="composite" mode="color-burn" />
</filter>
<mask id="shape-mask">
<linearGradient id="fade-gradient" gradientTransform="rotate(0)">
<stop offset="0%" stop-color="black" stop-opacity="0.6" />
<stop offset="65%" stop-color="white" stop-opacity="0.9" />
<stop offset="75%" stop-color="white" stop-opacity="1" />
</linearGradient>
<use href="#circle" fill="url('#fade-gradient')" />
</mask>
<ellipse id="circle" cx="50" cy="50" rx="50" ry="50" />
</defs>
</svg>
<main>
<svg class="shape" viewbox="0 0 200 175">
<use href="#circle" fill="hsl(269, 65%, 52%)" x="50" y="35" mask="url(#shape-mask)" filter="url('#noise')" />
<use href="#circle" fill="hsl(337, 92%, 69%)" x="0" y="0" mask="url(#shape-mask)" filter="url('#noise')" transform="rotate(180)" transform-origin="50 50" />
<use href="#circle" fill="hsl(20, 92%, 64%)" x="100" y="75" mask="url(#shape-mask)" filter="url('#noise')" transform="rotate(180)" transform-origin="145 120" />
</svg>
</main>
</body>
</html>