MagicMirror Forum

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

    MMM-SimpleBGSlideshow (yet another background slideshow module)

    Utilities
    4
    26
    1874
    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.
    • M
      MagicInMe last edited by

      I remade most of Darick Carpenter’s BackgroundSlideshow because the original was crashing my magic mirror with synchronous file system calls. This one has far fewer options, but has no dependencies and should be easier to implement and use.

      Installation

      There are no dependencies or node-modules required for this module. To install, run the following commands:

      cd ~/MagicMirror/modules/
      git clone https://github.com/scottdrichards/MMM-SimpleBGSlideshow
      

      Usage

      You can add the following to your main configuration file:

      {
          module: 'MMM-SimpleBGSlideshow',
          position: 'fullscreen_below',
          config: {
              imagePaths: ['images/'],
              slideshowSpeed: 15000,
              randomizeImageOrder: false,
          }
      }
      

      Configuration

      Parameter Usage Example
      imagePaths An array of paths for images to be taken from ["images","oldImages"]
      slideshowSpeed Number of milliseconds to show each image 10000
      sortImagesBy Sort the images by name, random, created (file creation, not image date taken), or modified created
      sortImagesDescending Sort the images in descending order true
      randomizeImageOrder Randomize the order to show images. Each image will still be shown once per rotation false
      recursiveSubDirectories Include subdirectories of image paths? false
      validImageFileExtensions Which image extensions to include. Make sure to only do extensions that the browser can render. "bmp,jpg,jpeg,gif,png"
      brightenText Brightens the all MagicMirror text for easier viewing true
      gradient An object that describes the gradient to be applied so that text/modules are easier to read. see below

      Here is how to configure the gradient object

      {
        direction: "linear", //vertical, horizontal, radial`
        opacity: 0.75, // 1 is black
        stop1: "40%", // linear first stop, radial start gradient
        stop2: "80%" // linear second start, radial end gradient (i.e., 120%)
      }
      

      See the project here: https://github.com/scottdrichards/MMM-SimpleBGSlideshow/

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

        @magicinme all of THESE from node helper are dependencies

        const express = require("express");
        const Log = require("../../js/logger.js");
        const FSPromises = require("fs/promises");
        const pathModule = require("path");
        

        and should be listed in the package.json, IN CASE one of them were to go away
        as has happened in 2.15 and 2.16 with removal of request and associated packages
        and ical and its co dependencies…

        Sam

        Create a working config
        How to add modules

        M 1 Reply Last reply Reply Quote 0
        • M
          MagicInMe @sdetweil last edited by

          @sdetweil how would package.json have a listed dependency for fs and path (included in Node) or MagicMirror’s logger? I suppose express is a dependency I could maintain independently, but I rely upon the MM expressInstance.

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

            @magicinme do npm install --save in your module folder for those dependencies.

            then let npm install for your module figure out where to resolve them

            u might depend on the mm expess server INSTANCE but not the code to talk to that instance

            Sam

            Create a working config
            How to add modules

            M 1 Reply Last reply Reply Quote 0
            • M
              MagicInMe @sdetweil last edited by

              @sdetweil what’s the purpose of installing core node features as a module? Looking at npm path it says "This is an exact copy of the NodeJS ’path’ module published to the NPM registry. "

              Good point on express, I had thought I was just calling the express object but I do use express.static

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

                @magicinme you may not ‘install’ it, as npm will resolve , but you document that you USE it, SO, if things change, you stuff still works…

                I don’t know where stuff is packaged, and don’t want to know

                Sam

                Create a working config
                How to add modules

                M 1 Reply Last reply Reply Quote 0
                • M
                  MagicInMe @sdetweil last edited by

                  @sdetweil perhaps this is why https://www.npmjs.com/package/fs gets a million downloads a week even though it does nothing. I believe including core modules in package.json presents an unnecessary security risk (i.e., npm path is controlled by an individual). Unless there’s a way to include a package in package.json as a comment?

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

                    @magicinme no comments in json.

                    whatever… I have given everything I know and my advice on helping insure users don’t encounter problems.

                    the high download counts are from build systems recreating the env from scratch…

                    not users

                    Sam

                    Create a working config
                    How to add modules

                    1 Reply Last reply Reply Quote 0
                    • R
                      robertybob last edited by

                      Does this module stretch images to fit the mirror? The original module had two different options for this, if I recall correctly

                      M 1 Reply Last reply Reply Quote 0
                      • M
                        MagicInMe @robertybob last edited by

                        @robertybob I currently have it so that it uses the css “cover” attribute which stretches to fill. Is that what you want?

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