Skip to content

Commit 1fb734c

Browse files
committed
minimum of settings tab
1 parent 6b98dcd commit 1fb734c

File tree

17 files changed

+484
-635
lines changed

17 files changed

+484
-635
lines changed

src/main/resources/iwtcms.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ web {
3737
}
3838

3939
dev {
40-
// used for developing, DO NOT CHANGE IF YOU ARE NO DEVELOPER
40+
// used for developing, DO NOT CHANGE IF YOU ARE NOT A DEVELOPER
4141
// CAN CAUSES CRASH IF YOU USE COMPILED JAR
4242
// ENABLE IT IF YOU KNOW WHAT YOU DO
4343
// to know more read README.md on github or modrinth of IWTCMS

src/main/web/App.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import Header from "./lib/Header.svelte";
33
import Footer from "./lib/Footer.svelte";
44
import ConsoleTab from "./lib/tabs/ConsoleTab/ConsoleTab.svelte";
5-
// import SettingsTab from "./lib/tabs/SettingsTab/SettingsTab.svelte";
5+
import SettingsTab from "./lib/tabs/SettingsTab/SettingsTab.svelte";
66
import PlayersTab from "./lib/tabs/PlayersTab/PlayersTab.svelte";
77
import Login from "./lib/Login.svelte";
88
import ToastSystem from "./scripts/toastSystem";
@@ -37,7 +37,7 @@
3737
<main class="align-center absolute flex w-screen justify-center">
3838
<div class="tabs h-full w-full">
3939
<ConsoleTab />
40-
<!-- <SettingsTab /> -->
40+
<SettingsTab />
4141
<PlayersTab />
4242
<UsersTab />
4343
</div>

src/main/web/lib/Footer.svelte

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@
109109
align-items: center;
110110
color: var(--footer-github-title-color);
111111
gap: 5px;
112-
transition:
113-
filter 0.3s ease,
114-
box-shadow 0.3s ease;
115112
116113
&:hover {
117114
@include hover-holo-effect.hover-holo-effect;

src/main/web/lib/Header.svelte

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,7 @@
171171
.material-symbols-rounded,
172172
.color-mode,
173173
.menu .menu-button {
174-
// hover holo effect
175-
transition:
176-
filter 0.3s ease,
177-
box-shadow 0.3s ease;
178-
179-
&:hover {
180-
@include hover-holo-effect.hover-holo-effect;
181-
}
174+
@include hover-holo-effect.hover-holo-effect;
182175
}
183176
184177
.material-symbols-rounded {
@@ -300,7 +293,6 @@
300293
width: 20px;
301294
height: 20px;
302295
margin-right: 10px;
303-
transition: filter 0.3s ease;
304296
}
305297
}
306298
}
@@ -329,7 +321,7 @@
329321
}
330322
331323
.hover-holo-effect {
332-
@include hover-holo-effect.hover-holo-effect;
324+
@include hover-holo-effect.holo-effect;
333325
}
334326
}
335327

src/main/web/lib/Login.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<style lang="scss">
6262
@use "../styles/hover-holo-effect";
6363
64-
:is(form > input, button, img):hover {
64+
:is(form > input, button, img) {
6565
@include hover-holo-effect.hover-holo-effect;
6666
}
6767
</style>

src/main/web/lib/tabs/ConsoleTab/ConsoleWindow.svelte

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,14 @@
182182
<style lang="scss">
183183
@use "../../../styles/variables";
184184
@use "../../../styles/scrollbar";
185-
@use "../../../styles/forbidden";
186185
187186
.console {
188187
width: variables.$console-width;
189188
190-
@include scrollbar.scrollbar;
191-
192189
.console-text {
193190
width: calc(100% - 32px);
194191
height: calc(100% - #{variables.$console-input-height} - 24px);
192+
@include scrollbar.scrollbar;
195193
}
196194
197195
.total-messages {
@@ -202,5 +200,5 @@
202200
height: variables.$console-input-height;
203201
}
204202
}
205-
@include forbidden.forbidden;
203+
206204
</style>

src/main/web/lib/tabs/ConsoleTab/StatsWindow.svelte

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@
110110
</div>
111111

112112
<style lang="scss">
113-
@use "../../../styles/forbidden";
114-
115113
.statistics {
116114
background-color: var(--console-background-color);
117115
padding: 10px;
@@ -133,6 +131,4 @@
133131
color: #597cef;
134132
}
135133
}
136-
137-
@include forbidden.forbidden();
138134
</style>
Lines changed: 115 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,115 @@
1-
<script lang="ts">
2-
import { onMount } from "svelte";
3-
import { isDev } from "../scripts/devMode";
4-
import { switchTab } from "../scripts/tabsController";
5-
import ToastSystem from "../scripts/toastSystem";
6-
7-
let devMenu: HTMLDivElement;
8-
let defaultTabInput: HTMLInputElement;
9-
let notificationInfoInput: HTMLInputElement;
10-
let notificationWarningInput: HTMLInputElement;
11-
let notificationErrorInput: HTMLInputElement;
12-
let removeNotificationsCheckbox: HTMLInputElement;
13-
14-
onMount(() => {
15-
isDev().then((isDEV) => {
16-
if (!isDEV) {
17-
return;
18-
}
19-
20-
devMenu.classList.remove("disabled");
21-
22-
// ? default tab
23-
const defaultTab = localStorage.getItem("default-tab");
24-
if (defaultTab != null) {
25-
switchTab(defaultTab);
26-
}
27-
28-
// ? remove notifications
29-
const isNotificationsRemoved = localStorage.getItem("remove-notifications") == "true";
30-
ToastSystem.enabled = !isNotificationsRemoved;
31-
removeNotificationsCheckbox.checked = isNotificationsRemoved;
32-
});
33-
});
34-
</script>
35-
36-
<div class="dev-menu disabled" bind:this={devMenu}>
37-
<input type="checkbox" class="open-dev-menu" />
38-
39-
<h3>Developer mode settings</h3>
40-
<hr />
41-
<span>Default tab</span>
42-
<input type="text" name="default tab (id)" class="dev-set-default-tab-input" bind:this={defaultTabInput} />
43-
<button
44-
class="dev-set-default-tab-button"
45-
onclick={() => {
46-
const tabName = defaultTabInput!.value;
47-
if (tabName.length === 0) {
48-
return;
49-
}
50-
51-
localStorage.setItem("default-tab", tabName);
52-
ToastSystem.addToQueue("Set default tab to " + tabName, ToastSystem.ToastType.INFO);
53-
console.log("Set default tab to " + tabName);
54-
}}>Set default tab</button
55-
>
56-
57-
<hr />
58-
59-
<span>Notification testing</span>
60-
<input type="text" name="notification text" value="This is a info notification" bind:this={notificationInfoInput} />
61-
<button onclick={() => ToastSystem.addToQueue(notificationInfoInput!.value.toString(), ToastSystem.ToastType.INFO)}>Test info notification</button>
62-
63-
<input type="text" name="notification text" value="This is a warning notification" bind:this={notificationWarningInput} />
64-
<button onclick={() => ToastSystem.addToQueue(notificationWarningInput!.value.toString(), ToastSystem.ToastType.WARNING)}>Test warning notification</button>
65-
66-
<input type="text" name="notification text" value="This is a error notification" bind:this={notificationErrorInput} />
67-
<button onclick={() => ToastSystem.addToQueue(notificationErrorInput!.value.toString(), ToastSystem.ToastType.ERROR)}>Test error notification</button>
68-
69-
<hr />
70-
71-
<label>
72-
<input
73-
type="checkbox"
74-
class="dev-remove-notifications"
75-
bind:this={removeNotificationsCheckbox}
76-
onchange={(event: Event) => localStorage.setItem("remove-notifications", (event.target as HTMLInputElement).checked.toString())}
77-
/>
78-
Remove all notifications
79-
</label>
80-
</div>
81-
82-
<style lang="scss">
83-
.dev-menu {
84-
position: absolute;
85-
bottom: 20px;
86-
left: -215px;
87-
background-color: #121717;
88-
padding: 10px;
89-
border-radius: 10px;
90-
width: 220px;
91-
transition: left 0.3s ease;
92-
93-
.open-dev-menu {
94-
position: absolute;
95-
top: 5px;
96-
right: 5px;
97-
}
98-
99-
button {
100-
margin-bottom: 10px;
101-
}
102-
}
103-
.dev-menu:has(.open-dev-menu[type="checkbox"]:checked) {
104-
left: 20px;
105-
}
106-
</style>
1+
<script lang="ts">
2+
import { onMount } from "svelte";
3+
import { isDev } from "../../../scripts/devMode";
4+
import { switchTab } from "../../../scripts/tabsController";
5+
import ToastSystem from "../../../scripts/toastSystem";
6+
7+
let devMenu: HTMLDivElement;
8+
let defaultTabInput: HTMLInputElement;
9+
let notificationInfoInput: HTMLInputElement;
10+
let notificationWarningInput: HTMLInputElement;
11+
let notificationErrorInput: HTMLInputElement;
12+
let removeNotificationsCheckbox: HTMLInputElement;
13+
14+
onMount(() => {
15+
isDev().then((isDEV) => {
16+
if (!isDEV) {
17+
return;
18+
}
19+
20+
devMenu.classList.remove("disabled");
21+
22+
// ? default tab
23+
const defaultTab = localStorage.getItem("default-tab");
24+
if (defaultTab != null) {
25+
switchTab(defaultTab);
26+
}
27+
28+
// ? remove notifications
29+
const isNotificationsRemoved = localStorage.getItem("remove-notifications") == "true";
30+
ToastSystem.enabled = !isNotificationsRemoved;
31+
removeNotificationsCheckbox.checked = isNotificationsRemoved;
32+
});
33+
});
34+
</script>
35+
36+
<div class="dev-menu disabled" bind:this={devMenu}>
37+
<input type="checkbox" class="open-dev-menu" />
38+
39+
<h3>Developer mode settings</h3>
40+
<hr />
41+
<span>Default tab</span>
42+
<input type="text" name="default tab (id)" class="dev-set-default-tab-input" bind:this={defaultTabInput} />
43+
<button
44+
class="dev-set-default-tab-button"
45+
onclick={() => {
46+
const tabName = defaultTabInput.value;
47+
if (tabName.length === 0) {
48+
return;
49+
}
50+
51+
localStorage.setItem("default-tab", tabName);
52+
ToastSystem.addToQueue("Set default tab to " + tabName, ToastSystem.ToastType.INFO);
53+
console.log("Set default tab to " + tabName);
54+
}}
55+
>Set default tab
56+
</button>
57+
58+
<hr />
59+
60+
<span>Notification testing</span>
61+
<input type="text" name="notification text" value="This is a info notification" bind:this={notificationInfoInput} />
62+
<button onclick={() => ToastSystem.addToQueue(notificationInfoInput!.value.toString(), ToastSystem.ToastType.INFO)}>Test info notification</button>
63+
64+
<input type="text" name="notification text" value="This is a warning notification" bind:this={notificationWarningInput} />
65+
<button onclick={() => ToastSystem.addToQueue(notificationWarningInput!.value.toString(), ToastSystem.ToastType.WARNING)}>Test warning notification</button>
66+
67+
<input type="text" name="notification text" value="This is a error notification" bind:this={notificationErrorInput} />
68+
<button onclick={() => ToastSystem.addToQueue(notificationErrorInput!.value.toString(), ToastSystem.ToastType.ERROR)}>Test error notification</button>
69+
70+
<hr />
71+
72+
<label>
73+
<input
74+
type="checkbox"
75+
class="dev-remove-notifications"
76+
bind:this={removeNotificationsCheckbox}
77+
onchange={(event: Event) => localStorage.setItem("remove-notifications", (event.target as HTMLInputElement).checked.toString())}
78+
/>
79+
Remove all notifications
80+
</label>
81+
</div>
82+
83+
<style lang="scss">
84+
.dev-menu {
85+
position: absolute;
86+
bottom: 20px;
87+
left: -200px;
88+
background-color: #121717;
89+
padding: 10px;
90+
border-radius: 10px;
91+
width: 220px;
92+
transition: left 0.3s ease;
93+
94+
.open-dev-menu {
95+
position: absolute;
96+
top: 5px;
97+
right: 5px;
98+
}
99+
100+
input {
101+
background-color: #4b4b4b;
102+
border-radius: 5px;
103+
}
104+
105+
button {
106+
background-color: #4b4b4b;
107+
margin-bottom: 10px;
108+
margin-top: 10px;
109+
border-radius: 5px;
110+
}
111+
}
112+
.dev-menu:has(.open-dev-menu[type="checkbox"]:checked) {
113+
left: 20px;
114+
}
115+
</style>

0 commit comments

Comments
 (0)