folk-canvas/demo/distance-field-visualizatio...

58 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Distance Field Demo</title>
<style>
html {
height: 100%;
}
body {
min-height: 100%;
position: relative;
margin: 0;
overscroll-behavior: none;
}
folk-shape {
background: transparent;
position: absolute;
background-color: rgba(255, 255, 255, 0.1);
border-radius: 2px;
border: 2px solid rgba(0, 0, 0, 0.5);
}
folk-distance-field {
position: absolute;
inset: 0;
}
h1,
p {
width: fit-content;
border: 2px solid rgba(0, 0, 0, 0.5);
}
</style>
</head>
<body>
<folk-distance-field>
<p>Hello</p>
<p>World</p>
<folk-shape x="100" y="100" width="50" height="50"></folk-shape>
<folk-shape x="100" y="200" width="50" height="50"></folk-shape>
<folk-shape x="100" y="300" width="50" height="50"></folk-shape>
<folk-shape x="300" y="150" width="80" height="40"></folk-shape>
<folk-shape x="400" y="250" width="60" height="90"></folk-shape>
<folk-shape x="200" y="400" width="100" height="100"></folk-shape>
<folk-shape x="500" y="100" width="30" height="70"></folk-shape>
</folk-distance-field>
<script type="module">
import '../src/standalone/folk-shape.ts';
import '../src/standalone/folk-distance-field.ts';
</script>
</body>
</html>