148 lines
7.0 KiB
HTML
148 lines
7.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Bluetooth Label Printer App</title>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="index.css">
|
|
<link rel="icon" type="image/svg+xml"
|
|
href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🖨️</text></svg>">
|
|
</head>
|
|
|
|
<body>
|
|
<div id="loginOverlay" class="login-overlay">
|
|
<div class="login-card">
|
|
<header class="login-header">
|
|
<div class="icon-container">
|
|
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
|
stroke-linecap="round" stroke-linejoin="round">
|
|
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
|
|
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
|
|
</svg>
|
|
</div>
|
|
<h1>Login Access</h1>
|
|
<p>Please enter your credentials to continue</p>
|
|
</header>
|
|
<form id="loginForm">
|
|
<div class="form-group">
|
|
<label for="username">Username</label>
|
|
<input type="text" id="username" placeholder="Type admin" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="password">Password</label>
|
|
<input type="password" id="password" placeholder="Type admin" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>Security Verification</label>
|
|
<div class="captcha-container">
|
|
<canvas id="captchaCanvas" width="150" height="50"></canvas>
|
|
<button type="button" id="refreshCaptcha" class="icon-btn" title="Refresh Captcha">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
|
stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"></path>
|
|
<path d="M21 3v5h-5"></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
<input type="text" id="captchaInput" placeholder="Enter characters above" required>
|
|
</div>
|
|
<div id="loginError" class="error-message" style="display: none;"></div>
|
|
<button type="submit" class="primary-btn full-width">Sign In</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="app-background"></div>
|
|
|
|
<div class="container" id="appContainer" style="display: none;">
|
|
<header class="app-header">
|
|
<div class="icon-container">
|
|
<svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
|
stroke-linecap="round" stroke-linejoin="round">
|
|
<polyline points="6 9 6 2 18 2 18 9"></polyline>
|
|
<path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"></path>
|
|
<rect x="6" y="14" width="12" height="8"></rect>
|
|
</svg>
|
|
</div>
|
|
<h1>Smart Label Printer</h1>
|
|
<p>58mm Thermal Bluetooth Print</p>
|
|
</header>
|
|
|
|
<section class="device-section">
|
|
<div class="status-indicator">
|
|
<div id="statusDot" class="dot disconnected"></div>
|
|
<span id="statusText">Disconnected</span>
|
|
</div>
|
|
<button id="connectBtn" class="primary-btn">
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
|
stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="m7 7 10 10-5 5V2l5 5L7 17"></path>
|
|
</svg>
|
|
Connect to Printer
|
|
</button>
|
|
</section>
|
|
|
|
<section class="designer-section">
|
|
<h2>Design Label</h2>
|
|
<form id="labelForm">
|
|
<div class="form-group">
|
|
<label for="labelType">Label Type</label>
|
|
<select id="labelType">
|
|
<option value="standard">Standard Label</option>
|
|
<option value="cable">Cable Wrap (Gulung Rapat)</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="itemName" id="itemNameLabel">Item Name</label>
|
|
<input type="text" id="itemName" placeholder="e.g. Premium Coffee Beans" required maxlength="25">
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<div class="form-group">
|
|
<label for="itemPrice" id="itemPriceLabel">Price</label>
|
|
<input type="text" id="itemPrice" placeholder="e.g. Rp 50.000" required>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="itemNotes" id="itemNotesLabel">Additional Notes (Optional)</label>
|
|
<input type="text" id="itemNotes" placeholder="e.g. 500g, Exp: 24/12/26" maxlength="32">
|
|
</div>
|
|
|
|
<div class="preview-container">
|
|
<label>Label Preview (58mm width)</label>
|
|
<div class="label-preview printable-area" id="labelPreview">
|
|
<div class="brand-header">LABEL STORE</div>
|
|
<div class="preview-name" id="previewName">Item Name</div>
|
|
<div class="divider">====================</div>
|
|
<div class="preview-price" id="previewPrice">Rp 0</div>
|
|
<div class="divider">====================</div>
|
|
<div class="preview-notes" id="previewNotes">Notes here</div>
|
|
</div>
|
|
</div>
|
|
|
|
<button type="submit" id="printBtn" class="action-btn" disabled>
|
|
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
|
stroke-linecap="round" stroke-linejoin="round">
|
|
<path d="M6 9V2h12v7" />
|
|
<path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" />
|
|
<rect x="6" y="14" width="12" height="8" />
|
|
</svg>
|
|
Print via Bluetooth
|
|
</button>
|
|
</form>
|
|
</section>
|
|
|
|
<footer>
|
|
<p>Built with Vanilla JS & Web Bluetooth API</p>
|
|
</footer>
|
|
</div>
|
|
|
|
<script src="login.js"></script>
|
|
<script src="app.js"></script>
|
|
</body>
|
|
|
|
</html> |