239 lines
6.6 KiB
HTML
239 lines
6.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Request Credits - LibreChat</title>
|
|
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
|
<style>
|
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
|
|
body {
|
|
font-family: 'Montserrat', sans-serif;
|
|
background: #000;
|
|
color: #f8fafc;
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.request-container {
|
|
width: 460px;
|
|
max-width: 90vw;
|
|
}
|
|
|
|
.request-header {
|
|
text-align: center;
|
|
margin-bottom: 32px;
|
|
}
|
|
|
|
.request-header .logo {
|
|
width: 56px;
|
|
height: 56px;
|
|
background: #FFC407;
|
|
border-radius: 14px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin: 0 auto 16px;
|
|
}
|
|
|
|
.request-header .logo svg {
|
|
width: 28px;
|
|
height: 28px;
|
|
color: #000;
|
|
}
|
|
|
|
.request-header h1 {
|
|
font-size: 24px;
|
|
font-weight: 700;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.request-header p {
|
|
color: #94a3b8;
|
|
font-size: 14px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.request-card {
|
|
background: rgba(20, 20, 20, 0.6);
|
|
border: 1px solid rgba(255, 196, 7, 0.12);
|
|
border-radius: 16px;
|
|
padding: 32px;
|
|
backdrop-filter: blur(12px);
|
|
}
|
|
|
|
.field {
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.field label {
|
|
display: block;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
color: #94a3b8;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.field input {
|
|
width: 100%;
|
|
background: rgba(30, 30, 30, 0.8);
|
|
border: 1px solid rgba(255, 196, 7, 0.12);
|
|
border-radius: 10px;
|
|
padding: 14px 16px;
|
|
color: #f8fafc;
|
|
font-family: 'Montserrat', sans-serif;
|
|
font-size: 14px;
|
|
outline: none;
|
|
transition: border-color 0.2s;
|
|
}
|
|
|
|
.field input::placeholder { color: #64748b; }
|
|
.field input:focus { border-color: #FFC407; }
|
|
|
|
.submit-btn {
|
|
width: 100%;
|
|
padding: 14px;
|
|
background: #FFC407;
|
|
color: #000;
|
|
border: none;
|
|
border-radius: 10px;
|
|
font-family: 'Montserrat', sans-serif;
|
|
font-size: 14px;
|
|
font-weight: 700;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.submit-btn:hover { background: #e6b006; transform: translateY(-1px); }
|
|
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
|
|
|
|
.success-message {
|
|
display: none;
|
|
text-align: center;
|
|
padding: 32px 0;
|
|
}
|
|
|
|
.success-message .check {
|
|
width: 64px;
|
|
height: 64px;
|
|
background: rgba(74, 222, 128, 0.15);
|
|
border-radius: 50%;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin: 0 auto 16px;
|
|
}
|
|
|
|
.success-message .check svg {
|
|
width: 32px;
|
|
height: 32px;
|
|
color: #4ade80;
|
|
}
|
|
|
|
.success-message h2 {
|
|
font-size: 20px;
|
|
font-weight: 700;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.success-message p {
|
|
color: #94a3b8;
|
|
font-size: 14px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.error-text {
|
|
color: #f87171;
|
|
font-size: 13px;
|
|
margin-top: 8px;
|
|
display: none;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="request-container">
|
|
<div class="request-header">
|
|
<div class="logo">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2.5"/><path d="M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"/></svg>
|
|
</div>
|
|
<h1>Request Credits</h1>
|
|
<p>Submit a request to top up your LibreChat token balance. An admin will review and process your request.</p>
|
|
</div>
|
|
|
|
<div class="request-card">
|
|
<form id="request-form">
|
|
<div class="field">
|
|
<label>Your Email Address</label>
|
|
<input type="email" id="req-email" placeholder="you@company.com" required autocomplete="email">
|
|
</div>
|
|
<div class="field">
|
|
<label>OMG Job Number</label>
|
|
<input type="text" id="req-omg" placeholder="e.g. OMG-12345" required>
|
|
</div>
|
|
<div class="error-text" id="error-text"></div>
|
|
<button type="submit" class="submit-btn" id="submit-btn">Submit Request</button>
|
|
</form>
|
|
|
|
<div class="success-message" id="success-message">
|
|
<div class="check">
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
|
|
</div>
|
|
<h2>Request Submitted</h2>
|
|
<p>Your request has been sent to the admin team. You'll receive your credits once it's been reviewed and approved.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
const form = document.getElementById('request-form');
|
|
const errorText = document.getElementById('error-text');
|
|
const submitBtn = document.getElementById('submit-btn');
|
|
const successMessage = document.getElementById('success-message');
|
|
|
|
form.addEventListener('submit', async (e) => {
|
|
e.preventDefault();
|
|
errorText.style.display = 'none';
|
|
submitBtn.disabled = true;
|
|
submitBtn.textContent = 'Submitting...';
|
|
|
|
const email = document.getElementById('req-email').value.trim();
|
|
const omgJobNumber = document.getElementById('req-omg').value.trim();
|
|
|
|
if (!email || !omgJobNumber) {
|
|
errorText.textContent = 'Both fields are required.';
|
|
errorText.style.display = 'block';
|
|
submitBtn.disabled = false;
|
|
submitBtn.textContent = 'Submit Request';
|
|
return;
|
|
}
|
|
|
|
try {
|
|
const base = window.location.pathname.replace(/\/request(\.html)?$/, '').replace(/\/$/, '');
|
|
const res = await fetch(`${base}/api/requests`, {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({ email, omgJobNumber }),
|
|
});
|
|
|
|
const data = await res.json();
|
|
if (!res.ok) {
|
|
throw new Error(data.error || 'Failed to submit');
|
|
}
|
|
|
|
form.style.display = 'none';
|
|
successMessage.style.display = 'block';
|
|
} catch (err) {
|
|
errorText.textContent = err.message;
|
|
errorText.style.display = 'block';
|
|
submitBtn.disabled = false;
|
|
submitBtn.textContent = 'Submit Request';
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|