-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
47 lines (46 loc) · 1.36 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
<!-- For github pages -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>NetLogo Color Picker</title>
<style>
html, body {
height: 100%;
margin: 0;
font-size: 16px;
}
</style>
</head>
<body>
<div class="code-editor"></div>
<script type="module">
import { ColorPicker } from "./ColorPicker.bundle.js";
const savedColors = [
[228, 202, 152, 255],
[228, 110, 72, 255],
[157, 110, 72, 255]
];
function init(parent) {
const colorPickerConfig = {
parent: parent,
initColor: [165, 234, 251, 255],
onColorSelect: (selectedColor) => {
console.log("Color selected:", selectedColor);
},
savedColors: savedColors
};
let colorPicker = new ColorPicker(colorPickerConfig);
}
var ce = document.querySelector(".code-editor");
ce.style.width = '100%';
ce.style.height = '100%';
ce.style.display = 'flex';
ce.style.justifyContent = 'center';
ce.style.alignItems = 'center';
ce.style.margin = '0 auto';
var editor = init(ce);
</script>
</body>
</html>