Files
yoresee_dropbox/web/login.html
T
XingfenD d84e4dfdba feat(web): componentize frontend and replace native delete confirm
- Split monolithic app.js/style.css into Alpine.js components (icons, store, fileSection, confirm)
- Add central Alpine.store('files') as single source of truth for file lists and actions
- Replace duplicated Inbox/Outbox markup with reusable fileSection component (props: dir, canShare)
- Add shared window.Icons module to remove duplicated inline SVGs
- Replace browser-native confirm() for file deletion with a styled, accessible modal dialog
- Split CSS into design tokens, base, and component layers; modernize visuals
- Update web.go embed and server static routes for the new component/style dirs
2026-08-27 15:03:09 +08:00

43 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>yDropbox Login</title>
<link rel="stylesheet" href="/styles/tokens.css">
<link rel="stylesheet" href="/styles/base.css">
<link rel="stylesheet" href="/styles/components.css">
</head>
<body>
<div class="login-wrap">
<div class="login-card">
<h1>y<span>Dropbox</span></h1>
<p>Enter your access token to continue</p>
<form id="loginForm">
<input type="password" id="token" placeholder="Access Token" required autocomplete="current-password">
<div class="login-error" id="loginError">Invalid token. Please try again.</div>
<button type="submit" class="btn btn-primary">Sign In</button>
</form>
</div>
</div>
<script>
document.getElementById('loginForm').addEventListener('submit', async (e) => {
e.preventDefault();
const errEl = document.getElementById('loginError');
errEl.classList.remove('show');
const token = document.getElementById('token').value;
const res = await fetch('/api/login', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({token})
});
if (res.ok) {
window.location.href = '/';
} else {
errEl.classList.add('show');
}
});
</script>
</body>
</html>