2025-12-22 13:14:56 +01:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="da">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
<title>Kunder - POC</title>
|
|
|
|
|
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
|
|
|
<style>
|
2025-12-29 13:47:09 +01:00
|
|
|
/* ==========================================
|
|
|
|
|
FONT FACE (Poppins)
|
|
|
|
|
========================================== */
|
|
|
|
|
@font-face {
|
|
|
|
|
font-family: 'Poppins';
|
|
|
|
|
src: url('fonts/Poppins-Regular.woff') format('woff');
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
font-display: swap;
|
|
|
|
|
}
|
|
|
|
|
@font-face {
|
|
|
|
|
font-family: 'Poppins';
|
|
|
|
|
src: url('fonts/Poppins-Medium.woff') format('woff');
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
font-display: swap;
|
|
|
|
|
}
|
|
|
|
|
@font-face {
|
|
|
|
|
font-family: 'Poppins';
|
|
|
|
|
src: url('fonts/Poppins-SemiBold.woff') format('woff');
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
font-display: swap;
|
|
|
|
|
}
|
|
|
|
|
@font-face {
|
|
|
|
|
font-family: 'Poppins';
|
|
|
|
|
src: url('fonts/Poppins-Bold.woff') format('woff');
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
font-display: swap;
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-22 13:14:56 +01:00
|
|
|
/* ==========================================
|
|
|
|
|
CSS VARIABLES (Design System)
|
|
|
|
|
========================================== */
|
|
|
|
|
:root {
|
|
|
|
|
/* Colors */
|
|
|
|
|
--color-surface: #fff;
|
|
|
|
|
--color-background: #f5f5f5;
|
|
|
|
|
--color-background-hover: #f0f0f0;
|
|
|
|
|
--color-background-alt: #fafafa;
|
|
|
|
|
--color-border: #e0e0e0;
|
|
|
|
|
--color-text: #333;
|
|
|
|
|
--color-text-secondary: #666;
|
|
|
|
|
--color-teal: #00897b;
|
|
|
|
|
--color-blue: #1976d2;
|
|
|
|
|
--color-red: #e53935;
|
|
|
|
|
--color-amber: #ffb300;
|
|
|
|
|
--color-purple: #8b5cf6;
|
|
|
|
|
--color-green: #43a047;
|
|
|
|
|
|
|
|
|
|
/* Typography */
|
2025-12-29 13:47:09 +01:00
|
|
|
--font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
2025-12-22 13:14:56 +01:00
|
|
|
--font-mono: 'JetBrains Mono', monospace;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ==========================================
|
|
|
|
|
RESET & BASE
|
|
|
|
|
========================================== */
|
|
|
|
|
* {
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
body {
|
|
|
|
|
font-family: var(--font-family);
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
background: var(--color-background);
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ==========================================
|
|
|
|
|
LAYOUT
|
|
|
|
|
========================================== */
|
|
|
|
|
swp-page-container {
|
|
|
|
|
display: block;
|
|
|
|
|
max-width: 1400px;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
padding: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ==========================================
|
|
|
|
|
HEADER
|
|
|
|
|
========================================== */
|
|
|
|
|
swp-page-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-page-title {
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-page-actions {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-btn {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
padding: 10px 16px;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
border: none;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: all 150ms ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-btn.primary {
|
|
|
|
|
background: var(--color-teal);
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-btn.primary:hover {
|
|
|
|
|
background: #00796b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-btn.secondary {
|
|
|
|
|
background: var(--color-surface);
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-btn.secondary:hover {
|
|
|
|
|
background: var(--color-background);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ==========================================
|
|
|
|
|
STATS BAR
|
|
|
|
|
========================================== */
|
|
|
|
|
swp-stats-bar {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(3, 1fr);
|
|
|
|
|
gap: 16px;
|
|
|
|
|
margin-bottom: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-stat-card {
|
|
|
|
|
background: var(--color-surface);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
padding: 16px 20px;
|
|
|
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-stat-value {
|
|
|
|
|
display: block;
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
font-family: var(--font-mono);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-stat-label {
|
|
|
|
|
display: block;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-stat-card.highlight swp-stat-value {
|
|
|
|
|
color: var(--color-teal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ==========================================
|
|
|
|
|
SEARCH BAR
|
|
|
|
|
========================================== */
|
|
|
|
|
swp-search-bar {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 16px;
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
background: var(--color-surface);
|
|
|
|
|
padding: 12px 16px;
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-search-input {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 10px;
|
|
|
|
|
flex: 1;
|
|
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-search-input img {
|
|
|
|
|
width: 18px;
|
|
|
|
|
height: 18px;
|
|
|
|
|
opacity: 0.5;
|
|
|
|
|
filter: invert(22%) sepia(14%) saturate(1042%) hue-rotate(164deg) brightness(102%) contrast(85%);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-search-input input {
|
|
|
|
|
flex: 1;
|
|
|
|
|
padding: 8px 0;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
border: none;
|
|
|
|
|
outline: none;
|
|
|
|
|
background: transparent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-search-input input::placeholder {
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-search-filters {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-btn {
|
|
|
|
|
padding: 6px 14px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
border-radius: 20px;
|
|
|
|
|
background: var(--color-surface);
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: all 150ms ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-btn:hover {
|
|
|
|
|
border-color: var(--color-teal);
|
|
|
|
|
color: var(--color-teal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.filter-btn.active {
|
|
|
|
|
background: var(--color-teal);
|
|
|
|
|
border-color: var(--color-teal);
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-search-count {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ==========================================
|
|
|
|
|
TABLE
|
|
|
|
|
========================================== */
|
|
|
|
|
swp-customer-table {
|
|
|
|
|
display: block;
|
|
|
|
|
background: var(--color-surface);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Grid: Navn(220) | Tlf(130) | Email(200) | Besøg(70) | Sidste(100) | Frisør(100) | Oprettet(90) | Tags(1fr) */
|
|
|
|
|
swp-table-header,
|
|
|
|
|
swp-customer-row {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: 220px 130px 200px 70px 100px 100px 90px 1fr;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-table-header {
|
|
|
|
|
background: var(--color-background);
|
|
|
|
|
border-bottom: 1px solid var(--color-border);
|
|
|
|
|
padding: 14px 20px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-th {
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
letter-spacing: 0.5px;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
user-select: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-th.sortable {
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
transition: color 150ms ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-th.sortable:hover {
|
|
|
|
|
color: var(--color-teal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-th.sorted {
|
|
|
|
|
color: var(--color-teal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sort-icon {
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
opacity: 0.4;
|
|
|
|
|
transition: opacity 150ms ease, transform 150ms ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-th.sorted .sort-icon {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-th.sorted.desc .sort-icon {
|
|
|
|
|
transform: rotate(180deg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-table-body {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-row {
|
|
|
|
|
padding: 14px 20px;
|
|
|
|
|
border-bottom: 1px solid var(--color-border);
|
|
|
|
|
transition: background 150ms ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-row:last-child {
|
|
|
|
|
border-bottom: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-row:hover {
|
|
|
|
|
background: var(--color-background-hover);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-row.hidden {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Table cells */
|
|
|
|
|
swp-td {
|
|
|
|
|
display: block;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-td.secondary {
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-td.center {
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-td.mono {
|
|
|
|
|
font-family: var(--font-mono);
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Name cell with avatar */
|
|
|
|
|
.name-cell {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-avatar {
|
|
|
|
|
width: 34px;
|
|
|
|
|
height: 34px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
background: var(--color-teal);
|
|
|
|
|
color: white;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-name {
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Tags */
|
|
|
|
|
swp-customer-tags {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-tag {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
padding: 3px 8px;
|
|
|
|
|
font-size: 10px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
letter-spacing: 0.3px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
background: var(--color-background);
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-tag.vip {
|
|
|
|
|
background: color-mix(in srgb, var(--color-amber) 20%, white);
|
|
|
|
|
color: #b8860b;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-tag.stamkunde {
|
|
|
|
|
background: color-mix(in srgb, var(--color-teal) 15%, white);
|
|
|
|
|
color: var(--color-teal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-tag.ny {
|
|
|
|
|
background: color-mix(in srgb, var(--color-blue) 15%, white);
|
|
|
|
|
color: var(--color-blue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-tag.allergi {
|
|
|
|
|
background: color-mix(in srgb, var(--color-red) 15%, white);
|
|
|
|
|
color: var(--color-red);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-tag.sensitiv {
|
|
|
|
|
background: color-mix(in srgb, var(--color-purple) 15%, white);
|
|
|
|
|
color: var(--color-purple);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ==========================================
|
|
|
|
|
EMPTY STATE
|
|
|
|
|
========================================== */
|
|
|
|
|
swp-empty-state {
|
|
|
|
|
display: none;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
padding: 60px 20px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-empty-state.visible {
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-empty-state svg {
|
|
|
|
|
width: 64px;
|
|
|
|
|
height: 64px;
|
|
|
|
|
opacity: 0.3;
|
|
|
|
|
margin-bottom: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-empty-state p {
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ==========================================
|
|
|
|
|
RESPONSIVE (optional)
|
|
|
|
|
========================================== */
|
|
|
|
|
@media (max-width: 1200px) {
|
|
|
|
|
swp-table-header,
|
|
|
|
|
swp-customer-row {
|
|
|
|
|
grid-template-columns: 200px 120px 180px 60px 90px 90px 90px 80px 1fr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ==========================================
|
|
|
|
|
OVERLAY
|
|
|
|
|
========================================== */
|
|
|
|
|
swp-overlay {
|
|
|
|
|
position: fixed;
|
|
|
|
|
inset: 0;
|
|
|
|
|
background: rgba(0, 0, 0, 0.25);
|
|
|
|
|
opacity: 0;
|
|
|
|
|
visibility: hidden;
|
|
|
|
|
transition: opacity 200ms ease, visibility 0ms 200ms;
|
|
|
|
|
z-index: 900;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-overlay.open {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
visibility: visible;
|
|
|
|
|
transition: opacity 200ms ease, visibility 0ms 0ms;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ==========================================
|
|
|
|
|
CUSTOMER CARD PANEL
|
|
|
|
|
========================================== */
|
|
|
|
|
swp-customer-card {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
width: 680px;
|
|
|
|
|
background: var(--color-surface);
|
|
|
|
|
box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
|
|
|
|
|
transform: translateX(100%);
|
|
|
|
|
opacity: 0;
|
|
|
|
|
transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
z-index: 1000;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-card.open {
|
|
|
|
|
transform: translateX(0);
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-card-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 20px 24px;
|
|
|
|
|
border-bottom: 1px solid var(--color-border);
|
|
|
|
|
background: var(--color-background-alt);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-card-title {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-card-title img {
|
|
|
|
|
width: 20px;
|
|
|
|
|
height: 20px;
|
|
|
|
|
filter: invert(22%) sepia(14%) saturate(1042%) hue-rotate(164deg) brightness(102%) contrast(85%);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-card-close {
|
|
|
|
|
width: 32px;
|
|
|
|
|
height: 32px;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
border: none;
|
|
|
|
|
background: transparent;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
transition: background 150ms ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-card-close:hover {
|
|
|
|
|
background: var(--color-background);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-card-content {
|
|
|
|
|
flex: 1;
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
padding: 24px;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 24px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Customer Header */
|
|
|
|
|
swp-customer-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 20px;
|
|
|
|
|
padding-bottom: 20px;
|
|
|
|
|
border-bottom: 1px solid var(--color-border);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-header swp-customer-avatar {
|
|
|
|
|
width: 80px;
|
|
|
|
|
height: 80px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
background: linear-gradient(135deg, var(--color-teal) 0%, #00695c 100%);
|
|
|
|
|
color: white;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-header-info {
|
|
|
|
|
flex: 1;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-header-top {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-header-left {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-header-name {
|
|
|
|
|
font-size: 24px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-since {
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-header-contact {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: flex-end;
|
|
|
|
|
gap: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-header-contact a {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: var(--color-teal);
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-customer-header-contact a:hover {
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-22 15:00:38 +01:00
|
|
|
swp-customer-header-contact swp-customer-tags {
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-22 13:14:56 +01:00
|
|
|
/* Fact Boxes */
|
|
|
|
|
swp-fact-boxes {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(3, 1fr);
|
|
|
|
|
gap: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-fact-box {
|
|
|
|
|
padding: 16px;
|
|
|
|
|
background: var(--color-background-alt);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-fact-box.highlight {
|
|
|
|
|
background: color-mix(in srgb, var(--color-teal) 10%, white);
|
|
|
|
|
border-color: var(--color-teal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-fact-box-value {
|
|
|
|
|
display: block;
|
|
|
|
|
font-size: 20px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
font-family: var(--font-mono);
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-fact-box.highlight swp-fact-box-value {
|
|
|
|
|
color: var(--color-teal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-fact-box-label {
|
|
|
|
|
display: block;
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
letter-spacing: 0.5px;
|
|
|
|
|
margin-top: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Section Labels */
|
|
|
|
|
swp-section-label {
|
|
|
|
|
display: block;
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
letter-spacing: 0.5px;
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Edit Section */
|
|
|
|
|
swp-edit-section {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-edit-row {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: 120px 1fr;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-edit-label {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-edit-input {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-edit-input input {
|
|
|
|
|
flex: 1;
|
|
|
|
|
padding: 10px 12px;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
background: var(--color-surface);
|
|
|
|
|
transition: border-color 150ms ease;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-edit-input input:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
border-color: var(--color-teal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-edit-input input.short {
|
|
|
|
|
max-width: 80px;
|
|
|
|
|
flex: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Marketing Section */
|
|
|
|
|
swp-marketing-section {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-toggle-row {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 12px 16px;
|
|
|
|
|
background: var(--color-background-alt);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-toggle-label {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-22 15:00:38 +01:00
|
|
|
swp-toggle-slider {
|
|
|
|
|
display: flex;
|
2025-12-22 13:14:56 +01:00
|
|
|
position: relative;
|
2025-12-22 15:00:38 +01:00
|
|
|
background: var(--color-background);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
padding: 3px;
|
|
|
|
|
gap: 0;
|
2025-12-22 13:14:56 +01:00
|
|
|
}
|
|
|
|
|
|
2025-12-22 15:00:38 +01:00
|
|
|
swp-toggle-slider::before {
|
2025-12-22 13:14:56 +01:00
|
|
|
content: '';
|
|
|
|
|
position: absolute;
|
2025-12-22 15:00:38 +01:00
|
|
|
top: 3px;
|
|
|
|
|
left: 3px;
|
|
|
|
|
width: calc(50% - 3px);
|
|
|
|
|
height: calc(100% - 6px);
|
|
|
|
|
background: color-mix(in srgb, var(--color-green) 18%, white);
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
transition: transform 200ms ease, background 200ms ease;
|
|
|
|
|
z-index: 0;
|
2025-12-22 13:14:56 +01:00
|
|
|
}
|
|
|
|
|
|
2025-12-22 15:00:38 +01:00
|
|
|
swp-toggle-slider[data-value="no"]::before {
|
|
|
|
|
transform: translateX(100%);
|
|
|
|
|
background: color-mix(in srgb, var(--color-red) 18%, white);
|
2025-12-22 13:14:56 +01:00
|
|
|
}
|
|
|
|
|
|
2025-12-22 15:00:38 +01:00
|
|
|
swp-toggle-option {
|
|
|
|
|
position: relative;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
padding: 5px 16px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: color 200ms ease;
|
|
|
|
|
user-select: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-toggle-slider[data-value="yes"] swp-toggle-option:first-child {
|
|
|
|
|
color: var(--color-green);
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-toggle-slider[data-value="no"] swp-toggle-option:last-child {
|
|
|
|
|
color: var(--color-red);
|
|
|
|
|
font-weight: 600;
|
2025-12-22 13:14:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Profile Boxes */
|
|
|
|
|
swp-profile-boxes {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(2, 1fr);
|
|
|
|
|
gap: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-profile-box {
|
|
|
|
|
padding: 12px 14px;
|
|
|
|
|
background: var(--color-background-alt);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-profile-box.warning {
|
|
|
|
|
background: color-mix(in srgb, var(--color-red) 8%, white);
|
|
|
|
|
border-color: color-mix(in srgb, var(--color-red) 30%, white);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-profile-box-label {
|
|
|
|
|
display: block;
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
letter-spacing: 0.5px;
|
|
|
|
|
margin-bottom: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-profile-box-value {
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-profile-box.warning swp-profile-box-value {
|
|
|
|
|
color: var(--color-red);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Chart Section */
|
|
|
|
|
swp-chart-section {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-chart-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 12px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-chart-legend {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-chart-legend-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
gap: 6px;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-chart-legend-dot {
|
|
|
|
|
width: 8px;
|
|
|
|
|
height: 8px;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-chart-legend-dot.services {
|
|
|
|
|
background: var(--color-teal);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-chart-legend-dot.products {
|
|
|
|
|
background: var(--color-blue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-chart-container {
|
|
|
|
|
background: var(--color-background-alt);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
min-height: 180px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Notes Section */
|
|
|
|
|
swp-notes-section {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-note-item {
|
|
|
|
|
display: block;
|
|
|
|
|
padding: 12px 14px;
|
|
|
|
|
background: var(--color-background-alt);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
border: 1px solid var(--color-border);
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-note-item:last-of-type {
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-note-meta {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
margin-bottom: 6px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-note-type {
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
text-transform: uppercase;
|
|
|
|
|
letter-spacing: 0.3px;
|
|
|
|
|
padding: 2px 6px;
|
|
|
|
|
border-radius: 3px;
|
|
|
|
|
background: color-mix(in srgb, var(--color-blue) 15%, white);
|
|
|
|
|
color: var(--color-blue);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-note-date {
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
color: var(--color-text-secondary);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-note-text {
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: var(--color-text);
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-see-all-link {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
margin-top: 12px;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
color: var(--color-teal);
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
swp-see-all-link:hover {
|
|
|
|
|
text-decoration: underline;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
|
|
<swp-page-container>
|
|
|
|
|
<!-- Page Header -->
|
|
|
|
|
<swp-page-header>
|
|
|
|
|
<swp-page-title>Kunder</swp-page-title>
|
|
|
|
|
<swp-page-actions>
|
|
|
|
|
<swp-btn class="secondary">
|
|
|
|
|
<span>⬇</span> Eksporter
|
|
|
|
|
</swp-btn>
|
|
|
|
|
<swp-btn class="primary">
|
|
|
|
|
<span>+</span> Ny kunde
|
|
|
|
|
</swp-btn>
|
|
|
|
|
</swp-page-actions>
|
|
|
|
|
</swp-page-header>
|
|
|
|
|
|
|
|
|
|
<!-- Stats Bar -->
|
|
|
|
|
<swp-stats-bar>
|
|
|
|
|
<swp-stat-card class="highlight">
|
|
|
|
|
<swp-stat-value>12</swp-stat-value>
|
|
|
|
|
<swp-stat-label>Total kunder</swp-stat-label>
|
|
|
|
|
</swp-stat-card>
|
|
|
|
|
<swp-stat-card>
|
|
|
|
|
<swp-stat-value>3</swp-stat-value>
|
|
|
|
|
<swp-stat-label>Nye denne måned</swp-stat-label>
|
|
|
|
|
</swp-stat-card>
|
|
|
|
|
<swp-stat-card>
|
|
|
|
|
<swp-stat-value>12,4</swp-stat-value>
|
|
|
|
|
<swp-stat-label>Gns. besøg</swp-stat-label>
|
|
|
|
|
</swp-stat-card>
|
|
|
|
|
</swp-stats-bar>
|
|
|
|
|
|
|
|
|
|
<!-- Search Bar -->
|
|
|
|
|
<swp-search-bar>
|
|
|
|
|
<swp-search-input>
|
|
|
|
|
<img src="icons/search.svg" alt="">
|
|
|
|
|
<input type="text" id="searchInput" placeholder="Søg kunde (navn, telefon, email...)">
|
|
|
|
|
</swp-search-input>
|
|
|
|
|
<swp-search-filters>
|
|
|
|
|
<button class="filter-btn active" data-filter="all">Alle</button>
|
|
|
|
|
<button class="filter-btn" data-filter="vip">VIP</button>
|
|
|
|
|
<button class="filter-btn" data-filter="stamkunde">Stamkunder</button>
|
|
|
|
|
<button class="filter-btn" data-filter="ny">Nye</button>
|
|
|
|
|
</swp-search-filters>
|
|
|
|
|
<swp-search-count id="searchCount">12 kunder</swp-search-count>
|
|
|
|
|
</swp-search-bar>
|
|
|
|
|
|
|
|
|
|
<!-- Customer Table -->
|
|
|
|
|
<swp-customer-table>
|
|
|
|
|
<swp-table-header>
|
|
|
|
|
<swp-th class="sortable sorted" data-sort="name">Navn <span class="sort-icon">▲</span></swp-th>
|
|
|
|
|
<swp-th class="sortable" data-sort="phone">Telefon <span class="sort-icon">▲</span></swp-th>
|
|
|
|
|
<swp-th class="sortable" data-sort="email">Email <span class="sort-icon">▲</span></swp-th>
|
|
|
|
|
<swp-th class="sortable" data-sort="visits">Besøg <span class="sort-icon">▲</span></swp-th>
|
|
|
|
|
<swp-th class="sortable" data-sort="lastVisit">Sidste <span class="sort-icon">▲</span></swp-th>
|
|
|
|
|
<swp-th class="sortable" data-sort="hairdresser">Frisør <span class="sort-icon">▲</span></swp-th>
|
|
|
|
|
<swp-th class="sortable" data-sort="created">Oprettet <span class="sort-icon">▲</span></swp-th>
|
|
|
|
|
<swp-th>Tags</swp-th>
|
|
|
|
|
</swp-table-header>
|
|
|
|
|
|
|
|
|
|
<swp-table-body id="tableBody">
|
|
|
|
|
<swp-customer-row data-name="Anna Jensen" data-visits="6" data-revenue="5900" data-created="2024-09" data-tags="">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>AJ</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Anna Jensen</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 22 33 44 55</swp-td>
|
|
|
|
|
<swp-td class="secondary">anna.j@hotmail.dk</swp-td>
|
|
|
|
|
<swp-td class="center">6</swp-td>
|
|
|
|
|
<swp-td>15. nov</swp-td>
|
|
|
|
|
<swp-td>Nina K.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Sep 2024</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
|
|
|
|
|
<swp-customer-row data-name="Camilla Holm" data-visits="25" data-revenue="18500" data-created="2022-12" data-tags="vip">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>CH</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Camilla Holm</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 66 77 88 99</swp-td>
|
|
|
|
|
<swp-td class="secondary">camilla.h@outlook.dk</swp-td>
|
|
|
|
|
<swp-td class="center">25</swp-td>
|
|
|
|
|
<swp-td>28. okt</swp-td>
|
|
|
|
|
<swp-td>Emma L.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Dec 2022</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags><swp-tag class="vip">VIP</swp-tag></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
|
|
|
|
|
<swp-customer-row data-name="Emma Larsen" data-visits="8" data-revenue="8200" data-created="2024-06" data-tags="">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>EL</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Emma Larsen</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 12 34 56 78</swp-td>
|
|
|
|
|
<swp-td class="secondary">emma.l@gmail.com</swp-td>
|
|
|
|
|
<swp-td class="center">8</swp-td>
|
|
|
|
|
<swp-td>5. dec</swp-td>
|
|
|
|
|
<swp-td>Nina K.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Jun 2024</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
|
|
|
|
|
<swp-customer-row data-name="Freja Christensen" data-visits="31" data-revenue="22100" data-created="2022-08" data-tags="vip,allergi">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>FC</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Freja Christensen</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 55 66 77 88</swp-td>
|
|
|
|
|
<swp-td class="secondary">freja.c@outlook.dk</swp-td>
|
|
|
|
|
<swp-td class="center">31</swp-td>
|
|
|
|
|
<swp-td>20. nov</swp-td>
|
|
|
|
|
<swp-td>Emma L.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Aug 2022</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags><swp-tag class="vip">VIP</swp-tag><swp-tag class="allergi">Allergi</swp-tag></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
|
|
|
|
|
<swp-customer-row data-name="Ida Andersen" data-visits="3" data-revenue="4500" data-created="2025-10" data-tags="ny">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>IA</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Ida Andersen</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 11 22 33 44</swp-td>
|
|
|
|
|
<swp-td class="secondary">ida@firma.dk</swp-td>
|
|
|
|
|
<swp-td class="center">3</swp-td>
|
|
|
|
|
<swp-td>28. nov</swp-td>
|
|
|
|
|
<swp-td>Sofie M.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Okt 2025</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags><swp-tag class="ny">Ny</swp-tag></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
|
|
|
|
|
<swp-customer-row data-name="Katrine Berg" data-visits="12" data-revenue="9600" data-created="2024-04" data-tags="">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>KB</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Katrine Berg</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 55 66 77 88</swp-td>
|
|
|
|
|
<swp-td class="secondary">katrine.b@firma.dk</swp-td>
|
|
|
|
|
<swp-td class="center">12</swp-td>
|
|
|
|
|
<swp-td>1. nov</swp-td>
|
|
|
|
|
<swp-td>Nina K.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Apr 2024</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
|
|
|
|
|
<swp-customer-row data-name="Line Frost" data-visits="9" data-revenue="7400" data-created="2024-05" data-tags="sensitiv">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>LF</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Line Frost</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 88 99 00 11</swp-td>
|
|
|
|
|
<swp-td class="secondary">line.f@mail.dk</swp-td>
|
|
|
|
|
<swp-td class="center">9</swp-td>
|
|
|
|
|
<swp-td>15. okt</swp-td>
|
|
|
|
|
<swp-td>Nina K.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Maj 2024</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags><swp-tag class="sensitiv">Sensitiv</swp-tag></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
|
|
|
|
|
<swp-customer-row data-name="Louise Hansen" data-visits="18" data-revenue="14200" data-created="2023-02" data-tags="stamkunde">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>LH</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Louise Hansen</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 33 44 55 66</swp-td>
|
|
|
|
|
<swp-td class="secondary">louise.h@gmail.com</swp-td>
|
|
|
|
|
<swp-td class="center">18</swp-td>
|
|
|
|
|
<swp-td>10. nov</swp-td>
|
|
|
|
|
<swp-td>Emma L.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Feb 2023</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags><swp-tag class="stamkunde">Stamkunde</swp-tag></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
|
|
|
|
|
<swp-customer-row data-name="Maja Petersen" data-visits="22" data-revenue="15800" data-created="2023-01" data-tags="stamkunde">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>MP</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Maja Petersen</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 98 76 54 32</swp-td>
|
|
|
|
|
<swp-td class="secondary">maja.p@mail.dk</swp-td>
|
|
|
|
|
<swp-td class="center">22</swp-td>
|
|
|
|
|
<swp-td>1. dec</swp-td>
|
|
|
|
|
<swp-td>Emma L.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Jan 2023</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags><swp-tag class="stamkunde">Stamkunde</swp-tag></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
|
|
|
|
|
<swp-customer-row data-name="Maria Olsen" data-visits="2" data-revenue="1800" data-created="2025-11" data-tags="ny">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>MO</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Maria Olsen</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 44 55 66 77</swp-td>
|
|
|
|
|
<swp-td class="secondary">maria.o@mail.dk</swp-td>
|
|
|
|
|
<swp-td class="center">2</swp-td>
|
|
|
|
|
<swp-td>5. nov</swp-td>
|
|
|
|
|
<swp-td>Sofie M.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Nov 2025</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags><swp-tag class="ny">Ny</swp-tag></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
|
|
|
|
|
<swp-customer-row data-name="Rikke Skov" data-visits="4" data-revenue="3200" data-created="2025-08" data-tags="">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>RS</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Rikke Skov</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 77 88 99 00</swp-td>
|
|
|
|
|
<swp-td class="secondary">rikke.s@gmail.com</swp-td>
|
|
|
|
|
<swp-td class="center">4</swp-td>
|
|
|
|
|
<swp-td>20. okt</swp-td>
|
|
|
|
|
<swp-td>Sofie M.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Aug 2025</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
|
|
|
|
|
<swp-customer-row data-name="Sofie Nielsen" data-visits="14" data-revenue="12450" data-created="2024-03" data-tags="vip">
|
|
|
|
|
<swp-td class="name-cell">
|
|
|
|
|
<swp-customer-avatar>SN</swp-customer-avatar>
|
|
|
|
|
<swp-customer-name>Sofie Nielsen</swp-customer-name>
|
|
|
|
|
</swp-td>
|
|
|
|
|
<swp-td>+45 23 45 67 89</swp-td>
|
|
|
|
|
<swp-td class="secondary">sofie@email.dk</swp-td>
|
|
|
|
|
<swp-td class="center">14</swp-td>
|
|
|
|
|
<swp-td>9. dec</swp-td>
|
|
|
|
|
<swp-td>Emma L.</swp-td>
|
|
|
|
|
<swp-td class="secondary">Mar 2024</swp-td>
|
|
|
|
|
<swp-td><swp-customer-tags><swp-tag class="vip">VIP</swp-tag></swp-customer-tags></swp-td>
|
|
|
|
|
</swp-customer-row>
|
|
|
|
|
</swp-table-body>
|
|
|
|
|
|
|
|
|
|
<swp-empty-state id="emptyState">
|
|
|
|
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2a10 10 0 100 20 10 10 0 000-20zm0 18a8 8 0 110-16 8 8 0 010 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"/></svg>
|
|
|
|
|
<p>Ingen kunder matcher din søgning</p>
|
|
|
|
|
</swp-empty-state>
|
|
|
|
|
</swp-customer-table>
|
|
|
|
|
</swp-page-container>
|
|
|
|
|
|
|
|
|
|
<!-- Overlay -->
|
|
|
|
|
<swp-overlay id="cardOverlay" onclick="closeCustomerCard()"></swp-overlay>
|
|
|
|
|
|
|
|
|
|
<!-- Customer Card Panel -->
|
|
|
|
|
<swp-customer-card id="customerCard">
|
|
|
|
|
<swp-card-header>
|
|
|
|
|
<swp-card-title><img src="icons/user.svg" alt="">Kundekort</swp-card-title>
|
|
|
|
|
<swp-card-close onclick="closeCustomerCard()">✕</swp-card-close>
|
|
|
|
|
</swp-card-header>
|
|
|
|
|
|
|
|
|
|
<swp-card-content>
|
|
|
|
|
<!-- Customer Header -->
|
|
|
|
|
<swp-customer-header>
|
|
|
|
|
<swp-customer-avatar id="cardAvatar">SN</swp-customer-avatar>
|
|
|
|
|
<swp-customer-header-info>
|
|
|
|
|
<swp-customer-header-top>
|
|
|
|
|
<swp-customer-header-left>
|
|
|
|
|
<swp-customer-header-name id="cardName">Sofie Nielsen</swp-customer-header-name>
|
|
|
|
|
<swp-customer-since id="cardSince">Kunde siden marts 2024</swp-customer-since>
|
|
|
|
|
</swp-customer-header-left>
|
|
|
|
|
<swp-customer-header-contact>
|
|
|
|
|
<a href="tel:+4523456789" id="cardPhoneLink">+45 23 45 67 89</a>
|
|
|
|
|
<a href="mailto:sofie@email.dk" id="cardEmailLink">sofie@email.dk</a>
|
2025-12-22 15:00:38 +01:00
|
|
|
<swp-customer-tags id="cardTags"></swp-customer-tags>
|
2025-12-22 13:14:56 +01:00
|
|
|
</swp-customer-header-contact>
|
|
|
|
|
</swp-customer-header-top>
|
|
|
|
|
</swp-customer-header-info>
|
|
|
|
|
</swp-customer-header>
|
|
|
|
|
|
|
|
|
|
<!-- Fact Boxes -->
|
|
|
|
|
<swp-fact-boxes>
|
|
|
|
|
<swp-fact-box class="highlight">
|
|
|
|
|
<swp-fact-box-value id="cardVisits">14</swp-fact-box-value>
|
|
|
|
|
<swp-fact-box-label>Besøg</swp-fact-box-label>
|
|
|
|
|
</swp-fact-box>
|
|
|
|
|
<swp-fact-box>
|
|
|
|
|
<swp-fact-box-value id="cardInterval">32 dage</swp-fact-box-value>
|
|
|
|
|
<swp-fact-box-label>Gns. interval</swp-fact-box-label>
|
|
|
|
|
</swp-fact-box>
|
|
|
|
|
<swp-fact-box>
|
|
|
|
|
<swp-fact-box-value id="cardHairdresser">Emma L.</swp-fact-box-value>
|
|
|
|
|
<swp-fact-box-label>Foretrukken frisør</swp-fact-box-label>
|
|
|
|
|
</swp-fact-box>
|
|
|
|
|
</swp-fact-boxes>
|
|
|
|
|
|
|
|
|
|
<!-- Contact Info (Editable) -->
|
|
|
|
|
<div>
|
|
|
|
|
<swp-section-label>Kontaktoplysninger</swp-section-label>
|
|
|
|
|
<swp-edit-section>
|
|
|
|
|
<swp-edit-row>
|
|
|
|
|
<swp-edit-label>Telefon</swp-edit-label>
|
|
|
|
|
<swp-edit-input><input type="tel" id="editPhone" value="+45 23 45 67 89"></swp-edit-input>
|
|
|
|
|
</swp-edit-row>
|
|
|
|
|
<swp-edit-row>
|
|
|
|
|
<swp-edit-label>Email</swp-edit-label>
|
|
|
|
|
<swp-edit-input><input type="email" id="editEmail" value="sofie@email.dk"></swp-edit-input>
|
|
|
|
|
</swp-edit-row>
|
|
|
|
|
<swp-edit-row>
|
|
|
|
|
<swp-edit-label>Adresse</swp-edit-label>
|
|
|
|
|
<swp-edit-input><input type="text" id="editAddress" value="Hovedgaden 12"></swp-edit-input>
|
|
|
|
|
</swp-edit-row>
|
|
|
|
|
<swp-edit-row>
|
|
|
|
|
<swp-edit-label>Postnr + By</swp-edit-label>
|
|
|
|
|
<swp-edit-input>
|
|
|
|
|
<input type="text" id="editZip" value="2100" class="short">
|
|
|
|
|
<input type="text" id="editCity" value="København Ø">
|
|
|
|
|
</swp-edit-input>
|
|
|
|
|
</swp-edit-row>
|
|
|
|
|
</swp-edit-section>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Marketing Opt-in -->
|
|
|
|
|
<div>
|
|
|
|
|
<swp-section-label>Marketing</swp-section-label>
|
|
|
|
|
<swp-marketing-section>
|
|
|
|
|
<swp-toggle-row>
|
|
|
|
|
<swp-toggle-label>Email marketing</swp-toggle-label>
|
2025-12-22 15:00:38 +01:00
|
|
|
<swp-toggle-slider id="toggleEmail" data-value="yes">
|
|
|
|
|
<swp-toggle-option>Ja</swp-toggle-option>
|
|
|
|
|
<swp-toggle-option>Nej</swp-toggle-option>
|
|
|
|
|
</swp-toggle-slider>
|
2025-12-22 13:14:56 +01:00
|
|
|
</swp-toggle-row>
|
|
|
|
|
<swp-toggle-row>
|
|
|
|
|
<swp-toggle-label>SMS marketing</swp-toggle-label>
|
2025-12-22 15:00:38 +01:00
|
|
|
<swp-toggle-slider id="toggleSms" data-value="no">
|
|
|
|
|
<swp-toggle-option>Ja</swp-toggle-option>
|
|
|
|
|
<swp-toggle-option>Nej</swp-toggle-option>
|
|
|
|
|
</swp-toggle-slider>
|
2025-12-22 13:14:56 +01:00
|
|
|
</swp-toggle-row>
|
|
|
|
|
</swp-marketing-section>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Profile Boxes -->
|
|
|
|
|
<div>
|
|
|
|
|
<swp-section-label>Profil</swp-section-label>
|
|
|
|
|
<swp-profile-boxes>
|
|
|
|
|
<swp-profile-box>
|
|
|
|
|
<swp-profile-box-label>Hårtype</swp-profile-box-label>
|
|
|
|
|
<swp-profile-box-value>Medium · Bølget</swp-profile-box-value>
|
|
|
|
|
</swp-profile-box>
|
|
|
|
|
<swp-profile-box>
|
|
|
|
|
<swp-profile-box-label>Porøsitet</swp-profile-box-label>
|
|
|
|
|
<swp-profile-box-value>Medium</swp-profile-box-value>
|
|
|
|
|
</swp-profile-box>
|
|
|
|
|
<swp-profile-box>
|
|
|
|
|
<swp-profile-box-label>Præference</swp-profile-box-label>
|
|
|
|
|
<swp-profile-box-value>Kold tone, ikke for mørk</swp-profile-box-value>
|
|
|
|
|
</swp-profile-box>
|
|
|
|
|
<swp-profile-box class="warning">
|
|
|
|
|
<swp-profile-box-label>Advarsler</swp-profile-box-label>
|
|
|
|
|
<swp-profile-box-value>Parfume-allergi</swp-profile-box-value>
|
|
|
|
|
</swp-profile-box>
|
|
|
|
|
</swp-profile-boxes>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Chart -->
|
|
|
|
|
<swp-chart-section>
|
|
|
|
|
<swp-chart-header>
|
|
|
|
|
<swp-section-label style="margin-bottom: 0;">Omsætning (sidste 6 mdr)</swp-section-label>
|
|
|
|
|
<swp-chart-legend>
|
|
|
|
|
<swp-chart-legend-item>
|
|
|
|
|
<swp-chart-legend-dot class="services"></swp-chart-legend-dot>
|
|
|
|
|
<span>Services</span>
|
|
|
|
|
</swp-chart-legend-item>
|
|
|
|
|
<swp-chart-legend-item>
|
|
|
|
|
<swp-chart-legend-dot class="products"></swp-chart-legend-dot>
|
|
|
|
|
<span>Produkter</span>
|
|
|
|
|
</swp-chart-legend-item>
|
|
|
|
|
</swp-chart-legend>
|
|
|
|
|
</swp-chart-header>
|
|
|
|
|
<swp-chart-container id="customerChart"></swp-chart-container>
|
|
|
|
|
</swp-chart-section>
|
|
|
|
|
|
|
|
|
|
<!-- Notes -->
|
|
|
|
|
<swp-notes-section>
|
|
|
|
|
<swp-section-label>Seneste noter</swp-section-label>
|
|
|
|
|
<swp-note-item>
|
|
|
|
|
<swp-note-meta>
|
|
|
|
|
<swp-note-type>Note</swp-note-type>
|
|
|
|
|
<swp-note-date>9. dec 2025</swp-note-date>
|
|
|
|
|
</swp-note-meta>
|
|
|
|
|
<swp-note-text>Kunden foretrækker naturlige farver og ønsker lidt ekstra tid til konsultation.</swp-note-text>
|
|
|
|
|
</swp-note-item>
|
|
|
|
|
<swp-note-item>
|
|
|
|
|
<swp-note-meta>
|
|
|
|
|
<swp-note-type>Farveformel</swp-note-type>
|
|
|
|
|
<swp-note-date>12. nov 2025</swp-note-date>
|
|
|
|
|
</swp-note-meta>
|
|
|
|
|
<swp-note-text>7/1 + 7/0 (1:1) · Oxidant 6% · Virketid 35 min</swp-note-text>
|
|
|
|
|
</swp-note-item>
|
|
|
|
|
<swp-see-all-link>Se alle noter →</swp-see-all-link>
|
|
|
|
|
</swp-notes-section>
|
|
|
|
|
</swp-card-content>
|
|
|
|
|
</swp-customer-card>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
// ==========================================
|
|
|
|
|
// SEARCH FUNCTIONALITY
|
|
|
|
|
// ==========================================
|
|
|
|
|
const searchInput = document.getElementById('searchInput');
|
|
|
|
|
const searchCount = document.getElementById('searchCount');
|
|
|
|
|
const tableBody = document.getElementById('tableBody');
|
|
|
|
|
const emptyState = document.getElementById('emptyState');
|
|
|
|
|
let currentFilter = 'all';
|
|
|
|
|
|
|
|
|
|
// Debounce helper
|
|
|
|
|
function debounce(fn, delay) {
|
|
|
|
|
let timeout;
|
|
|
|
|
return (...args) => {
|
|
|
|
|
clearTimeout(timeout);
|
|
|
|
|
timeout = setTimeout(() => fn(...args), delay);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function filterCustomers() {
|
|
|
|
|
const query = searchInput.value.toLowerCase().trim();
|
|
|
|
|
const rows = document.querySelectorAll('swp-customer-row');
|
|
|
|
|
let visibleCount = 0;
|
|
|
|
|
|
|
|
|
|
rows.forEach(row => {
|
|
|
|
|
const text = row.textContent.toLowerCase();
|
|
|
|
|
const tags = row.dataset.tags || '';
|
|
|
|
|
|
|
|
|
|
// Check search query
|
|
|
|
|
const matchesSearch = query === '' || text.includes(query);
|
|
|
|
|
|
|
|
|
|
// Check filter
|
|
|
|
|
let matchesFilter = true;
|
|
|
|
|
if (currentFilter !== 'all') {
|
|
|
|
|
matchesFilter = tags.includes(currentFilter);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (matchesSearch && matchesFilter) {
|
|
|
|
|
row.classList.remove('hidden');
|
|
|
|
|
visibleCount++;
|
|
|
|
|
} else {
|
|
|
|
|
row.classList.add('hidden');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Update count
|
|
|
|
|
searchCount.textContent = `${visibleCount} kunde${visibleCount !== 1 ? 'r' : ''}`;
|
|
|
|
|
|
|
|
|
|
// Show/hide empty state
|
|
|
|
|
if (visibleCount === 0) {
|
|
|
|
|
emptyState.classList.add('visible');
|
|
|
|
|
tableBody.style.display = 'none';
|
|
|
|
|
} else {
|
|
|
|
|
emptyState.classList.remove('visible');
|
|
|
|
|
tableBody.style.display = 'block';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
searchInput.addEventListener('input', debounce(filterCustomers, 150));
|
|
|
|
|
|
|
|
|
|
// ==========================================
|
|
|
|
|
// FILTER BUTTONS
|
|
|
|
|
// ==========================================
|
|
|
|
|
document.querySelectorAll('.filter-btn').forEach(btn => {
|
|
|
|
|
btn.addEventListener('click', () => {
|
|
|
|
|
// Update active state
|
|
|
|
|
document.querySelectorAll('.filter-btn').forEach(b => b.classList.remove('active'));
|
|
|
|
|
btn.classList.add('active');
|
|
|
|
|
|
|
|
|
|
// Apply filter
|
|
|
|
|
currentFilter = btn.dataset.filter;
|
|
|
|
|
filterCustomers();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// ==========================================
|
|
|
|
|
// SORTING FUNCTIONALITY
|
|
|
|
|
// ==========================================
|
|
|
|
|
let currentSort = { column: 'name', direction: 'asc' };
|
|
|
|
|
|
|
|
|
|
document.querySelectorAll('swp-th.sortable').forEach(th => {
|
|
|
|
|
th.addEventListener('click', () => {
|
|
|
|
|
const column = th.dataset.sort;
|
|
|
|
|
|
|
|
|
|
// Toggle direction if same column
|
|
|
|
|
if (currentSort.column === column) {
|
|
|
|
|
currentSort.direction = currentSort.direction === 'asc' ? 'desc' : 'asc';
|
|
|
|
|
} else {
|
|
|
|
|
currentSort.column = column;
|
|
|
|
|
currentSort.direction = 'asc';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sortTable();
|
|
|
|
|
updateSortIndicators();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function sortTable() {
|
|
|
|
|
const rows = [...document.querySelectorAll('swp-customer-row')];
|
|
|
|
|
const { column, direction } = currentSort;
|
|
|
|
|
|
|
|
|
|
rows.sort((a, b) => {
|
|
|
|
|
let aVal, bVal;
|
|
|
|
|
|
|
|
|
|
switch (column) {
|
|
|
|
|
case 'name':
|
|
|
|
|
aVal = a.dataset.name.toLowerCase();
|
|
|
|
|
bVal = b.dataset.name.toLowerCase();
|
|
|
|
|
break;
|
|
|
|
|
case 'visits':
|
|
|
|
|
aVal = parseInt(a.dataset.visits) || 0;
|
|
|
|
|
bVal = parseInt(b.dataset.visits) || 0;
|
|
|
|
|
break;
|
|
|
|
|
case 'created':
|
|
|
|
|
aVal = a.dataset.created;
|
|
|
|
|
bVal = b.dataset.created;
|
|
|
|
|
break;
|
|
|
|
|
case 'phone':
|
|
|
|
|
case 'email':
|
|
|
|
|
case 'lastVisit':
|
|
|
|
|
case 'hairdresser':
|
|
|
|
|
// Get text content from the appropriate cell
|
|
|
|
|
const cells = {
|
|
|
|
|
phone: 1,
|
|
|
|
|
email: 2,
|
|
|
|
|
lastVisit: 4,
|
|
|
|
|
hairdresser: 5
|
|
|
|
|
};
|
|
|
|
|
aVal = a.querySelectorAll('swp-td')[cells[column]]?.textContent.toLowerCase() || '';
|
|
|
|
|
bVal = b.querySelectorAll('swp-td')[cells[column]]?.textContent.toLowerCase() || '';
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
aVal = '';
|
|
|
|
|
bVal = '';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (typeof aVal === 'number' && typeof bVal === 'number') {
|
|
|
|
|
return direction === 'asc' ? aVal - bVal : bVal - aVal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (aVal < bVal) return direction === 'asc' ? -1 : 1;
|
|
|
|
|
if (aVal > bVal) return direction === 'asc' ? 1 : -1;
|
|
|
|
|
return 0;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Re-append sorted rows
|
|
|
|
|
rows.forEach(row => tableBody.appendChild(row));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateSortIndicators() {
|
|
|
|
|
document.querySelectorAll('swp-th.sortable').forEach(th => {
|
|
|
|
|
const isSorted = th.dataset.sort === currentSort.column;
|
|
|
|
|
th.classList.toggle('sorted', isSorted);
|
|
|
|
|
th.classList.toggle('desc', isSorted && currentSort.direction === 'desc');
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Initial state
|
|
|
|
|
updateSortIndicators();
|
|
|
|
|
|
|
|
|
|
// ==========================================
|
|
|
|
|
// CUSTOMER CARD
|
|
|
|
|
// ==========================================
|
|
|
|
|
const customerCard = document.getElementById('customerCard');
|
|
|
|
|
const cardOverlay = document.getElementById('cardOverlay');
|
|
|
|
|
|
|
|
|
|
// Add click handlers to all customer rows
|
|
|
|
|
document.querySelectorAll('swp-customer-row').forEach(row => {
|
|
|
|
|
row.style.cursor = 'pointer';
|
|
|
|
|
row.addEventListener('click', () => openCustomerCard(row));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function openCustomerCard(row) {
|
|
|
|
|
// Get data from row
|
|
|
|
|
const name = row.dataset.name;
|
|
|
|
|
const visits = row.dataset.visits;
|
|
|
|
|
const created = row.dataset.created;
|
|
|
|
|
const cells = row.querySelectorAll('swp-td');
|
|
|
|
|
const phone = cells[1]?.textContent || '';
|
|
|
|
|
const email = cells[2]?.textContent || '';
|
|
|
|
|
const hairdresser = cells[5]?.textContent || '';
|
|
|
|
|
|
|
|
|
|
// Generate initials
|
|
|
|
|
const initials = name.split(' ').map(n => n[0]).join('').toUpperCase();
|
|
|
|
|
|
|
|
|
|
// Format "Kunde siden"
|
|
|
|
|
const createdDate = created ? formatCreatedDate(created) : 'Ukendt';
|
|
|
|
|
|
|
|
|
|
// Update card content
|
|
|
|
|
document.getElementById('cardAvatar').textContent = initials;
|
|
|
|
|
document.getElementById('cardName').textContent = name;
|
|
|
|
|
document.getElementById('cardSince').textContent = `Kunde siden ${createdDate}`;
|
|
|
|
|
document.getElementById('cardPhoneLink').textContent = phone;
|
|
|
|
|
document.getElementById('cardPhoneLink').href = `tel:${phone.replace(/\s/g, '')}`;
|
|
|
|
|
document.getElementById('cardEmailLink').textContent = email;
|
|
|
|
|
document.getElementById('cardEmailLink').href = `mailto:${email}`;
|
|
|
|
|
document.getElementById('cardVisits').textContent = visits;
|
|
|
|
|
document.getElementById('cardHairdresser').textContent = hairdresser;
|
|
|
|
|
|
|
|
|
|
// Update editable fields
|
|
|
|
|
document.getElementById('editPhone').value = phone;
|
|
|
|
|
document.getElementById('editEmail').value = email;
|
|
|
|
|
|
2025-12-22 15:00:38 +01:00
|
|
|
// Update tags
|
|
|
|
|
const tags = row.dataset.tags || '';
|
|
|
|
|
const cardTags = document.getElementById('cardTags');
|
|
|
|
|
cardTags.innerHTML = '';
|
|
|
|
|
if (tags) {
|
|
|
|
|
tags.split(',').forEach(tag => {
|
|
|
|
|
const tagEl = document.createElement('swp-tag');
|
|
|
|
|
tagEl.className = tag.trim();
|
|
|
|
|
tagEl.textContent = tag.trim().charAt(0).toUpperCase() + tag.trim().slice(1);
|
|
|
|
|
cardTags.appendChild(tagEl);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
2025-12-22 13:14:56 +01:00
|
|
|
// Open panel
|
|
|
|
|
cardOverlay.classList.add('open');
|
|
|
|
|
customerCard.classList.add('open');
|
|
|
|
|
|
|
|
|
|
// Initialize chart
|
|
|
|
|
initCustomerChart();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function closeCustomerCard() {
|
|
|
|
|
cardOverlay.classList.remove('open');
|
|
|
|
|
customerCard.classList.remove('open');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function formatCreatedDate(dateStr) {
|
|
|
|
|
// Format: "2024-03" -> "marts 2024"
|
|
|
|
|
const months = ['januar', 'februar', 'marts', 'april', 'maj', 'juni',
|
|
|
|
|
'juli', 'august', 'september', 'oktober', 'november', 'december'];
|
|
|
|
|
const [year, month] = dateStr.split('-');
|
|
|
|
|
return `${months[parseInt(month) - 1]} ${year}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Escape key closes card
|
|
|
|
|
document.addEventListener('keydown', (e) => {
|
|
|
|
|
if (e.key === 'Escape') closeCustomerCard();
|
|
|
|
|
});
|
|
|
|
|
|
2025-12-22 15:00:38 +01:00
|
|
|
// ==========================================
|
|
|
|
|
// TOGGLE SLIDER (Ja/Nej)
|
|
|
|
|
// ==========================================
|
|
|
|
|
document.querySelectorAll('swp-toggle-slider').forEach(slider => {
|
|
|
|
|
const options = slider.querySelectorAll('swp-toggle-option');
|
|
|
|
|
options.forEach((option, index) => {
|
|
|
|
|
option.addEventListener('click', () => {
|
|
|
|
|
slider.dataset.value = index === 0 ? 'yes' : 'no';
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
2025-12-22 13:14:56 +01:00
|
|
|
// Chart initialization
|
|
|
|
|
let chartInitialized = false;
|
|
|
|
|
function initCustomerChart() {
|
|
|
|
|
if (chartInitialized) return;
|
|
|
|
|
|
|
|
|
|
import('https://unpkg.com/@sevenweirdpeople/swp-charting@latest/dist/index.js')
|
|
|
|
|
.then(module => {
|
|
|
|
|
const { createChart } = module;
|
|
|
|
|
createChart(document.getElementById('customerChart'), {
|
|
|
|
|
width: 620,
|
|
|
|
|
height: 180,
|
|
|
|
|
xAxis: {
|
|
|
|
|
categories: ['Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dec']
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Services',
|
|
|
|
|
color: '#00897b',
|
|
|
|
|
data: [
|
|
|
|
|
{ x: 'Jul', y: 1200 },
|
|
|
|
|
{ x: 'Sep', y: 1500 },
|
|
|
|
|
{ x: 'Okt', y: 2800 },
|
|
|
|
|
{ x: 'Dec', y: 1800 }
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Produkter',
|
|
|
|
|
color: '#1976d2',
|
|
|
|
|
data: [
|
|
|
|
|
{ x: 'Aug', y: 800 },
|
|
|
|
|
{ x: 'Okt', y: 900 },
|
|
|
|
|
{ x: 'Nov', y: 700 },
|
|
|
|
|
{ x: 'Dec', y: 950 }
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
legend: false
|
|
|
|
|
});
|
|
|
|
|
chartInitialized = true;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|