<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MMM-HTMLBox not displaying my 1 hour countdown timer html file]]></title><description><![CDATA[<p dir="auto">Hi,<br />
I want to have a 1 hour (minutes:seconds) countdown timer to show my young kids how much Tech Time they have left.<br />
I have tweaked the <a href="http://flipclockjs.com/" target="_blank" rel="noopener noreferrer nofollow ugc">http://flipclockjs.com/</a> countdown timer and created this html file</p>
<p dir="auto">Cant seem to show the html code here - it just says DIV DIV and I cant attach a zip file. Will see if I can paste the code in the next reply.</p>
<p dir="auto">This HTML file works if opened normally in the Web browser on the Pi, but when loaded via MMM-HTMLBox doesnt show anything.<br />
I am sure I am missing one small thing, but after changing folder/subfolder locations, copying css and js files to MagicMirror locations etc I just cant get it to load in this module. Any advice would be greatly welcomed.<br />
Thanks<br />
Dave</p>
<p dir="auto">the config.js is configured like</p>
<pre><code>		{
		  module: "MMM-HTMLBox",
		  position:"bottom_bar",
		  config: {
		    width: "100%",
		    height: "200px",
		    refresh_interval_sec: 0,
		    content: "There is nothing to display. &lt;br&gt;Put your HTML code into content field in 'config.js'.",
		    file: "base.html", //When content is too long, you can use this for external file. relative path from `MMM-HTMLBox`
		  }
		},

</code></pre>
]]></description><link>https://forum.magicmirror.builders/topic/11698/mmm-htmlbox-not-displaying-my-1-hour-countdown-timer-html-file</link><generator>RSS for Node</generator><lastBuildDate>Thu, 14 May 2026 10:16:25 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/11698.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Nov 2019 23:40:58 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Fri, 06 Dec 2019 08:32:22 GMT]]></title><description><![CDATA[<p dir="auto">@Sean Can you help me Website display on the mirror after voice search?<br />
It should look like this:<br />
<img src="https://i0.wp.com/uphinh.org/images/2019/12/06/56800819_2177846529172006_7356231933740711936_n.jpg" alt="alt text" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/65549</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65549</guid><dc:creator><![CDATA[guongthongminh]]></dc:creator><pubDate>Fri, 06 Dec 2019 08:32:22 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Wed, 04 Dec 2019 21:48:27 GMT]]></title><description><![CDATA[<p dir="auto">@Sean<br />
No problem, thanks for the help, :)<br />
D</p>
]]></description><link>https://forum.magicmirror.builders/post/65487</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65487</guid><dc:creator><![CDATA[btni]]></dc:creator><pubDate>Wed, 04 Dec 2019 21:48:27 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Wed, 04 Dec 2019 16:14:25 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/btni" aria-label="Profile: btni">@<bdi>btni</bdi></a><br />
That code was just an example. so you’d better create your own. Mine was just showing that module-building is not so difficult than people’s thought.</p>
]]></description><link>https://forum.magicmirror.builders/post/65470</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65470</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Wed, 04 Dec 2019 16:14:25 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Wed, 04 Dec 2019 15:39:21 GMT]]></title><description><![CDATA[<p dir="auto">@Sean<br />
Hi Sean,<br />
I rebuild a new Pi with MM and was able to get the countdown timer showing, thank you for your help.</p>
<p dir="auto">However some 0 numbers dissappear and I am trying to increase the size of the font.<br />
I have created a css file in the module subfolder as per your instructions in the cs file. Then I have copied and edited the css info from this post <a href="https://forum.magicmirror.builders/topic/4527/change-fontsize">https://forum.magicmirror.builders/topic/4527/change-fontsize</a> , I doubled all values to see if it makes a difference, but the text stayed the same size. Am I looking in the right area.</p>
<p dir="auto">I did uncomment your line</p>
<pre><code>    return ["MMM-MyCountDown.css"]   // If needed, you can add your css.
</code></pre>
<p dir="auto">Thanks<br />
Dave</p>
<pre><code> body {
 	
.xsmall {
  font-size: 30px;
  line-height: 40px;
}

.small {
  font-size: 40px;
  line-height: 50px;
}

.medium {
  font-size: 60px;
  line-height: 70px;
}

.large {
  font-size: 130px;
  line-height: 130px;
}

.xlarge {
  font-size: 150px;
  line-height: 150px;
  letter-spacing: -6px;
}

 }
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/65469</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65469</guid><dc:creator><![CDATA[btni]]></dc:creator><pubDate>Wed, 04 Dec 2019 15:39:21 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Mon, 02 Dec 2019 12:23:41 GMT]]></title><description><![CDATA[<p dir="auto">@Sean<br />
Hi Sean, I have tried putting this code in but getting a black screen. As I have played with lots of different modules and code I am going to rebuild the pi this afternoon and only put this module and code in to test.<br />
My idea is if my kids have built up enough brownie points to get 1hr of Tech, then I use remote.html (via MMM-Remote module) to refresh HTML or restart the MagicMirror to start a 1-hour timer on the Magic Mirror Screen above the computer desk.<br />
I am sure there are loads of ways to do this, but I like the clean crispness of the MagicMirror and will be building one with stocks/calendar etc for my bedroom, and possibly one for most rooms around the house (some touchscreen).<br />
I do want to get ways to put up an image and/or play a video to them which I have seen some modules to allow this, but the first basic thing I would like to get is this countdown timer working.</p>
<p dir="auto">Thanks again for your patience and help, I shall rebuild this pi this afternoon and let you know how I get on,<br />
Dave</p>
]]></description><link>https://forum.magicmirror.builders/post/65352</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65352</guid><dc:creator><![CDATA[btni]]></dc:creator><pubDate>Mon, 02 Dec 2019 12:23:41 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Mon, 02 Dec 2019 11:33:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/btni" aria-label="Profile: btni">@<bdi>btni</bdi></a><br />
Try this;</p>
<p dir="auto"><strong><code>modules/MMM-MyCountDown/MMM-MyCountDown.js</code></strong></p>
<pre><code class="language-js">Module.register("MMM-MyCountDown", {
  defaults: {
    refreshInterval: 1000,
    targettMS : 1000 * 10, // milliseconds to alarm
  },

  /*
  getStyles: function() {
    // return ["MMM-MyCountDown.css"]   // If needed, you can add your css.
  },
  */

  getScripts: function() {
    return ["moment.js"]
  },

  start: function() {
    this.endTime = null
    this.timer = null
  },

  getDom: function() {
    var dom = document.createElement("div")
    dom.className = "CountDown_Content"
    dom.innerHTML = this.showRemain()
    return dom
  },

  notificationReceived: function(noti, payload, sender) {
    switch(noti) {
      case "DOM_OBJECTS_CREATED":
        this.startCountDown()
        break
      case "RESET":
        this.startCountDown(payload)
        break
    }
  },

  startCountDown: function(ms = null) {
    this.resetCountDown()
    ms = (ms) ? ms : this.config.targetMS
    this.endTime = moment().add(ms, "ms")
    this.refresh()
  },

  resetCountDown: function() {
    this.endTime = null
    clearTimeout(this.timer)
    this.timer = null
  },

  refresh: function() {
    this.updateDom()
    var curTime = moment()
    if (curTime.isAfter(this.endTime)) {
      this.resetCountDown()
      this.sendNotification(
        "SHOW_ALERT",
        {
          title: "MyCountDown",
          message: "CountDown ended.",
          timer: 3000,
        }
      )
    } else {
      this.timer = setTimeout(()=&gt;{
        this.refresh()
      }, this.config.refreshInterval)
    }
  },

  showRemain: function() {
    if (!this.endTime) {
      return "CountDown being not set."
    } else {
      var curTime = moment()
      var remain = moment.duration(this.endTime.diff(curTime))
      var format = function (dur) {
        str = ""
        if(dur.days() &gt; 1) str = str + Math.floor(dur.days()) + " - "
        if(dur.hours() &gt; 1) str = str + Math.floor(dur.hours()) + ":"
        if(dur.minutes() &gt; 1) str = str + Math.floor(dur.minutes()) + ":"
        if(dur.seconds() &gt; 1) str = str + Math.floor(dur.seconds())
        return str
      }
      return format(remain)
    }
  },
})

</code></pre>
<p dir="auto"><strong><code>config/config.js</code></strong></p>
<pre><code class="language-js">{
  module: "MMM-MyCountDown",
  position: "top_left",
  config: {
    targetMS: 1000*60*60,
  }
}
</code></pre>
<p dir="auto">It will display like this;</p>
<p dir="auto"><img src="/assets/uploads/files/1575286266820-e27af3e9-4f93-4b28-a4cc-a7a4c8395192-image.png" alt="0_1575286266624_e27af3e9-4f93-4b28-a4cc-a7a4c8395192-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Of course, you can look inside and modify for your purpose.</p>
]]></description><link>https://forum.magicmirror.builders/post/65351</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65351</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 02 Dec 2019 11:33:51 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Mon, 02 Dec 2019 11:26:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/btni" aria-label="Profile: btni">@<bdi>btni</bdi></a><br />
Frankly said, Just needs inside of <code>&lt; html &gt;</code> but, putting all the things doesn’t matter. (It might cause iframe errors but it would not interfere MM’s running)</p>
<p dir="auto">Anyway, You have another option. Build your custom module. Almost the same with your current JS.</p>
<p dir="auto">Last question. What is the purpose of this count down? Your code will count down from every startup from MM, but I cannot understand why you need this. If I get your intention, maybe more adequate suggestions could be possible.</p>
]]></description><link>https://forum.magicmirror.builders/post/65350</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65350</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 02 Dec 2019 11:26:15 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Mon, 02 Dec 2019 10:58:16 GMT]]></title><description><![CDATA[<p dir="auto">Hi Sean,<br />
I think with my very limited knowledge of the code, I first started looking at some of the modules like Doomsday, countdown etc but from what i could see they all counted down to a date/time, rather than now + 60 minutes.<br />
I was then trying to just get html code and use the other modules, but still hitting the same wall. I still cant even get the html code working inside the MMM-Widget lol.</p>
<p dir="auto">If you can help steer me to a countdown module that can reset to 60 minutes via MMM-Remote - restart MM then that would be great, or if you can see where I am going wrong below it would help. I have shorted to a sample html file.<br />
At the start of the HTML code, do I need the file header items like DOCUTYPE, html and body? It makes it dissapear in the formatted code below.</p>
<pre><code>{
  module: "MMM-Widget",
  config: {
    widgets: [
      {
        html:`
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;body&gt;
&lt;h1&gt;My First Heading&lt;/h1&gt;
&lt;p&gt;My first paragraph.&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;        `,
        position: "top_left",
        width: "800px",
        height: "400px",
        backgroundColor: "#FFF"
      },
</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1575282743671-mmmwidget.jpg" alt="0_1575282743647_MMMWidget.JPG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/65349</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65349</guid><dc:creator><![CDATA[btni]]></dc:creator><pubDate>Mon, 02 Dec 2019 10:58:16 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Mon, 02 Dec 2019 09:47:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/btni" aria-label="Profile: btni">@<bdi>btni</bdi></a><br />
But if you need just a countdown itself, there be plenty of countdown(and more) modules. How about using them?</p>
]]></description><link>https://forum.magicmirror.builders/post/65348</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65348</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 02 Dec 2019 09:47:38 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Mon, 02 Dec 2019 09:46:02 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Sean, sorry I left my update late last night, then when driving into work this morning remembered I had moved away from testing the MMM-Widget and was going to test it first thing this morning. You beat me to it, thank you for your help, I can now tweak the background and text colour etc.</p>
<p dir="auto">Thanks again<br />
David</p>
]]></description><link>https://forum.magicmirror.builders/post/65347</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65347</guid><dc:creator><![CDATA[btni]]></dc:creator><pubDate>Mon, 02 Dec 2019 09:46:02 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Mon, 02 Dec 2019 09:19:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/btni" aria-label="Profile: btni">@<bdi>btni</bdi></a><br />
Is this what you want?</p>
<p dir="auto"><img src="/assets/uploads/files/1575278171138-ee7c245a-574a-41f1-913a-c6d436f9ed01-image.png" alt="0_1575278171064_ee7c245a-574a-41f1-913a-c6d436f9ed01-image.png" class=" img-fluid img-markdown" /></p>
<pre><code class="language-js">{
  module: "MMM-Widget",
  config: {
    widgets: [
      {
        html:`
// Put your HTML &amp; JS code into here.
        `,
        position: "top_left",
        width: "800px",
        height: "400px",
        backgroundColor: "#FFF"
      },

    ]
  }
}
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/65346</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65346</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Mon, 02 Dec 2019 09:19:23 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Mon, 02 Dec 2019 01:10:58 GMT]]></title><description><![CDATA[<p dir="auto">ok I have been trying out different code in different modules like MMM-Widget and MMM-iFrames and still unable to get a 1hr coutdown to display.</p>
<p dir="auto">issue 1 - MMM-Widget - I cannot get it to display a local file. I have even tried creating a public subfolder and use url local location, but I cant seem to get any public folder to publish?</p>
<p dir="auto">Issue 2 - MMM-iFrame - Will display a local single test html file but if I use this code below it doesnt. Here is my code that is working in the <a href="http://www.w3schools.com" target="_blank" rel="noopener noreferrer nofollow ugc">www.w3schools.com</a> website.</p>
<p dir="auto">Sorry I am a bit of a noob with html, js MM etc.</p>
<p dir="auto">I cant seem to add the code in here but here is a link to the w3schools site</p>
<p dir="auto">Your Code has Been Saved<br />
File has been saved to: <a href="https://www.w3schools.com/code/tryit.asp?filename=G0I4VVLAWBCN" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.w3schools.com/code/tryit.asp?filename=G0I4VVLAWBCN</a></p>
<p dir="auto">Thanks<br />
Dave</p>
]]></description><link>https://forum.magicmirror.builders/post/65327</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65327</guid><dc:creator><![CDATA[btni]]></dc:creator><pubDate>Mon, 02 Dec 2019 01:10:58 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Fri, 29 Nov 2019 13:19:43 GMT]]></title><description><![CDATA[<p dir="auto">Thanks @Sean i will try that</p>
]]></description><link>https://forum.magicmirror.builders/post/65250</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65250</guid><dc:creator><![CDATA[btni]]></dc:creator><pubDate>Fri, 29 Nov 2019 13:19:43 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Fri, 29 Nov 2019 08:07:54 GMT]]></title><description><![CDATA[<p dir="auto"><code>MMM-HTMLBox</code> is <strong>Just putting <code>static</code> HTML code into MagicMirror.</strong> as described on byline. It will not parse your JS code, that is not HTML.<br />
So if you need, you could make iframe wrapper to load your page.<br />
Or try <code>MMM-Widget</code>instead.</p>
]]></description><link>https://forum.magicmirror.builders/post/65249</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65249</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 29 Nov 2019 08:07:54 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Thu, 28 Nov 2019 23:56:46 GMT]]></title><description><![CDATA[<p dir="auto">the file structure looks a bit messy as i have copied the files in a number of places to try to get it working, but currently running with all necessary files in the same location, the sub folder of MMM-HTMLBox</p>
<p dir="auto"><img src="/assets/uploads/files/1574985403658-files.jpg" alt="0_1574985403249_files.JPG" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/65243</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65243</guid><dc:creator><![CDATA[btni]]></dc:creator><pubDate>Thu, 28 Nov 2019 23:56:46 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Thu, 28 Nov 2019 23:51:40 GMT]]></title><description><![CDATA[<p dir="auto"><img src="/assets/uploads/files/1574985055851-base.html.jpg" alt="0_1574985054807_base.html.jpg" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/65242</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65242</guid><dc:creator><![CDATA[btni]]></dc:creator><pubDate>Thu, 28 Nov 2019 23:51:40 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-HTMLBox not displaying my 1 hour countdown timer html file on Thu, 28 Nov 2019 23:49:36 GMT]]></title><description><![CDATA[<p dir="auto">not sure if anyone can see this code below, i shall take a screen grab next and upload it</p>
<pre><code>&lt;html&gt;
	&lt;head&gt;
		&lt;link rel="stylesheet" href="flipclock.css"&gt;

		&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt;

		&lt;script src="flipclock.js"&gt;&lt;/script&gt;
	&lt;/head&gt;
	&lt;body&gt;
	&lt;div class="clock" style="margin:2em;"&gt;&lt;/div&gt;
	&lt;div class="message"&gt;&lt;/div&gt;

	&lt;script type="text/javascript"&gt;
		var clock;
		
		$(document).ready(function() {
			var clock;

			clock = $('.clock').FlipClock({
		        clockFace: 'MinuteCounter',
		        autoStart: false,
		        callbacks: {
		        	stop: function() {
		        		$('.message').html('The clock has stopped!')
		        	}
		        }
		    });
				    
		    clock.setTime(3598);
		    clock.setCountdown(true);
		    clock.start();

		});
	&lt;/script&gt;
	
	&lt;/body&gt;
&lt;/html&gt;
</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/65241</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/65241</guid><dc:creator><![CDATA[btni]]></dc:creator><pubDate>Thu, 28 Nov 2019 23:49:36 GMT</pubDate></item></channel></rss>