File size: 6,796 Bytes
7e8ce75 239487c 7e8ce75 239487c 7e8ce75 239487c 7e8ce75 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover" />
<title>DOTO — Temp Upload</title>
<link rel="stylesheet" href="/static/css/styles.css" />
<!-- DOTO is a custom font; fallback to system sans -->
<style>
@font-face {
font-family: "DOTO";
src: local("DOTO"), local("Doto"), local("Doto-Bold");
font-weight: 700;
font-style: normal;
}
/* === Modal Styling === */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.55);
display: none;
align-items: center;
justify-content: center;
z-index: 2000;
}
.modal {
background: #fff;
border-radius: 14px;
width: 90%;
max-width: 480px;
padding: 0;
box-shadow: 0 10px 30px rgba(0,0,0,0.25);
transform: scale(0.8);
opacity: 0;
transition: all 0.3s ease-in-out;
overflow: hidden;
}
.modal.show {
transform: scale(1);
opacity: 1;
}
.modal header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 16px;
background: #f5f5f5;
font-weight: bold;
border-bottom: 1px solid #ddd;
}
.modal header strong {
font-size: 1rem;
}
#closeApi {
background: none;
border: none;
font-size: 1.2rem;
cursor: pointer;
color: #333;
}
.modal-body {
padding: 16px;
font-size: 0.95rem;
}
.modal-body p {
margin: 6px 0;
}
.curl {
margin: 12px 0;
background: #f7f7f7;
border-radius: 6px;
padding: 10px;
position: relative;
}
.curl pre {
white-space: pre-wrap;
word-wrap: break-word;
font-size: 0.85rem;
margin: 0 0 8px 0;
}
.curl button {
position: absolute;
top: 8px;
right: 8px;
font-size: 0.8rem;
}
.dev {
margin-top: 12px;
text-align: center;
}
.dev strong {
color: #222;
}
.dev .muted {
color: #666;
font-size: 0.8rem;
}
</style>
</head>
<body class="theme-light">
<div class="app">
<header class="topbar">
<div class="brand">DOTO</div>
<div class="meta">
<button id="apiBtn" class="icon-btn" title="API & Developer">/></button>
</div>
</header>
<main class="main">
<section class="upload-card" id="uploadCard">
<div class="placeholder" id="placeholder">
<img src="/static/images/placeholder.gif" alt="placeholder" class="placeholder-gif"/>
<div class="placeholder-text">
<strong>Drop a file or tap to upload</strong>
<small>Files expire ~3 hours • max 2GB</small>
</div>
<input id="fileInput" type="file" class="file-input" />
</div>
<div class="preview" id="preview" hidden>
<div class="preview-left">
<div id="previewThumb" class="preview-thumb"></div>
</div>
<div class="preview-right">
<div id="previewName" class="filename"></div>
<div id="previewSize" class="filesize"></div>
<div class="progress-wrap">
<progress id="uploadProgress" value="0" max="100"></progress>
<div id="progressText" class="progress-text"></div>
</div>
</div>
</div>
</section>
<section class="history" id="historySection">
<div class="history-header">
<strong>Recent uploads</strong>
<button id="clearHistory" class="link-btn">Clear</button>
</div>
<div id="historyList" class="history-list"></div>
</section>
</main>
<footer class="sticky-footer">
<div class="left">
<button id="uploadBtn" class="big-btn">Upload</button>
</div>
<div class="right actions">
<button id="copyBtn" class="small-btn" title="Copy link">Copy</button>
<button id="viewBtn" class="small-btn" title="View">View</button>
<button id="dlBtn" class="small-btn" title="Download">Download</button>
</div>
</footer>
</div>
<!-- API modal -->
<div id="apiModal" class="modal-overlay">
<div class="modal">
<header>
<strong>API & Developer</strong>
<button id="closeApi" class="icon-btn">✕</button>
</header>
<div class="modal-body">
<p><strong>Version:</strong> <span id="apiVersion">{{ api_version }}</span></p>
<p><strong>Upload endpoint:</strong> <code>/api/upload</code></p>
<p><strong>Max size:</strong> <code>{{ max_bytes }} bytes</code></p>
<p><strong>Expiry:</strong> ~{{ expire_seconds }} seconds</p>
<div class="curl">
<label>cURL example</label>
<pre id="curlExample">curl -X POST -F "file=@/path/to/file" https://your-space-url/api/upload</pre>
<button id="copyCurl" class="link-btn">Copy</button>
</div>
<hr/>
<div class="dev">
<small>Made by <strong>Aditya Devarshi</strong></small><br/>
<small class="muted">Files are public to anyone with the link. Avoid sensitive uploads.</small>
</div>
</div>
</div>
</div>
<script>
// inject server values for max size / expire as JS constants
window.APP_CONFIG = {
API_VERSION: "{{ api_version }}",
MAX_BYTES: {{ max_bytes }},
EXPIRE_SECONDS: {{ expire_seconds }}
}
const apiBtn = document.getElementById("apiBtn");
const apiModal = document.getElementById("apiModal");
const closeApi = document.getElementById("closeApi");
const copyCurl = document.getElementById("copyCurl");
const curlExample = document.getElementById("curlExample");
// Open modal
apiBtn.addEventListener("click", () => {
apiModal.style.display = "flex";
requestAnimationFrame(() => {
apiModal.querySelector(".modal").classList.add("show");
});
});
// Close modal
function closeModal() {
const modalCard = apiModal.querySelector(".modal");
modalCard.classList.remove("show");
setTimeout(() => {
apiModal.style.display = "none";
}, 300);
}
closeApi.addEventListener("click", closeModal);
apiModal.addEventListener("click", (e) => {
if (e.target === apiModal) closeModal();
});
// Copy curl command
copyCurl.addEventListener("click", () => {
navigator.clipboard.writeText(curlExample.innerText).then(() => {
copyCurl.innerText = "Copied!";
setTimeout(() => (copyCurl.innerText = "Copy"), 1500);
});
});
</script>
<script src="/static/js/app.js"></script>
</body>
</html>
|