yizhangliu commited on
Commit
5c5c0f6
1 Parent(s): ebc5193

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -123,7 +123,13 @@ start_work = """async() => {
123
  }
124
  return clientHeight;
125
  }
126
-
 
 
 
 
 
 
127
  function setNativeValue(element, value) {
128
  const valueSetter = Object.getOwnPropertyDescriptor(element.__proto__, 'value').set;
129
  const prototype = Object.getPrototypeOf(element);
@@ -164,7 +170,10 @@ start_work = """async() => {
164
  new_div.className = "px-3 py-2 rounded-[22px] rounded-bl-none place-self-start text-white text-sm chat-message svelte-rct66g";
165
  new_div.style.backgroundColor = "#2563eb";
166
  if (conversations[i].indexOf("<img ") == 0) {
167
- new_div.style.width = "80%";
 
 
 
168
  new_div.style.padding = "0.2rem";
169
  }
170
  }
@@ -293,7 +302,10 @@ start_work = """async() => {
293
  var bot_div = document.createElement("div");
294
  bot_div.className = "px-3 py-2 rounded-[22px] rounded-bl-none place-self-start text-white text-sm chat-message svelte-rct66g";
295
  bot_div.style.backgroundColor = "#2563eb";
296
- bot_div.style.width = "80%";
 
 
 
297
  bot_div.style.padding = "0.2rem";
298
  bot_div.appendChild(imgs[0].cloneNode(true));
299
  window['chat_bot1'].children[2].children[0].appendChild(bot_div);
 
123
  }
124
  return clientHeight;
125
  }
126
+ function img_click(img) {
127
+ this_width = parseInt(img.style.width) + 20;
128
+ if (this_width > 100) {
129
+ this_width = 20;
130
+ }
131
+ img.style.width = this_width + "%";
132
+ }
133
  function setNativeValue(element, value) {
134
  const valueSetter = Object.getOwnPropertyDescriptor(element.__proto__, 'value').set;
135
  const prototype = Object.getPrototypeOf(element);
 
170
  new_div.className = "px-3 py-2 rounded-[22px] rounded-bl-none place-self-start text-white text-sm chat-message svelte-rct66g";
171
  new_div.style.backgroundColor = "#2563eb";
172
  if (conversations[i].indexOf("<img ") == 0) {
173
+ new_div.style.width = "20%";
174
+ new_div.onclick = function(e){
175
+ img_click(this);
176
+ }
177
  new_div.style.padding = "0.2rem";
178
  }
179
  }
 
302
  var bot_div = document.createElement("div");
303
  bot_div.className = "px-3 py-2 rounded-[22px] rounded-bl-none place-self-start text-white text-sm chat-message svelte-rct66g";
304
  bot_div.style.backgroundColor = "#2563eb";
305
+ bot_div.style.width = "40%";
306
+ bot_div.onclick = function(e){
307
+ img_click(this);
308
+ }
309
  bot_div.style.padding = "0.2rem";
310
  bot_div.appendChild(imgs[0].cloneNode(true));
311
  window['chat_bot1'].children[2].children[0].appendChild(bot_div);