Spaces:
Running
Running
File size: 14,913 Bytes
bfa0bcc | 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 245 246 247 248 249 250 251 252 253 254 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AppVoyage - New App</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<style>
.sidebar {
transition: all 0.3s ease;
}
.active-nav-item {
background: rgba(124, 58, 237, 0.1);
border-left: 4px solid #7c3aed;
}
.file-upload {
border: 2px dashed #d1d5db;
transition: all 0.3s;
}
.file-upload:hover {
border-color: #7c3aed;
background-color: rgba(124, 58, 237, 0.05);
}
</style>
</head>
<body class="bg-gray-50">
<div class="flex h-screen overflow-hidden">
<!-- Sidebar -->
<div class="sidebar bg-white w-64 border-r border-gray-200 flex flex-col">
<div class="flex items-center justify-center h-16 px-4 border-b border-gray-200">
<div class="flex items-center">
<i data-feather="box" class="w-6 h-6 text-purple-600"></i>
<span class="ml-2 text-xl font-bold text-gray-800">AppVoyage</span>
</div>
</div>
<div class="flex-1 overflow-y-auto">
<nav class="px-4 py-6 space-y-1">
<a href="dashboard.html" class="group flex items-center px-3 py-3 text-sm font-medium rounded-md text-gray-600 hover:bg-purple-50 hover:text-purple-600">
<i data-feather="home" class="flex-shrink-0 h-5 w-5 mr-3 text-gray-400 group-hover:text-purple-600"></i>
Dashboard
</a>
<a href="apps.html" class="group flex items-center px-3 py-3 text-sm font-medium rounded-md text-gray-600 hover:bg-purple-50 hover:text-purple-600">
<i data-feather="grid" class="flex-shrink-0 h-5 w-5 mr-3 text-gray-400 group-hover:text-purple-600"></i>
Apps
</a>
<a href="users.html" class="group flex items-center px-3 py-3 text-sm font-medium rounded-md text-gray-600 hover:bg-purple-50 hover:text-purple-600">
<i data-feather="users" class="flex-shrink-0 h-5 w-5 mr-3 text-gray-400 group-hover:text-purple-600"></i>
Users
</a>
<a href="#" class="group flex items-center px-3 py-3 text-sm font-medium rounded-md text-gray-600 hover:bg-purple-50 hover:text-purple-600">
<i data-feather="settings" class="flex-shrink-0 h-5 w-5 mr-3 text-gray-400 group-hover:text-purple-600"></i>
Settings
</a>
</nav>
</div>
<div class="p-4 border-t border-gray-200">
<div class="flex items-center">
<img class="h-9 w-9 rounded-full" src="http://static.photos/people/200x200/10" alt="User avatar">
<div class="ml-3">
<p class="text-sm font-medium text-gray-700">John Doe</p>
<a href="#" class="text-xs font-medium text-purple-600 hover:text-purple-500">Sign out</a>
</div>
</div>
</div>
</div>
<!-- Main content -->
<div class="flex-1 overflow-auto">
<header class="bg-white shadow-sm">
<div class="flex justify-between items-center px-6 py-4">
<h1 class="text-2xl font-semibold text-gray-800">Add New App</h1>
<div class="flex items-center space-x-4">
<button class="p-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200">
<i data-feather="bell"></i>
</button>
<button class="p-2 rounded-full bg-gray-100 text-gray-600 hover:bg-gray-200">
<i data-feather="help-circle"></i>
</button>
</div>
</div>
</header>
<main class="p-6">
<form id="appForm" class="space-y-6">
<div class="bg-white rounded-lg shadow p-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4">Basic Information</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label for="appName" class="block text-sm font-medium text-gray-700 mb-1">App Name</label>
<input type="text" id="appName" name="appName" required
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
</div>
<div>
<label for="appType" class="block text-sm font-medium text-gray-700 mb-1">App Type</label>
<select id="appType" name="appType" required
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
<option value="">Select type</option>
<option value="web">Web App</option>
<option value="mobile">Mobile App</option>
<option value="ussd">USSD</option>
<option value="api">API</option>
</select>
</div>
<div>
<label for="appUrl" class="block text-sm font-medium text-gray-700 mb-1">App URL</label>
<input type="url" id="appUrl" name="appUrl"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"
placeholder="https://">
</div>
<div>
<label for="appStatus" class="block text-sm font-medium text-gray-700 mb-1">Status</label>
<select id="appStatus" name="appStatus"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
<option value="active">Active</option>
<option value="inactive">Inactive</option>
<option value="development">In Development</option>
</select>
</div>
</div>
<div class="mt-6">
<label for="appDescription" class="block text-sm font-medium text-gray-700 mb-1">Description</label>
<textarea id="appDescription" name="appDescription" rows="3"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"></textarea>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4">App Images</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div class="file-upload p-6 rounded-lg text-center cursor-pointer">
<input type="file" id="appLogo" name="appLogo" accept="image/*" class="hidden">
<div class="flex flex-col items-center justify-center h-full">
<i data-feather="upload" class="w-10 h-10 text-gray-400 mb-2"></i>
<p class="text-sm text-gray-500">Upload Logo (PNG, JPG)</p>
<p class="text-xs text-gray-400 mt-1">Recommended: 200x200 px</p>
</div>
</div>
<div class="file-upload p-6 rounded-lg text-center cursor-pointer">
<input type="file" id="appScreenshot" name="appScreenshot" accept="image/*" class="hidden">
<div class="flex flex-col items-center justify-center h-full">
<i data-feather="image" class="w-10 h-10 text-gray-400 mb-2"></i>
<p class="text-sm text-gray-500">Upload Screenshot</p>
<p class="text-xs text-gray-400 mt-1">Recommended: 16:9 ratio</p>
</div>
</div>
</div>
</div>
<div class="bg-white rounded-lg shadow p-6">
<h2 class="text-lg font-semibold text-gray-800 mb-4">Additional Information</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label for="appCategory" class="block text-sm font-medium text-gray-700 mb-1">Category</label>
<select id="appCategory" name="appCategory"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
<option value="finance">Finance</option>
<option value="health">Health</option>
<option value="education">Education</option>
<option value="ecommerce">E-commerce</option>
<option value="entertainment">Entertainment</option>
<option value="utility">Utility</option>
</select>
</div>
<div>
<label for="appTags" class="block text-sm font-medium text-gray-700 mb-1">Tags</label>
<input type="text" id="appTags" name="appTags"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent"
placeholder="Separate tags with commas">
</div>
<div>
<label for="appOwner" class="block text-sm font-medium text-gray-700 mb-1">Owner/Team</label>
<input type="text" id="appOwner" name="appOwner"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
</div>
<div>
<label for="appLaunchDate" class="block text-sm font-medium text-gray-700 mb-1">Launch Date</label>
<input type="date" id="appLaunchDate" name="appLaunchDate"
class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent">
</div>
</div>
</div>
<div class="flex justify-end space-x-3">
<button type="button" class="px-6 py-2 border border-gray-300 rounded-lg text-sm font-medium text-gray-700 bg-white hover:bg-gray-50">
Cancel
</button>
<button type="submit" class="px-6 py-2 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-purple-600 hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500">
Save App
</button>
</div>
</form>
</main>
</div>
</div>
<script>
feather.replace();
// Handle file upload UI
document.querySelectorAll('.file-upload').forEach(uploadDiv => {
const fileInput = uploadDiv.querySelector('input[type="file"]');
uploadDiv.addEventListener('click', () => fileInput.click());
fileInput.addEventListener('change', (e) => {
if (e.target.files.length > 0) {
uploadDiv.innerHTML = `
<div class="flex flex-col items-center justify-center h-full">
<i data-feather="check-circle" class="w-10 h-10 text-green-500 mb-2"></i>
<p class="text-sm text-gray-700">${e.target.files[0].name}</p>
<p class="text-xs text-gray-500 mt-1">${(e.target.files[0].size / 1024).toFixed(2)} KB</p>
</div>
`;
feather.replace();
}
});
});
// Form submission
document.getElementById('appForm').addEventListener('submit', function(e) {
e.preventDefault();
Swal.fire({
title: 'App Created!',
text: 'Your new app has been added successfully.',
icon: 'success',
confirmButtonText: 'OK',
confirmButtonColor: '#7c3aed'
}).then(() => {
window.location.href = 'apps.html';
});
});
</script>
</body>
</html> |