Skip to content

Commit ce112ff

Browse files
committed
continue break all with tailwind
1 parent d18903c commit ce112ff

File tree

12 files changed

+342
-427
lines changed

12 files changed

+342
-427
lines changed

src/main/web/App.svelte

Lines changed: 28 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import ToastSystem from "./scripts/toastSystem";
99
import icon from "./assets/icon_clearbg.png";
1010
import "./styles/tailwind.css";
11+
import "./styles/style.scss";
12+
import UsersTab from "./lib/tabs/UsersTab/UsersTab.svelte";
1113
1214
window.addEventListener("load", async () => {
1315
// ? remove loading screen
@@ -18,42 +20,26 @@
1820
<Footer />
1921

2022
{#if window.location.pathname == "/BadConnection"}
21-
<main>
22-
<a href="/"><img src={icon} alt="icon" /></a>
23-
<div class="text">
24-
<p1>Oh no!</p1>
25-
<p1>It seems like you have a bad connection to the server.</p1>
26-
<p1>Try to refresh the page or check your internet connection.</p1>
27-
<p1>Good luck!</p1>
23+
<main class="h-screen content-center">
24+
<div class="flex justify-center">
25+
<a href="/"><img src={icon} alt="icon" /></a>
26+
<div class="ml-[20px] flex flex-col content-center justify-center font-['Nunito'] text-[20px]">
27+
<p1>Oh no!</p1>
28+
<p1>It seems like you have a bad connection to the server.</p1>
29+
<p1>Try to refresh the page or check your internet connection.</p1>
30+
<p1>Good luck!</p1>
31+
</div>
2832
</div>
2933
</main>
30-
31-
<style lang="scss">
32-
main {
33-
justify-content: center;
34-
align-items: center;
35-
display: flex;
36-
height: 100vh;
37-
38-
.text {
39-
margin-left: 20px;
40-
font-size: 20px;
41-
display: flex;
42-
flex-direction: column;
43-
justify-content: center;
44-
align-items: center;
45-
font-family: "Nunito", sans-serif;
46-
}
47-
}
48-
</style>
4934
{:else}
5035
<Header />
5136

52-
<main>
53-
<div class="tabs">
37+
<main class="align-center absolute flex w-screen justify-center">
38+
<div class="tabs h-full w-full">
5439
<ConsoleTab />
55-
<SettingsTab />
40+
<!-- <SettingsTab /> -->
5641
<PlayersTab />
42+
<UsersTab />
5743
</div>
5844
</main>
5945

@@ -63,34 +49,29 @@
6349

6450
<style lang="scss">
6551
@use "./styles/variables";
52+
@use "./styles/disabled";
6653
6754
main {
68-
display: flex;
69-
align-items: center;
70-
justify-content: center;
71-
width: 100vw;
7255
height: variables.$container-height;
73-
position: absolute;
7456
top: variables.$header-height;
7557
76-
.tabs {
58+
.tabs > div {
7759
width: 100%;
7860
height: 100%;
7961
80-
.tab {
81-
width: 100%;
82-
height: 100%;
83-
84-
.container {
85-
display: flex;
86-
align-items: center;
87-
justify-content: center;
88-
color: var(--main-text-color);
89-
transition: color 0.3s ease;
90-
top: 0;
91-
}
62+
.container {
63+
display: flex;
64+
align-items: center;
65+
justify-content: center;
66+
color: var(--main-text-color);
67+
transition: color 0.3s ease;
68+
top: 0;
69+
height: variables.$container-height;
9270
}
9371
}
9472
}
9573
</style>
9674
{/if}
75+
76+
<style lang="scss">
77+
</style>

src/main/web/lib/Header.svelte

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,23 @@
9797
GitHub
9898
</a>
9999
</li>
100+
<li>
101+
<a href="https://github.com/Bumer-32/I-Want-To-Control-My-Server/issues">
102+
<span class="material-symbols-rounded">bug_report</span>
103+
Bug tracker
104+
</a>
105+
</li>
100106
<li>
101107
<a href="files/iwtcms_client.zip">
102108
<span class="material-symbols-rounded">download</span>
103109
Python CLI
104110
</a>
105111
</li>
106112
<li>
107-
<a href="https://github.com/Bumer-32/I-Want-To-Control-My-Server/issues">
108-
<span class="material-symbols-rounded">bug_report</span>
109-
Bug tracker
110-
</a>
113+
<button type="button" on:click={() => switchTab("users-tab")}>
114+
<span class="material-symbols-rounded">account_circle</span>
115+
Users
116+
</button>
111117
</li>
112118
<li id="logout-button">
113119
<button type="button" on:click={logout}>

src/main/web/lib/Login.svelte

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,13 @@
11
<script lang="ts">
22
import icon from "../assets/icon_clearbg.png";
33
import { checkAuth, login } from "../scripts/auth";
4-
import Constants from "../scripts/constants";
5-
import { isDev } from "../scripts/devMode";
64
import ToastSystem from "../scripts/toastSystem";
75
import { onMount } from "svelte";
86
97
let loginForm: HTMLFormElement;
108
let loginDiv: HTMLDivElement;
119
12-
async function checkIsLoginNeeded(): Promise<boolean> {
13-
try {
14-
const response = await fetch(Constants.IS_AUTH_ENABLED_URL);
15-
16-
if (!response.ok) {
17-
console.error("Error fetching data:", response.status, response.statusText);
18-
ToastSystem.addToQueue(`Error fetching data: ${response.status}`, ToastSystem.ToastType.ERROR);
19-
if (!(await isDev())) {
20-
window.location.href = Constants.PAGE_BAD_CONNECTION_URL;
21-
}
22-
return false;
23-
}
24-
25-
if ((await response.text()) == "false") {
26-
loginDiv.classList.add("disabled");
27-
}
28-
} catch (error) {
29-
console.error(error);
30-
ToastSystem.addToQueue(`Error: ${error}`, ToastSystem.ToastType.ERROR);
31-
if (!(await isDev())) {
32-
window.location.assign(Constants.PAGE_BAD_CONNECTION_URL);
33-
}
34-
}
35-
return true;
36-
}
37-
3810
onMount(async () => {
39-
const isLoginNeeded = await checkIsLoginNeeded();
40-
if (!isLoginNeeded) return;
41-
4211
const auth = await checkAuth();
4312
if (auth != null) {
4413
ToastSystem.addToQueue(`Hello ${auth}`, ToastSystem.ToastType.INFO);

0 commit comments

Comments
 (0)