-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
100 lines (92 loc) · 3.32 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Squircle Generator</title>
<link rel="icon" type="image/png" href="assets/squircle.png">
<meta name="description" content="CSS Squircle Polygon Generator">
<link rel="stylesheet" href="assets/styles.css">
<script type="module" src="assets/app.mjs"></script>
</head>
<body>
<div class="wrapper">
<div class="controls">
<h1 class="heading">Squircle</h1>
<div class="input-control">
<div class="input-header">
<label for="radius-input">Radius</label>
<span id="radius-output"></span>
</div>
<input id="radius-input" type="range" min="0" max="200" step="1" value="20">
</div>
<div class="input-control">
<div class="input-header">
<label for="length-input">Length</label>
<span id="length-output"></span>
</div>
<input id="length-input" type="range" min="0.5" step="0.01" max="1" value="1">
</div>
<div class="input-control">
<div class="input-header">
<label for="steps-input">Steps</label>
<span id="steps-output"></span>
</div>
<input id="steps-input" type="range" min="1" step="1" max="100" value="30">
</div>
<div class="code-wrapper">
<code id="code"></code>
<i id="copy-button" class="gg-copy" title="Copy to clipboard"></i>
</div>
<div class="bottom-action">
<a id="border-radius-button" href="#">Toggle border radius visibility</a>
</div>
</div>
<div class="preview">
<div id="rect">
<div id="rect-dimensions"></div>
<i id="resize-button" class="gg-arrows-expand-right" title="Resize rect"></i>
</div>
</div>
</div>
<!-- https://codepen.io/ksenia-k/pen/jXbWaJ -->
<svg class="background" preserveAspectRatio="xMidYMid slice" viewBox="10 10 80 80">
<defs>
<style>
@keyframes rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.out-top {
animation: rotate 10s linear infinite;
transform-origin: 13px 25px;
}
.in-top {
animation: rotate 5s linear infinite;
transform-origin: 13px 25px;
}
.out-bottom {
animation: rotate 15s linear infinite;
transform-origin: 84px 93px;
}
.in-bottom {
animation: rotate 5s linear infinite;
transform-origin: 84px 93px;
}
</style>
</defs>
<path fill="#9b5de5" class="out-top"
d="M37-5C25.1-14.7,5.7-19.1-9.2-10-28.5,1.8-32.7,31.1-19.8,49c15.5,21.5,52.6,22,67.2,2.3C59.4,35,53.7,8.5,37-5Z" />
<path fill="#f15bb5" class="in-top"
d="M20.6,4.1C11.6,1.5-1.9,2.5-8,11.2-16.3,23.1-8.2,45.6,7.4,50S42.1,38.9,41,24.5C40.2,14.1,29.4,6.6,20.6,4.1Z" />
<path fill="#00bbf9" class="out-bottom"
d="M105.9,48.6c-12.4-8.2-29.3-4.8-39.4.8-23.4,12.8-37.7,51.9-19.1,74.1s63.9,15.3,76-5.6c7.6-13.3,1.8-31.1-2.3-43.8C117.6,63.3,114.7,54.3,105.9,48.6Z" />
<path fill="#00f5d4" class="in-bottom"
d="M102,67.1c-9.6-6.1-22-3.1-29.5,2-15.4,10.7-19.6,37.5-7.6,47.8s35.9,3.9,44.5-12.5C115.5,92.6,113.9,74.6,102,67.1Z" />
</svg>
</body>
</html>