Skip to content

Commit 55bed15

Browse files
committed
added viewportheight configuration option
1 parent c2eab7b commit 55bed15

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ You should install this card using [HACS](https://hacs.xyz).
3535
| bottomrightcolor | string | #bdb76b | CSS color for bottom center slot (soft yellow)
3636
| displaywidth | integer | 800 | width (in px) of display on which this will be displayed
3737
| displayheight | integer | 480 | height (in px) of display on which this will be displayed
38+
| viewportheight | integer or text | 100 | height of the black background; if no measurement is included, it's in vh, otherwise it's the measurement you include (px, etc)
3839
| offset | integer | 0 | change vertical position of card (in px)
3940
| clockspacing | integer | 0 | change space between clock and info slots (in px)
4041
| infospacing | integer | 0 | change space between info rows (in px)

simple-weather-clock.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class SimpleWeatherClock extends HTMLElement {
55
<style>
66
ha-card {
77
display: flex;
8-
height: 100vh;
8+
height: ${this.config.viewportheight};
99
border-width: 0px;
1010
border-radius: 0px;
1111
padding: 0px;
@@ -212,6 +212,7 @@ class SimpleWeatherClock extends HTMLElement {
212212
var eba = 0;
213213
const cardConfig = Object.assign({}, config);
214214

215+
if (!cardConfig.viewportheight) cardConfig.viewportheight = "100vh";
215216
if (!cardConfig.background) cardConfig.background = "#000000";
216217
if (!cardConfig.font) cardConfig.font = "IBM Plex Mono";
217218
if (!cardConfig.fontweight) cardConfig.fontweight = 700;

0 commit comments

Comments
 (0)