Skip to content

Commit f9caafe

Browse files
committed
3.7.3
1. Move sidebar to layout 2. Add converter 3. Add /types 4. Converted app.css to app.scss 5. Removed uneeded parts of settings.json 6. Added lib to svelte config
1 parent 7ac0521 commit f9caafe

12 files changed

Lines changed: 545 additions & 128 deletions

File tree

.vscode/settings.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
22
"editor.defaultFormatter": "esbenp.prettier-vscode",
3-
"editor.formatOnSave": true,
4-
"[svelte]": {
5-
"editor.defaultFormatter": "svelte.svelte-vscode"
6-
}
3+
"editor.formatOnSave": true
74
}

app/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "uchat",
33
"private": true,
4-
"version": "3.7.2",
4+
"version": "3.7.3",
55
"type": "module",
66
"scripts": {
77
"dev": "vite dev",
@@ -35,4 +35,4 @@
3535
"tinycolor2": "^1.6.0",
3636
"twemoji": "^14.0.2"
3737
}
38-
}
38+
}

app/src/app.css renamed to app/src/app.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,28 @@ body {
5050
-8px 0;
5151
}
5252

53+
.note {
54+
color: rgba(255, 255, 255, 0.575);
55+
user-select: all;
56+
}
57+
58+
a {
59+
all: unset;
60+
display: block;
61+
color: #8b8bff;
62+
cursor: pointer;
63+
64+
&:hover {
65+
text-decoration: underline;
66+
}
67+
}
68+
69+
a[href="#help-notice"] {
70+
margin-bottom: 5px;
71+
text-align: center;
72+
display: block;
73+
}
74+
5375
@font-face {
5476
font-family: "Just Sans";
5577
src: url("/fonts/Just-Sans/JUST-Sans-Regular.otf") format("opentype");

app/src/components/Main.svelte

Lines changed: 34 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<script lang="ts">
22
import { Coffee, Github, Home, Info } from "lucide-svelte";
33
4-
import Sidebar from "./Main/Sidebar.svelte";
54
import MainDisplay from "./Main/Chat/Main.svelte";
65
76
import HelpMain from "./Main/Help/Main.svelte";
@@ -19,59 +18,43 @@
1918
$: console.log("Hash changed to", hash);
2019
</script>
2120

22-
<main>
23-
<Sidebar />
24-
{#if hash.includes("help")}
25-
<HelpMain />
26-
{:else if hash.includes("message-creator")}
27-
<MessageCreatorMain />
28-
{:else}
29-
<MainDisplay />
30-
{/if}
31-
32-
{#if $isMobile}
33-
<footer>
34-
<a href="/#">
35-
<Home size={$icon_size} /> Home
36-
</a>
37-
<a href="#help">
38-
<Info size={$icon_size} /> About
39-
</a>
40-
<a
41-
class="hide-on-small"
42-
href="https://github.com/Fiszh/UChat"
43-
target="_blank"
44-
rel="noopener noreferrer"
45-
>
46-
<Github size={$icon_size} /> GitHub
47-
</a>
48-
<a
49-
class="hide-on-small"
50-
href="https://buymeacoffee.com/jzlnkf5qgo"
51-
target="_blank"
52-
rel="noopener noreferrer"
53-
>
54-
<Coffee size={$icon_size} /> Support
55-
</a>
56-
</footer>
57-
{/if}
58-
</main>
21+
{#if hash.includes("help")}
22+
<HelpMain />
23+
{:else if hash.includes("message-creator")}
24+
<MessageCreatorMain />
25+
{:else}
26+
<MainDisplay />
27+
{/if}
28+
29+
{#if $isMobile}
30+
<footer>
31+
<a href="/#">
32+
<Home size={$icon_size} /> Home
33+
</a>
34+
<a href="#help">
35+
<Info size={$icon_size} /> About
36+
</a>
37+
<a
38+
class="hide-on-small"
39+
href="https://github.com/Fiszh/UChat"
40+
target="_blank"
41+
rel="noopener noreferrer"
42+
>
43+
<Github size={$icon_size} /> GitHub
44+
</a>
45+
<a
46+
class="hide-on-small"
47+
href="https://buymeacoffee.com/jzlnkf5qgo"
48+
target="_blank"
49+
rel="noopener noreferrer"
50+
>
51+
<Coffee size={$icon_size} /> Support
52+
</a>
53+
</footer>
54+
{/if}
5955

6056
<style lang="scss">
61-
main {
62-
display: flex;
63-
width: 100%;
64-
height: 100dvh;
65-
66-
background: linear-gradient(#080808, #000000);
67-
}
68-
6957
@media (max-width: 768px) {
70-
main {
71-
flex-direction: column;
72-
overflow: hidden;
73-
}
74-
7558
footer {
7659
border-top: 1px #161616 solid;
7760
padding: 0.5rem 2rem;

app/src/components/Main/Sidebar.svelte

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Github,
66
Coffee,
77
MessageSquareMore,
8+
ArrowLeftRight,
89
} from "lucide-svelte";
910
1011
import moment from "moment/min/moment-with-locales";
@@ -17,6 +18,7 @@
1718
1819
import { overlayVersion } from "$stores/settings";
1920
import { dev } from "$app/environment";
21+
import { page } from "$app/state";
2022
2123
$: version_text = $overlayVersion;
2224
@@ -103,35 +105,41 @@
103105
</header>
104106

105107
<nav>
106-
<a href="/#" class="active" bind:this={navLinks["home"]["navLink"]}>
107-
<House size="20" /> Home
108-
</a>
109-
<!-- <a href="convert/" target="_blank" rel="noopener noreferrer">
110-
<RefreshCcw size="20" /> Invalid URL
111-
</a> -->
112-
<a
113-
href="#message-creator"
114-
bind:this={navLinks["msgCreator"]["navLink"]}
115-
>
116-
<MessageSquareMore size="20" /> Message creator
117-
</a>
118-
<a href="#help" bind:this={navLinks["help"]["navLink"]}>
119-
<Info size="20" /> Info & Privacy
120-
</a>
121-
<a
122-
href="https://github.com/Fiszh/UChat"
123-
target="_blank"
124-
rel="noopener noreferrer"
125-
>
126-
<Github size="20" /> GitHub
127-
</a>
128-
<a
129-
href="https://buymeacoffee.com/jzlnkf5qgo"
130-
target="_blank"
131-
rel="noopener noreferrer"
132-
>
133-
<Coffee size="20" /> Support
134-
</a>
108+
{#if page.route.id == "/"}
109+
<a href="/#" class="active" bind:this={navLinks["home"]["navLink"]}>
110+
<House size="20" /> Home
111+
</a>
112+
<a
113+
href="#message-creator"
114+
bind:this={navLinks["msgCreator"]["navLink"]}
115+
>
116+
<MessageSquareMore size="20" /> Message creator
117+
</a>
118+
<a href="/convert">
119+
<ArrowLeftRight size="20" /> Convert
120+
</a>
121+
<a href="#help" bind:this={navLinks["help"]["navLink"]}>
122+
<Info size="20" /> Info & Privacy
123+
</a>
124+
<a
125+
href="https://github.com/Fiszh/UChat"
126+
target="_blank"
127+
rel="noopener noreferrer"
128+
>
129+
<Github size="20" /> GitHub
130+
</a>
131+
<a
132+
href="https://buymeacoffee.com/jzlnkf5qgo"
133+
target="_blank"
134+
rel="noopener noreferrer"
135+
>
136+
<Coffee size="20" /> Support
137+
</a>
138+
{:else}
139+
<a href="/#">
140+
<House size="20" /> Home
141+
</a>
142+
{/if}
135143
</nav>
136144

137145
<section id="account" aria-label="User account section">

app/src/routes/+layout.svelte

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,67 @@
11
<script lang="ts">
2+
import { onMount } from "svelte";
3+
4+
import Sidebar from "$components/Main/Sidebar.svelte";
5+
6+
import "app.scss";
7+
8+
import { page } from "$app/state";
9+
import { overlayVersion } from "$stores/settings";
10+
import { getVersion } from "$lib/overlayIndex";
11+
212
let { children } = $props();
313
4-
import "app.css";
14+
let mounted = $state<boolean>(false);
15+
let hasChannel = $state<boolean>(false);
16+
17+
onMount(() => {
18+
const params = new URLSearchParams(window.location.search);
19+
hasChannel = params.has("channel") || params.has("id");
20+
21+
(async () => {
22+
overlayVersion.set(await getVersion());
23+
})();
24+
25+
mounted = true;
26+
});
527
</script>
628

7-
{@render children()}
29+
{#if mounted}
30+
{#if !hasChannel}
31+
<main>
32+
{#if page.status !== 404 && page.route.id != "/auth"}
33+
<Sidebar />
34+
{/if}
35+
{@render children()}
36+
</main>
37+
{:else}
38+
{@render children()}
39+
{/if}
40+
{:else}
41+
<main>Loading...</main>
42+
{/if}
43+
44+
<noscript style="color:black;">
45+
<div>
46+
<h1>JavaScript is disabled</h1>
47+
<p>This app requires JavaScript to work.</p>
48+
<p>Enable JavaScript to use the app.</p>
49+
</div>
50+
</noscript>
51+
52+
<style>
53+
main {
54+
display: flex;
55+
width: 100%;
56+
height: 100dvh;
57+
58+
background: linear-gradient(#080808, #000000);
59+
}
60+
61+
@media (max-width: 768px) {
62+
main {
63+
flex-direction: column;
64+
overflow: hidden;
65+
}
66+
}
67+
</style>

app/src/routes/+page.svelte

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
import LoadingUI from "../components/Loading.svelte";
99
1010
import { icon_size, isMobile, loadingInfo } from "$stores/global";
11-
import { overlayVersion } from "$stores/settings";
12-
import { getVersion } from "$lib/overlayIndex";
1311
1412
$: LoadingMsg = $loadingInfo;
1513
@@ -30,10 +28,6 @@
3028
const params = new URLSearchParams(window.location.search);
3129
hasChannel = params.has("channel") || params.has("id");
3230
33-
(async () => {
34-
overlayVersion.set(await getVersion());
35-
})();
36-
3731
setMobile();
3832
window.addEventListener("resize", setMobile);
3933
@@ -55,14 +49,14 @@
5549
</script>
5650

5751
{#if mounted}
58-
<LoadingUI
59-
loading={{
60-
text: LoadingMsg.text,
61-
type: LoadingMsg.type,
62-
}}
63-
/>
64-
6552
{#if hasChannel}
53+
<LoadingUI
54+
loading={{
55+
text: LoadingMsg.text,
56+
type: LoadingMsg.type,
57+
}}
58+
/>
59+
6660
<ChatOverlay />
6761
{:else}
6862
<Main />
@@ -118,9 +112,9 @@
118112
}
119113
120114
/*
121-
START
122-
WHAT MAKES EMOTES WORK IN ZERO-WIDTH
123-
*/
115+
START
116+
WHAT MAKES EMOTES WORK IN ZERO-WIDTH
117+
*/
124118
.emote-wrapper {
125119
display: inline-grid;
126120
grid-auto-rows: 0px;
@@ -147,28 +141,6 @@
147141
line-height: normal;
148142
}
149143
150-
.note {
151-
color: rgba(255, 255, 255, 0.575);
152-
user-select: all;
153-
}
154-
155-
a {
156-
all: unset;
157-
display: block;
158-
color: #8b8bff;
159-
cursor: pointer;
160-
161-
&:hover {
162-
text-decoration: underline;
163-
}
164-
}
165-
166-
a[href="#help-notice"] {
167-
margin-bottom: 5px;
168-
text-align: center;
169-
display: block;
170-
}
171-
172144
#rainbow-text {
173145
font-weight: bold;
174146
background: linear-gradient(

0 commit comments

Comments
 (0)