add one ui theme

This commit is contained in:
Bkk1234 committed 2026-10-24 17:32:25 +07:00
1 parent 7a39f96256
commit e19147dc73
18 files changed
+5299 -785

No files matched your search

+40 -177
View File
@@ -1,203 +1,66 @@
<!DOCTYPE html>
<html lang="en">
<html lang="th">
<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="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover">
<meta name="theme-color" content="#F2F3F5" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#000000" media="(prefers-color-scheme: dark)">
<meta name="color-scheme" content="light dark">
<meta name="mobile-web-app-capable" content="yes">
<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">
<meta name="format-detection" content="telephone=no">
<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>
<link rel="stylesheet" href="css/app.css">
<title>CamCat — ถ่ายรูปแยกโฟลเดอร์</title>
</head>
<body>
<div id="app">
<header>
<h1>📷 CamCat</h1>
<div class="folder-pill" id="active-folder-pill">📁 Default</div>
<div class="head-text">
<h1>CamCat</h1>
<button class="head-sub" id="active-folder-pill" type="button" aria-label="โฟลเดอร์ที่ใช้งาน — แตะเพื่อเปลี่ยน">
<span id="active-folder-name">—</span>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 18l6-6-6-6"/></svg>
</button>
</div>
<div class="head-actions">
<button class="icon-round" id="theme-toggle" type="button" aria-label="สลับธีมสว่าง/มืด"></button>
<button class="icon-round" type="button" data-action="diagnostics" aria-label="ข้อมูลอุปกรณ์และกล้อง">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/></svg>
</button>
</div>
</header>
<main id="main"></main>
<main id="main" aria-live="polite"></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
<nav id="bottom-nav">
<button id="nav-camera" class="active" type="button" data-view="camera" aria-label="กล้อง">
<span class="tab-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/><circle cx="12" cy="13" r="4"/></svg></span>
<span>กล้อง</span>
</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 id="nav-folders" type="button" data-view="folders" aria-label="โฟลเดอร์">
<span class="tab-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg></span>
<span>โฟลเดอร์</span>
</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 id="nav-gallery" type="button" data-view="gallery" aria-label="รูปภาพ">
<span class="tab-ico"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="3"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="M21 15l-5-5L5 21"/></svg></span>
<span>รูปภาพ</span>
</button>
</nav>
</div>
<!-- Modal -->
<div class="modal-overlay" id="modal-overlay">
<div class="modal" id="modal-content"></div>
<div class="sheet-overlay" id="sheet-overlay" hidden aria-hidden="true">
<div class="sheet" id="sheet-content" role="dialog" aria-modal="true"></div>
</div>
<!-- Toast -->
<div id="toast"></div>
<div id="toast" role="status"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jszip.min.js"></script>
<script src="app.js"></script>
<script src="vendor/jszip.min.js"></script>
<script src="vendor/piexif.js"></script>
<script src="vendor/qrcode.min.js"></script>
<script type="module" src="js/main.js"></script>
</body>
</html>