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

Is it possible to have CSS for normal screens and a custom CSS for 7in screen?

Scheduled Pinned Locked Moved Custom CSS
32 Posts 3 Posters 8.3k Views 3 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.
  • S Away
    sdetweil @Radnor
    last edited by sdetweil Apr 27, 2020, 6:51 PM Apr 27, 2020, 6:46 PM

    @Radnor to debug, npm start dev
    in the developer window, select the sources tab, select config.js on the left
    find the 1st line, click on the number on the left column, it will turn blue, now have a program stop
    hit f5 to refresh the page, it will stop at that line… you can hover over variables and it will tell u the values.
    you can explore the variable on the right, global, scroll down

    I assume u are running electron browser (its the default)
    this is firefox.
    Screenshot at 2020-04-27 13-47-36.png
    and electron (with the hover)
    Screenshot at 2020-04-27 13-50-56.png

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    S 1 Reply Last reply Apr 27, 2020, 7:13 PM Reply Quote 0
    • S Away
      sdetweil @sdetweil
      last edited by sdetweil Apr 27, 2020, 7:19 PM Apr 27, 2020, 7:13 PM

      @sdetweil hang on… I see the bug on loading at node_helper time…

      change it like this to capture the undefined error at startup

      var width = 0
      try {
      width=outerWidth
      }
      catch(error){
      }

      var config={ etc

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • R Offline
        Radnor
        last edited by Apr 27, 2020, 7:18 PM

        in the config.js it does not like outerWidth. shows errors as loading up. It DOES get the correct value though…

        I have at the top of my config file:

        var small_size = 800;
        var ss = outerWidth;
        

        In debug mode I can see both vars getting their respective values.

        S 1 Reply Last reply Apr 27, 2020, 7:21 PM Reply Quote 0
        • S Away
          sdetweil @Radnor
          last edited by Apr 27, 2020, 7:21 PM

          @Radnor see my comments above workaround for not defined at node_module load time

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • S Away
            sdetweil @Radnor
            last edited by Apr 27, 2020, 7:22 PM

            @Radnor css and config.js are different things… no way to change the filenames of the css files…

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • R Offline
              Radnor
              last edited by Apr 27, 2020, 7:43 PM

              Getting really close!

              My config file is:

              var small_size = 800;
              var width = 0;
              try {
              	width=outerWidth
              }
              catch(error){
              }
              
              SNIP
              
              		{
              			module: "newsfeed",
              			position: "bottom_bar",
              disabled: width > small_size ? false:true,
              			config: {
              SNIP
              

              On phone does not show. On laptop stuck at “Loading…”

              S 1 Reply Last reply Apr 27, 2020, 7:47 PM Reply Quote 0
              • S Away
                sdetweil @Radnor
                last edited by sdetweil Apr 27, 2020, 7:48 PM Apr 27, 2020, 7:47 PM

                @Radnor said in Is it possible to have CSS for normal screens and a custom CSS for 7in screen?:

                disabled: width > small_size ? false:true,

                because width =0
                0 > 800 is false, so disabled=true
                when loading the node_modules, so it doesn’t get loaded

                try
                var width=801
                the node_helper might get loaded, but won’t execute cause they are waiting for module to send parms

                the value will be corrected on browser side

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                R 1 Reply Last reply Apr 27, 2020, 8:02 PM Reply Quote 0
                • R Offline
                  Radnor @sdetweil
                  last edited by Apr 27, 2020, 8:02 PM

                  @sdetweil said in Is it possible to have CSS for normal screens and a custom CSS for 7in screen?:

                  @Radnor said in Is it possible to have CSS for normal screens and a custom CSS for 7in screen?:

                  disabled: width > small_size ? false:true,

                  because width =0

                  Dont think so. I started it up with DEV option. Loaded the config.js file in debugger hovered over the width and it showed 1280. Then hovered over the small_size and it showed 800. Then thought false and true might need double quotes because the rest in config has t/f in double quotes.

                  Thank you for sticking with me and getting this working I really appreciate your time. it is SO close.

                  S 1 Reply Last reply Apr 27, 2020, 8:11 PM Reply Quote 0
                  • R Offline
                    Radnor
                    last edited by Radnor Apr 27, 2020, 8:06 PM Apr 27, 2020, 8:05 PM

                    I put in config width =801 and reran it. Same “Loading …”
                    And commented out try - catch block.

                    1 Reply Last reply Reply Quote 0
                    • S Away
                      sdetweil @Radnor
                      last edited by sdetweil Apr 27, 2020, 8:16 PM Apr 27, 2020, 8:11 PM

                      @Radnor single or double quotes don’t matter, as long as both ends of the string have the same

                      I just set my code to

                      var width	= 1920  // make it so on big screen they get enabled
                      try {
                        	width=outerWidth
                      }
                      catch(error){
                      
                      }
                      var large_screen=1920  // expected size on computer
                      

                      and the test for calendar at

                      			module: "calendar",
                      			disabled:    width< large_screen?true:false, // if the current screen is smaller than computer, disabled
                                                                                           // you can flip too,  ?false:true
                      			header: "US Holidays",
                      			position: "top_left",
                      

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      S 1 Reply Last reply Apr 27, 2020, 8:17 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 3 / 4
                      3 / 4
                      • First post
                        12/32
                        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