tablet: split price/pfand, light mode, bigger bold text
- show drink price and Pfand separately on tiles and in cart - add light/dark toggle on the bar-picker page (persisted) - theme via CSS variables, applied on load for tablet + admin - larger, bolder text throughout; much bigger total sum
This commit is contained in:
parent
40cdc98f82
commit
2a43b59947
1 changed files with 111 additions and 28 deletions
|
|
@ -27,6 +27,22 @@ export function formatCents(cents: number): string {
|
|||
return `${sign}${(abs / 100).toFixed(2)} €`;
|
||||
}
|
||||
|
||||
export type Theme = 'dark' | 'light';
|
||||
const THEME_KEY = 'wutz.theme';
|
||||
|
||||
export function getTheme(): Theme {
|
||||
return localStorage.getItem(THEME_KEY) === 'light' ? 'light' : 'dark';
|
||||
}
|
||||
|
||||
export function applyTheme(t: Theme = getTheme()): void {
|
||||
document.documentElement.setAttribute('data-theme', t);
|
||||
}
|
||||
|
||||
export function setTheme(t: Theme): void {
|
||||
localStorage.setItem(THEME_KEY, t);
|
||||
applyTheme(t);
|
||||
}
|
||||
|
||||
export function uuid(): string {
|
||||
if (typeof crypto !== 'undefined' && 'randomUUID' in crypto) {
|
||||
return (crypto as any).randomUUID();
|
||||
|
|
|
|||
Loading…
Reference in a new issue