Skip to content

Commit 0921def

Browse files
committed
gui folders start in closed state
added year, month. date and day variables fixed date delimiter display condition
1 parent affe877 commit 0921def

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

index.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ window.onload = function () {
121121
});
122122
rainFolder.add(options, "ui_rain_dropCount").min(1).max(5).step(1).name("Drop Count/Column").onChange(initialAnimation);
123123
rainFolder.add(options, "ui_rain_initialAnimation", optionsToDict(config.general.properties.ui_rain_initialanimation.options)).name("Initial Animation").onChange(initialAnimation);
124+
rainFolder.close();
124125

125126
const colorFolder = gui.addFolder("Color");
126127
colorFolder.add(options, 'ui_color_colorMode', optionsToDict(config.general.properties.ui_color_colormode.options)).name('Color Mode');
@@ -131,17 +132,20 @@ window.onload = function () {
131132
options.colorAnimationSpeed = calculateColorAnimationSpeed(options.ui_color_colorAnimationSpeed);
132133
});
133134
colorFolder.add(options, 'ui_color_highlightFirstCharacter').name('Highlight First Character');
135+
colorFolder.close();
134136

135137
const characterFolder = gui.addFolder("Characters");
136138
characterFolder.add(options, 'ui_characters_charset', optionsToDict(config.general.properties.ui_characters_charset.options)).name('Char set').onChange(updateCharSet);
137139
characterFolder.add(options, 'ui_characters_customCharset').name('Custom Char Set').onChange(updateCharSet);
140+
characterFolder.close();
138141

139142
const fontFolder = gui.addFolder("Font");
140143
fontFolder.add(options, 'ui_font_size').min(5).max(30).step(1).name('Font Size').onChange(updateFont);
141144
fontFolder.add(options, 'ui_font_font', optionsToDict(config.general.properties.ui_font_font.options)).name('Font').onChange(updateFont);
142145
fontFolder.add(options, 'ui_font_customFont').name('Custom Font').onChange(updateFont);
146+
fontFolder.close();
143147

144-
gui.addFolder("Audio (not available in web version)");
148+
gui.addFolder("Audio (not available in web version)").close();;
145149

146150
const logoFolder = gui.addFolder("Logo");
147151
logoFolder.add(options, "ui_logo_logo", optionsToDict(config.general.properties.ui_logo_logo.options)).name("Logo").onChange(updateLogo);
@@ -151,6 +155,7 @@ window.onload = function () {
151155
const logoPositionFolder = logoFolder.addFolder("Position");
152156
logoPositionFolder.add(options, "ui_logo_positionX").min(-2500).max(2500).step(1).name("X").onChange(updateLogo);
153157
logoPositionFolder.add(options, "ui_logo_positionY").min(-2500).max(2500).step(1).name("Y").onChange(updateLogo);
158+
logoFolder.close();
154159

155160
const clockFolder = gui.addFolder("Clock");
156161
clockFolder.add(options, "ui_clock_clock", optionsToDict(config.general.properties.ui_clock_clock.options)).name("Clock").onChange(updateMask);
@@ -166,6 +171,7 @@ window.onload = function () {
166171
const clockPositionFolder = clockFolder.addFolder("Position");
167172
clockPositionFolder.add(options, "ui_clock_positionX").min(-100).max(100).step(1).name("X").onChange(updateMask);
168173
clockPositionFolder.add(options, "ui_clock_positionY").min(-100).max(100).step(1).name("Y").onChange(updateMask);
174+
clockFolder.close();
169175

170176
const messageFolder = gui.addFolder("Message");
171177
messageFolder.add(options, "ui_message_message").name("Message").onChange(updateMask);
@@ -174,6 +180,7 @@ window.onload = function () {
174180
const messagePositionFolder = messageFolder.addFolder("Position");
175181
messagePositionFolder.add(options, "ui_message_positionX").min(-100).max(100).step(1).name("X").onChange(updateMask);
176182
messagePositionFolder.add(options, "ui_message_positionY").min(-100).max(100).step(1).name("Y").onChange(updateMask);
183+
messageFolder.close();
177184

178185
const dayFolder = gui.addFolder("Day");
179186
dayFolder.add(options, "ui_day_day", optionsToDict(config.general.properties.ui_day_day.options)).name("Day").onChange(updateMask);
@@ -182,6 +189,7 @@ window.onload = function () {
182189
const dayPositionFolder = dayFolder.addFolder("Position");
183190
dayPositionFolder.add(options, "ui_day_positionX").min(-100).max(100).step(1).name("X").onChange(updateMask);
184191
dayPositionFolder.add(options, "ui_day_positionY").min(-100).max(100).step(1).name("Y").onChange(updateMask);
192+
dayFolder.close();
185193

186194
const dateFolder = gui.addFolder("Date");
187195
dateFolder.add(options, "ui_date_date", optionsToDict(config.general.properties.ui_date_date.options)).name("Day").onChange(updateMask);
@@ -191,12 +199,14 @@ window.onload = function () {
191199
const datePositionFolder = dateFolder.addFolder("Position");
192200
datePositionFolder.add(options, "ui_date_positionX").min(-100).max(100).step(1).name("X").onChange(updateMask);
193201
datePositionFolder.add(options, "ui_date_positionY").min(-100).max(100).step(1).name("Y").onChange(updateMask);
202+
dateFolder.close();
194203

195204
const otherFolder = gui.addFolder("Other");
196205
otherFolder.add(options, 'ui_other_codesCommaSeparated').name('Codes (Comma separated)').onChange(() => {
197206
options.codes = makeCodes(options.ui_other_codesCommaSeparated);
198207
initialAnimation();
199208
});
209+
otherFolder.close();
200210

201211
gui.add(options, "Share");
202212
gui.add(options, "Save");
@@ -366,7 +376,7 @@ window.onload = function () {
366376
];
367377
var logo = null, logos = ["ipaf", "kali-1", "kali-2", "ubuntu-1", "ubuntu-2", "windows-11", "windows-10-8", "windows-7", "visual-studio", "vs-code", "unity-1", "unity-2", "unreal", "python", "blazor", "docker", "flutter", "git", "blender", "angular", "c-sharp", "c-plus-plus", "qt"];
368378
var debug = document.getElementById("debug"), logs = [];
369-
var hour = "", minute = "";
379+
var year = "", month = "", date = "", day = "", hour = "", minute = "";
370380
var startTime, now, then, elapsed, letters, columns, rows, drops, staticChars;
371381
var AudioTimeout = false, LastSoundTime = new Date(), isSilent = false, frequencyArray, frequencyArrayLength = 128, column_frequency;
372382
var column_hue, row_hue;
@@ -423,6 +433,10 @@ window.onload = function () {
423433

424434
function updateTime() {
425435
let today = new Date();
436+
year = today.getFullYear();
437+
month = today.getMonth();
438+
date = today.getDate();
439+
day = today.getDay();
426440
hour = today.getHours();
427441
minute = today.getMinutes();
428442

@@ -488,12 +502,12 @@ window.onload = function () {
488502
}
489503

490504
if (options.ui_message_message) {
491-
let cc = getCharsCount(options.ui_message_text);
492505
if (options.ui_message_scale > 0) {
493506
let bb = getTextBoundingBox(options.ui_message_text, options.ui_message_scale);
494507
let center = [Math.floor((columns - bb[0]) / 2), Math.floor((rows - bb[1]) / 2)];
495508
drawTextOnMask(options.ui_message_text, center[0] + options.ui_message_positionX, center[1] + options.ui_message_positionY, options.ui_message_scale);
496509
} else {
510+
let cc = getCharsCount(options.ui_message_text);
497511
let center = [Math.floor((columns - cc[0]) / 2), Math.floor((rows - cc[1]) / 2)];
498512
drawTextOnMatrix(options.ui_message_text, center[0] + options.ui_message_positionX, center[1] + options.ui_message_positionY);
499513
}

project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@
786786
"ui_date_delimiter" :
787787
{
788788
"index" : 52,
789-
"condition" : "ui_date_orientation.value == 0",
789+
"condition" : "ui_date_date.value != 0 && ui_date_orientation.value == 0",
790790
"options" :
791791
[
792792
{

0 commit comments

Comments
 (0)