MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    MMM-Moon, See the moon phases and rise/set times!

    Utilities
    4
    6
    201
    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.
    • E
      enderflop last edited by

      https://github.com/EnderFlop/MMM-Moon

      There’s an indepth README on the GitHub page for anyone interested in installing this. If there is interest I can add more configuration options for customizing the image, but right now all you do is set your location and timezone. Let me know what you think!

      R S 2 Replies Last reply Reply Quote 2
      • R
        Rags @enderflop last edited by

        @enderflop
        Okay, so i tried it out and it is working fine. Nice effort. However, You have forgotten to add the sample config.js entries, though you have given the configuration options. Is there a way to enlarge the size of the image in the configuration file?
        Thanks

        R 1 Reply Last reply Reply Quote 0
        • S
          siboy73 @enderflop last edited by

          @enderflop I have given this a try and all i get is the No Image! message. Any ideas?

          S 1 Reply Last reply Reply Quote 0
          • R
            Rags @Rags last edited by sdetweil

            @Rags said in MMM-Moon, See the moon phases and rise/set times!:

            @enderflop
            Okay, so i tried it out and it is working fine. Nice effort. However, You have forgotten to add the sample config.js entries, though you have given the configuration options. Is there a way to enlarge the size of the image in the configuration file?
            Thanks

            To add lines of code to configure the size of the image, you can modify the getDom function as follows:

            getDom: function() {
              var outerDiv = document.createElement("div");
              if (this.content) {
                var img = document.createElement("img");
                img.src = this.content;
                img.style.width = this.config.width || "100%"; // add this line to set the width of the image
                img.style.height = this.config.height || "auto"; // add this line to set the height of the image
                outerDiv.appendChild(img);
              } else {
                outerDiv.innerText = "No image!";
              }
              return outerDiv;
            },
            
            add this in config.js;
            {
              module: "MMM-Moon",
              position: "top_right",
              config: {
                width: "400px",      //    as per requirement
                height: "400px"       //    as per requirement
              }
            }
            

            code blocks please, by sdetweil

            S 1 Reply Last reply Reply Quote 0
            • S
              siboy73 @siboy73 last edited by

              @enderflop further to before mentioned, I have changed my location in the js file from the standard US location you had and if I leave my location out of the config file I get an image(not sure if this a correct image or generic) but when I add my location in the config I get the no image message.

              1 Reply Last reply Reply Quote 0
              • S
                sdetweil @Rags last edited by

                @Rags a much better way is to use css to set the size instead of changing the code

                Sam

                Create a working config
                How to add modules

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy