room cards 2
This commit is contained in:
@@ -80,11 +80,6 @@
|
|||||||
gap: 0.75rem;
|
gap: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.room-title::before {
|
|
||||||
content: '🏠';
|
|
||||||
font-size: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.devices {
|
.devices {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||||
@@ -539,6 +534,30 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
// Set room icons based on room name
|
||||||
|
document.addEventListener('DOMContentLoaded', () => {
|
||||||
|
const roomTitles = document.querySelectorAll('.room-title');
|
||||||
|
roomTitles.forEach(title => {
|
||||||
|
const roomName = title.textContent.trim().toLowerCase();
|
||||||
|
let icon = '🏠'; // Default
|
||||||
|
|
||||||
|
if (roomName.includes('wohn') || roomName.includes('living')) icon = '🛋️';
|
||||||
|
else if (roomName.includes('schlaf') || roomName.includes('bed')) icon = '🛏️';
|
||||||
|
else if (roomName.includes('küch') || roomName.includes('kitchen')) icon = '🍳';
|
||||||
|
else if (roomName.includes('bad') || roomName.includes('bath')) icon = '🛁';
|
||||||
|
else if (roomName.includes('büro') || roomName.includes('office')) icon = '💼';
|
||||||
|
else if (roomName.includes('kind') || roomName.includes('child')) icon = '🧸';
|
||||||
|
else if (roomName.includes('garten') || roomName.includes('garden')) icon = '🌿';
|
||||||
|
else if (roomName.includes('garage')) icon = '🚗';
|
||||||
|
else if (roomName.includes('keller') || roomName.includes('basement')) icon = '📦';
|
||||||
|
else if (roomName.includes('dach') || roomName.includes('attic')) icon = '🏚️';
|
||||||
|
|
||||||
|
// Replace the ::before pseudo-element with actual emoji
|
||||||
|
const originalText = title.textContent.trim();
|
||||||
|
title.innerHTML = `${icon} ${originalText}`;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// API_BASE injected from backend (supports Docker/K8s environments)
|
// API_BASE injected from backend (supports Docker/K8s environments)
|
||||||
window.API_BASE = '{{ api_base }}';
|
window.API_BASE = '{{ api_base }}';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user