feat: initial project structure webapp

This commit is contained in:
phattaranun.a committed 2026-10-24 16:49:24 +07:00
commit 7a39f96256
8 files changed
+858

No files matched your search

+203
View File
@@ -0,0 +1,203 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="theme-color" content="#7C83FF">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="mobile-web-app-capable" content="yes">
<link rel="manifest" href="manifest.json">
<link rel="icon" href="icon-192.png">
<link rel="apple-touch-icon" href="icon-192.png">
<title>CamCat — Camera Folder Organizer</title>
<style>
:root {
--bg: #0F172A; --surface: #1E293B; --surface-2: #334155;
--text: #F8FAFC; --muted: #94A3B8; --accent: #7C83FF;
--accent-2: #B06BFF; --accent-3: #FF6B9D;
--green: #2DD4A7; --red: #F87A7A; --border: rgba(255,255,255,0.08);
--radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
font-family: -apple-system, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text);
height: 100vh; height: 100dvh; overflow: hidden; user-select: none;
}
/* ── App Shell ── */
#app { display: flex; flex-direction: column; height: 100dvh; }
/* ── Header ── */
header {
background: var(--surface); padding: 12px 16px; display: flex;
align-items: center; justify-content: space-between;
border-bottom: 1px solid var(--border); flex-shrink: 0;
}
header h1 { font-size: 18px; font-weight: 700; }
.folder-pill {
background: var(--accent); color: white; padding: 4px 12px;
border-radius: 20px; font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 4px;
}
/* ── Main; flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }
/* ── Bottom Nav ── */
nav {
background: var(--surface); border-top: 1px solid var(--border);
display: flex; justify-content: space-around; padding: 8px 0; flex-shrink: 0;
}
nav button {
background: none; border: none; color: var(--muted); font-size: 11px;
display: flex; flex-direction: column; align-items: center; gap: 4px;
padding: 6px 16px; cursor: pointer; transition: color 0.2s;
}
nav button.active { color: var(--accent); }
nav button svg { width: 22px; height: 22px; }
/* ── Camera View ── */
#camera-view { display: flex; flex-direction: column; align-items: center; height: 100%; }
#video {
width: 100%; flex: 1; object-fit: cover; background: #000;
}
.camera-bar {
padding: 20px; display: flex; justify-content: center; align-items: center; gap: 30px;
background: var(--surface); width: 100%;
}
#shutter {
width: 64px; height: 64px; border-radius: 50%; background: var(--accent-3);
border: 4px solid white; cursor: pointer; font-size: 0; transition: transform 0.1s;
}
#shutter:active { transform: scale(0.9); }
#switch-cam {
width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2);
border: none; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
/* ── Folders View ── */
.section-head {
padding: 16px; display: flex; justify-content: space-between; align-items: center;
}
.section-head h2 { font-size: 16px; }
.btn-primary {
background: var(--accent); color: white; border: none; padding: 8px 16px;
border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.btn-ghost {
background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
padding: 8px 16px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.folder-list { padding: 0 16px 16px; }
.folder-item {
background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
padding: 14px; margin-bottom: 8px; display: flex; justify-content: space-between;
align-items: center; cursor: pointer; transition: border-color 0.2s;
}
.folder-item:hover { border-color: var(--accent); }
.folder-item.active { border-color: var(--accent); background: rgba(124,131,255,0.08); }
.folder-item .name { font-weight: 600; font-size: 14px; }
.folder-item .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.folder-item .actions { display: flex; gap: 8px; }
.icon-btn {
background: var(--surface-2); border: none; color: var(--muted); width: 32px; height: 32px;
border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--text); }
/* ── Gallery View ── */
.gallery-grid {
display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 16px 16px;
}
.gallery-item {
aspect-ratio: 1; border-radius: 8px; overflow: hidden; position: relative; cursor: pointer;
border: 2px solid transparent; transition: border-color 0.15s;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.gallery-item.selected { border-color: var(--accent); }
.gallery-item .check {
position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
border-radius: 50%; background: var(--accent); color: white;
display: none; align-items: center; justify-content: center; font-size: 12px;
}
.gallery-item.selected .check { display: flex; }
.gallery-bar {
padding: 8px 16px; display: flex; justify-content: space-between; align-items: center;
background: var(--surface); font-size: 12px; color: var(--muted);
}
.gallery-actions { display: flex; gap: 8px; }
/* ── Image Viewer ── */
#image-viewer { padding: 16px; display: flex; flex-direction: column; height: 100%; }
#image-viewer img { flex: 1; border-radius: var(--radius); object-fit: contain; min-height: 0; }
.exif-panel {
background: var(--surface); border-radius: var(--radius); padding: 12px; margin-top: 12px;
font-size: 12px; line-height: 1.8; color: var(--muted); flex-shrink: 0; max-height: 200px; overflow-y: auto;
}
.exif-panel b { color: var(--text); font-size: 13px; }
.exif-panel .row { display: flex; justify-content: space-between; }
.exif-panel .key { color: var(--muted); }
.exif-panel .val { color: var(--text); }
/* ── Modal ── */
.modal-overlay {
position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100;
display: none; align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
background: var(--surface); border-radius: 16px; padding: 20px; width: 90%; max-width: 360px;
}
.modal h3 { margin-bottom: 12px; }
.modal input {
width: 100%; padding: 12px; background: var(--bg); border: 1px solid var(--border);
border-radius: 8px; color: var(--text); font-size: 14px; margin-bottom: 12px;
}
.modal-actions { display: flex; gap: 8px; }
.modal-actions button { flex: 1; padding: 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
/* ── Toast ── */
#toast {
position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
background: var(--surface-2); color: var(--text); padding: 10px 20px;
border-radius: 20px; font-size: 13px; z-index: 200; opacity: 0;
transition: opacity 0.3s; pointer-events: none;
}
#toast.show { opacity: 1; }
/* ── Empty State ── */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.3; }
/* ── Loading ── */
.spinner {
border: 3px solid var(--border); border-top-color: var(--accent);
border-radius: 50%; width: 32px; height: 32px; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
</style>
</head>
<body>
<div id="app">
<header>
<h1>📷 CamCat</h1>
<div class="folder-pill" id="active-folder-pill">📁 Default</div>
</header>
<main id="main"></main>
<nav>
<button id="nav-camera" class="active" onclick="navigate('camera')">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 19a2 2 0 01-2 2H3a2 %200 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z"/><circle cx="12" cy="13" r="4"/></svg>
Camera
</button>
<button id="nav-folders" onclick="navigate('folders')">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"/></svg>
Folders
</button>
<button id="nav-gallery" onclick="navigate('gallery')">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg>
Gallery
</button>
</nav>
</div>
<!-- Modal -->
<div class="modal-overlay" id="modal-overlay">
<div class="modal" id="modal-content"></div>
</div>
<!-- Toast -->
<div id="toast"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jszip.min.js"></script>
<script src="app.js"></script>
</body>
</html>