Spaces:
Sleeping
Sleeping
Commit
·
046b0b5
1
Parent(s):
068ad16
update
Browse files
app.py
CHANGED
@@ -63,7 +63,7 @@ observe_js = """
|
|
63 |
entries.forEach((entry) => {
|
64 |
const target = entry.target;
|
65 |
const newWidth = entry.contentRect.width;
|
66 |
-
target.style.setProperty("--
|
67 |
});
|
68 |
});
|
69 |
observer.observe(document.querySelector("#radio-group > div:nth-of-type(2)"));
|
@@ -86,7 +86,7 @@ init_js = """
|
|
86 |
}else return;
|
87 |
|
88 |
const div = document.querySelector(selector);
|
89 |
-
div.style.setProperty("--
|
90 |
|
91 |
// add figure of the input montage
|
92 |
div.style.cssText = `
|
@@ -112,8 +112,8 @@ init_js = """
|
|
112 |
el.querySelector(":scope > input").style.cssText = `
|
113 |
position: absolute;
|
114 |
z-index: 2;
|
115 |
-
width: var(--
|
116 |
-
height: var(--
|
117 |
transform: translate(-50%, -50%);
|
118 |
`;
|
119 |
});
|
@@ -128,8 +128,8 @@ init_js = """
|
|
128 |
position: absolute;
|
129 |
left: ${left}%;
|
130 |
bottom: ${bottom}%;
|
131 |
-
width: var(--
|
132 |
-
height: var(--
|
133 |
border-radius: 50%;
|
134 |
background-color: red;
|
135 |
}
|
@@ -195,8 +195,8 @@ update_js = """
|
|
195 |
position: absolute;
|
196 |
left: ${left}%;
|
197 |
bottom: ${bottom}%;
|
198 |
-
width: var(--
|
199 |
-
height: var(--
|
200 |
border-radius: 50%;
|
201 |
background-color: red;
|
202 |
}
|
|
|
63 |
entries.forEach((entry) => {
|
64 |
const target = entry.target;
|
65 |
const newWidth = entry.contentRect.width;
|
66 |
+
target.style.setProperty("--indicator-size", `${newWidth*0.025}px`);
|
67 |
});
|
68 |
});
|
69 |
observer.observe(document.querySelector("#radio-group > div:nth-of-type(2)"));
|
|
|
86 |
}else return;
|
87 |
|
88 |
const div = document.querySelector(selector);
|
89 |
+
div.style.setProperty("--indicator-size", `${div.clientWidth*0.025}px`);
|
90 |
|
91 |
// add figure of the input montage
|
92 |
div.style.cssText = `
|
|
|
112 |
el.querySelector(":scope > input").style.cssText = `
|
113 |
position: absolute;
|
114 |
z-index: 2;
|
115 |
+
width: var(--indicator-size);
|
116 |
+
height: var(--indicator-size);
|
117 |
transform: translate(-50%, -50%);
|
118 |
`;
|
119 |
});
|
|
|
128 |
position: absolute;
|
129 |
left: ${left}%;
|
130 |
bottom: ${bottom}%;
|
131 |
+
width: var(--indicator-size);
|
132 |
+
height: var(--indicator-size);
|
133 |
border-radius: 50%;
|
134 |
background-color: red;
|
135 |
}
|
|
|
195 |
position: absolute;
|
196 |
left: ${left}%;
|
197 |
bottom: ${bottom}%;
|
198 |
+
width: var(--indicator-size);
|
199 |
+
height: var(--indicator-size);
|
200 |
border-radius: 50%;
|
201 |
background-color: red;
|
202 |
}
|