Skip to content

Commit

Permalink
Chore: Upgrade to Svelte5 [ and some minor visual changes :) ]
Browse files Browse the repository at this point in the history
chore: update to svelte5
chore: fix theme for svelte5
  • Loading branch information
liquidsquid1 authored Jan 3, 2025
1 parent 6396b76 commit 8e85d1b
Show file tree
Hide file tree
Showing 70 changed files with 723 additions and 875 deletions.
1,284 changes: 539 additions & 745 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
"check": "svelte-check --tsconfig ./tsconfig.json"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@tsconfig/svelte": "^5.0.2",
"@types/dateformat": "^5.0.2",
"sass": "^1.70.0",
"svelte": "^4.2.10",
"svelte-check": "^3.6.3",
"tslib": "^2.6.2",
"typescript": "^5.2.2",
"vite": "^5.1.7"
"@sveltejs/vite-plugin-svelte": "^5.0.0",
"@tsconfig/svelte": "^5.0.4",
"svelte": "^5.2.7",
"svelte-check": "^4.1.0",
"tslib": "^2.8.1",
"typescript": "~5.6.2",
"vite": "^6.0.1"
},
"dependencies": {
"@faker-js/faker": "^9.3.0",
Expand Down
2 changes: 0 additions & 2 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import AltManager from "./routes/menu/altmanager/AltManager.svelte";
import Singleplayer from "./routes/menu/singleplayer/Singleplayer.svelte";
import ProxyManager from "./routes/menu/proxymanager/ProxyManager.svelte";
import None from "./routes/none/None.svelte";
import Disconnected from "./routes/menu/disconnected/Disconnected.svelte";
import Browser from "./routes/browser/Browser.svelte";
Expand All @@ -27,7 +26,6 @@
"/altmanager": AltManager,
"/singleplayer": Singleplayer,
"/proxymanager": ProxyManager,
"/none": None,
"/disconnected": Disconnected,
"/browser": Browser
};
Expand Down
2 changes: 1 addition & 1 deletion src/app.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import "colors.scss";
@use "colors.scss" as *;

@font-face {
font-family: "Inter";
Expand Down
7 changes: 4 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import "./app.scss";
import App from "./App.svelte";
import {mount} from "svelte";

const app = new App({
target: document.getElementById("app") as HTMLElement,
});
const app = mount(App, {
target: document.getElementById("app")!}
);

export default app
2 changes: 1 addition & 1 deletion src/routes/browser/Browser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

<style lang="scss">
@import "../../colors.scss";
@use "../../colors.scss" as *;
.browser-controls {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/ClickGui.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</div>

<style lang="scss">
@import "../../colors.scss";
@use "../../colors.scss" as *;
$GRID_SIZE: 10px;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/Description.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{/key}

<style lang="scss">
@import "../../colors.scss";
@use "../../colors.scss" as *;
.description-wrapper {
position: fixed;
Expand Down
6 changes: 3 additions & 3 deletions src/routes/clickgui/Module.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
}, 500);
});
highlightModuleName.subscribe(() => {
if (name !== $highlightModuleName) {
highlightModuleName.subscribe((m) => {
if (name !== m) {
return;
}
Expand Down Expand Up @@ -128,7 +128,7 @@
</div>

<style lang="scss">
@import "../../colors.scss";
@use "../../colors.scss" as *;
.module {
position: relative;
Expand Down
7 changes: 4 additions & 3 deletions src/routes/clickgui/Panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@
savePanelConfig();
}
highlightModuleName.subscribe(() => {
highlightModuleName.subscribe((m) => {
const highlightModule = modules.find(
(m) => m.name === $highlightModuleName,
(m) => m.name === m.name,
);
if (highlightModule) {
panelConfig.zIndex = ++$maxPanelZIndex;
Expand Down Expand Up @@ -207,6 +207,7 @@
/>
<span class="category">{category}</span>

<!-- svelte-ignore a11y_consider_explicit_label -->
<button class="expand-toggle" on:click={toggleExpanded}>
<div class="icon" class:expanded={panelConfig.expanded}></div>
</button>
Expand All @@ -220,7 +221,7 @@
</div>

<style lang="scss">
@import "../../colors.scss";
@use "../../colors.scss" as *;
.panel {
border-radius: 16px;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/Search.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
</div>

<style lang="scss">
@import "../../colors.scss";
@use "../../colors.scss" as *;
.search {
position: fixed;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/BindSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
padding: 7px 0px;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/ChoiceSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
padding: 7px 0px;
Expand Down
5 changes: 4 additions & 1 deletion src/routes/clickgui/setting/ColorSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,22 @@
bind:value={hex}
on:input={handleValueInput}
/>
<!-- svelte-ignore a11y_consider_explicit_label -->
<button
class="color-pickr-button"
on:click={() => (hidden = !hidden)}
style="background-color: {hex};"
></button>
</div>
<!-- svelte-ignore a11y_consider_explicit_label -->
<div class="color-picker" class:hidden>
<!-- svelte-ignore element_invalid_self_closing_tag -->
<button bind:this={colorPicker} />
</div>
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
display: grid;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/ConfigurableSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
padding: 7px 0;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/FloatRangeSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
padding: 7px 0 2px 0;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/FloatSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
padding: 7px 0 2px 0;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/IntRangeSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
padding: 7px 0 2px 0;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/IntSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
padding: 7px 0 2px 0;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/KeySetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
padding: 7px 0;
Expand Down
5 changes: 3 additions & 2 deletions src/routes/clickgui/setting/TextArraySetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "sass:color";
@use "../../../colors.scss" as *;
.input-wrapper {
display: grid;
Expand Down Expand Up @@ -91,7 +92,7 @@
transition: ease background-color .2s;
&:hover {
background-color: darken(desaturate($accent, 30%), 10%);
background-color: color.adjust(color.adjust($accent, $saturation: -30%), $lightness: -10%);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/TextSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
padding: 7px 0px;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/TogglableSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
padding: 7px 0px;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/VectorSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</div>

<style lang="scss">
@import "../../../colors.scss";
@use "../../../colors.scss" as *;
.setting {
padding: 7px 0;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/blocks/Block.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</div>

<style lang="scss">
@import "../../../../colors.scss";
@use "../../../../colors.scss" as *;
.block {
display: grid;
Expand Down
8 changes: 4 additions & 4 deletions src/routes/clickgui/setting/blocks/BlocksSetting.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
const cSetting = setting as BlocksSetting;
interface Block {
interface TBlock {
name: string;
identifier: string;
}
const dispatch = createEventDispatcher();
let blocks: Block[] = [];
let renderedBlocks: Block[] = blocks;
let blocks: TBlock[] = [];
let renderedBlocks: TBlock[] = blocks;
let searchQuery = "";
$: {
Expand Down Expand Up @@ -60,7 +60,7 @@
</div>

<style lang="scss">
@import "../../../../colors.scss";
@use "../../../../colors.scss" as *;
.setting {
padding: 7px 0;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/common/Dropdown.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</div>

<style lang="scss">
@import "../../../../colors.scss";
@use "../../../../colors.scss" as *;
.dropdown {
position: relative;
Expand Down
1 change: 1 addition & 0 deletions src/routes/clickgui/setting/common/ExpandArrow.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
}
</script>

<!-- svelte-ignore a11y_consider_explicit_label -->
<button class="arrow" class:expanded on:click={handleClick}
></button>

Expand Down
12 changes: 6 additions & 6 deletions src/routes/clickgui/setting/common/Switch.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@

<style lang="scss">
@use "sass:color";
@import "../../../../colors.scss";
@use "../../../../colors.scss" as *;
.switch-container {
display: flex;
align-items: center;
justify-content: flex-start;
margin: none; /* Adjust margin for the smaller size */
margin: none;
transition: all 0.3s ease;
}
.title {
color: $text;
font-size: 11px; /* Reduced from 22px to 50% */
margin-left: 6px; /* Reduced from 12px */
font-size: 11px;
margin-left: 6px;
font-weight: 500;
transition: color 0.2s ease-in-out;
}
Expand All @@ -45,8 +45,8 @@
.checkbox {
display: block;
position: relative;
width: 16px; /* Reduced from 32px to 50% */
height: 16px; /* Reduced from 32px to 50% */
width: 16px;
height: 16px;
background-color: rgba($crust, 0.8);
border-radius: 4px;
border: 2px solid rgba(white, 0.1);
Expand Down
2 changes: 1 addition & 1 deletion src/routes/clickgui/setting/common/ValueInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<span contenteditable="true" class="value" bind:innerText={inputValue} on:input={handleInput} on:keydown={handleKeyDown} bind:this={inputElement}></span>

<style lang="scss">
@import "../../../../colors.scss";
@use "../../../../colors.scss" as *;
.value {
font-family: monospace;
Expand Down
5 changes: 3 additions & 2 deletions src/routes/clickgui/setting/nouislider.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@import "../../../colors.scss";
@use "sass:color";
@use "../../../colors.scss" as *;

.noUi-handle {
background-color: $accent;
Expand All @@ -19,7 +20,7 @@
margin: 10px 0;
height: 2px;
border: none;
background-color: darken($text, 80%);
background-color: color.adjust($text, $lightness: 80%);
box-shadow: unset;
}

Expand Down
Loading

0 comments on commit 8e85d1b

Please sign in to comment.