ginipick commited on
Commit
d98ef41
ยท
verified ยท
1 Parent(s): 675828a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -4
app.py CHANGED
@@ -450,6 +450,11 @@ HTML = """
450
  }
451
 
452
  .floating-home .icon {
 
 
 
 
 
453
  font-size: 22px;
454
  color: var(--primary-color);
455
  transition: var(--transition);
@@ -879,11 +884,11 @@ HTML = """
879
 
880
  <section id="home" class="fade-in">
881
  <div class="upload-container">
882
- <button class="upload">
883
  <i class="fas fa-images"></i> ์ด๋ฏธ์ง€ ์ถ”๊ฐ€
884
  <input id="imgInput" type="file" accept="image/*" multiple hidden>
885
  </button>
886
- <button class="upload">
887
  <i class="fas fa-file-pdf"></i> PDF ์ถ”๊ฐ€
888
  <input id="pdfInput" type="file" accept="application/pdf" hidden>
889
  </button>
@@ -941,6 +946,33 @@ HTML = """
941
  /* โ”€โ”€ ์œ ํ‹ธ โ”€โ”€ */
942
  function $id(id){return document.getElementById(id)}
943
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
944
  function addCard(i, thumb, title, isCached = false) {
945
  const d = document.createElement('div');
946
  d.className = 'card fade-in';
@@ -1612,8 +1644,8 @@ HTML = """
1612
 
1613
  // ํŽ˜์ด์ง€ ๋กœ๋“œ ์‹œ ์„œ๋ฒ„ PDF ๋กœ๋“œ
1614
  window.addEventListener('DOMContentLoaded', () => {
1615
- // ์—…๋กœ๋“œ ๋ฒ„ํŠผ ์ด๋ฒคํŠธ ์—ฐ๊ฒฐ
1616
- setupUploadButtons();
1617
 
1618
  loadServerPDFs();
1619
 
 
450
  }
451
 
452
  .floating-home .icon {
453
+ display: flex;
454
+ justify-content: center;
455
+ align-items: center;
456
+ width: 100%;
457
+ height: 100%;
458
  font-size: 22px;
459
  color: var(--primary-color);
460
  transition: var(--transition);
 
884
 
885
  <section id="home" class="fade-in">
886
  <div class="upload-container">
887
+ <button class="upload" id="imageUploadBtn">
888
  <i class="fas fa-images"></i> ์ด๋ฏธ์ง€ ์ถ”๊ฐ€
889
  <input id="imgInput" type="file" accept="image/*" multiple hidden>
890
  </button>
891
+ <button class="upload" id="pdfUploadBtn">
892
  <i class="fas fa-file-pdf"></i> PDF ์ถ”๊ฐ€
893
  <input id="pdfInput" type="file" accept="application/pdf" hidden>
894
  </button>
 
946
  /* โ”€โ”€ ์œ ํ‹ธ โ”€โ”€ */
947
  function $id(id){return document.getElementById(id)}
948
 
949
+ // ์ง์ ‘ ์ด๋ฒคํŠธ ๋ฆฌ์Šค๋„ˆ ์„ค์ • (๋” ํ™•์‹คํ•œ ๋ฐฉ๋ฒ•)
950
+ function setupDirectEvents() {
951
+ // ์ด๋ฏธ์ง€ ์—…๋กœ๋“œ ๋ฒ„ํŠผ
952
+ const imageBtn = $id('imageUploadBtn');
953
+ const imageInput = $id('imgInput');
954
+ if (imageBtn && imageInput) {
955
+ console.log('์ด๋ฏธ์ง€ ์—…๋กœ๋“œ ๋ฒ„ํŠผ ์ด๋ฒคํŠธ ์„ค์ •');
956
+ imageBtn.onclick = function(e) {
957
+ e.preventDefault();
958
+ e.stopPropagation();
959
+ imageInput.click();
960
+ };
961
+ }
962
+
963
+ // PDF ์—…๋กœ๋“œ ๋ฒ„ํŠผ
964
+ const pdfBtn = $id('pdfUploadBtn');
965
+ const pdfInput = $id('pdfInput');
966
+ if (pdfBtn && pdfInput) {
967
+ console.log('PDF ์—…๋กœ๋“œ ๋ฒ„ํŠผ ์ด๋ฒคํŠธ ์„ค์ •');
968
+ pdfBtn.onclick = function(e) {
969
+ e.preventDefault();
970
+ e.stopPropagation();
971
+ pdfInput.click();
972
+ };
973
+ }
974
+ }
975
+
976
  function addCard(i, thumb, title, isCached = false) {
977
  const d = document.createElement('div');
978
  d.className = 'card fade-in';
 
1644
 
1645
  // ํŽ˜์ด์ง€ ๋กœ๋“œ ์‹œ ์„œ๋ฒ„ PDF ๋กœ๋“œ
1646
  window.addEventListener('DOMContentLoaded', () => {
1647
+ // ์ง์ ‘ ์ด๋ฒคํŠธ ๋ฆฌ์Šค๋„ˆ ์„ค์ • (๋” ํ™•์‹คํ•œ ๋ฐฉ๋ฒ•)
1648
+ setupDirectEvents();
1649
 
1650
  loadServerPDFs();
1651