h / templates /upload.html
Xlnk's picture
Upload 13 files
e767f32 verified
<!DOCTYPE html>
<html>
<head>
<title>Upload - h by Xlnk</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #0d0d1f 100%);
min-height: 100vh;
font-family: 'Inter', system-ui, sans-serif;
color: #e2e8f0;
}
.navbar {
background: rgba(15, 23, 42, 0.9);
backdrop-filter: blur(20px);
border-bottom: 1px solid rgba(99, 102, 241, 0.2);
padding: 16px 30px;
display: flex;
justify-content: space-between;
align-items: center;
position: sticky;
top: 0;
z-index: 100;
}
.nav-brand {
font-size: 1.5rem;
font-weight: 700;
background: linear-gradient(135deg, #818cf8, #c084fc);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 20px;
align-items: center;
}
.nav-links a {
color: #94a3b8;
text-decoration: none;
font-size: 0.9rem;
transition: color 0.3s ease;
}
.nav-links a:hover {
color: #818cf8;
}
.nav-links a.active {
color: #818cf8;
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 40px 20px;
}
.page-header {
text-align: center;
margin-bottom: 40px;
}
.page-header h1 {
font-size: 2rem;
font-weight: 700;
background: linear-gradient(135deg, #818cf8, #c084fc, #f472b6);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 10px;
}
.page-header p {
color: #94a3b8;
}
.flash-messages {
margin-bottom: 20px;
}
.flash {
padding: 12px 16px;
border-radius: 12px;
font-size: 0.9rem;
margin-bottom: 10px;
animation: slideIn 0.3s ease;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.flash.error {
background: rgba(239, 68, 68, 0.15);
border: 1px solid rgba(239, 68, 68, 0.3);
color: #fca5a5;
}
.flash.success {
background: rgba(34, 197, 94, 0.15);
border: 1px solid rgba(34, 197, 94, 0.3);
color: #86efac;
}
.card {
background: rgba(15, 23, 42, 0.8);
backdrop-filter: blur(20px);
border: 1px solid rgba(99, 102, 241, 0.2);
border-radius: 20px;
padding: 30px;
box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}
.form-group {
margin-bottom: 24px;
}
label {
display: block;
color: #e2e8f0;
font-size: 0.9rem;
font-weight: 500;
margin-bottom: 10px;
}
input[type="text"],
input[type="date"] {
width: 100%;
padding: 14px 16px;
background: rgba(30, 41, 59, 0.8);
border: 1px solid rgba(148, 163, 184, 0.2);
border-radius: 12px;
color: #f1f5f9;
font-size: 1rem;
font-family: inherit;
transition: all 0.3s ease;
}
input[type="text"]:focus,
input[type="date"]:focus {
outline: none;
border-color: #818cf8;
box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}
input::placeholder {
color: #64748b;
}
.file-upload {
border: 2px dashed rgba(99, 102, 241, 0.4);
border-radius: 16px;
padding: 40px 20px;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
background: rgba(99, 102, 241, 0.05);
}
.file-upload:hover {
border-color: #818cf8;
background: rgba(99, 102, 241, 0.1);
}
.file-upload.dragover {
border-color: #818cf8;
background: rgba(99, 102, 241, 0.15);
}
.file-upload input[type="file"] {
display: none;
}
.file-upload-icon {
font-size: 3rem;
margin-bottom: 15px;
}
.file-upload-text {
color: #94a3b8;
}
.file-upload-text strong {
color: #818cf8;
}
.file-name {
margin-top: 10px;
color: #22c55e;
font-size: 0.9rem;
}
.hint {
color: #64748b;
font-size: 0.8rem;
margin-top: 8px;
}
button {
width: 100%;
padding: 16px;
background: linear-gradient(135deg, #6366f1, #8b5cf6);
border: none;
border-radius: 12px;
color: white;
font-size: 1rem;
font-weight: 600;
font-family: inherit;
cursor: pointer;
transition: all 0.3s ease;
}
button:hover {
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}
button:active {
transform: translateY(0);
}
.glow-orb {
position: fixed;
width: 400px;
height: 400px;
border-radius: 50%;
filter: blur(100px);
opacity: 0.2;
pointer-events: none;
z-index: -1;
}
.orb-1 {
background: #6366f1;
top: 20%;
left: -100px;
}
.orb-2 {
background: #c084fc;
bottom: 10%;
right: -100px;
}
</style>
</head>
<body>
<div class="glow-orb orb-1"></div>
<div class="glow-orb orb-2"></div>
<nav class="navbar">
<a href="/my-sites" class="nav-brand">h by Xlnk</a>
<div class="nav-links">
<a href="/my-sites">My Sites</a>
<a href="/upload" class="active">Upload</a>
</div>
</nav>
<div class="container">
<div class="page-header">
<h1>Upload New Site</h1>
<p>Upload your HTML file or ZIP archive</p>
</div>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
<div class="flash-messages">
{% for category, message in messages %}
<div class="flash {{ category }}">{{ message }}</div>
{% endfor %}
</div>
{% endif %}
{% endwith %}
<div class="card">
<form method="post" enctype="multipart/form-data" id="uploadForm">
<div class="form-group">
<label>Select File</label>
<div class="file-upload" id="dropZone">
<input type="file" name="file" id="fileInput" accept=".html,.htm,.zip" required>
<div class="file-upload-icon">📁</div>
<p class="file-upload-text">
<strong>Click to browse</strong> or drag and drop
</p>
<p class="hint">HTML file or ZIP archive</p>
<p class="file-name" id="fileName"></p>
</div>
</div>
<div class="form-group">
<label for="site_id">Custom Site ID (optional)</label>
<input type="text" id="site_id" name="site_id" placeholder="e.g., mysite">
<p class="hint">Leave empty for auto-generated ID</p>
</div>
<div class="form-group">
<label for="expires">Expiration Date (optional)</label>
<input type="date" id="expires" name="expires">
<p class="hint">Site will be auto-deleted after this date</p>
</div>
<button type="submit">🚀 Upload Site</button>
</form>
</div>
</div>
<script>
const dropZone = document.getElementById('dropZone');
const fileInput = document.getElementById('fileInput');
const fileName = document.getElementById('fileName');
dropZone.addEventListener('click', () => fileInput.click());
dropZone.addEventListener('dragover', (e) => {
e.preventDefault();
dropZone.classList.add('dragover');
});
dropZone.addEventListener('dragleave', () => {
dropZone.classList.remove('dragover');
});
dropZone.addEventListener('drop', (e) => {
e.preventDefault();
dropZone.classList.remove('dragover');
if (e.dataTransfer.files.length) {
fileInput.files = e.dataTransfer.files;
updateFileName();
}
});
fileInput.addEventListener('change', updateFileName);
function updateFileName() {
if (fileInput.files.length) {
fileName.textContent = '✓ ' + fileInput.files[0].name;
}
}
</script>
</body>
</html>