feat: complete v1 — QR invoice generator with i18n, short URLs, offline support

- XMR address validation (standard, subaddress, integrated)
- Amount in XMR/EUR/USD/CHF with CoinGecko conversion
- QR code generation with monero: URI
- Shareable short URLs (/s/abc123) via self-hosted PHP backend
- i18n (DE/EN) with browser language detection
- Service worker for offline capability
- Dark mode, responsive design
This commit is contained in:
Alexander Schmidt
2026-03-24 16:38:44 +01:00
parent 5a088f595b
commit bd796e46dc
9 changed files with 1190 additions and 17 deletions

418
style.css Normal file
View File

@@ -0,0 +1,418 @@
:root {
--bg: #0d0d0d;
--bg-card: #1a1a1a;
--bg-input: #222;
--border: #333;
--text: #e0e0e0;
--text-muted: #888;
--accent: #ff6600;
--accent-hover: #ff8533;
--success: #4caf50;
--error: #f44336;
--radius: 8px;
--font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
--mono: 'JetBrains Mono', 'Fira Code', monospace;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: var(--font);
background: var(--bg);
color: var(--text);
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
}
header {
text-align: center;
padding: 2rem 1rem 1rem;
}
.lang-picker {
position: fixed;
top: 0.75rem;
right: 0.75rem;
z-index: 50;
}
.lang-toggle {
display: flex;
align-items: center;
gap: 0.35rem;
background: var(--bg-card);
border: 1px solid var(--border);
color: var(--text-muted);
padding: 0.35rem 0.6rem;
border-radius: var(--radius);
font-size: 0.75rem;
font-weight: 600;
cursor: pointer;
font-family: var(--font);
transition: border-color 0.2s, color 0.2s;
}
.lang-toggle:hover,
.lang-picker.open .lang-toggle {
border-color: var(--accent);
color: var(--text);
}
.lang-dropdown {
display: none;
position: absolute;
top: calc(100% + 4px);
right: 0;
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
overflow: hidden;
min-width: 120px;
box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.lang-picker.open .lang-dropdown {
display: block;
}
.lang-option {
display: block;
width: 100%;
padding: 0.5rem 0.75rem;
background: none;
border: none;
color: var(--text-muted);
font-family: var(--font);
font-size: 0.8rem;
text-align: left;
cursor: pointer;
transition: background 0.15s, color 0.15s;
}
.lang-option:hover {
background: var(--bg-input);
color: var(--text);
}
.lang-option.active {
color: var(--accent);
}
header h1 {
font-size: 1.8rem;
font-weight: 700;
letter-spacing: -0.5px;
}
header h1 a {
color: inherit;
text-decoration: none;
}
header h1 a:hover {
opacity: 0.8;
}
header h1 span {
color: var(--accent);
}
header p {
color: var(--text-muted);
font-size: 0.9rem;
margin-top: 0.3rem;
}
main {
width: 100%;
max-width: 480px;
padding: 1rem;
}
.card {
background: var(--bg-card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 1.5rem;
margin-bottom: 1rem;
}
label {
display: block;
font-size: 0.8rem;
color: var(--text-muted);
margin-bottom: 0.3rem;
text-transform: uppercase;
letter-spacing: 0.5px;
}
input, select, textarea {
width: 100%;
padding: 0.7rem 0.8rem;
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
font-family: var(--mono);
font-size: 0.9rem;
outline: none;
transition: border-color 0.2s;
color-scheme: dark;
}
input[type="number"] {
-webkit-appearance: none;
-moz-appearance: textfield;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.6rem center;
padding-right: 2rem;
}
input:focus, select:focus, textarea:focus {
border-color: var(--accent);
}
input.invalid {
border-color: var(--error);
}
input.valid {
border-color: var(--success);
}
.field {
margin-bottom: 1rem;
}
.field:last-child {
margin-bottom: 0;
}
.amount-row {
display: flex;
gap: 0.5rem;
}
.amount-row input {
flex: 1;
}
.amount-row select {
width: 90px;
flex-shrink: 0;
}
.fiat-hint {
font-size: 0.75rem;
color: var(--text-muted);
margin-top: 0.3rem;
min-height: 1.1em;
}
.fiat-hint.error {
color: var(--error);
}
textarea {
resize: vertical;
min-height: 60px;
}
.btn {
width: 100%;
padding: 0.8rem;
border: none;
border-radius: var(--radius);
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: background 0.2s, opacity 0.2s;
}
.btn-primary {
background: var(--accent);
color: #fff;
}
.btn-primary:hover {
background: var(--accent-hover);
}
.btn-primary:disabled {
opacity: 0.4;
cursor: not-allowed;
}
.btn-secondary {
background: var(--bg-input);
color: var(--text);
border: 1px solid var(--border);
font-size: 0.85rem;
padding: 0.6rem;
}
.btn-secondary:hover {
border-color: var(--accent);
}
#result {
display: none;
}
#result.visible {
display: block;
}
.qr-container {
display: flex;
justify-content: center;
padding: 1rem 0;
}
.qr-container canvas,
.qr-container img {
border-radius: var(--radius);
padding: 12px;
background: #fff;
}
.uri-box {
background: var(--bg-input);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 0.6rem 0.8rem;
font-family: var(--mono);
font-size: 0.75rem;
word-break: break-all;
color: var(--text-muted);
margin-bottom: 0.8rem;
max-height: 80px;
overflow-y: auto;
}
.share-link-box {
margin-bottom: 0.8rem;
}
.share-link-box label {
margin-bottom: 0.3rem;
}
.share-link-row {
display: flex;
gap: 0.4rem;
}
.share-link-row input {
flex: 1;
font-size: 0.75rem;
padding: 0.5rem 0.6rem;
cursor: text;
}
.btn-icon {
width: auto;
padding: 0.5rem 0.6rem;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.actions {
display: flex;
gap: 0.5rem;
}
.actions .btn-secondary {
flex: 1;
}
.btn-new {
margin-top: 0.8rem;
background: transparent;
border: 1px solid var(--accent);
color: var(--accent);
}
.btn-new:hover {
background: var(--accent);
color: #fff;
}
.toast {
position: fixed;
bottom: 2rem;
left: 50%;
transform: translateX(-50%) translateY(100px);
background: var(--success);
color: #fff;
padding: 0.6rem 1.2rem;
border-radius: var(--radius);
font-size: 0.85rem;
font-weight: 500;
opacity: 0;
transition: transform 0.3s, opacity 0.3s;
z-index: 100;
}
.toast.show {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
footer {
text-align: center;
padding: 2rem 1rem;
color: var(--text-muted);
font-size: 0.75rem;
}
footer a {
color: var(--accent);
text-decoration: none;
}
footer a:hover {
text-decoration: underline;
}
.countdown {
text-align: center;
font-size: 0.85rem;
color: var(--text-muted);
margin-bottom: 0.8rem;
}
.countdown.expired {
color: var(--error);
}
.countdown.active {
color: var(--accent);
}
@media (max-width: 500px) {
main {
padding: 0.5rem;
}
.card {
padding: 1rem;
}
header h1 {
font-size: 1.5rem;
}
}