Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mykle1 authored Oct 27, 2017
1 parent f22f03c commit 8c15111
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MMM-SunRiseSet.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

.MMM-SunRiseSet .img {
/* display: none; uncomment if you don't want animated image */
width: 95%; /* adjust size of moon picture */
width: 99%; /* adjust size of moon picture */
margin-left: 0px; /* Precisely align moon picture with these */
margin-right: 0px;
margin-top: 10px;
Expand Down
28 changes: 26 additions & 2 deletions MMM-SunRiseSet.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ Module.register("MMM-SunRiseSet", {
defaults: {
lat: "36.7201600", // latitude
lng: "-4.4203400", // longitude
image: "world", // world or static (for graph)
image: "world", // world or static (for graph)
mapOnly: "no", // no = all data, yes = only animated world map
useHeader: false, // true if you want a header
header: "On to the heart of the sunrise", // Any text you want. useHeader must be true
maxWidth: "300px",
Expand Down Expand Up @@ -58,6 +59,10 @@ Module.register("MMM-SunRiseSet", {
header.innerHTML = this.config.header;
wrapper.appendChild(header);
}

///////////// First - IF you want all the data and the image ///////////////////

if (this.config.mapOnly != "yes") {

var SunRiseSet = this.SunRiseSet;
var lat = this.config.lat; // latitude
Expand Down Expand Up @@ -157,6 +162,25 @@ Module.register("MMM-SunRiseSet", {
pic.appendChild(img);
wrapper.appendChild(pic);
}

////////////////// ELSE - Only the world map image //////////////

} else {

var top = document.createElement("div");
top.classList.add("list-row");

var pic = document.createElement("div");
var img = document.createElement("img");
img.classList.add("img");
var getTimeStamp = new Date().getTime(); // @Sean & @ Strawberry
img.src = "http://api.usno.navy.mil/imagery/earth.png?date=today&seed=" + getTimeStamp; //
pic.appendChild(img);
wrapper.appendChild(pic);

} // closes else


return wrapper;
},

Expand Down Expand Up @@ -185,4 +209,4 @@ Module.register("MMM-SunRiseSet", {
}
this.updateDom(this.config.initialLoadDelay);
},
});
});
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ More information than you ever wanted to know about the rising and setting of th

* MMM-Lunartic in top_left region

![](pix/1.JPG), ![](pix/2.JPG)
![](pix/1.JPG)

* MMM-SunRiseSet in bottom_left region

## Example animation instead of static graph

![](pix/1.gif)
![](pix/1.gif), ![](pix/11.JPG)

* Config option to just show animated world image without the data

* Obviously, the shadow will move much more slowly

Expand All @@ -45,6 +47,7 @@ Annotated .css file included for aligning and coloring text and header.
lat: "40.574783", // Your latitude (for the data)
lng: "-74.112450", // Your longitude (for the data)
image: "world", // world (animation) or static (graph)
mapOnly: "no", // no = all data, yes = only animated world map
useHeader: false, // true if you want a header
header: "Header", // useHeader must be true
maxWidth: "300px",
Expand All @@ -53,4 +56,4 @@ Annotated .css file included for aligning and coloring text and header.


## Thanks go to SpaceCowboysDude for UTC and moment advice
## Thanks also to Sean and Strawberry for updateDOM guidance
## Thanks also to Sean and Strawberry for updateDOM guidance

0 comments on commit 8c15111

Please sign in to comment.