refactor: split states and burgs generators

This commit is contained in:
Azgaar 2024-09-29 14:24:44 +02:00
parent e53c3a7773
commit d7d79ad740
18 changed files with 445 additions and 358 deletions

View file

@ -280,16 +280,6 @@ function addStylePreset() {
"font-size",
"font-family"
],
"#burgIcons > #cities": [
"opacity",
"fill",
"fill-opacity",
"size",
"stroke",
"stroke-width",
"stroke-dasharray",
"stroke-linecap"
],
"#anchors > #cities": ["opacity", "fill", "size", "stroke", "stroke-width"],
"#burgLabels > #towns": [
"opacity",
@ -300,16 +290,6 @@ function addStylePreset() {
"font-size",
"font-family"
],
"#burgIcons > #towns": [
"opacity",
"fill",
"fill-opacity",
"size",
"stroke",
"stroke-width",
"stroke-dasharray",
"stroke-linecap"
],
"#anchors > #towns": ["opacity", "fill", "size", "stroke", "stroke-width"],
"#labels > #states": [
"opacity",
@ -352,6 +332,20 @@ function addStylePreset() {
]
};
const burgIconsAttributes = [
"opacity",
"fill",
"fill-opacity",
"size",
"stroke",
"stroke-width",
"stroke-dasharray",
"stroke-linecap"
];
options.burgs.groups.forEach(group => {
attributes[`#burgIcons > g[data-name='${group}']`] = burgIconsAttributes;
});
for (const selector in attributes) {
const el = document.querySelector(selector);
if (!el) continue;