• 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.

Current and Forecast Weather Animated Icons

Scheduled Pinned Locked Moved Solved Troubleshooting
8 Posts 2 Posters 684 Views 2 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.
  • E Offline
    En-TACT
    last edited by Sep 16, 2023, 7:06 PM

    I added these animated icons (https://www.amcharts.com/free-animated-svg-weather-icons/) to path /css/icons and, updated the custom.css and config.js code respectively. The weather animated icons work, however, any changes I do to the icons in custom.css effects both current and forecast weather icons globally - both are using module weather. How can I distinguish between the two. For example, I want current weather icons to be 200 px in height, and forecast weather icons to be 20 px in height.

    S 1 Reply Last reply Sep 16, 2023, 10:06 PM Reply Quote 0
    • S Away
      sdetweil @En-TACT
      last edited by sdetweil Sep 22, 2023, 1:26 PM Sep 18, 2023, 12:07 PM

      @En-TACT under each of those sections up at the top which has region is where the modules are located in the web content, the DOM. So if you expand those you should be able to find where those modules are that are that you’re talking about.

      an easier way is to use the pointer in the top left corner of the developer’s window elements tab and click that and then navigate over the content of the module that you’re interested in, and that part of the DOM will be expanded on the right hand side and then you’ll see the module entry with its ID

      In a CSS element, everything to the left of the open brace {, is called the selector clause.
      it’s selects the elements that everything inside the braces will apply to

      I use this cheat sheet to help me remember all the different options.

      https://www.w3schools.com/cssref/css_selectors.php

      and you can combine the statement elements to make very focused selections of content.
      One thing to remember is that the selector clause will ALWAYS select ALL elements in the DOM that match. You might want just one, but if it finds multiple it will select multiple.
      So you may have to be very specific about how you find things anyhow.

      a quick beginner on the selector clause:
      if you have a name with a dot in the front that means that’s a class name
      if you have a name with a pound sign in front that means it’s an ID
      if you have a name with nothing in front that means it’s an element name like a div or p for a paragraph, or li

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      E 2 Replies Last reply Sep 18, 2023, 1:07 PM Reply Quote 0
      • S Away
        sdetweil @En-TACT
        last edited by sdetweil Sep 16, 2023, 10:07 PM Sep 16, 2023, 10:06 PM

        @En-TACT you would use the module ID and they start from 1 at the top of the config.js and then their sequential down after that if you open the developers window control shift I and use the elements tab you can see the module ID the supplied as part of the content and so you can use the #id to specify the selector instead of the .module name

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        E 1 Reply Last reply Sep 17, 2023, 3:28 AM Reply Quote 0
        • E Offline
          En-TACT @sdetweil
          last edited by Sep 17, 2023, 3:28 AM

          @sdetweil if I’m understanding you, starting with the first module in config.js is module: “alert”, making it #id = 1. Numbering down to module: “weather”, makes it #id = 6. How would I write the code in custom.css to replace .weather what I have …

          .weather .wi-day-sunny {
          content url(“/css/icons/day.svg”);
          }

          … would be,

          .6.wi-day-sunny {
          content url(“/css/icons/day.svg”);
          }

          Also, I opened the developers window (CTRL + Shift + I) and under Elements tab, the screen is broken into two sections. Can you point me exactly where I should be looking for the module ID?

          2023-09-16-190650_1080x1920_scrot.png

          S 1 Reply Last reply Sep 18, 2023, 12:07 PM Reply Quote 0
          • S Away
            sdetweil @En-TACT
            last edited by sdetweil Sep 22, 2023, 1:26 PM Sep 18, 2023, 12:07 PM

            @En-TACT under each of those sections up at the top which has region is where the modules are located in the web content, the DOM. So if you expand those you should be able to find where those modules are that are that you’re talking about.

            an easier way is to use the pointer in the top left corner of the developer’s window elements tab and click that and then navigate over the content of the module that you’re interested in, and that part of the DOM will be expanded on the right hand side and then you’ll see the module entry with its ID

            In a CSS element, everything to the left of the open brace {, is called the selector clause.
            it’s selects the elements that everything inside the braces will apply to

            I use this cheat sheet to help me remember all the different options.

            https://www.w3schools.com/cssref/css_selectors.php

            and you can combine the statement elements to make very focused selections of content.
            One thing to remember is that the selector clause will ALWAYS select ALL elements in the DOM that match. You might want just one, but if it finds multiple it will select multiple.
            So you may have to be very specific about how you find things anyhow.

            a quick beginner on the selector clause:
            if you have a name with a dot in the front that means that’s a class name
            if you have a name with a pound sign in front that means it’s an ID
            if you have a name with nothing in front that means it’s an element name like a div or p for a paragraph, or li

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            E 2 Replies Last reply Sep 18, 2023, 1:07 PM Reply Quote 0
            • E Offline
              En-TACT @sdetweil
              last edited by Sep 18, 2023, 1:07 PM

              @sdetweil I found the div id for the current weather, module_4_weather. I’ll look into using that to change the icon this evening. Thanks.

              1 Reply Last reply Reply Quote 1
              • E Offline
                En-TACT @sdetweil
                last edited by Sep 22, 2023, 1:23 PM

                @sdetweil got the animated weather icons working for current & forecast modules - thank you!

                S 1 Reply Last reply Sep 22, 2023, 1:27 PM Reply Quote 1
                • S Away
                  sdetweil @En-TACT
                  last edited by sdetweil Sep 22, 2023, 1:44 PM Sep 22, 2023, 1:27 PM

                  @En-TACT awesome!!! thanks for the feedback,
                  one thing to note on using the module ID , if you move any modules around (in config.js, not on screen w position) or add/delete near the top, the IDs WILL change… so if things stop working, consider looking here too…

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  E 1 Reply Last reply Sep 22, 2023, 1:34 PM Reply Quote 0
                  • E Offline
                    En-TACT @sdetweil
                    last edited by Sep 22, 2023, 1:34 PM

                    @sdetweil ahh that makes sense … I’ll keep that in mind!

                    1 Reply Last reply Reply Quote 0
                    • S sdetweil referenced this topic on Sep 16, 2024, 9:23 PM
                    • 1 / 1
                    1 / 1
                    • First post
                      4/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