Skip to content

Commit

Permalink
added daylight saving option
Browse files Browse the repository at this point in the history
updated readme
increased version
  • Loading branch information
IPdotSetAF committed Apr 11, 2024
1 parent b5096ec commit 7c8b21f
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 24 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ This is a highly customizable animated Matrix wallpaper for Wallpaper Engine (We
- Clock
- Horizontal/Vertical
- 12/24 Hour Format
- Day-light Saving
- Scale
- Position
- Message
Expand Down
19 changes: 17 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
window.onload = function () {
const version = "v4.2.0";
const version = "v4.3.0";

checkForUpdates = async () => {
const url = 'https://api.github.com/repos/IPdotSetAF/NeoMatrix/tags';
Expand Down Expand Up @@ -51,6 +51,7 @@ window.onload = function () {
ui_logo_positionY: 0,
ui_clock_clock: "0",
ui_clock_24HourFormat: true,
ui_clock_dayLightSaving: 0,
ui_clock_scale: 1,
ui_clock_positionX: 0,
ui_clock_positionY: 0,
Expand Down Expand Up @@ -134,6 +135,10 @@ window.onload = function () {
updateTime();
updateMask();
});
clockfolder.add(options, "ui_clock_dayLightSaving").min(-1).max(1).step(1).name("Day-light Saving").onChange(() => {
updateTime();
updateMask();
});
clockfolder.add(options, "ui_clock_scale").min(1).max(10).step(1).name("Scale").onChange(updateMask);
const clockPositionFolder = clockfolder.addFolder("Position");
clockPositionFolder.add(options, "ui_clock_positionX").min(-100).max(100).step(1).name("X").onChange(updateMask);
Expand Down Expand Up @@ -230,13 +235,17 @@ window.onload = function () {
options.ui_clock_24HourFormat = properties.ui_clock_24hourformat.value;
updateTime();
}
if (properties.ui_clock_daylightsaving) {
options.ui_clock_dayLightSaving = properties.ui_clock_daylightsaving.value;
updateTime();
}
if (properties.ui_clock_scale)
options.ui_clock_scale = properties.ui_clock_scale.value;
if (properties.ui_clock_positionx)
options.ui_clock_positionX = properties.ui_clock_positionx.value;
if (properties.ui_clock_positiony)
options.ui_clock_positionY = properties.ui_clock_positiony.value;
if (properties.ui_clock_clock || properties.ui_clock_24hourformat || properties.ui_clock_scale || properties.ui_clock_positionx || properties.ui_clock_positiony)
if (properties.ui_clock_clock || properties.ui_clock_24hourformat || properties.ui_clock_daylightsaving || properties.ui_clock_scale || properties.ui_clock_positionx || properties.ui_clock_positiony)
updateMask();

if (properties.ui_message_message)
Expand Down Expand Up @@ -337,6 +346,12 @@ window.onload = function () {
hour = today.getHours();
minute = today.getMinutes();

hour += options.ui_clock_dayLightSaving;
if (hour < 0)
hour = 23;
if (hour > 23)
hour = 0;

if (!options.ui_clock_24HourFormat && hour > 12) {
hour = hour % 12;
if (hour == 0)
Expand Down
56 changes: 34 additions & 22 deletions project.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@
},
"folder_message" :
{
"index" : 34,
"order" : 134,
"index" : 35,
"order" : 135,
"text" : "<h4>Message</h4>",
"type" : "text"
},
"folder_other" :
{
"index" : 40,
"order" : 140,
"index" : 41,
"order" : 141,
"text" : "<h4>Other</h4>",
"type" : "text"
},
Expand Down Expand Up @@ -200,14 +200,26 @@
"type" : "combo",
"value" : "0"
},
"ui_clock_daylightsaving" :
{
"condition" : "ui_clock_clock.value != 0",
"fraction" : false,
"index" : 31,
"max" : 1,
"min" : -1,
"order" : 131,
"text" : "Day-light Saving",
"type" : "slider",
"value" : 0
},
"ui_clock_positionx" :
{
"condition" : "ui_clock_clock.value != 0",
"fraction" : false,
"index" : 32,
"index" : 33,
"max" : 100,
"min" : -100,
"order" : 132,
"order" : 133,
"text" : "Clock Position X",
"type" : "slider",
"value" : 0
Expand All @@ -216,10 +228,10 @@
{
"condition" : "ui_clock_clock.value != 0",
"fraction" : false,
"index" : 33,
"index" : 34,
"max" : 100,
"min" : -100,
"order" : 133,
"order" : 134,
"text" : "Clock Position Y",
"type" : "slider",
"value" : 0
Expand All @@ -228,10 +240,10 @@
{
"condition" : "ui_clock_clock.value == 3 || ui_clock_clock.value == 4",
"fraction" : false,
"index" : 31,
"index" : 32,
"max" : 10,
"min" : 1,
"order" : 131,
"order" : 132,
"text" : "Clock Scale",
"type" : "slider",
"value" : 1
Expand Down Expand Up @@ -510,7 +522,7 @@
},
"ui_message_message" :
{
"index" : 35,
"index" : 36,
"options" :
[
{
Expand All @@ -522,7 +534,7 @@
"value" : "3"
}
],
"order" : 135,
"order" : 136,
"text" : "Message",
"type" : "combo",
"value" : "0"
Expand All @@ -531,10 +543,10 @@
{
"condition" : "ui_message_message.value != 0",
"fraction" : false,
"index" : 38,
"index" : 39,
"max" : 200,
"min" : 0,
"order" : 138,
"order" : 139,
"text" : "Message Position X",
"type" : "slider",
"value" : 0
Expand All @@ -543,10 +555,10 @@
{
"condition" : "ui_message_message.value != 0",
"fraction" : false,
"index" : 39,
"index" : 40,
"max" : 200,
"min" : 0,
"order" : 139,
"order" : 140,
"text" : "Message Position Y",
"type" : "slider",
"value" : 0
Expand All @@ -555,27 +567,27 @@
{
"condition" : "ui_message_message.value == 3 || ui_message_message.value == 4",
"fraction" : false,
"index" : 37,
"index" : 38,
"max" : 10,
"min" : 1,
"order" : 137,
"order" : 138,
"text" : "Message Scale",
"type" : "slider",
"value" : 1
},
"ui_message_text" :
{
"condition" : "ui_message_message.value != 0",
"index" : 36,
"order" : 136,
"index" : 37,
"order" : 137,
"text" : "Message Text",
"type" : "textinput",
"value" : "THE MATRIX"
},
"ui_other_codescommaseparated" :
{
"index" : 41,
"order" : 141,
"index" : 42,
"order" : 142,
"text" : "Codes (comma separated)",
"type" : "textinput",
"value" : "THE MATRIX"
Expand Down

0 comments on commit 7c8b21f

Please sign in to comment.