clock-weather-card icon indicating copy to clipboard operation
clock-weather-card copied to clipboard

Make clock font-width grow dynamically

Open pkissling opened this issue 2 years ago • 13 comments

Currently the font-size of the clock is set to a fixed value. Depending on the resolution and viewport, there is a lot of wasted space.

Task: Find a solution to make the clock font-size grow dynamically with the space of the surrounding div. Options:

  • Calculate font-size dynamically based on width of surrounding div
  • Render text as svg

pkissling avatar Oct 19 '22 06:10 pkissling

I wonder this. I want to use this on a mounted dash as a clock and the time is too small

joevberg avatar Oct 21 '22 01:10 joevberg

Let me know if I should open another issue, but It would be great to be able to set the font size of the clock in the YAML definition when adding this card to a dashboard.

In the mean time - Can you point me towards where in the JS file the clock size is statically configured so I can change it manually?

Really appreciate the great work! Loving this card!

netmanchris avatar Oct 22 '22 21:10 netmanchris

I've tried changing everything in the js to no avail

joevberg avatar Oct 22 '22 21:10 joevberg

hi there,

you can easily change the font size yourself using card-mod:

- type: custom:clock-weather-card
  entity: weather.home
  style: |
    clock-weather-card-today-right-wrap-center {
      font-size: 20rem !important;
    }

pkissling avatar Oct 23 '22 05:10 pkissling

Ty much. I just needed time know what section. Great.

joevberg avatar Oct 23 '22 14:10 joevberg

Ty much. I just needed time know what section. Great. It overlaps the condition and date. I don't need the date. Is it possible to move the condition? Or remove it too?

joevberg avatar Oct 23 '22 14:10 joevberg

- type: custom:clock-weather-card
  entity: weather.tomorrow_io_daily
  style: |
    clock-weather-card-today-right-wrap-center {
      font-size: 7rem !important;
    }
    clock-weather-card-today-right-wrap-top {
      display: none !important;
    }
    clock-weather-card-today-right-wrap-bottom {
      display: none !important;
    }
Screenshot 2022-10-23 at 17 47 22

pkissling avatar Oct 23 '22 15:10 pkissling

Ty

joevberg avatar Oct 23 '22 16:10 joevberg

is it possible to, using the above method, separate temperature so its more positioned towards the top left/right? changing the size of the temp and clock makes them go into eachother since they seem bound with the middle part fixed.

Cptkex82 avatar Apr 05 '23 12:04 Cptkex82

on the same topic, would it be possible to have the day and date rows also aligned to the center instead left/right?

vhardono avatar Apr 12 '23 16:04 vhardono

you could also change the font with

        clock-weather-card-today-right-wrap-center {
          font-family: "Orbitron";
        } 

rchiileea avatar Jun 03 '23 07:06 rchiileea

is it possible to, using the above method, separate temperature so its more positioned towards the top left/right? changing the size of the temp and clock makes them go into eachother since they seem bound with the middle part fixed.

I would love to do this as well, just have the temperature (digits) displayed with the time.

BillyFKidney avatar Dec 02 '23 19:12 BillyFKidney

I could be dumb, but the above styling didn't change mine at all and yes I have card mod installed.

teek541 avatar Apr 17 '24 19:04 teek541