From d0a7a9afedf9b769fd160297a068a73bea6350d1 Mon Sep 17 00:00:00 2001 From: Izan Gil <66965250+SrIzan10@users.noreply.github.com> Date: Sat, 29 Mar 2025 18:22:44 +0100 Subject: [PATCH] upload receipts --- .gitignore | 1 + index.html | 693 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 685 insertions(+), 9 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..314f02b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.txt \ No newline at end of file diff --git a/index.html b/index.html index e5bdf6d..b591e3e 100644 --- a/index.html +++ b/index.html @@ -548,6 +548,260 @@ .price-calculation p { margin-bottom: 4px; } + + /* File upload styles */ + .file-upload { + border: 2px dashed var(--color-border); + border-radius: 8px; + padding: 20px; + text-align: center; + margin-bottom: 20px; + position: relative; + cursor: pointer; + background-color: var(--bg-tertiary); + transition: all 0.3s ease; + } + + .file-upload:hover { + border-color: var(--color-primary); + background-color: rgba(74, 109, 167, 0.05); + } + + .file-upload input[type="file"] { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + opacity: 0; + cursor: pointer; + } + + .file-upload p { + margin: 0; + color: var(--color-text-light); + } + + .file-upload-icon { + font-size: 2rem; + margin-bottom: 10px; + color: var(--color-primary); + } + + .file-list { + list-style: none; + padding: 0; + margin: 15px 0 0 0; + } + + .file-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 8px 12px; + background-color: var(--bg-secondary); + border-radius: 6px; + margin-bottom: 8px; + } + + .file-info { + display: flex; + align-items: center; + gap: 10px; + overflow: hidden; + } + + .file-name { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 250px; + } + + .file-size { + color: var(--color-text-light); + font-size: 0.8rem; + } + + .file-actions { + display: flex; + gap: 8px; + } + + .file-preview-btn, .file-remove-btn { + background: none; + border: none; + padding: 4px; + cursor: pointer; + border-radius: 4px; + display: flex; + align-items: center; + justify-content: center; + } + + .file-preview-btn { + color: var(--color-info); + } + + .file-remove-btn { + color: var(--color-danger); + } + + .file-preview-btn:hover, .file-remove-btn:hover { + background-color: var(--bg-tertiary); + } + + .upload-progress { + width: 100%; + height: 6px; + margin-top: 10px; + border-radius: 3px; + overflow: hidden; + background-color: var(--bg-primary); + } + + .upload-bar { + height: 100%; + width: 0%; + background-color: var(--color-primary); + transition: width 0.3s ease; + } + + .receipts-container { + display: flex; + gap: 10px; + flex-wrap: wrap; + margin-top: 10px; + } + + .receipt-thumbnail { + position: relative; + width: 100px; + height: 100px; + border-radius: 6px; + overflow: hidden; + box-shadow: var(--shadow-sm); + } + + .receipt-thumbnail img { + width: 100%; + height: 100%; + object-fit: cover; + } + + .receipt-thumbnail .overlay { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.5); + display: flex; + align-items: center; + justify-content: center; + opacity: 0; + transition: opacity 0.3s ease; + } + + .receipt-thumbnail:hover .overlay { + opacity: 1; + } + + .receipt-thumbnail .overlay-btn { + background: white; + color: var(--color-text); + border: none; + border-radius: 50%; + width: 30px; + height: 30px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + margin: 0 5px; + } + + .modal { + display: none; + position: fixed; + z-index: 999; + left: 0; + top: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.7); + overflow: auto; + } + + .modal-content { + position: relative; + margin: auto; + padding: 0; + width: 80%; + max-width: 900px; + top: 50%; + transform: translateY(-50%); + } + + .modal-close { + position: absolute; + top: 15px; + right: 15px; + font-size: 28px; + font-weight: bold; + color: white; + cursor: pointer; + z-index: 1000; + background: rgba(0, 0, 0, 0.5); + width: 40px; + height: 40px; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + } + + .modal-img { + width: 100%; + height: auto; + display: block; + max-height: 80vh; + object-fit: contain; + } + + .modal-nav { + position: absolute; + top: 50%; + transform: translateY(-50%); + padding: 16px; + color: white; + font-weight: bold; + font-size: 24px; + cursor: pointer; + background: rgba(0, 0, 0, 0.3); + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + width: 50px; + height: 50px; + user-select: none; + } + + .modal-prev { + left: 15px; + } + + .modal-next { + right: 15px; + } + + .receipts-title { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 10px; + }
@@ -629,6 +883,22 @@ + + +Drag & drop receipts here or click to browse
+(JPG, PNG, PDF up to 5MB each)
+ +