Polish upload call to action

This commit is contained in:
DESKTOP-KSVGT20\shkim
2026-05-10 21:14:33 +09:00
parent 3a797694b2
commit 328065db18
2 changed files with 68 additions and 44 deletions
+12 -5
View File
@@ -22,16 +22,23 @@
<form class="upload-panel" method="post" action="/r/{{slug}}" enctype="multipart/form-data">
<p class="upload-panel__today">오늘의 순간</p>
<label class="file-picker">
<span class="file-picker__label">사진 선택</span>
<label class="upload-button file-picker" aria-label="업로드">
<span>사진 올리기</span>
<input type="file" name="files" accept="{{accept}}" multiple required>
</label>
<button class="upload-button" type="submit" aria-label="업로드">
<span>사진 올리기</span>
</button>
<button class="submit-fallback" type="submit" aria-label="업로드">사진 올리기</button>
</form>
</section>
</main>
<script>
document.querySelectorAll(".upload-panel").forEach((form) => {
const input = form.querySelector('input[type="file"][name="files"]');
const submit = form.querySelector('button[type="submit"]');
input?.addEventListener("change", () => {
if (input.files && input.files.length > 0) submit?.click();
});
});
</script>
</body>
</html>