-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
61 lines (54 loc) · 1.6 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Squircle</title>
<style>
body {
display: grid;
gap: 1rem;
grid-template-columns: 1fr 1fr;
grid-template-rows: 16rem 16rem;
background-color: grey;
}
.rounded {
border-radius: var(--squircle-border-radius);
border-width: var(--squircle-border-width);
background-color: var(--squircle-background-color);
border-color: var(--squircle-border-color);
border-style: solid;
}
.radius-1rem {
--squircle-border-radius: 2rem;
--squircle-border-width: 0.5rem;
--squircle-background-color: hsla(120deg 50% 50% / 0.5);
--squircle-border-color: hsla(240deg 50% 50% / 0.2);
}
</style>
</head>
<body>
<div class="squircle radius-1rem"></div>
<div class="rounded radius-1rem"></div>
<svg viewBox="0 0 512 256" width="512" height="256">
<path id="squircle-svg" fill="black"></path>
</svg>
<ce-squircle
background-color="rgb(255, 127, 63)"
border-radius="16"
border-width="4"
border-color="rgb(63, 127, 255)"
>
<span>Hello,</span>
<span>world</span>
</ce-squircle>
<script type="module">
import { register, path, createCustomElement } from "@";
register();
createCustomElement();
const svg = document.getElementById("squircle-svg");
const d = path(0, 0, 512, 256, 32);
svg.setAttribute("d", d);
</script>
</body>
</html>