MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. GHLasse
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    G
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Groups 0

    GHLasse

    @GHLasse

    1
    Reputation
    411
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    GHLasse Unfollow Follow

    Best posts made by GHLasse

    • RE: local pictures, displayed on the mirror.

      On first thought this should be not too difficult to achieve.

      I would try something like

      getDom: function() {
          var wrapper = document.createElement("div");
          if (!this.config.imageurl) {
              wrapper.innerHTML = "ERROR";
          }else{
              var pic = document.createElement("img");
              if(!this.config.showColor){
                  pic.className = "bw";
              }
              pic.src = this.config.imageurl;
              wrapper.appendChild(pic);
          }
          return wrapper;
      }
      

      and then use

      defaults: {
          imageurl: '',
          showColor: false
      }
      

      where the imageurl should default to the modules public directory if no “http” address is specified.

      in the css

      .MODULENAME img.bw {
        -webkit-filter: grayscale(100%);
      }
      

      would allow to convert to grayscale to fit in with the general design.

      Hope that gets you started :-)

      posted in Troubleshooting
      G
      GHLasse

    Latest posts made by GHLasse

    • RE: local pictures, displayed on the mirror.

      On first thought this should be not too difficult to achieve.

      I would try something like

      getDom: function() {
          var wrapper = document.createElement("div");
          if (!this.config.imageurl) {
              wrapper.innerHTML = "ERROR";
          }else{
              var pic = document.createElement("img");
              if(!this.config.showColor){
                  pic.className = "bw";
              }
              pic.src = this.config.imageurl;
              wrapper.appendChild(pic);
          }
          return wrapper;
      }
      

      and then use

      defaults: {
          imageurl: '',
          showColor: false
      }
      

      where the imageurl should default to the modules public directory if no “http” address is specified.

      in the css

      .MODULENAME img.bw {
        -webkit-filter: grayscale(100%);
      }
      

      would allow to convert to grayscale to fit in with the general design.

      Hope that gets you started :-)

      posted in Troubleshooting
      G
      GHLasse