A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Subcategories

  • Share your custom style sheets with the community!

    24 Topics
    302 Posts
    @jerryy622 Hey Jerry, This sounds fantastic! Please share your scripts or a link as to where to find the info! I would love to have this kind of thing running on my TV so i can view it when i switch to the HDMI channel that my Pi would be hooked to! I would love to see some screen shots of what you created also! Joe
  • You have questions regarding CSS?

    114 Topics
    680 Posts
    @kool said Bumping this back up. Pleeeease help Dear @kool , if you are using url as suggested by Sam ( @sdetweil ), you are nearly done. As far as I can see from my rookie perspective you do have some redundancies in your config.js (e.g. the unit section: units, tempUnits, windUnits) ) but this shouldn’t disturb. As far as I understood you can delete these icontables because you do not use the icon-font but try to use some images from sigle file-URLs instead - so you can delete the whole section iconTable {} with all entries. In addition you have to adapt (see above, Sam’s tip) the URL of all you images in your custom.css file. (pls. double check, if the files are really in these locations) You wrote in your current css .weatherforecast .wi-day-sunny { content: url("/home/kool/MagicMirror/css/icons/6fas/day.svg") !important; } IF your weather-icon files are really in this directory (/home/kool/MagicMirror/css/icons/6fas/) than your css should be as follows: .weatherforecast .wi-day-sunny { content: url("/css/icons/6fas/day.svg"); You do not need the !important flag (in my case) second wrong thing besides the URL is your qualifier. you are using .weatherforecast .wi-something .... This cannot be recognized because .weatherforecast is not defined. At first you have to decide if you want to have different icons for the current weather and for the weather forecast. (In my case this is true). IF you would like to have this you have to differentiate the two instances of the weather-module by a “classes” definition. For example your first instance of the weather module (current weather) than should be module: "weather", position: "top_right", // Adjust position as needed classes: "weather_current", config: { weatherProvider: "openmeteo", // Specify the Open-Meteo provider apiBase: "https://api.open-meteo.com/v1", // REQUIRED: Base URL for Open-Meteo lat: xxxx, // REQUIRED: Latitude of the location lon: xxxx, // REQUIRED: Longitude of the location maxNumberOfDays: 8, // OPTIONAL: Number of forecast days (default is 5) pastDays: 0, // OPTIONAL: Number of past days of data to include (default is 0) units: "imperial", // Set this to 'imperial' for Fahrenheit and miles per hour tempUnits: "imperial", // Make sure to match with 'imperial' windUnits: "imperial", type: "current", // OPTIONAL: Change to "current" if only current weather data is desired } }, (pay attention for the third line: classes: “weather_current”, ) THIS is your qualifier if you are about to diffrentiate between current weather and weather forecast image-wise. (“weather_current” is just an example! you can name it like you want every name is suitable and OK, only pay attention that all of these namings are strictly case sensitive, so Weather is NOT the same as weather" Your correct line for custom.css than is: .weather_current .wi-day-sunny { content: url("/css/icons/6fas/day.svg"); and the same dance than for your second instance with DIFFERENT classes-clause in config.js (e.g. a " classes: “weather_forecast”, " in the definition of the second weather instance ) results in a custom.css entry like this: .weather_forecast .wi-day-sunny { content: url("/css/icons/some_other_directory_with_smaller_icons/day.svg"); Because the “forecast instance” of the weather module is (in my case) organized as table I found it really useful to differentite these logos - big ones for current, smaller ones for the forecast: [image: 1744630855324-screenfloat-bildschirmfoto-von-sublime-text-am-14_04_2025-13_38_51-14_04_2025-13-38-51.jpg] If You do NOT like to differentiate the current and forecast instance you do NOT need the classes-phrase in config.js and your correct qualifier is the name of the module (so “weather” ) and your custom.css entry is like this: .weather .wi-day-sunny { content: url("/css/icons/6fas/day.svg"); And this than is valid for both instances. Keep in mind that there are a LOT more weather conditions than the two times 5 conditions you have defined in your current custom.css! my own definition for the current weather for your reference: .weather_current .wi-fog { content: url("/css/icons/current/wsymbol_0007_fog.png"); } .weather_current .wi-cloudy { content: url("/css/icons/current/wsymbol_0002_sunny_intervals.png"); } .weather_current .wi-cloudy-windy { content: url("/css/icons/current/wsymbol_0004_black_low_cloud.png"); } .weather_current .wi-rain { content: url("/css/icons/current/wsymbol_0018_cloudy_with_heavy_rain.png"); } .weather_current .wi-showers { content: url("/css/icons/current/wsymbol_0017_cloudy_with_light_rain.png"); } .weather_current .wi-thunderstorm { content: url("/css/icons/current/wsymbol_0024_thunderstorms.png"); } .weather_current .wi-snow { content: url("/css/icons/current/wsymbol_0019_cloudy_with_light_snow.png"); } .weather_current .wi-snowflake-cold { content: url("/css/icons/current/wsymbol_0020_cloudy_with_heavy_snow.png"); } .weather_current .wi-na { content: url("/css/icons/current/wsymbol_0999_unknown.png"); } .weather_current .wi-day-sunny { content: url("/css/icons/current/wsymbol_0001_sunny.png"); } .weather_current .wi-day-cloudy { content: url("/css/icons/current/wsymbol_0043_mostly_cloudy.png"); } .weather_current .wi-day-cloudy-gusts { content: url("/css/icons/current/wsymbol_0004_black_low_cloud.png"); } .weather_current .wi-day-cloudy-windy { content: url("/css/icons/current/wsymbol_0004_black_low_cloud.png"); } .weather_current .wi-cloudy-windy { content: url("/css/icons/current/wsymbol_0004_black_low_cloud.png"); } .weather_current .wi-day-fog { content: url("/css/icons/current/wsymbol_0007_fog.png"); } .weather_current .wi-day-hail { content: url("/css/icons/current/wsymbol_0015_heavy_hail_showers.png"); } .weather_current .wi-day-haze { content: url("/css/icons/current/wsymbol_0005_hazy_sun.png"); } .weather_current .wi-day-lightning { content: url("/css/icons/current/wsymbol_0016_thundery_showers.png"); } .weather_current .wi-day-rain { content: url("/css/icons/current/wsymbol_0085_extreme_rain_showers.png"); } .weather_current .wi-day-rain-mix { content: url("/css/icons/current/wsymbol_0009_light_rain_showers.png"); } .weather_current .wi-day-rain-wind { content: url("/css/icons/current/wsymbol_0010_heavy_rain_showers.png"); } .weather_current .wi-day-showers { content: url("/css/icons/current/wsymbol_0018_cloudy_with_heavy_rain.png"); } .weather_current .wi-day-sleet { content: url("/css/icons/current/wsymbol_0087_heavy_sleet_showers.png"); } .weather_current .wi-day-sleet-storm { content: url("/css/icons/current/wsymbol_0089_heavy_sleet.png"); } .weather_current .wi-day-snow { content: url("/css/icons/current/wsymbol_0011_light_snow_showers.png"); } .weather_current .wi-day-snow-thunderstorm { content: url("/css/icons/current/wsymbol_0057_thundery_snow_showers.png"); } .weather_current .wi-day-snow-wind { content: url("/css/icons/current/wsymbol_0053_blowing_snow.png"); } .weather_current .wi-day-sprinkle { content: url("/css/icons/current/wsymbol_0009_light_rain_showers.png"); } .weather_current .wi-day-storm-showers { content: url("/css/icons/current/wsymbol_0018_cloudy_with_heavy_rain.png"); } .weather_current .wi-day-sunny-overcast { content: url("/css/icons/current/wsymbol_0002_sunny_intervals.png"); } .weather_current .wi-day-thunderstorm { content: url("/css/icons/current/wsymbol_0024_thunderstorms.png"); } .weather_current .wi-day-windy { content: url("/css/icons/current/wsymbol_0060_windy.png"); } .weather_current .wi-solar-eclipse { content: url("/css/icons/current/wsymbol_0005_hazy_sun.png"); } .weather_current .wi-hot { content: url("/css/icons/current/wsymbol_0045_hot.png"); } .weather_current .wi-day-cloudy-high { content: url("/css/icons/current/wsymbol_0006_mist.png"); } .weather_current .wi-day-light-wind { content: url("/css/icons/current/wsymbol_0060_windy.png"); } .weather_current .wi-night-clear { content: url("/css/icons/current/wsymbol_0008_clear_sky_night.png"); } .weather_current .wi-night-alt-cloudy { content: url("/css/icons/current/wsymbol_0041_partly_cloudy_night.png"); } .weather_current .wi-night-alt-partly-cloudy { content: url("/css/icons/current/wsymbol_0041_partly_cloudy_night.png"); } .weather_current .wi-night-alt-cloudy-gusts { content: url("/css/icons/current/wsymbol_0041_partly_cloudy_night.png"); } .weather_current .wi-night-alt-cloudy-windy { content: url("/css/icons/current/wsymbol_0041_partly_cloudy_night.png"); } .weather_current .wi-night-alt-hail { content: url("/css/icons/current/wsymbol_0031_heavy_hail_showers_night.png"); } .weather_current .wi-night-alt-lightning { content: url("/css/icons/current/wsymbol_0032_thundery_showers_night.png"); } .weather_current .wi-night-alt-rain { content: url("/css/icons/current/wsymbol_0025_light_rain_showers_night.png"); } .weather_current .wi-night-alt-rain-mix { content: url("/css/icons/current/wsymbol_0026_heavy_rain_showers_night.png"); } .weather_current .wi-night-alt-rain-wind { content: url("/css/icons/current/wsymbol_0026_heavy_rain_showers_night.png"); } .weather_current .wi-night-alt-showers { content: url("/css/icons/current/wsymbol_0025_light_rain_showers_night.png"); } .weather_current .wi-night-alt-sleet { content: url("/css/icons/current/wsymbol_0029_sleet_showers_night.png"); } .weather_current .wi-night-alt-sleet-storm { content: url("/css/icons/current/wsymbol_0029_sleet_showers_night.png"); } .weather_current .wi-night-alt-snow { content: url("/css/icons/current/wsymbol_0028_heavy_snow_showers_night.png"); } .weather_current .wi-night-alt-snow-thunderstorm { content: url("/css/icons/current/wsymbol_0075_thundery_snow_showers_night.png"); } .weather_current .wi-night-alt-snow-wind { content: url("/css/icons/current/wsymbol_0071_blowing_snow_night.png"); } .weather_current .wi-night-alt-sprinkle { content: url("/css/icons/current/wsymbol_0025_light_rain_showers_night.png"); } .weather_current .wi-night-alt-storm-showers { content: url("/css/icons/current/wsymbol_0026_heavy_rain_showers_night.png"); } .weather_current .wi-night-alt-thunderstorm { content: url("/css/icons/current/wsymbol_0032_thundery_showers_night.png"); } .weather_current .wi-night-cloudy { content: url("/css/icons/current/wsymbol_0041_partly_cloudy_night.png"); } .weather_current .wi-night-cloudy-gusts { content: url("/css/icons/current/wsymbol_0044_mostly_cloudy_night.png"); } .weather_current .wi-night-cloudy-windy { content: url("/css/icons/current/wsymbol_0044_mostly_cloudy_night.png"); } .weather_current .wi-night-fog { content: url("/css/icons/current/wsymbol_0064_fog_night.png"); } .weather_current .wi-night-hail { content: url("/css/icons/current/wsymbol_0039_cloudy_with_heavy_hail_night.png"); } .weather_current .wi-night-lightning { content: url("/css/icons/current/wsymbol_0032_thundery_showers_night.png"); } .weather_current .wi-night-partly-cloudy { content: url("/css/icons/current/wsymbol_0041_partly_cloudy_night.png"); } .weather_current .wi-night-rain { content: url("/css/icons/current/wsymbol_0025_light_rain_showers_night.png"); } .weather_current .wi-night-rain-mix { content: url("/css/icons/current/wsymbol_0026_heavy_rain_showers_night.png"); } .weather_current .wi-night-rain-wind { content: url("/css/icons/current/wsymbol_0025_light_rain_showers_night.png"); } .weather_current .wi-night-showers { content: url("/css/icons/current/wsymbol_0026_heavy_rain_showers_night.png"); } .weather_current .wi-night-sleet { content: url("/css/icons/current/wsymbol_0029_sleet_showers_night.png"); } .weather_current .wi-night-sleet-storm { content: url("/css/icons/current/wsymbol_0029_sleet_showers_night.png"); } .weather_current .wi-night-snow { content: url("/css/icons/current/wsymbol_0027_light_snow_showers_night.png"); } .weather_current .wi-night-snow-thunderstorm { content: url("/css/icons/current/wsymbol_0075_thundery_snow_showers_night.png"); } .weather_current .wi-night-snow-wind { content: url("/css/icons/current/wsymbol_0028_heavy_snow_showers_night.png"); } .weather_current .wi-night-sprinkle { content: url("/css/icons/current/wsymbol_0025_light_rain_showers_night.png"); } .weather_current .wi-night-storm-showers { content: url("/css/icons/current/wsymbol_0026_heavy_rain_showers_night.png"); } .weather_current .wi-night-thunderstorm { content: url("/css/icons/current/wsymbol_0032_thundery_showers_night.png"); } HTH & good luck! Ralf
  • change font of modules (local fonts)

    Solved Nov 11, 2017, 4:19 PM
    0 Votes
    20 Posts
    18k Views
  • Home Info Board

    Oct 6, 2018, 4:38 PM
    0 Votes
    3 Posts
    2k Views
    Sorry, board works so well I haven’t touched for over a year. Didn’t realize that people were still interested. I edited my post with my mess of a custom CSS, but yes I just force the width of the columns. In the custom CSS if you add width: 550px; to one item for each column it will force it to that width and draw the line the full width. 550px seems to work well with 1920 width and the default pad / margins.
  • unable to reply to topic here

    Oct 12, 2018, 12:48 PM
    0 Votes
    5 Posts
    1k Views
    My mobile does not have block popups turned on
  • Font struggles.

    Oct 9, 2018, 8:37 PM
    0 Votes
    6 Posts
    2k Views
    thank you very much
  • Full Screen CSS

    Nov 16, 2017, 4:34 AM
    0 Votes
    6 Posts
    8k Views
    @sdetweil Of course, there are many tricks to display something to specific region. .fullscreen.below is the lowest layer of region system of MM. its position is already absolute and fit for screen size. If you put some module here, it will be displayed like background. .fullscreen.above is the highest layer. If you put some module here, it will cover the lower region layer. And, modifying CSS is safer and easier option than hardcoded in the module itself. Therefore there is “custom.css” for customization. The main reason you are confused might be this; In main.css body { margin: 60px; position: absolute; height: calc(100% - 120px); width: calc(100% - 120px); It gives 60px margin for the entire screen. So YOUR_FULLSCREEN module couldn’t cover the WHOLE_SCREEN_YOU_THOUGHT. But I recommend you leave it. Because, some ppl needs those margin for their mirror edge. Who don’t need that margin will modify his custom.css for using fullscreen without margin by himself. I think you’d better to research some BACKGROUND-IMAGE modules to get a hint to use full screen CSS. I believe it’s enough to put your module with 100% width/height into .fullscreen.below or .fullscreen.above to display your module as full screen size.
  • 0 Votes
    2 Posts
    1k Views
    Try .ns-box.light {font-size: 120px} .ns-box.thin {font-size: 100px}
  • 0 Votes
    4 Posts
    2k Views
    @huso15 you can choose what is better. try cut lines and if it will be not acceptable you can try second option.
  • How to change icons

    May 9, 2018, 9:37 PM
    0 Votes
    15 Posts
    13k Views
    i have tried all methods to change my icons for the current weather and the weather forcast modules but nothing seems to work ! i dont get any errors or warnings ! whatever changes i make the module remains the same ( like default) i use icons from amcharts ! and i refered the other post from the forum ! im a noobie kindly help me out@!!! the icons are on MagicMirror![1_1535028197192_Webp.net-resizeimage.jpg](Uploading 100%) ![0_1535028197191_Webp.net-resizeimage (1).jpg](Uploading 100%) /css/icons/ i have attached images of my custom css file and my config file
  • New Position / Area in the middle

    Aug 17, 2018, 6:21 AM
    0 Votes
    1 Posts
    954 Views
    Is it possible to create a new area? I’d like to create a center_middle_lr section. This should allow me that I have in the middle again a division left right. Background: In the middle on the right side I want to display the soccer results and to the left the soccer clubs table. How can I create this?
  • 0 Votes
    2 Posts
    2k Views
    Hi, I just saw that you already opened an issue on GitHub and answered there so that the developer get’s a notification, too. Meanwhile, you can edit the module yourself like this: Change line 103 in MMM-MQTT.js from valueWrapper.className = "align-right bright medium"; to valueWrapper.className = "align-right bright medium " + sub.value.toLowerCase(); provided the value is just one word, not more, the cell with the value now has a class name added that’s the same as the value, in your case ‘closed’ and you can add the following to the CSS file or your custom.css: .MMM-MQTT .closed { color: green; } .MMM-MQTT .open{ color: red; } Regards, Torben
  • Calendar Font Size

    Jul 31, 2018, 2:09 PM
    1
    0 Votes
    13 Posts
    10k Views
    @deroptiker86 Always glad to help out!
  • 0 Votes
    3 Posts
    1k Views
    @charley said in Add an external output to Dash Board from an html or Xml file.: Domoticz module Hi, Thanks for the reply. Yes, i think JSON is best solution at this moment. Thanks again for your kindly respond…
  • Module "centered"

    Jul 20, 2018, 5:18 AM
    1
    0 Votes
    2 Posts
    1k Views
    No Idea ? :-(
  • 0 Votes
    4 Posts
    2k Views
    Well you could just add some code to your other modules to hide them when they are set up and let your gif module send a message to the other modules to show after the gif finished. (How sending these messages and reacting to them to show/hide modules works you can see quite well in Mykles Hello Lucy module, where he uses them to hide/show modules according to voice commands)
  • This topic is deleted!

    Jul 11, 2018, 8:13 PM
    0 Votes
    1 Posts
    112 Views
  • 0 Votes
    7 Posts
    7k Views
    @broberg Ah, that seems to be what the problem was. Thank you so much for your help in solving this issue! As for the two different files I went ahead and removed the .woff file from the program.
  • 0 Votes
    5 Posts
    3k Views
    @ninjabreadman, thanks a lot for trying to help. You are right in your assumption, that I dont fully understand CSS. I am learning as we speak. The site you mentioned is the one I found as well and followed. Unsuccessful. It is working for the copyright text/title of the Wallpaper module. So I cant be to far off. But not for the clock. From what I found out so far is that the problem is that the wallpaper and the clock are not in the same “stacking index” which I tried to solve following this article.
  • compliments font problem

    May 31, 2018, 8:14 AM
    0 Votes
    5 Posts
    3k Views
    thank you very much pjkoeleman, for help! i tried: .compliments div {…} and it works.
  • Clock

    May 19, 2018, 4:29 PM
    1 Votes
    7 Posts
    4k Views
    @hriereb Yes, Love the clock! I copied the code from there and will see how to incorporate it into a module for the Mirror. I am currently learning how to do this with a couple modules I am working on myself, so this will give me some more practice!
  • Need some styling help here!

    May 4, 2018, 9:40 PM
    1
    2 Votes
    1 Posts
    2k Views
    Allright lads. Here is my custom.css and a snippet from a module i need some help with. The module is a timetable for the busses in my area basically. I am only trying to a small thing, wich is that i want the color of the entire line to change color as the time closes in on when the bus is supposed to leave. Say at 15 minutes its the neat blue color i already have, but under 10 changes to yellow. And at 5 minutes turns red. The second bit im struggeling with is the actual width of the entire table. I cant seem to modify it much. I can shrink it quite a bit, but im unable to get it to be the same width as the rest of my modules on that side of the mirror, wich for me is quite annoying. Hope someone can help me out here. Screenshots and code added below. /* Magic Mirror * Module: Ruter * * By Cato Antonsen (https://github.com/CatoAntonsen) * MIT Licensed. */ Module.register("MMM-Skyss",{ // Default module config. defaults: { timeFormat: null, // This is set automatically based on global config showHeader: false, // Set this to true to show header above the journeys (default is false) showPlatform: false, // Set this to true to get the names of the platforms (default is false) showStopName: false, // Show the name of the stop (you have to configure 'name' for each stop) maxItems: 5, // Number of journeys to display (default is 5) humanizeTimeTreshold: 15, // If time to next journey is below this value, it will be displayed as "x minutes" instead of time (default is 15 minutes) serviceReloadInterval: 30000, // Refresh rate in MS for how often we call Skyss' web service. NB! Don't set it too low! (default is 30 seconds) animationSpeed: 0, // How fast the animation changes when updating mirror (default is 0 second) fade: true, // Set this to true to fade list from light to dark. (default is true) fadePoint: 0.25, // Start on 1/4th of the list. useRealtime: true // Whether to use realtime data from Skyss }, getStyles: function () { return ["skyss.css"]; }, getScripts: function() { return []; }, getTranslations: function() { return { en: "translations/en.json", nb: "translations/nb.json" } }, start: function() { console.log(this.translate("STARTINGMODULE") + ": " + this.name); this.journeys = []; this.previousJourneys = []; var self = this; // Set locale and time format based on global config if (config.timeFormat === 24) { this.config.timeFormat = "HH:mm"; } else { this.config.timeFormat = "h:mm A"; } // Just do an initial poll. Otherwise we have to wait for the serviceReloadInterval self.startPolling(); setInterval(function() { self.startPolling(); }, this.config.serviceReloadInterval); }, getDom: function() { if (this.journeys.length > 0) { var table = document.createElement("table"); table.className = "ruter small"; if (this.config.showHeader) { table.appendChild(this.getTableHeaderRow()); } for(var i = 0; i < this.journeys.length; i++) { var journey = this.journeys[i]; var tr = this.getTableRow(journey); // Create fade effect. = startingPoint) { var currentStep = i - startingPoint; tr.style.opacity = 1 - (1 / steps * currentStep); } } table.appendChild(tr); } return table; } else { var wrapper = document.createElement("div"); wrapper.innerHTML = this.translate("LOADING"); wrapper.className = "small dimmed"; return wrapper; } }, startPolling: function() { var self = this; var promise = new Promise((resolv) => { this.getStopInfo(this.config.stops, function(err, result) { resolv(result); }); }); promise.then(function(promiseResults) { if (promiseResults.length > 0) { var allJourneys = []; for(var i=0; i < promiseResults.length; i++) { allJourneys = allJourneys.concat(promiseResults[i]) } allJourneys.sort(function(a,b) { var dateA = new Date(a.time.Timestamp); var dateB = new Date(b.time.Timestamp); return dateA - dateB; }); self.journeys = allJourneys.slice(0, self.config.maxItems); self.updateDom(); } }); }, getStopInfo: function(stopItems, callback) { var self = this; var HttpClient = function() { this.get = function(requestUrl, requestCallback) { // var httpRequest = new XMLHttpRequest(); // httpRequest.onreadystatechange = function() { // if (httpRequest.readyState == 4 && httpRequest.status == 200){ // requestCallback(httpRequest.responseText); // } // }; // httpRequest.open("GET", requestUrl, true); // httpRequest.setRequestHeader("Authorization", ""); // httpRequest.send(null); self.requests.push(requestCallback); self.sendSocketNotification("getstop", requestUrl); } } //DisplayTime contains realtime-information. Formatted as "x min"(remaining time), or "HH:mm" var processSkyssDisplaytime = function(displayTime) { var realTime; var regexInMinutes = new RegExp('([0-9]+) min'); var regexLocalTimeStamp = new RegExp('[0-9]{2}\:[0-9]{2}'); //Time format is "x min" if (regexInMinutes.test(displayTime)) { inMinutes = parseInt(displayTime.match(regexInMinutes)[1]); // Adding 1 gives same result as skyss app -.- realTime = moment().add(inMinutes+1, 'minutes'); //Time format is "HH:mm". } else if (regexLocalTimeStamp.test(displayTime)) { realTime = moment(displayTime, "HH:mm"); //Time is next day if (realTime.isBefore(moment())) { realTime.add(1, 'day'); } } return realTime; }; // var shouldAddPlatform = function(platform, platformFilter) { // if (platformFilter == null || platformFilter.length == 0) { return true; } // If we don't add any interesting platformFilter, then we asume we'll show all // for(var i=0; i < platformFilter.length; i++) { // if (platformFilter[i] === platform) { return true; } // } // return false; // }; // var departureUrl = function() { // var dateParam = ""; // if (stopItem.timeToThere) { // var min = stopItem.timeToThere; // var timeAhead = moment(moment.now()).add(min, "minute").format().substring(0, 16); // console.log("Looking for journeys " + min + " minutes ahead in time."); // dateParam = "?datetime=" + timeAhead; // } else { // console.log("Looking for current journeys"); // } // return "http://reisapi.ruter.no/StopVisit/GetDepartures/" + stopItem.stopId + dateParam; // }; var stopUrl = function() { return "/public/departures?Hours=12&StopIdentifiers=" + stopItems.map(stopItem => stopItem.stopId).join(); }; var client = new HttpClient(); client.get(stopUrl(), function(stopResponse) { var departure = JSON.parse(stopResponse); var times = departure.PassingTimes; var allStopItems = []; for(var j = 0; j < times.length; j++) { var journey = times[j]; var stop = departure.Stops[journey.StopIdentifier]; var timestamp; var realtimeStamp = processSkyssDisplaytime(journey.DisplayTime); if ( self.config.useRealtime && moment.isMoment(realtimeStamp) ) { timestamp = realtimeStamp.toISOString(); } else { timestamp = journey.AimedTime; } allStopItems.push({ stopId: journey.StopIdentifier, stopName: stop.PlaceDescription, lineName: journey.RoutePublicIdentifier, destinationName: journey.TripDestination, service: stop.ServiceModes[0], time: { Timestamp: timestamp, Status: journey.Status, }, platform: journey.Platform }); } callback(null, allStopItems); }) }, getTableHeaderRow: function() { var thLine = document.createElement("th"); thLine.className = ""; thLine.appendChild(document.createTextNode(this.translate("LINEHEADER"))); var thDestination = document.createElement("th"); thDestination.className = ""; thDestination.appendChild(document.createTextNode(this.translate("DESTINATIONHEADER"))); var thPlatform = document.createElement("th"); thPlatform.className = ""; thPlatform.appendChild(document.createTextNode(this.translate("PLATFORMHEADER"))); var thStopName = document.createElement("th"); thStopName.className = ""; thStopName.appendChild(document.createTextNode(this.translate("STOPNAMEHEADER"))); var thTime = document.createElement("th"); thTime.className = "time"; thTime.appendChild(document.createTextNode(this.translate("TIMEHEADER"))); var thead = document.createElement("thead"); thead.addClass = "xsmall dimmed"; thead.appendChild(document.createElement("th")); thead.appendChild(thLine); thead.appendChild(thDestination); if (this.config.showStopName) { thead.appendChild(thStopName); } if (this.config.showPlatform) { thead.appendChild(thPlatform); } thead.appendChild(thTime); return thead; }, getTableRow: function(journey) { var tdIcon = document.createElement("td"); var imageFA; switch (journey.service) { case "Bus": case "Express": case "Airport bus": imageFA = "bus"; break; case "Light rail": imageFA = "subway"; break; case "Ferry": case "Boat": imageFA = "ship"; break; case "Train": imageFA = "train"; break; default: imageFA = "rocket"; break; } tdIcon.className = "fa fa-"+imageFA; var tdLine = document.createElement("td"); tdLine.className = "line"; var txtLine = document.createTextNode(journey.lineName); tdLine.appendChild(txtLine); var tdDestination = document.createElement("td"); tdDestination.className = "destination bright"; tdDestination.appendChild(document.createTextNode(journey.destinationName)); if (this.config.showPlatform) { var tdPlatform = document.createElement("td"); tdPlatform.className = "platform"; tdPlatform.appendChild(document.createTextNode(journey.platform)); } if (this.config.showStopName) { var tdStopName = document.createElement("td"); tdStopName.className = "light"; tdStopName.appendChild(document.createTextNode(journey.stopName)); } var tdTime = document.createElement("td"); if (journey.time.Status != "Schedule") { tdTime.className = "time light sanntid"; } else { tdTime.className = "time light"; } tdTime.appendChild(document.createTextNode(this.formatTime(journey.time.Timestamp))); var tr = document.createElement("tr"); tr.appendChild(tdIcon); tr.appendChild(tdLine); tr.appendChild(tdDestination); if (this.config.showStopName) { tr.appendChild(tdStopName); } if (this.config.showPlatform) { tr.appendChild(tdPlatform); } tr.appendChild(tdTime); return tr; }, formatTime: function(t) { var now = new Date(); var tti = new Date(t); var diff = tti - now; var min = Math.floor(diff/60000); if (min == 0) { return this.translate("NOW"); } else if (min == 1) { return this.translate("1MIN"); } else if (min < this.config.humanizeTimeTreshold) { return min + " " + this.translate("MINUTES"); } else { return tti.getHours() + ":" + ("0" + tti.getMinutes()).slice(-2); } }, socketNotificationReceived: function(notification, payload) { var self = this; Log.log(this.name + " recieved a socket notification: " + notification); if (notification == "getstop") { if (payload.err) { throw payload.err; } else { self.requests.shift()(payload.response); } } }, requests: [] }); body { margin: 20px; position: absolute; height: calc(100% - 20px); width: calc(100% - 20px); background: #000; background-Image: url("bg.jpg"); background-size: cover; color: #aaa; font-family: "Roboto Condensed", sans-serif; font-weight: 400; font-size: 2em; line-height: 1.5em; -webkit-font-smoothing: antialiased; } .region.fullscreen { position: absolute; top: -65px; left: -65px; right: -65px; bottom: -65px; } /* MMM-Hue Color changes */ .MMM-Hue .centered { text-align: center; color: #99F; } .MMM-Hue .lights-all-on { color: #FF8000; } .MMM-Hue .lights-partial-on { color: #A46526; } .MMM-Hue .fa-home { color: #FF8000; } .MMM-Hue td { color: #99F; } /* MMM-Hue header color */ .MMM-Hue .header { color: #99F; } .clock .time { color: #99F; text-transform: uppercase; } .clock .date { color: #99F; text-transform: uppercase; } .calendar_monthly table { width: initial; float: left; } .calendar_monthly td { text-align: left !important; } .calendar_monthly calendar-table { text-align: left !important; } .calendar_monthly { color: #99F; width: 350px; } /* Highlighting today in calender */ .square-content .today { color: #2A2A2A; font-weight: normal; border: solid 2px #FF8000; border-radius: 5px; background-color: #FF8000; } /* Removes icons above max-temp, min-temp and % chance of rain */ .region.top.right .MMM-WunderGround table th { display: none; } .MMM-WunderGround .max-temp { color: #f66; } .MMM-WunderGround .min-temp { color: #0ff; } .MMM-WunderGround .weather-icon { color: #f93; } .MMM-WunderGround .day { color: #99F; } .MMM-WunderGround .large .bright { color: #99F; } .MMM-WunderGround table.small tr:first-child td { color: #99F; } .MMM-WunderGround .hourv { color: #99F; } /* Weather changes */ .region.top.center .MMM-WunderGround table.small, /* selector for ONLY current weather Thanks to Strawberry-3.141 */ .region.top.right .MMM-WunderGround table:not(.small), /* selector for ONLY weather forecast */ .region.top.right .MMM-WunderGround table.small td:nth-child(6) { display: none; /* this line and line above selector for NO rain amount column */ } /* Newsfeed size & color */ .newsfeed div.light.small.dimmed { color: #99F; /* color for newsfeed **source** */ font-size: 24px; /* size for newsfeed **source** */ } /* Limit the width of the left and right columns to 350px */ .region.right .module-content, .region.left .module-content { max-width: 350px; } /* Region left width */ .region.left { width:350px; } /* Region right width */ .region.right { width:350px; } /* Allows styling of row elements in tables. You need this for the next rule */ table.small { border-collapse:collapse; } /* Add an underline to table rows - also requires the rule above this one */ table tr { border-bottom: solid 1px #222; border-bottom-color: #99F; } /* Blue colour styling for module headers */ .module-header { color: #99F; border-bottom-color: #99F; font-size: 15.5px; font-family: "Roboto"; text-align: center; } /* MMM-OneLiner header color & border */ .MMM-Oneliner .header { color: #99F; border-bottom-color: #99F; } /* MMM-OneLiner text color & size & text type */ .MMM-Oneliner .wrapper { color: #99F; font-family: 'Bubbler One', sans-serif; font-size: 24px; } /* MMM-NetworkScanner icon color */ .MMM-NetworkScanner .fa-li { color: #FF8000; } /* MMM-NetworkScanner Name color */ .MMM-NetworkScanner li { color: #99F; } /* MMM-Tools width & header color change */ .MMM-Tools { width: 320px; color: #99F; } /* Fix for MMM-Tools - Place module anywhere */ .Tools .status_item .container { margin-top:0; } /* MMM-Tools Color change right side */ .Tools { color: #99F; } /* MMM-Tools Color change left side */ .Tools .status_item .item_label { color: #99F; } /* MMM-Tools Transparent progress bar */ .Tools .bar.step0 { background-color: #33C; opacity: 0.3; } .Tools .bar.step10 { background-color: #43B; opacity: 0.3; } .Tools .bar.step20 { background-color: #53A; opacity: 0.3; } .Tools .bar.step30 { background-color: #639; opacity: 0.3; } .Tools .bar.step40 { background-color: #738; opacity: 0.3; } .Tools .bar.step50 { background-color: #837; opacity: 0.3; } .Tools .bar.step60 { background-color: #936; opacity: 0.3; } .Tools .bar.step70 { background-color: #A35; opacity: 0.3; } .Tools .bar.step80 { background-color: #B34; opacity: 0.3; } .Tools .bar.step90 { background-color: #C33; opacity: 0.3; } .Tools .bar.step100 { background-color: #D32; opacity: 0.3; } /* MMM-NiceThings Colors */ .MMM-NiceThings .morning { color: #99F; } .MMM-NiceThings .afternoon { color: #99F; } .MMM-NiceThings .evening { color: #99F; } /* MMM-NowPlayingOnSpotify */ .NPOS_albumCover { width: 350px; } .MMM-NowPlayingOnSpotify { width: 350px; } /* MMM-Ruter */ table.ruter { width: 0px; text-align: left; } table.ruter td, table.ruter th { padding: 0 6px; color: #99F; text-align: left; } table.ruter thead { border-bottom: 1px solid rgba(255, 255, 255, 0.733); color: #99F; text-align: left; } .ruter .time { padding-left: 0px; text-align: left; color: #99F; } [image: 1525470015152-skjermbilde.jpg]