TrungLC commited on
Commit
c52164d
·
verified ·
1 Parent(s): ee7e686

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -112
app.py CHANGED
@@ -300,119 +300,9 @@ with gr.Blocks(title="triggertool PLT") as demo:
300
  <div id="header-center">
301
  <div id="header-main-title">🩸 triggertool PLT</div>
302
  <div id="header-separator"></div>
303
- <div id="animated-credit"><span id="ac-text"></span></div>
 
304
  </div>
305
- <svg id="plt-ecg" viewBox="0 0 800 20" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg">
306
- <polyline points="0,10 80,10 100,2 110,18 120,10 200,10 220,2 230,18 240,10 320,10 340,2 350,18 360,10 440,10 460,2 470,18 480,10 560,10 580,2 590,18 600,10 680,10 700,2 710,18 720,10 800,10"
307
- stroke="white" stroke-width="1.5" fill="none"/>
308
- </svg>
309
- </div>
310
- <script>
311
- (function() {
312
- var TEXT = "\u0110\u01b0\u1ee3c t\u1ea1o b\u1edfI DSCKI. Nguy\u1ec5n Th\u00e0nh Trung - Trung t\u00e2m y t\u1ebf khu v\u1ef1c B\u1ea3o Th\u1eafng";
313
- // Correct unicode for: Được tạo bởi DSCKI. Nguyễn Thành Trung - Trung tâm y tế khu vực Bảo Thắng
314
- var TEXT2 = "\u0110\u01b0\u1ee3c t\u1ea1o b\u1edfi DSCKI. Nguy\u1ec5n Th\u00e0nh Trung - Trung t\u00e2m y t\u1ebf khu v\u1ef1c B\u1ea3o Th\u1eafng";
315
- var cur = 0;
316
-
317
- function getEl() { return document.getElementById('ac-text'); }
318
-
319
- function typewriter(cb) {
320
- var el = getEl(); if (!el) { cb && cb(); return; }
321
- el.innerHTML = ''; var i = 0;
322
- el.style.cssText = 'color:#FFD700;font-size:13px;font-weight:600;font-family:Segoe UI,sans-serif;text-shadow:0 1px 6px rgba(0,0,0,0.6);letter-spacing:0.3px;border-right:2px solid #FFD700;';
323
- var iv = setInterval(function() {
324
- el.textContent = TEXT2.slice(0, ++i);
325
- if (i >= TEXT2.length) {
326
- clearInterval(iv);
327
- el.style.borderRight = 'none';
328
- cb && setTimeout(cb, 1400);
329
- }
330
- }, 45);
331
- }
332
-
333
- function bounceIn(cb) {
334
- var el = getEl(); if (!el) { cb && cb(); return; }
335
- el.innerHTML = '';
336
- TEXT2.split('').forEach(function(ch, i) {
337
- var s = document.createElement('span');
338
- s.textContent = ch === ' ' ? '\u00a0' : ch;
339
- s.style.cssText = 'color:#FFD700;font-size:13px;font-weight:600;display:inline-block;opacity:0;transform:translateY(-28px);transition:transform 0.45s cubic-bezier(.34,1.56,.64,1) ' + (i*18) + 'ms,opacity 0.3s ease ' + (i*18) + 'ms';
340
- el.appendChild(s);
341
- });
342
- setTimeout(function() {
343
- if (!getEl()) return;
344
- getEl().querySelectorAll('span').forEach(function(s) {
345
- s.style.transform = 'translateY(0)'; s.style.opacity = '1';
346
- });
347
- cb && setTimeout(cb, TEXT2.length * 18 + 800);
348
- }, 50);
349
- }
350
-
351
- function waveIn(cb) {
352
- var el = getEl(); if (!el) { cb && cb(); return; }
353
- var st = document.getElementById('wv-kf');
354
- if (!st) {
355
- st = document.createElement('style'); st.id = 'wv-kf';
356
- st.textContent = '@keyframes wv2{0%{opacity:0;transform:translateY(12px)}60%{transform:translateY(-3px)}100%{opacity:1;transform:translateY(0)}}';
357
- document.head.appendChild(st);
358
- }
359
- el.innerHTML = '';
360
- TEXT2.split('').forEach(function(ch, i) {
361
- var s = document.createElement('span');
362
- s.textContent = ch === ' ' ? '\u00a0' : ch;
363
- s.style.cssText = 'color:#FFD700;font-size:13px;font-weight:600;display:inline-block;animation:wv2 0.5s ease ' + (i*26) + 'ms both';
364
- el.appendChild(s);
365
- });
366
- cb && setTimeout(cb, TEXT2.length * 26 + 700);
367
- }
368
-
369
- function slideIn(cb) {
370
- var el = getEl(); if (!el) { cb && cb(); return; }
371
- el.innerHTML = '';
372
- el.style.cssText = 'color:#FFD700;font-size:13px;font-weight:600;overflow:hidden;display:inline-block;max-width:100%';
373
- var sp = document.createElement('span');
374
- sp.textContent = TEXT2;
375
- sp.style.cssText = 'color:#FFD700;display:inline-block;transform:translateX(-100%);opacity:0;transition:transform 0.9s cubic-bezier(.22,1,.36,1),opacity 0.7s ease';
376
- el.appendChild(sp);
377
- setTimeout(function() {
378
- sp.style.transform = 'translateX(0)';
379
- sp.style.opacity = '1';
380
- cb && setTimeout(cb, 1400);
381
- }, 60);
382
- }
383
-
384
- var effects = [typewriter, bounceIn, waveIn, slideIn];
385
-
386
- function runNext() {
387
- var fn = effects[cur % effects.length]; cur++;
388
- fn(function() {
389
- setTimeout(function() {
390
- var el = getEl(); if (!el) return;
391
- el.style.transition = 'opacity 0.5s';
392
- el.style.opacity = '0';
393
- setTimeout(function() {
394
- var el2 = getEl(); if (!el2) return;
395
- el2.style.opacity = '1';
396
- el2.style.transition = '';
397
- el2.innerHTML = '';
398
- runNext();
399
- }, 600);
400
- }, 2800);
401
- });
402
- }
403
-
404
- function tryStart(attempts) {
405
- var el = getEl();
406
- if (el) {
407
- setTimeout(runNext, 400);
408
- } else if ((attempts || 0) < 60) {
409
- setTimeout(function() { tryStart((attempts||0)+1); }, 200);
410
- }
411
- }
412
- tryStart(0);
413
- })();
414
- </script>
415
- """)
416
 
417
  # ===== MAIN LAYOUT =====
418
  with gr.Row():
 
300
  <div id="header-center">
301
  <div id="header-main-title">🩸 triggertool PLT</div>
302
  <div id="header-separator"></div>
303
+ <div id="animated-credit" style="color:#FFD700;font-size:13px;font-weight:600;font-family:Segoe UI,Arial,sans-serif;text-shadow:0 1px 6px rgba(0,0,0,0.7);letter-spacing:0.3px;margin-top:4px;">
304
+ Được tạo bởi DSCKI. Nguyễn Thành Trung - Trung tâm y tế khu vực Bảo Thắng
305
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
 
307
  # ===== MAIN LAYOUT =====
308
  with gr.Row():