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

Memory effect with MM2

Scheduled Pinned Locked Moved Hardware
16 Posts 8 Posters 9.0k Views 8 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.
  • W Offline
    wladek
    last edited by Mar 27, 2019, 8:13 PM

    @strawberry-3.141 I tried to get your class into my MM but I don’t know where to put the .css and .js files and how to toggle them.

    S 1 Reply Last reply Mar 27, 2019, 8:17 PM Reply Quote 0
    • S Offline
      sdetweil @wladek
      last edited by sdetweil May 5, 2019, 11:56 AM Mar 27, 2019, 8:17 PM

      @wladek you add the css file to your module folder… and then modify your module.js code per the instructions above to load the css, and the timer code to invoke the other css…

      you could also make a complete new module with a little more code…

      make a folder

      MM/modules/MMM-Anti-Screen-Burn-In
      

      put the css file in that folder
      create a new file in that folder

      MMM-Anti-Screen-Burn-In.js
      
      Module.register("MMM-Anti-Screen-Burn-In", {
      start: function(){
          setInterval(() => {
              document.querySelector("body").classList.toggle("MMM-Anti-Screen-Burn-In");
          }, 6 * 60 * 60 * 1000); // every 6 hours
      },
      
      getStyles: function(){
          return ["MMM-Anti-Screen-Burn-In.css"];
      },
      getDom: function(){
        var wrapper = document.createElement("div");
        return wrapper
      }
      })
      

      and the module to config.js

      {
         module: "MMM-Anti-Screen-Burn-In",
         position: middle
      }
      

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      W 1 Reply Last reply Mar 28, 2019, 12:12 PM Reply Quote 0
      • W Offline
        wladek @sdetweil
        last edited by Mar 28, 2019, 12:12 PM

        @sdetweil Tried that before, somehow works now though, thanks!
        Only problem I have now is that the module displays two line of text right across the rest of my modules:

        MMM-Anti-Screen-Burn-In
        module_8_MMM-Anti-Screen-Burn-In

        I didn’t add any text to the .js or .css file tho and I can’t figure out how to get rid of it.

        S 1 Reply Last reply Mar 28, 2019, 12:32 PM Reply Quote 0
        • S Offline
          sdetweil @wladek
          last edited by Mar 28, 2019, 12:32 PM

          @wladek oops… if no getDom(), MM puts out some content

          replace the js file with this

          Module.register("MMM-Anti-Screen-Burn-In", {
          start: function(){
              setInterval(() => {
                  document.querySelector("body").classList.toggle("MMM-Anti-Screen-Burn-In");
              }, 6 * 60 * 60 * 1000); // every 6 hours
          },
          
          getStyles: function(){
              return ["MMM-Anti-Screen-Burn-In.css"];
          },
          getDom: function(){
            var wrapper = document.createElement("div");
            return wrapper
          }
          })
          

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          W 1 Reply Last reply Mar 28, 2019, 12:53 PM Reply Quote 0
          • W Offline
            wladek @sdetweil
            last edited by Mar 28, 2019, 12:53 PM

            @sdetweil That has fixed it, thank you so much!

            1 Reply Last reply Reply Quote 0
            • T Offline
              toucherts
              last edited by toucherts May 5, 2019, 8:19 PM May 5, 2019, 11:46 AM

              how do I then “activate” it?
              Speed Test Scrabble Word Finder Solitaire

              S 1 Reply Last reply May 5, 2019, 11:54 AM Reply Quote 0
              • S Offline
                sdetweil @toucherts
                last edited by sdetweil May 5, 2019, 12:02 PM May 5, 2019, 11:54 AM

                @toucherts every 6 hours it toggles the class used to present the screen.

                I just made a little module package on github
                https://github.com/sdetweil/MMM-Anti-Screen-Burn-In

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                M 1 Reply Last reply Jun 2, 2019, 5:35 AM Reply Quote 0
                • M Offline
                  moali6705 @sdetweil
                  last edited by Jun 2, 2019, 5:35 AM

                  @sdetweil said in Memory effect with MM2:

                  @toucherts every 6 hours it toggles the class used to present the screen.

                  I just made a little module package on github
                  https://github.com/sdetweil/MMM-Anti-Screen-Burn-In

                  OK GOOD

                  1 Reply Last reply Reply Quote 0
                  • 1
                  • 2
                  • 2 / 2
                  • First post
                    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