Compare commits

...

2 Commits

Author SHA1 Message Date
bfca0c8fa4 better look 2025-05-23 23:15:30 +01:00
e6ff012774 better look 2025-05-23 23:15:15 +01:00
2 changed files with 24 additions and 28 deletions

View File

@@ -1,38 +1,34 @@
/* Door Status Indicator Buttonstyle visuals */ /* door-status.css styles the indicator as a pillshaped button */
.door-status-indicator { .door-status-indicator {
display:inline-flex; display:inline-flex;
align-items:center; align-items:center;
gap: 0.35em; gap:0.4em;
font-size: 1em; padding:0.25em 0.75em;
padding: 0.35em 0.75em; border-radius:1em; /* fullyrounded corners */
border-radius: 0.6em; font-size:0.95em;
font-weight:600; font-weight:600;
line-height:1; line-height:1;
text-decoration: none; border:1px solid transparent;
user-select:none; user-select:none;
transition:filter .15s ease-in-out;
} }
/* OPEN → light green background, dark green text */ /* Open = soft green background + dark green text */
.door-status-indicator.open { .door-status-indicator.open {
background: #d4edda; /* light mint green */ background:#e7f9ec;
color: #155724; /* dark evergreen */ color:#1e7a34;
border: 1px solid #c3e6cb;
} }
/* CLOSED → light red background, dark red text */ /* Closed = soft red background + dark red text */
.door-status-indicator.closed { .door-status-indicator.closed {
background: #f8d7da; /* blush pink */ background:#fdeeee;
color: #721c24; /* maroon */ color:#c03c3c;
border: 1px solid #f5c6cb;
} }
/* Optional hover focus states for better UX */ /* (Optional) slight hover effect */
.door-status-indicator.open:hover, .door-status-indicator:hover,
.door-status-indicator.open:focus { .door-status-indicator:focus {
background: #c3e6cb; filter:brightness(1.05);
} outline:none;
.door-status-indicator.closed:hover,
.door-status-indicator.closed:focus {
background: #f5c6cb;
} }

View File

@@ -92,7 +92,7 @@ function dsi_get_status() : bool {
function dsi_shortcode() : string { function dsi_shortcode() : string {
$open = dsi_get_status(); $open = dsi_get_status();
$emoji = $open ? '<div class="door-status-indicator open">Open</div>' : '<div class="door-status-indicator closed">Closed</div>'; $emoji = $open ? '<div class="door-status-indicator open">🟢 Open</div>' : '<div class="door-status-indicator closed">🔴 Closed</div>';
return sprintf( return sprintf(
'<span class="door-status-indicator" aria-label="Door is %s">%s</span>', '<span class="door-status-indicator" aria-label="Door is %s">%s</span>',