• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

How to change the clock css to be 90% full screen ?

Scheduled Pinned Locked Moved Development
8 Posts 4 Posters 10.0k Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    nagaculun
    last edited by Jul 17, 2017, 1:31 AM

    Hi,

    The current ‘zoom’ is not working. Basically I want the digital clock to be zoom out almost the whole screen. Any help ?

    Thanks

    S J 2 Replies Last reply Jul 17, 2017, 4:58 AM Reply Quote 0
    • S Offline
      strawberry 3.141 Project Sponsor Module Developer @nagaculun
      last edited by Jul 17, 2017, 4:58 AM

      @nagaculun did you consider using the config option analogSize for the clock module?

      analogSize: Specific to the analog clock. Defines how large the analog display is. Possible values: A positive number of pixels Default value: '200px'

      Furthermore the value can have even more units than just pixels, as it uses the standard width and height property for it.
      Check out the property values section here https://www.w3schools.com/cssref/pr_dim_width.asp

      Please create a github issue if you need help, so I can keep track

      N M 2 Replies Last reply Jul 17, 2017, 5:24 PM Reply Quote 1
      • N Offline
        nagaculun @strawberry 3.141
        last edited by Jul 17, 2017, 5:24 PM

        @strawberry-3.141

        Basically, I have 2 set of configs; day and night. At day time, it display calendar, 3 clocks, weather and news feed.

        But at night time, it only shows a digital clock, which is much easier to read. So still prefer the digital version.

        S 1 Reply Last reply Jul 19, 2017, 11:49 AM Reply Quote 0
        • M Offline
          Mykle1 Project Sponsor Module Developer @strawberry 3.141
          last edited by Jul 17, 2017, 6:24 PM

          @strawberry-3.141 said in How to change the clock css to be 90% full screen ?:

          Furthermore the value can have even more units than just pixels, as it uses the standard width and height property for it.
          Check out the property values section here https://www.w3schools.com/cssref/pr_dim_width.asp

          I am not embarrassed to admit that I’ve used these css properties without understanding them. I only cared that they worked. So this link gave me a better understanding of how and why they work.

          Thank you.

          Create a working config
          How to add modules

          1 Reply Last reply Reply Quote 0
          • S Offline
            strawberry 3.141 Project Sponsor Module Developer @nagaculun
            last edited by Jul 19, 2017, 11:49 AM

            @nagaculun then you could set the font sizes of the clock elements in custom.css

            Please create a github issue if you need help, so I can keep track

            1 Reply Last reply Reply Quote 0
            • J Offline
              j.e.f.f Project Sponsor Module Developer @nagaculun
              last edited by j.e.f.f Jul 19, 2017, 1:27 PM Jul 19, 2017, 1:23 PM

              @nagaculun Your easiest bet would be to use a CSS transform to scale the clock module. That way it won’t mess up the base layout in case you decide you want other modules to also be displayed.

              I’m assuming you’re using the module scheduler to turn the modules on and off. I’d use this to schedule a second instance of the clock module for the evening, so that way I could position it in a different part of the screen. It also makes it easier to target just that version so that your daytime version isn’t also scaled.

              Say I had my daytime clock positioned in the top_left, and my evening clock positioned in the top_right

              Here’s what the CSS would look like:

              /* targets only the clock module I have positioned top_right, leaves the top_left version untouched. */
              .region.top.right .clock { 
                  transform: scale(3.5); /* Scale multiplier.  adjust to taste. */
                  
                  /* by default the clock will scale from the center.  Use this to change the origin point. */
                  transform-origin: top right; 
              }
              

              What is important to note here is that this will NOT affect the flow of other modules. The upside is the size of the clock will not be constrained by the size of the parent container, meaning the time and date won’t wrap when the width exceeds to width of the top_left region, for example. However, if you have another module below it, this will cause the clock to overlap it. You’ll need to add some CSS to that module to move it downward (or position it in a different region).

              The main idea here is to have two versions of the clock module, and use the scheduler to toggle the day time one off and the night time one on when you need it.

              I was using the clock’s configured position to target the particular one I want, but If you want to have the clock in the same position for day and night, then add a class in the config to the one you want to style, like so:

                  {
                    module: "clock",
                    position: "top_left",
                    classes: "default everyone night", /* added "night" */
                    config: {
                      timeFormat: 12,
                      displaySeconds: false,
                      showPeriod: true,
                      showPeriodUpper: false
                    }
                  },
              

              Then you can target the module by class name:

              .clock.night {
                ... /* CSS rules here */
              }
              

              lastly, the scale rule can also accept separate parameters for length and width… so if you wanted to make a severely stretched and distorted) clock, you could do something like:

              transform: scale(3,10);

              This will stretch the clock 3 times as wide and 10 times as tall. Maybe you could make something pretty cool this way…

              I hope this helps!

              • Jeff
              N 2 Replies Last reply Jul 19, 2017, 10:02 PM Reply Quote 1
              • N Offline
                nagaculun @j.e.f.f
                last edited by Jul 19, 2017, 10:02 PM

                @j.e.f.f

                Thanks for the instructions. Unfortunately my mirror in the 'kernel panic’state yesterday. Will need to bring that up first before I try your suggestion. Will update when I do that.

                1 Reply Last reply Reply Quote 0
                • N Offline
                  nagaculun @j.e.f.f
                  last edited by Jul 24, 2017, 4:48 AM

                  @j.e.f.f

                  It works.

                  Thanks a lot.

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  1 / 1
                  • First post
                    1/8
                    Last post
                  Enjoying MagicMirror? Please consider a donation!
                  MagicMirror created by Michael Teeuw.
                  Forum managed by Sam, technical setup by Karsten.
                  This forum is using NodeBB as its core | Contributors
                  Contact | Privacy Policy