Hello everybody.
They could guide me. I am trying to arrange the elements in the grid.
I can’t get the font size when viewed on a cell phone to stay in proportion. It is very small and I cannot adjust the size of the font.
And another thing that I can’t do is make the temperature look a little higher.
If you can help me, I appreciate it.
Greetings
#################################################
# #
# Temperatura #
# #
#################################################
temperature:
variables:
state: >
[[[ return entity === undefined || entity.state; ]]]
timeout: >
[[[ return entity === undefined || Date.now() - Date.parse(entity.last_changed); ]]]
light_color: >
[[[ return entity === undefined ? 'var(--state-icon-color)' : 'var(--button-card-light-color-no-temperature)'; ]]]
aspect_ratio: 1/1
show_name: false
show_state: true
show_icon: false # linea const tablet states['switch.galaxy_tab_a_screensaver'];
state_display: >
[[[ if (variables.state === true)
return 'Desconocido';
else
return variables.state + "°C";
]]]
tap_action:
ui_sound_tablet: |
[[[
const tablet = 1;
const screensaver = states[tablet] === undefined || states[tablet].state;
if (variables.state === 'off' && screensaver === 'off') {
hass.callService('media_player', 'play_media', {
entity_id: 'media_player.b1870054_18c4f630',
media_content_id: '/local/sound/on.m4a',
media_content_type: 'music'
});
}
if (variables.state === 'on' && screensaver === 'off') {
hass.callService('media_player', 'play_media', {
entity_id: 'media_player.b1870054_18c4f630',
media_content_id: '/local/sound/off.m4a',
media_content_type: 'music'
});
}
]]]
animation_card: |
[[[
const animation_speed_ms = 900;
const animation = `card_bounce ${animation_speed_ms}ms cubic-bezier(0.22, 1, 0.36, 1)`;
this.shadowRoot.getElementById("card").style.animation = animation;
window.setTimeout(() => {
this.shadowRoot.getElementById("card").style.animation = "none";
}, animation_speed_ms)
]]]
haptic: medium
styles:
grid:
- grid-template-areas: |
"icon1 icon2 icon3 icon4"
"s s s s"
- grid-template-columns: 1fr 1fr 1fr 1fr
- grid-template-rows: 1vw auto
- gap: 2%
- align-items: start
state:
- justify-self: center
- font-size: 4vw
card:
- font-family: Archivo Black
- border-radius: var(--custom-button-card-border-radius)
- -webkit-tap-highlight-color: rgba(0,0,0,0)
- transition: none
- padding: 5%
- --mdc-ripple-color: >
[[[
return (variables.state === 'on' || variables.state === 'home') ?
'rgb(0, 0, 0)' :
'rgba(255, 255, 255, 0.3)';
]]]
- color: >
[[[
return (variables.state === 'on' || variables.state === 'home') ?
'rgba(0, 0, 0, 0.6)' :
'rgba(255, 255, 255, 0.3)';
]]]
- background-color: >
[[[
return (variables.state === 'on' || variables.state === 'home') ?
'rgba(255, 255, 255, 0.8)' :
'rgba(115, 115, 115, 0.2)';
]]]
extra_styles: |
#name, #state {
font-size: 1.34vw;
letter-spacing: 0.05vw;
}
/* portrait */
@media screen and (max-width: 1200px) {
#name, #state {
font-size: 12vw;
letter-spacing: 0.05vw;
}
}
/* phone */
@media screen and (max-width: 800px) {
#state {
font-size: 4vw;
letter-spacing: 0.3vw;
}
}
@keyframes card_bounce {
0% {
transform: scale(1);
}
15% {
transform: scale(0.9);
}
25% {
transform: scale(1);
}
30% {
transform: scale(0.98);
}
100% {
transform: scale(1);
}
}