audrey06100 commited on
Commit
046b0b5
·
1 Parent(s): 068ad16
Files changed (1) hide show
  1. app.py +8 -8
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("--channel-indicator-size", `${newWidth*0.025}px`);
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("--channel-indicator-size", `${div.clientWidth*0.025}px`);
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(--channel-indicator-size);
116
- height: var(--channel-indicator-size);
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(--channel-indicator-size);
132
- height: var(--channel-indicator-size);
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(--channel-indicator-size);
199
- height: var(--channel-indicator-size);
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
  }