Skip to content

Commit e635c29

Browse files
committed
chore: cf
1 parent 5413559 commit e635c29

26 files changed

Lines changed: 1254 additions & 713 deletions

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
> This is a fork of [SkyCryptWebsite/SkyCrypt-Frontend](https://github.com/SkyCryptWebsite/SkyCrypt-Frontend) with minimal changes to support embedding the profile viewer in Lunar Client. To keep this fork up to date with upstream:
2+
>
3+
> ```
4+
> git rebase upstream/dev
5+
> # Resolve any conflicts that occur
6+
> git push origin dev --force-with-lease
7+
> ```
8+
19
<p align="center">
210
<picture>
311
<source media="(prefers-color-scheme: light)" srcset="static/img/logo_black.avif">

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"@oslojs/crypto": "^1.0.1",
4848
"@oslojs/encoding": "^1.1.0",
4949
"@playwright/test": "^1.60.0",
50+
"@sveltejs/adapter-cloudflare": "^7.2.8",
5051
"@sveltejs/adapter-node": "^5.5.4",
5152
"@sveltejs/kit": "^2.60.1",
5253
"@sveltejs/vite-plugin-svelte": "^7.1.2",
@@ -107,6 +108,7 @@
107108
"@sentry/sveltekit": "^10.53.1",
108109
"culori": "^4.0.2",
109110
"simple-git-hooks": "^2.13.1",
111+
"svelte-interactions": "^0.2.0",
110112
"takumi-js": "1.1.2"
111113
},
112114
"engines": {
@@ -120,4 +122,4 @@
120122
"simple-git-hooks": {
121123
"commit-msg": "pnpm exec commitlint --edit $1"
122124
}
123-
}
125+
}

pnpm-lock.yaml

Lines changed: 1137 additions & 274 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
allowBuilds:
22
"@sentry/cli": true
3+
"@tailwindcss/oxide": true
34
esbuild: true
5+
sharp: true
46
simple-git-hooks: true
57
svelte-preprocess: true
8+
workerd: true

src/app.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,3 +420,8 @@
420420
@utility minecraft-tooltip {
421421
@apply relative rounded-sm border-2 border-solid border-transparent bg-mctooltip-bg px-1 pt-1 pb-0.75 indent-[initial] font-minecraft text-[0.9375rem] leading-4.5 font-normal text-pretty [border-image:linear-gradient(to_bottom,oklch(48.503%_0.297_278.42/0.31),oklch(29.365%_0.17619_281.21/0.31))_1] text-shadow-[0.09375rem_0.09375rem_oklch(36.768%,0.00004,271.152)];
422422
}
423+
424+
body {
425+
-webkit-user-select: none;
426+
user-select: none;
427+
}

src/context/preferences.svelte.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ interface PreferencesData {
1717
export class PreferencesContext {
1818
#data = new PersistedState<PreferencesData>("skycryptPreferences", {
1919
sectionOrder: sections,
20-
performanceMode: false,
20+
performanceMode: true,
2121
keybind: "/",
22-
showGlint: true,
22+
showGlint: false,
2323
rainbowEnchantments: false,
2424
mctooltip: false
2525
});

src/hooks.server.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const headersHandler = (async ({ event, resolve }) => {
1111
response.headers.set("Permissions-Policy", "accelerometer=(), autoplay=(), camera=(), encrypted-media=(), fullscreen=(), gyroscope=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), sync-xhr=(), usb=(), xr-spatial-tracking=(), geolocation=()");
1212
response.headers.set("X-Content-Type-Options", "nosniff");
1313
response.headers.set("Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload");
14-
response.headers.set("X-Frame-Options", "DENY");
1514

1615
// Cross-Origin policies
1716
// COEP intentionally unsafe-none: tightening would require all cross-origin

src/instrumentation.server.ts

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/lib/components/header/Info.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
2+
import { version } from "$app/environment";
23
import { getHoverContext } from "$ctx";
34
import { env } from "$env/dynamic/public";
4-
import { PUBLIC_COMMIT_HASH } from "$env/static/public";
55
import { flyAndScale } from "$lib/shared/utils";
66
import ExternalLink from "@lucide/svelte/icons/external-link";
77
import Info from "@lucide/svelte/icons/info";
@@ -12,12 +12,12 @@
1212
1313
const { PUBLIC_DISCORD_INVITE, PUBLIC_PATREON } = env;
1414
const packageVersion = __NPM_PACKAGE_VERSION__;
15-
const commitHash = PUBLIC_COMMIT_HASH;
15+
const commitHash = version;
1616
</script>
1717

1818
{#snippet info()}
1919
<p class="my-4">SkyCrypt is a free, open-source stats viewer for Hypixel SkyBlock.</p>
20-
{#if __NPM_PACKAGE_VERSION__ || PUBLIC_COMMIT_HASH}
20+
{#if __NPM_PACKAGE_VERSION__ || version}
2121
<p>
2222
Currently running version
2323
<span class="font-semibold">
Lines changed: 1 addition & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,12 @@
11
<script lang="ts">
22
import { getPreferences } from "$ctx";
33
import { SettingsTab } from "$lib/components/header/types";
4-
import { cn, flyAndScale } from "$lib/shared/utils";
5-
import CircleQuestionMark from "@lucide/svelte/icons/circle-question-mark";
6-
import Fan from "@lucide/svelte/icons/fan";
7-
import Keyboard from "@lucide/svelte/icons/keyboard";
84
import Pickaxe from "@lucide/svelte/icons/pickaxe";
9-
import Rainbow from "@lucide/svelte/icons/rainbow";
105
import Settings2 from "@lucide/svelte/icons/settings-2";
11-
import Sparkle from "@lucide/svelte/icons/sparkle";
12-
import { Button, Tabs, Tooltip } from "bits-ui";
6+
import { Tabs } from "bits-ui";
137
import SettingToggleRow from "./SettingToggleRow.svelte";
148
159
const preferences = getPreferences();
16-
17-
let isListening = $state(false);
18-
19-
function handleKeybindKeydown(e: KeyboardEvent) {
20-
if (isListening) {
21-
e.preventDefault();
22-
e.stopPropagation();
23-
const key = e.key;
24-
if (key.length === 1 && key.match(/[a-zA-Z0-9/\\.,;'"`~!@#$%^&*()_+\-=[\]{}|:<>?]/)) {
25-
preferences.keybind = key;
26-
isListening = false;
27-
} else if (key === "Escape") {
28-
isListening = false;
29-
preferences.keybind = preferences.keybind || "/";
30-
}
31-
}
32-
}
33-
34-
function handleKeybindClick() {
35-
isListening = true;
36-
setTimeout(() => {
37-
if (isListening) {
38-
isListening = false;
39-
}
40-
}, 5000);
41-
}
4210
</script>
4311

4412
<Tabs.Content value={SettingsTab.Misc} class="space-y-6">
@@ -54,71 +22,12 @@
5422
</div>
5523
</div>
5624
</div>
57-
<SettingToggleRow id="performance" title="Performance Mode" description="Disables blur, transparency and backdrop effects for better performance on low-end devices." checked={preferences.performanceMode} onCheckedChange={() => (preferences.performanceMode = !preferences.performanceMode)}>
58-
{#snippet icon()}
59-
<Fan class="size-6 h-lh shrink-0 will-change-transform data-[performance=false]:animate-spin-slow data-[performance=true]:animate-spin" data-performance={preferences.performanceMode} />
60-
{/snippet}
61-
<Tooltip.Provider delayDuration={0}>
62-
<Tooltip.Root>
63-
<Tooltip.Trigger class="flex items-center gap-1">
64-
<CircleQuestionMark class="size-4 h-lh text-text/60" />
65-
</Tooltip.Trigger>
66-
<Tooltip.Portal>
67-
<Tooltip.Content forceMount class={cn("z-50 flex w-full max-w-lg flex-col space-y-2 overflow-hidden rounded-lg p-4 select-text", preferences.performanceMode ? "bg-background-grey" : "backdrop-blur-lg backdrop-brightness-50")}>
68-
{#snippet child({ wrapperProps, props, open })}
69-
{#if open}
70-
<div {...wrapperProps}>
71-
<div {...props} transition:flyAndScale>
72-
<p>You might not need this! We've noticed that often the reason for low performance is due to Graphics Acceleration being disabled in the browser settings.</p>
73-
<p>Graphics Acceleration gives the browsers access to your GPU for rendering, which can significantly improve performance; especially with opacity and blur effects.</p>
74-
<p>
75-
Enable <a href="https://www.google.com/search?q=enable+graphics+acceleration+in+%5Bbrowser%5D" target="_blank" rel="noopener noreferrer" class="text-icon underline">Graphics Acceleration</a> in your browser settings first, and if you still experience performance issues, then consider enabling Performance Mode.
76-
</p>
77-
<Tooltip.Arrow />
78-
</div>
79-
</div>
80-
{/if}
81-
{/snippet}
82-
</Tooltip.Content>
83-
</Tooltip.Portal>
84-
</Tooltip.Root>
85-
</Tooltip.Provider>
86-
</SettingToggleRow>
87-
88-
<SettingToggleRow id="glint" title="Show Glint" description="Show the enchantment glint effect on enchanted items." checked={preferences.showGlint} onCheckedChange={() => (preferences.showGlint = !preferences.showGlint)}>
89-
{#snippet icon()}
90-
<Sparkle class="size-6 h-lh shrink-0" />
91-
{/snippet}
92-
</SettingToggleRow>
9325

9426
<SettingToggleRow id="mctooltip" title="Minecraft Styled Tooltips" description="Enable Minecraft styled tooltips for items." checked={preferences.mctooltip} onCheckedChange={() => (preferences.mctooltip = !preferences.mctooltip)}>
9527
{#snippet icon()}
9628
<Pickaxe class="size-6 h-lh shrink-0" />
9729
{/snippet}
9830
</SettingToggleRow>
99-
100-
<SettingToggleRow id="rainbow" title="Rainbow Colors" titleClass="group-data-[rainbow=true]/html:chroma-gradient" description="Enable rainbow colors animation for maxed enchants on items." checked={preferences.rainbowEnchantments} onCheckedChange={() => (preferences.rainbowEnchantments = !preferences.rainbowEnchantments)}>
101-
{#snippet icon()}
102-
<Rainbow class="size-6 h-lh shrink-0" />
103-
{/snippet}
104-
</SettingToggleRow>
105-
106-
<div class="flex items-center justify-between gap-4 rounded-lg bg-text/5 p-2">
107-
<div class="flex items-start gap-2">
108-
<Keyboard class="size-6 h-lh shrink-0" />
109-
<div class="flex flex-col">
110-
<h4 class="font-semibold text-text/90">Keybind</h4>
111-
<p class="text-text/60">Set the keybind to open the command menu</p>
112-
</div>
113-
</div>
114-
<Button.Root class="flex h-8 min-w-8 items-center justify-center rounded-md border border-text/20 bg-text/10 px-2 py-1 font-mono text-sm font-semibold text-text/90 transition-colors ease-out hover:bg-text/20 focus:ring-2 focus:ring-icon/50 focus:outline-none" onclick={handleKeybindClick} onkeydown={handleKeybindKeydown} tabindex={0}>
115-
{#if isListening}
116-
<span class="animate-pulse text-icon">Press a key</span>
117-
{:else}
118-
<span class="min-w-2 text-center">{preferences.keybind}</span>
119-
{/if}
120-
</Button.Root>
121-
</div>
12231
</div>
12332
</div>
12433
</Tabs.Content>

0 commit comments

Comments
 (0)